blixify-ui-web 1.2.196 → 1.2.198
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/lib/components/data/columnTypes/buttonCell.d.ts +15 -0
- package/lib/components/data/columnTypes/buttonCell.d.ts.map +1 -0
- package/lib/components/data/columnTypes/buttonCell.js +156 -0
- package/lib/components/data/columnTypes/buttonCell.js.map +1 -0
- package/lib/components/data/columnTypes/context.d.ts +13 -0
- package/lib/components/data/columnTypes/context.d.ts.map +1 -0
- package/lib/components/data/columnTypes/context.js +8 -0
- package/lib/components/data/columnTypes/context.js.map +1 -0
- package/lib/components/data/columnTypes/dateRange.d.ts +24 -0
- package/lib/components/data/columnTypes/dateRange.d.ts.map +1 -0
- package/lib/components/data/columnTypes/dateRange.js +75 -0
- package/lib/components/data/columnTypes/dateRange.js.map +1 -0
- package/lib/components/data/columnTypes/groupSections.d.ts +56 -0
- package/lib/components/data/columnTypes/groupSections.d.ts.map +1 -0
- package/lib/components/data/columnTypes/groupSections.js +170 -0
- package/lib/components/data/columnTypes/groupSections.js.map +1 -0
- package/lib/components/data/columnTypes/index.d.ts +14 -0
- package/lib/components/data/columnTypes/index.d.ts.map +1 -0
- package/lib/components/data/columnTypes/index.js +30 -0
- package/lib/components/data/columnTypes/index.js.map +1 -0
- package/lib/components/data/columnTypes/ratingCell.d.ts +29 -0
- package/lib/components/data/columnTypes/ratingCell.d.ts.map +1 -0
- package/lib/components/data/columnTypes/ratingCell.js +176 -0
- package/lib/components/data/columnTypes/ratingCell.js.map +1 -0
- package/lib/components/data/columnTypes/systemColumns.d.ts +27 -0
- package/lib/components/data/columnTypes/systemColumns.d.ts.map +1 -0
- package/lib/components/data/columnTypes/systemColumns.js +118 -0
- package/lib/components/data/columnTypes/systemColumns.js.map +1 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts +27 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts.map +1 -0
- package/lib/components/data/columnTypes/timeTracking.js +127 -0
- package/lib/components/data/columnTypes/timeTracking.js.map +1 -0
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts +17 -0
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts.map +1 -0
- package/lib/components/data/columnTypes/timeTrackingCell.js +146 -0
- package/lib/components/data/columnTypes/timeTrackingCell.js.map +1 -0
- package/lib/components/data/dataTemplate/activityChanges.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/activityChanges.js +7 -0
- package/lib/components/data/dataTemplate/activityChanges.js.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +6 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +399 -323
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +26 -2
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.js +13 -6
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js +18 -3
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +23 -1
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/formula/builder.d.ts.map +1 -1
- package/lib/components/data/formula/builder.js +30 -10
- package/lib/components/data/formula/builder.js.map +1 -1
- package/lib/components/data/formula/functions.d.ts +3 -0
- package/lib/components/data/formula/functions.d.ts.map +1 -1
- package/lib/components/data/formula/functions.js +269 -1
- package/lib/components/data/formula/functions.js.map +1 -1
- package/lib/components/data/formula/index.d.ts +8 -0
- package/lib/components/data/formula/index.d.ts.map +1 -1
- package/lib/components/data/formula/index.js +77 -12
- package/lib/components/data/formula/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +42 -1
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +105 -74
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +75 -28
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +13 -0
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +1 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +53 -14
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DataStructure } from "../dataTemplate/model";
|
|
3
|
+
interface Props {
|
|
4
|
+
column: DataStructure;
|
|
5
|
+
row: any;
|
|
6
|
+
onClick?: (columnId: string, row: any) => Promise<any> | any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The cell of a `type: "button"` column. A click calls onButtonClick and the
|
|
11
|
+
* cell stays busy until its promise settles; a click while busy is dropped.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ButtonCell(props: Props): React.JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=buttonCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonCell.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/buttonCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAgB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGpE,UAAU,KAAK;IACb,MAAM,EAAE,aAAa,CAAC;IAEtB,GAAG,EAAE,GAAG,CAAC;IAET,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAcD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,qBA6GtC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
exports.ButtonCell = ButtonCell;
|
|
63
|
+
var react_1 = __importStar(require("react"));
|
|
64
|
+
var modal_1 = require("../../display/modal");
|
|
65
|
+
var context_1 = require("./context");
|
|
66
|
+
var BUTTON_COLOUR_CLASS = {
|
|
67
|
+
primary: "bg-primary-600 hover:bg-primary-700 text-white",
|
|
68
|
+
red: "bg-red-600 hover:bg-red-700 text-white",
|
|
69
|
+
blue: "bg-blue-600 hover:bg-blue-700 text-white",
|
|
70
|
+
green: "bg-green-600 hover:bg-green-700 text-white",
|
|
71
|
+
yellow: "bg-yellow-400 hover:bg-yellow-500 text-gray-900",
|
|
72
|
+
indigo: "bg-indigo-600 hover:bg-indigo-700 text-white",
|
|
73
|
+
purple: "bg-purple-600 hover:bg-purple-700 text-white",
|
|
74
|
+
orange: "bg-orange-500 hover:bg-orange-600 text-white",
|
|
75
|
+
dark: "bg-gray-900 hover:bg-black text-white",
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The cell of a `type: "button"` column. A click calls onButtonClick and the
|
|
79
|
+
* cell stays busy until its promise settles; a click while busy is dropped.
|
|
80
|
+
*/
|
|
81
|
+
function ButtonCell(props) {
|
|
82
|
+
var _this = this;
|
|
83
|
+
var _a, _b, _c, _d;
|
|
84
|
+
// 1. State
|
|
85
|
+
var _e = (0, react_1.useState)(false), busy = _e[0], setBusy = _e[1];
|
|
86
|
+
var _f = (0, react_1.useState)(false), confirmOpen = _f[0], setConfirmOpen = _f[1];
|
|
87
|
+
// 2. Refs
|
|
88
|
+
// INFO: a ref, not the state, guards the double tap — two taps in one frame
|
|
89
|
+
// both see busy === false before React re-renders
|
|
90
|
+
var busyRef = (0, react_1.useRef)(false);
|
|
91
|
+
var actions = (0, react_1.useContext)(context_1.ColumnTypeContext);
|
|
92
|
+
// 3. Computed
|
|
93
|
+
var handler = (_a = props.onClick) !== null && _a !== void 0 ? _a : actions.onButtonClick;
|
|
94
|
+
var isDisabled = (_b = props.disabled) !== null && _b !== void 0 ? _b : (!handler || (!props.onClick && !actions.canUpdate));
|
|
95
|
+
var label = props.column.buttonLabel || props.column.name;
|
|
96
|
+
var colourClass = (_d = BUTTON_COLOUR_CLASS[(_c = props.column.buttonColour) !== null && _c !== void 0 ? _c : "primary"]) !== null && _d !== void 0 ? _d : BUTTON_COLOUR_CLASS.primary;
|
|
97
|
+
// 5. Handlers
|
|
98
|
+
var handleRun = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
99
|
+
var err_1;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
if (busyRef.current || !handler)
|
|
104
|
+
return [2 /*return*/];
|
|
105
|
+
busyRef.current = true;
|
|
106
|
+
setBusy(true);
|
|
107
|
+
_a.label = 1;
|
|
108
|
+
case 1:
|
|
109
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
110
|
+
return [4 /*yield*/, handler(props.column.id, props.row)];
|
|
111
|
+
case 2:
|
|
112
|
+
_a.sent();
|
|
113
|
+
return [3 /*break*/, 5];
|
|
114
|
+
case 3:
|
|
115
|
+
err_1 = _a.sent();
|
|
116
|
+
return [3 /*break*/, 5];
|
|
117
|
+
case 4:
|
|
118
|
+
busyRef.current = false;
|
|
119
|
+
setBusy(false);
|
|
120
|
+
return [7 /*endfinally*/];
|
|
121
|
+
case 5: return [2 /*return*/];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}); };
|
|
125
|
+
var handleClick = function (event) {
|
|
126
|
+
// INFO: the cell sits inside a clickable row or card — the click is the
|
|
127
|
+
// button's alone and must not also open the record
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
event.stopPropagation();
|
|
130
|
+
if (isDisabled || busyRef.current)
|
|
131
|
+
return;
|
|
132
|
+
if (props.column.buttonConfirm)
|
|
133
|
+
setConfirmOpen(true);
|
|
134
|
+
else
|
|
135
|
+
handleRun();
|
|
136
|
+
};
|
|
137
|
+
// 6. Render
|
|
138
|
+
var renderConfirm = function () { return (react_1.default.createElement(modal_1.Modal, { open: confirmOpen, title: label, onClose: function () { return setConfirmOpen(false); }, renderContent: function () { return (react_1.default.createElement("div", { className: "mt-3 space-y-4", onClick: function (event) { return event.stopPropagation(); } },
|
|
139
|
+
react_1.default.createElement("p", { className: "text-sm text-gray-700 whitespace-pre-wrap" }, props.column.buttonConfirm),
|
|
140
|
+
react_1.default.createElement("div", { className: "flex justify-end gap-x-2" },
|
|
141
|
+
react_1.default.createElement("button", { type: "button", className: "min-h-[44px] rounded-md border border-gray-300 px-4 text-sm", onClick: function () { return setConfirmOpen(false); } }, "Cancel"),
|
|
142
|
+
react_1.default.createElement("button", { type: "button", "data-testid": "button-cell-confirm-".concat(props.column.id), className: "min-h-[44px] rounded-md px-4 text-sm font-medium ".concat(colourClass), onClick: function () {
|
|
143
|
+
setConfirmOpen(false);
|
|
144
|
+
handleRun();
|
|
145
|
+
} }, label)))); } })); };
|
|
146
|
+
// 7. Return
|
|
147
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
148
|
+
react_1.default.createElement("button", { type: "button", "data-testid": "button-cell-".concat(props.column.id), "aria-busy": busy, disabled: isDisabled, onClick: handleClick,
|
|
149
|
+
// INFO: drawn at 28px so a row keeps its height, as wide as the cell;
|
|
150
|
+
// the ::before layer makes the tap area 44px tall on a phone
|
|
151
|
+
className: "relative inline-flex h-7 w-full min-w-[96px] items-center justify-center gap-x-1.5 rounded-md px-3 text-xs font-medium transition before:absolute before:-inset-y-2 before:inset-x-0 before:content-[''] ".concat(colourClass, " ").concat(isDisabled || busy ? "cursor-not-allowed opacity-60" : "") },
|
|
152
|
+
busy && (react_1.default.createElement("span", { "aria-hidden": "true", className: "h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent" })),
|
|
153
|
+
react_1.default.createElement("span", { className: "truncate" }, label)),
|
|
154
|
+
props.column.buttonConfirm && renderConfirm()));
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=buttonCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonCell.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/buttonCell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,gCA6GC;AA3ID,6CAA4D;AAC5D,6CAA4C;AAE5C,qCAA8C;AAW9C,IAAM,mBAAmB,GAAsC;IAC7D,OAAO,EAAE,gDAAgD;IACzD,GAAG,EAAE,wCAAwC;IAC7C,IAAI,EAAE,0CAA0C;IAChD,KAAK,EAAE,4CAA4C;IACnD,MAAM,EAAE,iDAAiD;IACzD,MAAM,EAAE,8CAA8C;IACtD,MAAM,EAAE,8CAA8C;IACtD,MAAM,EAAE,8CAA8C;IACtD,IAAI,EAAE,uCAAuC;CAC9C,CAAC;AAEF;;;GAGG;AACH,SAAgB,UAAU,CAAC,KAAY;IAAvC,iBA6GC;;IA5GC,WAAW;IACL,IAAA,KAAkB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAhC,IAAI,QAAA,EAAE,OAAO,QAAmB,CAAC;IAClC,IAAA,KAAgC,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IAEtD,UAAU;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AU,IAAI,IAAI,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,CACzD;YAED,IAAI,IAAI,CACP,uDACc,MAAM,EAClB,SAAS,EAAC,gFAAgF,GAC1F,CACH;YACD,wCAAM,SAAS,EAAC,UAAU,IAAE,KAAK,CAAQ,CAClC;QACR,KAAK,CAAC,MAAM,CAAC,aAAa,IAAI,aAAa,EAAE,CAC7C,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a cell needs from the DataTemplate drawing it. List rows are built
|
|
3
|
+
* once per read and handed to every view (table, list, kanban, read), so a
|
|
4
|
+
* cell reaches the template's handlers through context rather than through
|
|
5
|
+
* the row — a row can then be rebuilt or cached without stale callbacks.
|
|
6
|
+
*/
|
|
7
|
+
export interface ColumnTypeActions {
|
|
8
|
+
canUpdate: boolean;
|
|
9
|
+
onButtonClick?: (columnId: string, row: any) => Promise<any> | any;
|
|
10
|
+
onUpdateCell?: (rowId: string, columnId: string, value: any) => Promise<any> | any;
|
|
11
|
+
}
|
|
12
|
+
export declare const ColumnTypeContext: import("react").Context<ColumnTypeActions>;
|
|
13
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/context.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAEnE,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,GAAG,KACP,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,4CAE5B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnTypeContext = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
exports.ColumnTypeContext = (0, react_1.createContext)({
|
|
6
|
+
canUpdate: false,
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/context.tsx"],"names":[],"mappings":";;;AAAA,+BAAsC;AAoBzB,QAAA,iBAAiB,GAAG,IAAA,qBAAa,EAAoB;IAChE,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date range column (`type: "dateRange"`), monday's timeline: one stored
|
|
3
|
+
* object `{ start, end }`. Filters and sorts read `<columnId>.start`.
|
|
4
|
+
*/
|
|
5
|
+
export interface DateRangeValue {
|
|
6
|
+
start?: string | Date;
|
|
7
|
+
end?: string | Date;
|
|
8
|
+
}
|
|
9
|
+
export type DateRangePart = "start" | "end";
|
|
10
|
+
export declare const DATE_RANGE_PARTS: DateRangePart[];
|
|
11
|
+
export declare const handleGetDateRangeQueryId: (columnId: string) => string;
|
|
12
|
+
export declare const handleGetDateRangePartKey: (columnId: string, part: DateRangePart) => string;
|
|
13
|
+
export declare const handleNormaliseDateRange: (value: any) => {
|
|
14
|
+
start?: Date;
|
|
15
|
+
end?: Date;
|
|
16
|
+
};
|
|
17
|
+
export declare const handleIsDateRangeEmpty: (value: any) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* `12 – 18 Nov`, `28 Nov – 3 Dec`, `28 Dec 2026 – 3 Jan 2027`. The year is
|
|
20
|
+
* written only when the range leaves the current year.
|
|
21
|
+
*/
|
|
22
|
+
export declare const handleFormatDateRange: (value: any, now?: Date) => string;
|
|
23
|
+
export declare const handleFormatDateRangePart: (value: any, part: DateRangePart) => string;
|
|
24
|
+
//# sourceMappingURL=dateRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateRange.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/dateRange.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5C,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAAqB,CAAC;AAGlE,eAAO,MAAM,yBAAyB,aAAc,MAAM,WACrC,CAAC;AAItB,eAAO,MAAM,yBAAyB,aAC1B,MAAM,QACV,aAAa,WACK,CAAC;AAY3B,eAAO,MAAM,wBAAwB,UAC5B,GAAG,KACT;IAAE,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAQ5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,GAAG,YAGhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UACzB,GAAG,QACL,IAAI,KACR,MAeF,CAAC;AAIF,eAAO,MAAM,yBAAyB,UAAW,GAAG,QAAQ,aAAa,WAGxE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handleFormatDateRangePart = exports.handleFormatDateRange = exports.handleIsDateRangeEmpty = exports.handleNormaliseDateRange = exports.handleGetDateRangePartKey = exports.handleGetDateRangeQueryId = exports.DATE_RANGE_PARTS = void 0;
|
|
7
|
+
var dayjs_1 = __importDefault(require("../../dayjs"));
|
|
8
|
+
exports.DATE_RANGE_PARTS = ["start", "end"];
|
|
9
|
+
// INFO: the stored field a filter or sort on the range uses
|
|
10
|
+
var handleGetDateRangeQueryId = function (columnId) {
|
|
11
|
+
return "".concat(columnId, ".start");
|
|
12
|
+
};
|
|
13
|
+
exports.handleGetDateRangeQueryId = handleGetDateRangeQueryId;
|
|
14
|
+
// INFO: the flat key the list row carries for each end of the range — a
|
|
15
|
+
// calendar or timeline tab can point its start and end date at them
|
|
16
|
+
var handleGetDateRangePartKey = function (columnId, part) { return "".concat(columnId, ".").concat(part); };
|
|
17
|
+
exports.handleGetDateRangePartKey = handleGetDateRangePartKey;
|
|
18
|
+
var handleToDate = function (value) {
|
|
19
|
+
if (value === null || value === undefined || value === "")
|
|
20
|
+
return undefined;
|
|
21
|
+
if (value instanceof Date)
|
|
22
|
+
return Number.isFinite(value.getTime()) ? value : undefined;
|
|
23
|
+
if (typeof value === "object" && (value === null || value === void 0 ? void 0 : value._seconds))
|
|
24
|
+
return new Date(value._seconds * 1000);
|
|
25
|
+
var parsed = (0, dayjs_1.default)(value);
|
|
26
|
+
return parsed.isValid() ? parsed.toDate() : undefined;
|
|
27
|
+
};
|
|
28
|
+
var handleNormaliseDateRange = function (value) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!value || typeof value !== "object" || value instanceof Date)
|
|
31
|
+
return {};
|
|
32
|
+
var start = handleToDate(value.start);
|
|
33
|
+
var end = handleToDate(value.end);
|
|
34
|
+
// INFO: a range typed backwards still reads forwards
|
|
35
|
+
if (start && end && end.getTime() < start.getTime())
|
|
36
|
+
_a = [end, start], start = _a[0], end = _a[1];
|
|
37
|
+
return { start: start, end: end };
|
|
38
|
+
};
|
|
39
|
+
exports.handleNormaliseDateRange = handleNormaliseDateRange;
|
|
40
|
+
var handleIsDateRangeEmpty = function (value) {
|
|
41
|
+
var _a = (0, exports.handleNormaliseDateRange)(value), start = _a.start, end = _a.end;
|
|
42
|
+
return !start && !end;
|
|
43
|
+
};
|
|
44
|
+
exports.handleIsDateRangeEmpty = handleIsDateRangeEmpty;
|
|
45
|
+
/**
|
|
46
|
+
* `12 – 18 Nov`, `28 Nov – 3 Dec`, `28 Dec 2026 – 3 Jan 2027`. The year is
|
|
47
|
+
* written only when the range leaves the current year.
|
|
48
|
+
*/
|
|
49
|
+
var handleFormatDateRange = function (value, now) {
|
|
50
|
+
if (now === void 0) { now = new Date(); }
|
|
51
|
+
var _a = (0, exports.handleNormaliseDateRange)(value), start = _a.start, end = _a.end;
|
|
52
|
+
if (!start && !end)
|
|
53
|
+
return "";
|
|
54
|
+
var from = (0, dayjs_1.default)(start !== null && start !== void 0 ? start : end);
|
|
55
|
+
var to = (0, dayjs_1.default)(end !== null && end !== void 0 ? end : start);
|
|
56
|
+
var currentYear = now.getFullYear();
|
|
57
|
+
var isSameYear = from.year() === to.year();
|
|
58
|
+
var showYear = !isSameYear || from.year() !== currentYear;
|
|
59
|
+
if (from.isSame(to, "day"))
|
|
60
|
+
return from.format(showYear ? "D MMM YYYY" : "D MMM");
|
|
61
|
+
if (isSameYear && from.month() === to.month())
|
|
62
|
+
return "".concat(from.format("D"), " \u2013 ").concat(to.format(showYear ? "D MMM YYYY" : "D MMM"));
|
|
63
|
+
if (isSameYear)
|
|
64
|
+
return "".concat(from.format("D MMM"), " \u2013 ").concat(to.format(showYear ? "D MMM YYYY" : "D MMM"));
|
|
65
|
+
return "".concat(from.format("D MMM YYYY"), " \u2013 ").concat(to.format("D MMM YYYY"));
|
|
66
|
+
};
|
|
67
|
+
exports.handleFormatDateRange = handleFormatDateRange;
|
|
68
|
+
// INFO: the format the list writes every date in, which the calendar and
|
|
69
|
+
// timeline tabs parse back
|
|
70
|
+
var handleFormatDateRangePart = function (value, part) {
|
|
71
|
+
var date = (0, exports.handleNormaliseDateRange)(value)[part];
|
|
72
|
+
return date ? (0, dayjs_1.default)(date).format("YYYY-MM-DD hh:mm A") : "";
|
|
73
|
+
};
|
|
74
|
+
exports.handleFormatDateRangePart = handleFormatDateRangePart;
|
|
75
|
+
//# sourceMappingURL=dateRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateRange.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/dateRange.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAgC;AAanB,QAAA,gBAAgB,GAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAElE,4DAA4D;AACrD,IAAM,yBAAyB,GAAG,UAAC,QAAgB;IACxD,OAAA,UAAG,QAAQ,WAAQ;AAAnB,CAAmB,CAAC;AADT,QAAA,yBAAyB,6BAChB;AAEtB,wEAAwE;AACxE,oEAAoE;AAC7D,IAAM,yBAAyB,GAAG,UACvC,QAAgB,EAChB,IAAmB,IAChB,OAAA,UAAG,QAAQ,cAAI,IAAI,CAAE,EAArB,CAAqB,CAAC;AAHd,QAAA,yBAAyB,6BAGX;AAE3B,IAAM,YAAY,GAAG,UAAC,KAAU;IAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC5E,IAAI,KAAK,YAAY,IAAI;QACvB,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAA;QAC9C,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACzC,IAAM,MAAM,GAAG,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EA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AAC,CAAC,CAAC,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9D,CAAC,CAAC;AAHW,QAAA,yBAAyB,6BAGpC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DataStructure } from "../dataTemplate/model";
|
|
2
|
+
import { Query } from "../readQuery";
|
|
3
|
+
/**
|
|
4
|
+
* Sections of a table grouped by one column, monday-board style: one section
|
|
5
|
+
* per option in the column's own order, then a section for values outside the
|
|
6
|
+
* options and one for rows with no value.
|
|
7
|
+
*/
|
|
8
|
+
export interface GroupSection {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
colour?: string;
|
|
12
|
+
rowIds: string[];
|
|
13
|
+
count?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface GroupSectionOption {
|
|
16
|
+
key: string;
|
|
17
|
+
title: string;
|
|
18
|
+
colour?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const GROUP_UNKNOWN_KEY = "__unknown";
|
|
21
|
+
export declare const GROUP_EMPTY_KEY = "__empty";
|
|
22
|
+
export declare const GROUP_UNKNOWN_TITLE = "Unknown";
|
|
23
|
+
export declare const GROUP_EMPTY_TITLE = "No Value";
|
|
24
|
+
export declare const GROUP_FIXED_OPTION_TYPES: string[];
|
|
25
|
+
export declare const handleGetGroupOptions: (column?: DataStructure, members?: {
|
|
26
|
+
key: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}[]) => GroupSectionOption[] | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The section a stored value belongs to. With fixed options, a value outside
|
|
31
|
+
* them is Unknown; without, every distinct value is its own section.
|
|
32
|
+
*/
|
|
33
|
+
export declare const handleGetGroupKey: (column: DataStructure | undefined, rawValue: any, options?: GroupSectionOption[], isFirebase?: boolean) => string;
|
|
34
|
+
/**
|
|
35
|
+
* The query that reads one section on its own — an option is an equality,
|
|
36
|
+
* No Value matches a missing, null or blank field, and Unknown is every value
|
|
37
|
+
* that is none of those.
|
|
38
|
+
*/
|
|
39
|
+
export declare const handleGetGroupSectionQuery: (column: DataStructure, sectionId: string, options: GroupSectionOption[]) => Query[];
|
|
40
|
+
/**
|
|
41
|
+
* Builds the sections for the loaded rows. With fixed options every option is
|
|
42
|
+
* a section in option order — empty ones only when `keepEmptyOptions` (a
|
|
43
|
+
* section that reads its own rows needs to be there before they load) — and
|
|
44
|
+
* Unknown and No Value follow. Without options, sections follow the order the
|
|
45
|
+
* values first appear in.
|
|
46
|
+
*/
|
|
47
|
+
export declare const handleBuildGroupSections: (params: {
|
|
48
|
+
column?: DataStructure;
|
|
49
|
+
rows: any[];
|
|
50
|
+
getRowId: (row: any, index: number) => string | undefined;
|
|
51
|
+
getValue?: (row: any, index: number) => any;
|
|
52
|
+
options?: GroupSectionOption[];
|
|
53
|
+
keepEmptyOptions?: boolean;
|
|
54
|
+
isFirebase?: boolean;
|
|
55
|
+
}) => GroupSection[];
|
|
56
|
+
//# sourceMappingURL=groupSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupSections.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/groupSections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAI5C,eAAO,MAAM,wBAAwB,UAAgC,CAAC;AAStE,eAAO,MAAM,qBAAqB,YACvB,aAAa,YACZ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,KACzC,kBAAkB,EAAE,GAAG,SAoBzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WACpB,aAAa,GAAG,SAAS,YACvB,GAAG,YACH,kBAAkB,EAAE,eACjB,OAAO,KACnB,MAsBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,WAC7B,aAAa,aACV,MAAM,WACR,kBAAkB,EAAE,KAC5B,KAAK,EAiBP,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,WAAY;IAC/C,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;IAC5C,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,YAAY,EA+Cf,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.handleBuildGroupSections = exports.handleGetGroupSectionQuery = exports.handleGetGroupKey = exports.handleGetGroupOptions = exports.GROUP_FIXED_OPTION_TYPES = exports.GROUP_EMPTY_TITLE = exports.GROUP_UNKNOWN_TITLE = exports.GROUP_EMPTY_KEY = exports.GROUP_UNKNOWN_KEY = void 0;
|
|
16
|
+
var dayjs_1 = __importDefault(require("../../dayjs"));
|
|
17
|
+
// INFO: ids no option can take, so an option called "Unknown" keeps its own
|
|
18
|
+
// section
|
|
19
|
+
exports.GROUP_UNKNOWN_KEY = "__unknown";
|
|
20
|
+
exports.GROUP_EMPTY_KEY = "__empty";
|
|
21
|
+
exports.GROUP_UNKNOWN_TITLE = "Unknown";
|
|
22
|
+
exports.GROUP_EMPTY_TITLE = "No Value";
|
|
23
|
+
// INFO: the column types a section's members can be listed for before any row
|
|
24
|
+
// is read — the rest group by the values the loaded rows hold
|
|
25
|
+
exports.GROUP_FIXED_OPTION_TYPES = ["list", "boolean", "person"];
|
|
26
|
+
var handleIsEmptyValue = function (value) {
|
|
27
|
+
return value === undefined ||
|
|
28
|
+
value === null ||
|
|
29
|
+
value === "" ||
|
|
30
|
+
value === " - " ||
|
|
31
|
+
(Array.isArray(value) && value.length === 0);
|
|
32
|
+
};
|
|
33
|
+
var handleGetGroupOptions = function (column, members) {
|
|
34
|
+
var _a;
|
|
35
|
+
switch (column === null || column === void 0 ? void 0 : column.type) {
|
|
36
|
+
case "list":
|
|
37
|
+
if (!((_a = column.listSelection) === null || _a === void 0 ? void 0 : _a.length))
|
|
38
|
+
return undefined;
|
|
39
|
+
return column.listSelection.map(function (key, index) {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return ({
|
|
42
|
+
key: key,
|
|
43
|
+
title: ((_a = column.listSelectionLabel) === null || _a === void 0 ? void 0 : _a[index]) || key,
|
|
44
|
+
colour: (_b = column.listSelectionColour) === null || _b === void 0 ? void 0 : _b[index],
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
case "boolean":
|
|
48
|
+
return [
|
|
49
|
+
{ key: "true", title: "Yes", colour: "green" },
|
|
50
|
+
{ key: "false", title: "No" },
|
|
51
|
+
];
|
|
52
|
+
case "person":
|
|
53
|
+
if (!(members === null || members === void 0 ? void 0 : members.length))
|
|
54
|
+
return undefined;
|
|
55
|
+
return members.map(function (each) { return ({ key: each.key, title: each.label }); });
|
|
56
|
+
default:
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.handleGetGroupOptions = handleGetGroupOptions;
|
|
61
|
+
/**
|
|
62
|
+
* The section a stored value belongs to. With fixed options, a value outside
|
|
63
|
+
* them is Unknown; without, every distinct value is its own section.
|
|
64
|
+
*/
|
|
65
|
+
var handleGetGroupKey = function (column, rawValue, options, isFirebase) {
|
|
66
|
+
var value = rawValue;
|
|
67
|
+
if ((column === null || column === void 0 ? void 0 : column.type) === "person" && Array.isArray(value))
|
|
68
|
+
value = value[0];
|
|
69
|
+
if (handleIsEmptyValue(value))
|
|
70
|
+
return exports.GROUP_EMPTY_KEY;
|
|
71
|
+
if ((column === null || column === void 0 ? void 0 : column.type) === "boolean") {
|
|
72
|
+
if (value === true || value === "true")
|
|
73
|
+
return "true";
|
|
74
|
+
if (value === false || value === "false")
|
|
75
|
+
return "false";
|
|
76
|
+
return exports.GROUP_UNKNOWN_KEY;
|
|
77
|
+
}
|
|
78
|
+
if ((column === null || column === void 0 ? void 0 : column.type) === "date") {
|
|
79
|
+
var day = (0, dayjs_1.default)(isFirebase && (value === null || value === void 0 ? void 0 : value._seconds) ? value._seconds * 1000 : value);
|
|
80
|
+
return day.isValid()
|
|
81
|
+
? day.startOf("day").format("YYYY-MM-DD")
|
|
82
|
+
: exports.GROUP_UNKNOWN_KEY;
|
|
83
|
+
}
|
|
84
|
+
if (typeof value === "object")
|
|
85
|
+
return exports.GROUP_UNKNOWN_KEY;
|
|
86
|
+
var key = String(value);
|
|
87
|
+
if (options && !options.some(function (each) { return each.key === key; }))
|
|
88
|
+
return exports.GROUP_UNKNOWN_KEY;
|
|
89
|
+
return key;
|
|
90
|
+
};
|
|
91
|
+
exports.handleGetGroupKey = handleGetGroupKey;
|
|
92
|
+
/**
|
|
93
|
+
* The query that reads one section on its own — an option is an equality,
|
|
94
|
+
* No Value matches a missing, null or blank field, and Unknown is every value
|
|
95
|
+
* that is none of those.
|
|
96
|
+
*/
|
|
97
|
+
var handleGetGroupSectionQuery = function (column, sectionId, options) {
|
|
98
|
+
if (sectionId === exports.GROUP_EMPTY_KEY)
|
|
99
|
+
return [{ type: "in", queryId: column.id, value: [null, ""] }];
|
|
100
|
+
var optionValues = options.map(function (each) {
|
|
101
|
+
return column.type === "boolean" ? each.key === "true" : each.key;
|
|
102
|
+
});
|
|
103
|
+
if (sectionId === exports.GROUP_UNKNOWN_KEY)
|
|
104
|
+
return [
|
|
105
|
+
{ type: "!in", queryId: column.id, value: __spreadArray(__spreadArray([], optionValues, true), [null, ""], false) },
|
|
106
|
+
];
|
|
107
|
+
return [
|
|
108
|
+
{
|
|
109
|
+
type: "=",
|
|
110
|
+
queryId: column.id,
|
|
111
|
+
value: column.type === "boolean" ? sectionId === "true" : sectionId,
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
};
|
|
115
|
+
exports.handleGetGroupSectionQuery = handleGetGroupSectionQuery;
|
|
116
|
+
/**
|
|
117
|
+
* Builds the sections for the loaded rows. With fixed options every option is
|
|
118
|
+
* a section in option order — empty ones only when `keepEmptyOptions` (a
|
|
119
|
+
* section that reads its own rows needs to be there before they load) — and
|
|
120
|
+
* Unknown and No Value follow. Without options, sections follow the order the
|
|
121
|
+
* values first appear in.
|
|
122
|
+
*/
|
|
123
|
+
var handleBuildGroupSections = function (params) {
|
|
124
|
+
var _a;
|
|
125
|
+
var column = params.column, rows = params.rows, getRowId = params.getRowId, options = params.options, keepEmptyOptions = params.keepEmptyOptions, isFirebase = params.isFirebase;
|
|
126
|
+
var getValue = (_a = params.getValue) !== null && _a !== void 0 ? _a : (function (row) { return (column ? row === null || row === void 0 ? void 0 : row[column.id] : undefined); });
|
|
127
|
+
var sections = new Map();
|
|
128
|
+
(options !== null && options !== void 0 ? options : []).forEach(function (each) {
|
|
129
|
+
return sections.set(each.key, {
|
|
130
|
+
id: each.key,
|
|
131
|
+
title: each.title,
|
|
132
|
+
colour: each.colour,
|
|
133
|
+
rowIds: [],
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
var unknown = {
|
|
137
|
+
id: exports.GROUP_UNKNOWN_KEY,
|
|
138
|
+
title: exports.GROUP_UNKNOWN_TITLE,
|
|
139
|
+
rowIds: [],
|
|
140
|
+
};
|
|
141
|
+
var empty = {
|
|
142
|
+
id: exports.GROUP_EMPTY_KEY,
|
|
143
|
+
title: exports.GROUP_EMPTY_TITLE,
|
|
144
|
+
rowIds: [],
|
|
145
|
+
};
|
|
146
|
+
rows.forEach(function (row, index) {
|
|
147
|
+
var rowId = getRowId(row, index);
|
|
148
|
+
if (!rowId)
|
|
149
|
+
return;
|
|
150
|
+
var key = (0, exports.handleGetGroupKey)(column, getValue(row, index), options, isFirebase);
|
|
151
|
+
if (key === exports.GROUP_UNKNOWN_KEY)
|
|
152
|
+
unknown.rowIds.push(rowId);
|
|
153
|
+
else if (key === exports.GROUP_EMPTY_KEY)
|
|
154
|
+
empty.rowIds.push(rowId);
|
|
155
|
+
else {
|
|
156
|
+
var section = sections.get(key);
|
|
157
|
+
if (!section) {
|
|
158
|
+
section = { id: key, title: key, rowIds: [] };
|
|
159
|
+
sections.set(key, section);
|
|
160
|
+
}
|
|
161
|
+
section.rowIds.push(rowId);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
var ordered = __spreadArray(__spreadArray([], Array.from(sections.values()), true), [unknown, empty], false);
|
|
165
|
+
if (keepEmptyOptions)
|
|
166
|
+
return ordered;
|
|
167
|
+
return ordered.filter(function (each) { return each.rowIds.length > 0; });
|
|
168
|
+
};
|
|
169
|
+
exports.handleBuildGroupSections = handleBuildGroupSections;
|
|
170
|
+
//# sourceMappingURL=groupSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupSections.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/groupSections.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAAgC;AAuBhC,4EAA4E;AAC5E,UAAU;AACG,QAAA,iBAAiB,GAAG,WAAW,CAAC;AAChC,QAAA,eAAe,GAAG,SAAS,CAAC;AAC5B,QAAA,mBAAmB,GAAG,SAAS,CAAC;AAChC,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAE5C,8EAA8E;AAC9E,8DAA8D;AACjD,QAAA,wBAAwB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAEtE,IAAM,kBAAkB,GAAG,UAAC,KAAU;IACpC,OAAA,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,EAAE;QACZ,KAAK,KAAK,KAAK;QACf,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AAJ5C,CAI4C,CAAC;AAExC,IAAM,qBAAqB,GAAG,UACnC,MAAsB,EACtB,OAA0C;;IAE1C,QAAQ,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;QACrB,KAAK,MAAM;YACT,IAAI,CAAC,CAAA,MAAA,MAAM,CAAC,aAAa,0CAAE,MAAM,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AAE,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;gBAC9C,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC7B,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,IAAM,OAAO,mCAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,UAAE,OAAO,EAAE,KAAK,SAAC,CAAC;IACnE,IAAI,gBAAgB;QAAE,OAAO,OAAO,CAAC;IACrC,OAAO,OAAO,CAAC,MAAM,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAtB,CAAsB,CAAC,CAAC;AAC1D,CAAC,CAAC;AAvDW,QAAA,wBAAwB,4BAuDnC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column types added for monday.com parity — button, time tracking, date
|
|
3
|
+
* range, rating, system columns and grouped table sections. The value maths
|
|
4
|
+
* here is pure, so a server can import it and agree with the table exactly.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./buttonCell";
|
|
7
|
+
export * from "./context";
|
|
8
|
+
export * from "./dateRange";
|
|
9
|
+
export * from "./groupSections";
|
|
10
|
+
export * from "./ratingCell";
|
|
11
|
+
export * from "./systemColumns";
|
|
12
|
+
export * from "./timeTracking";
|
|
13
|
+
export * from "./timeTrackingCell";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Column types added for monday.com parity — button, time tracking, date
|
|
19
|
+
* range, rating, system columns and grouped table sections. The value maths
|
|
20
|
+
* here is pure, so a server can import it and agree with the table exactly.
|
|
21
|
+
*/
|
|
22
|
+
__exportStar(require("./buttonCell"), exports);
|
|
23
|
+
__exportStar(require("./context"), exports);
|
|
24
|
+
__exportStar(require("./dateRange"), exports);
|
|
25
|
+
__exportStar(require("./groupSections"), exports);
|
|
26
|
+
__exportStar(require("./ratingCell"), exports);
|
|
27
|
+
__exportStar(require("./systemColumns"), exports);
|
|
28
|
+
__exportStar(require("./timeTracking"), exports);
|
|
29
|
+
__exportStar(require("./timeTrackingCell"), exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/data/columnTypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B;AAC5B,kDAAgC;AAChC,+CAA6B;AAC7B,kDAAgC;AAChC,iDAA+B;AAC/B,qDAAmC"}
|