@powerhousedao/contributor-billing 0.0.16 → 0.0.18
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.
|
@@ -98,13 +98,13 @@ const LineItemsTable = (props) => {
|
|
|
98
98
|
if (showTagTable) {
|
|
99
99
|
return (_jsx(LineItemTagsTable, { lineItems: state.lineItems, onClose: () => setShowTagTable(false), dispatch: dispatch }));
|
|
100
100
|
}
|
|
101
|
-
return (_jsxs("div", { className: "mt-2 overflow-x-auto",
|
|
101
|
+
return (_jsxs("div", { className: "mt-2 overflow-x-auto", children: [_jsxs("div", { className: "flex justify-between mt-6", children: [_jsx("div", { className: "flex items-center", children: _jsx("h1", { className: "text-1xl font-bold", children: "Line Items" }) }), _jsx("div", { className: "flex items-center", children: _jsx(Tag, { style: {
|
|
102
102
|
cursor: "pointer",
|
|
103
103
|
width: 28,
|
|
104
104
|
height: 28,
|
|
105
105
|
color: "white",
|
|
106
106
|
fill: "#475264",
|
|
107
|
-
}, onClick: () => setShowTagTable(!showTagTable) }) })] }), _jsx("div", { className: "mt-4 min-w-[900px]", children: _jsxs("table", { className: "w-full border border-gray-300 text-sm", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-100", children: [_jsx("th", { className: "border px-2 py-1 w-10", children: "#" }), _jsx("th", { className: "border px-2 py-1", children: "Desc" }), _jsx("th", { className: "border px-2 py-1 w-40", children: "Unit" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "Qty" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "FIAT/Unit" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "POWT/Unit" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "Total Fiat" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "Total POWT" })] }) }), _jsx("tbody", { children: state.lineItems.map((item, idx) => (editingRow === idx ? (_jsxs("tr", { className: "bg-yellow-
|
|
107
|
+
}, onClick: () => setShowTagTable(!showTagTable) }) })] }), _jsx("div", { className: "mt-4 min-w-[900px]", ref: tableRef, children: _jsxs("table", { className: "w-full border border-gray-300 text-sm", children: [_jsx("thead", { className: "h-12", children: _jsxs("tr", { className: "bg-gray-100 h-10", children: [_jsx("th", { className: "border px-2 py-1 w-10", children: "#" }), _jsx("th", { className: "border px-2 py-1 w-72", children: "Desc" }), _jsx("th", { className: "border px-2 py-1 w-40", children: "Unit" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "Qty" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "FIAT/Unit" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "POWT/Unit" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "Total Fiat" }), _jsx("th", { className: "border px-2 py-1 w-16", children: "Total POWT" })] }) }), _jsx("tbody", { children: state.lineItems.map((item, idx) => (editingRow === idx ? (_jsxs("tr", { className: "bg-yellow-100", children: [_jsx("td", { className: "border px-2 py-1 text-center w-10", children: idx + 1 }), _jsx("td", { className: "border px-2 py-1 w-72", children: _jsx(InputField, { input: localLineItem.description, value: localLineItem.description, onBlur: () => { }, handleInputChange: (e) => handleInputChange("description", e.target.value), className: "w-full px-1 py-1 border rounded" }) }), _jsx("td", { className: "border px-2 py-1 w-16", children: _jsx(Select, { options: units, value: localLineItem.unit, onChange: (value) => handleInputChange("unit", value), className: "w-32 px-1 py-1 border rounded" }) }), _jsx("td", { className: "border px-2 py-1 w-16", children: _jsx(NumberForm, { number: localLineItem.quantity, handleInputChange: (e) => handleInputChange("quantity", e.target.value), className: "w-32 px-4 py-1 border rounded text-center" }) }), _jsx("td", { className: "border px-2 py-1 w-16", children: _jsx(NumberForm, { number: localLineItem.unitPriceCash, handleInputChange: (e) => handleInputChange("unitPriceCash", String(e.target.value)), className: "w-32 px-4 py-1 border rounded text-center" }) }), _jsx("td", { className: "border px-2 py-1 w-16", children: _jsx(NumberForm, { number: localLineItem.unitPricePwt, handleInputChange: (e) => handleInputChange("unitPricePwt", e.target.value), className: "w-32 px-4 py-1 border rounded text-center" }) }), _jsx("td", { className: "border px-2 py-1 text-center", children: localLineItem.quantity && localLineItem.unitPriceCash
|
|
108
108
|
? Number(localLineItem.quantity) * Number(localLineItem.unitPriceCash)
|
|
109
109
|
: "" }), _jsx("td", { className: "border px-2 py-1 text-center", children: localLineItem.quantity && localLineItem.unitPricePwt
|
|
110
110
|
? Number(localLineItem.quantity) * Number(localLineItem.unitPricePwt)
|
|
@@ -12,12 +12,12 @@ export default function Editor(props) {
|
|
|
12
12
|
const [notes, setNotes] = useState(state.notes ?? "");
|
|
13
13
|
return (_jsxs("div", { className: "editor-container", children: [_jsxs("div", { className: "grid grid-cols-2 gap-2 border border-gray-500 p-2 rounded-md bg-gray-1001", children: [_jsx("div", { className: "col-span-1 flex items-center", children: _jsx("h1", { className: "text-xl md:text-2xl font-bold", children: "Billing Statement" }) }), _jsxs("div", { className: "grid col-span-1 grid-rows-2 gap-2 justify-end ", children: [_jsxs("div", { className: "col-span-1 space-x-2", children: [_jsx("span", { children: "Submitter" }), _jsx("span", { children: state.contributor })] }), _jsxs("div", { className: "col-span-1 space-x-2", children: [_jsx("span", { children: "Status" }), _jsx("span", { children: state.status })] })] })] }), _jsx("div", { className: "mt-6 p-2", children: _jsxs("div", { className: "flex justify-end", children: [_jsx("span", { className: "mr-2 pt-2", children: "Currency: " }), _jsx(CurrencyForm, { currency: props.document.state.global.currency, handleInputChange: (e) => {
|
|
14
14
|
dispatch(actions.editBillingStatement({ currency: e.target.value }));
|
|
15
|
-
} })] }) }), _jsx("div", { className: "", children: _jsx(LineItemsTable, { state: state, dispatch: dispatch }) }), _jsxs("div", { className: "grid grid-cols-2
|
|
15
|
+
} })] }) }), _jsx("div", { className: "", children: _jsx(LineItemsTable, { state: state, dispatch: dispatch }) }), _jsxs("div", { className: "grid sm:grid-cols-2 two-column-grid", children: [_jsx("div", { className: "mt-6 p-2 two-column-grid:mt-2", children: _jsx(Textarea, { label: "Notes", placeholder: "Add notes", autoExpand: false, rows: 4, multiline: true, value: notes, onBlur: (e) => {
|
|
16
16
|
const newValue = e.target.value;
|
|
17
17
|
if (newValue !== state.notes) {
|
|
18
18
|
dispatch(actions.editBillingStatement({ notes: newValue }));
|
|
19
19
|
}
|
|
20
20
|
}, onChange: (e) => {
|
|
21
21
|
setNotes(e.target.value);
|
|
22
|
-
}, className: "p-2 mb-4" }) }), _jsx("div", { className: "mt-6 p-2
|
|
22
|
+
}, className: "p-2 mb-4" }) }), _jsx("div", { className: "mt-6 p-2 flex justify-center items-center", children: _jsxs("table", { className: "border border-gray-300", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-100", children: [_jsx("th", { className: "border px-4 py-2", children: "Total Fiat" }), _jsx("th", { className: "border px-4 py-2", children: "Total POWT" })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { className: "border px-4 py-2 text-center", children: formatNumber(state.totalCash) }), _jsx("td", { className: "border px-4 py-2 text-center", children: formatNumber(state.totalPowt) })] }) })] }) })] })] }));
|
|
23
23
|
}
|
package/dist/style.css
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
--color-orange-700: oklch(55.3% 0.195 38.402);
|
|
19
19
|
--color-orange-800: oklch(47% 0.157 37.304);
|
|
20
20
|
--color-orange-900: oklch(40.8% 0.123 38.172);
|
|
21
|
-
--color-yellow-50: oklch(98.7% 0.026 102.212);
|
|
22
21
|
--color-yellow-100: oklch(97.3% 0.071 103.193);
|
|
23
22
|
--color-yellow-300: oklch(90.5% 0.182 98.111);
|
|
24
23
|
--color-yellow-400: oklch(85.2% 0.199 91.936);
|
|
@@ -392,6 +391,9 @@
|
|
|
392
391
|
.h-10 {
|
|
393
392
|
height: calc(var(--spacing) * 10);
|
|
394
393
|
}
|
|
394
|
+
.h-12 {
|
|
395
|
+
height: calc(var(--spacing) * 12);
|
|
396
|
+
}
|
|
395
397
|
.h-32 {
|
|
396
398
|
height: calc(var(--spacing) * 32);
|
|
397
399
|
}
|
|
@@ -425,6 +427,9 @@
|
|
|
425
427
|
.w-64 {
|
|
426
428
|
width: calc(var(--spacing) * 64);
|
|
427
429
|
}
|
|
430
|
+
.w-72 {
|
|
431
|
+
width: calc(var(--spacing) * 72);
|
|
432
|
+
}
|
|
428
433
|
.w-\[200px\] {
|
|
429
434
|
width: 200px;
|
|
430
435
|
}
|
|
@@ -647,9 +652,6 @@
|
|
|
647
652
|
.bg-white {
|
|
648
653
|
background-color: var(--color-white);
|
|
649
654
|
}
|
|
650
|
-
.bg-yellow-50 {
|
|
651
|
-
background-color: var(--color-yellow-50);
|
|
652
|
-
}
|
|
653
655
|
.bg-yellow-100 {
|
|
654
656
|
background-color: var(--color-yellow-100);
|
|
655
657
|
}
|
|
@@ -968,6 +970,11 @@
|
|
|
968
970
|
padding: calc(var(--spacing) * 0);
|
|
969
971
|
}
|
|
970
972
|
}
|
|
973
|
+
.sm\:grid-cols-2 {
|
|
974
|
+
@media (width >= 40rem) {
|
|
975
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
976
|
+
}
|
|
977
|
+
}
|
|
971
978
|
.md\:grid-cols-2 {
|
|
972
979
|
@media (width >= 48rem) {
|
|
973
980
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
@@ -6348,12 +6355,9 @@ input[type="number"] {
|
|
|
6348
6355
|
transform: none;
|
|
6349
6356
|
}
|
|
6350
6357
|
}
|
|
6351
|
-
@media (
|
|
6352
|
-
.
|
|
6353
|
-
grid-template-columns: 1fr
|
|
6354
|
-
}
|
|
6355
|
-
.editor-grid-item {
|
|
6356
|
-
width: 100% !important;
|
|
6358
|
+
@media (min-width: 640px) {
|
|
6359
|
+
.two-column-grid {
|
|
6360
|
+
grid-template-columns: 1fr 1fr;
|
|
6357
6361
|
}
|
|
6358
6362
|
}
|
|
6359
6363
|
@property --tw-border-spacing-x {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/contributor-billing",
|
|
3
3
|
"description": "Document models that help contributors of open organisations get paid anonymously for their work on a monthly basis.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.18",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|