@teselagen/ui 0.10.2 → 0.10.4
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/CollapsibleCard/index.d.ts +2 -1
- package/DataTable/Columns.d.ts +4 -1
- package/DataTable/DisplayOptions.d.ts +2 -1
- package/DividerWithText/index.d.ts +16 -0
- package/index.cjs.js +547 -389
- package/index.d.ts +1 -0
- package/index.es.js +548 -390
- package/package.json +1 -1
- package/src/CollapsibleCard/index.js +8 -1
- package/src/DataTable/Columns.js +69 -1
- package/src/DataTable/DisplayOptions.js +35 -6
- package/src/DataTable/index.js +46 -7
- package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +2 -2
- package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +21 -0
- package/src/DataTable/utils/withTableParams.js +33 -13
- package/src/DividerWithText/index.js +30 -0
- package/src/DividerWithText/style.css +37 -0
- package/src/InfoHelper/style.css +1 -0
- package/src/index.js +1 -0
- package/ui.css +38 -0
package/index.es.js
CHANGED
|
@@ -55,7 +55,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
55
55
|
};
|
|
56
56
|
import * as React from "react";
|
|
57
57
|
import React__default, { useState, useEffect, forwardRef as forwardRef$2, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useCallback, createElement, Component, useLayoutEffect, createContext as createContext$1, memo, useContext, isValidElement, PureComponent } from "react";
|
|
58
|
-
import {
|
|
58
|
+
import { Classes, Icon, Button, Intent, MenuItem, Keys, Tag, Popover, Tooltip, Spinner, Checkbox, Switch, Position, FormGroup, InputGroup, TextArea, EditableText, NumericInput, RadioGroup, Menu, Toaster, MenuDivider, ContextMenu, KeyCombo, useHotkeys, Callout, Dialog, Card, Tabs, Tab, Colors, HTMLSelect, Overlay, ProgressBar } from "@blueprintjs/core";
|
|
59
59
|
import { formValueSelector, initialize, change, Field, reduxForm, SubmissionError, destroy, touch, FormName, Fields } from "redux-form";
|
|
60
60
|
import require$$2$1, { unstable_batchedUpdates, createPortal, flushSync } from "react-dom";
|
|
61
61
|
import { connect, useDispatch, useSelector, useStore } from "react-redux";
|
|
@@ -3055,26 +3055,6 @@ const LoadingDots = /* @__PURE__ */ __name(() => {
|
|
|
3055
3055
|
const FormSeparator = /* @__PURE__ */ __name(({ label = "or" } = {}) => {
|
|
3056
3056
|
return /* @__PURE__ */ React__default.createElement("div", { className: "form-separator" }, /* @__PURE__ */ React__default.createElement("p", { style: { opacity: 0.8 } }, label));
|
|
3057
3057
|
}, "FormSeparator");
|
|
3058
|
-
const AssignDefaultsModeContext = React__default.createContext({
|
|
3059
|
-
inAssignDefaultsMode: false,
|
|
3060
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3061
|
-
setAssignDefaultsMode: /* @__PURE__ */ __name(() => {
|
|
3062
|
-
}, "setAssignDefaultsMode")
|
|
3063
|
-
});
|
|
3064
|
-
const workflowDefaultParamsObj = {
|
|
3065
|
-
taskNumber: void 0,
|
|
3066
|
-
workflowDefinitionName: void 0,
|
|
3067
|
-
workflowDefinitionId: void 0,
|
|
3068
|
-
workflowRunName: void 0,
|
|
3069
|
-
workflowRunId: void 0,
|
|
3070
|
-
toolName: void 0,
|
|
3071
|
-
workflowToolTitle: void 0,
|
|
3072
|
-
workflowToolDefinitionId: void 0,
|
|
3073
|
-
workflowTaskCode: void 0
|
|
3074
|
-
};
|
|
3075
|
-
const WorkflowDefaultParamsContext = React__default.createContext(
|
|
3076
|
-
workflowDefaultParamsObj
|
|
3077
|
-
);
|
|
3078
3058
|
var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3079
3059
|
function getDefaultExportFromCjs(x2) {
|
|
3080
3060
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -3105,6 +3085,111 @@ function getAugmentedNamespace(n2) {
|
|
|
3105
3085
|
return a2;
|
|
3106
3086
|
}
|
|
3107
3087
|
__name(getAugmentedNamespace, "getAugmentedNamespace");
|
|
3088
|
+
var classnames = { exports: {} };
|
|
3089
|
+
/*!
|
|
3090
|
+
Copyright (c) 2018 Jed Watson.
|
|
3091
|
+
Licensed under the MIT License (MIT), see
|
|
3092
|
+
http://jedwatson.github.io/classnames
|
|
3093
|
+
*/
|
|
3094
|
+
var hasRequiredClassnames;
|
|
3095
|
+
function requireClassnames() {
|
|
3096
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
3097
|
+
hasRequiredClassnames = 1;
|
|
3098
|
+
(function(module2) {
|
|
3099
|
+
(function() {
|
|
3100
|
+
var hasOwn2 = {}.hasOwnProperty;
|
|
3101
|
+
function classNames2() {
|
|
3102
|
+
var classes = "";
|
|
3103
|
+
for (var i2 = 0; i2 < arguments.length; i2++) {
|
|
3104
|
+
var arg = arguments[i2];
|
|
3105
|
+
if (arg) {
|
|
3106
|
+
classes = appendClass(classes, parseValue(arg));
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
return classes;
|
|
3110
|
+
}
|
|
3111
|
+
__name(classNames2, "classNames");
|
|
3112
|
+
function parseValue(arg) {
|
|
3113
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
3114
|
+
return arg;
|
|
3115
|
+
}
|
|
3116
|
+
if (typeof arg !== "object") {
|
|
3117
|
+
return "";
|
|
3118
|
+
}
|
|
3119
|
+
if (Array.isArray(arg)) {
|
|
3120
|
+
return classNames2.apply(null, arg);
|
|
3121
|
+
}
|
|
3122
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
3123
|
+
return arg.toString();
|
|
3124
|
+
}
|
|
3125
|
+
var classes = "";
|
|
3126
|
+
for (var key in arg) {
|
|
3127
|
+
if (hasOwn2.call(arg, key) && arg[key]) {
|
|
3128
|
+
classes = appendClass(classes, key);
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
return classes;
|
|
3132
|
+
}
|
|
3133
|
+
__name(parseValue, "parseValue");
|
|
3134
|
+
function appendClass(value, newClass) {
|
|
3135
|
+
if (!newClass) {
|
|
3136
|
+
return value;
|
|
3137
|
+
}
|
|
3138
|
+
if (value) {
|
|
3139
|
+
return value + " " + newClass;
|
|
3140
|
+
}
|
|
3141
|
+
return value + newClass;
|
|
3142
|
+
}
|
|
3143
|
+
__name(appendClass, "appendClass");
|
|
3144
|
+
if (module2.exports) {
|
|
3145
|
+
classNames2.default = classNames2;
|
|
3146
|
+
module2.exports = classNames2;
|
|
3147
|
+
} else {
|
|
3148
|
+
window.classNames = classNames2;
|
|
3149
|
+
}
|
|
3150
|
+
})();
|
|
3151
|
+
})(classnames);
|
|
3152
|
+
return classnames.exports;
|
|
3153
|
+
}
|
|
3154
|
+
__name(requireClassnames, "requireClassnames");
|
|
3155
|
+
var classnamesExports = requireClassnames();
|
|
3156
|
+
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
3157
|
+
function DividerWithText({ text: text2, className, style }) {
|
|
3158
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
3159
|
+
"div",
|
|
3160
|
+
{
|
|
3161
|
+
className: classNames(
|
|
3162
|
+
Classes.DIVIDER,
|
|
3163
|
+
"tg-blueprint-divider",
|
|
3164
|
+
{ "tg-blueprint-divider-with-text": !!text2 },
|
|
3165
|
+
className
|
|
3166
|
+
),
|
|
3167
|
+
style
|
|
3168
|
+
},
|
|
3169
|
+
text2 && /* @__PURE__ */ React__default.createElement("span", { className: "tg-blueprint-divider-text" }, text2)
|
|
3170
|
+
);
|
|
3171
|
+
}
|
|
3172
|
+
__name(DividerWithText, "DividerWithText");
|
|
3173
|
+
const AssignDefaultsModeContext = React__default.createContext({
|
|
3174
|
+
inAssignDefaultsMode: false,
|
|
3175
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3176
|
+
setAssignDefaultsMode: /* @__PURE__ */ __name(() => {
|
|
3177
|
+
}, "setAssignDefaultsMode")
|
|
3178
|
+
});
|
|
3179
|
+
const workflowDefaultParamsObj = {
|
|
3180
|
+
taskNumber: void 0,
|
|
3181
|
+
workflowDefinitionName: void 0,
|
|
3182
|
+
workflowDefinitionId: void 0,
|
|
3183
|
+
workflowRunName: void 0,
|
|
3184
|
+
workflowRunId: void 0,
|
|
3185
|
+
toolName: void 0,
|
|
3186
|
+
workflowToolTitle: void 0,
|
|
3187
|
+
workflowToolDefinitionId: void 0,
|
|
3188
|
+
workflowTaskCode: void 0
|
|
3189
|
+
};
|
|
3190
|
+
const WorkflowDefaultParamsContext = React__default.createContext(
|
|
3191
|
+
workflowDefaultParamsObj
|
|
3192
|
+
);
|
|
3108
3193
|
var propTypes$1 = { exports: {} };
|
|
3109
3194
|
var ReactPropTypesSecret_1;
|
|
3110
3195
|
var hasRequiredReactPropTypesSecret;
|
|
@@ -4570,75 +4655,6 @@ __name(reducer$1, "reducer$1");
|
|
|
4570
4655
|
function noop$5() {
|
|
4571
4656
|
}
|
|
4572
4657
|
__name(noop$5, "noop$5");
|
|
4573
|
-
var classnames = { exports: {} };
|
|
4574
|
-
/*!
|
|
4575
|
-
Copyright (c) 2018 Jed Watson.
|
|
4576
|
-
Licensed under the MIT License (MIT), see
|
|
4577
|
-
http://jedwatson.github.io/classnames
|
|
4578
|
-
*/
|
|
4579
|
-
var hasRequiredClassnames;
|
|
4580
|
-
function requireClassnames() {
|
|
4581
|
-
if (hasRequiredClassnames) return classnames.exports;
|
|
4582
|
-
hasRequiredClassnames = 1;
|
|
4583
|
-
(function(module2) {
|
|
4584
|
-
(function() {
|
|
4585
|
-
var hasOwn2 = {}.hasOwnProperty;
|
|
4586
|
-
function classNames2() {
|
|
4587
|
-
var classes = "";
|
|
4588
|
-
for (var i2 = 0; i2 < arguments.length; i2++) {
|
|
4589
|
-
var arg = arguments[i2];
|
|
4590
|
-
if (arg) {
|
|
4591
|
-
classes = appendClass(classes, parseValue(arg));
|
|
4592
|
-
}
|
|
4593
|
-
}
|
|
4594
|
-
return classes;
|
|
4595
|
-
}
|
|
4596
|
-
__name(classNames2, "classNames");
|
|
4597
|
-
function parseValue(arg) {
|
|
4598
|
-
if (typeof arg === "string" || typeof arg === "number") {
|
|
4599
|
-
return arg;
|
|
4600
|
-
}
|
|
4601
|
-
if (typeof arg !== "object") {
|
|
4602
|
-
return "";
|
|
4603
|
-
}
|
|
4604
|
-
if (Array.isArray(arg)) {
|
|
4605
|
-
return classNames2.apply(null, arg);
|
|
4606
|
-
}
|
|
4607
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
4608
|
-
return arg.toString();
|
|
4609
|
-
}
|
|
4610
|
-
var classes = "";
|
|
4611
|
-
for (var key in arg) {
|
|
4612
|
-
if (hasOwn2.call(arg, key) && arg[key]) {
|
|
4613
|
-
classes = appendClass(classes, key);
|
|
4614
|
-
}
|
|
4615
|
-
}
|
|
4616
|
-
return classes;
|
|
4617
|
-
}
|
|
4618
|
-
__name(parseValue, "parseValue");
|
|
4619
|
-
function appendClass(value, newClass) {
|
|
4620
|
-
if (!newClass) {
|
|
4621
|
-
return value;
|
|
4622
|
-
}
|
|
4623
|
-
if (value) {
|
|
4624
|
-
return value + " " + newClass;
|
|
4625
|
-
}
|
|
4626
|
-
return value + newClass;
|
|
4627
|
-
}
|
|
4628
|
-
__name(appendClass, "appendClass");
|
|
4629
|
-
if (module2.exports) {
|
|
4630
|
-
classNames2.default = classNames2;
|
|
4631
|
-
module2.exports = classNames2;
|
|
4632
|
-
} else {
|
|
4633
|
-
window.classNames = classNames2;
|
|
4634
|
-
}
|
|
4635
|
-
})();
|
|
4636
|
-
})(classnames);
|
|
4637
|
-
return classnames.exports;
|
|
4638
|
-
}
|
|
4639
|
-
__name(requireClassnames, "requireClassnames");
|
|
4640
|
-
var classnamesExports = requireClassnames();
|
|
4641
|
-
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
4642
4658
|
let nanoid = /* @__PURE__ */ __name((size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
|
|
4643
4659
|
byte &= 63;
|
|
4644
4660
|
if (byte < 36) {
|
|
@@ -19427,10 +19443,10 @@ function tableQueryParamsToHasuraClauses({
|
|
|
19427
19443
|
const uniqueFieldsByPath = {};
|
|
19428
19444
|
const searchTerms = searchTerm.split(",");
|
|
19429
19445
|
schema.fields.forEach((field) => {
|
|
19430
|
-
const { type: type2, path: path2, searchDisabled } = field;
|
|
19446
|
+
const { type: type2, path: path2, searchDisabled, isHidden } = field;
|
|
19431
19447
|
if (uniqueFieldsByPath[path2]) return;
|
|
19432
19448
|
uniqueFieldsByPath[path2] = true;
|
|
19433
|
-
if (searchDisabled || field.filterDisabled || type2 === "color") return;
|
|
19449
|
+
if (searchDisabled || field.filterDisabled || type2 === "color" || isHidden) return;
|
|
19434
19450
|
searchTerms.forEach((term) => {
|
|
19435
19451
|
const filterValue = term.trim();
|
|
19436
19452
|
if (type2 === "string" || type2 === "lookup") {
|
|
@@ -34462,6 +34478,7 @@ const DisplayOptions = /* @__PURE__ */ __name(({
|
|
|
34462
34478
|
compact,
|
|
34463
34479
|
extraCompact,
|
|
34464
34480
|
disabled,
|
|
34481
|
+
doNotSearchHiddenColumns,
|
|
34465
34482
|
hideDisplayOptionsIcon,
|
|
34466
34483
|
resetDefaultVisibility = noop$4,
|
|
34467
34484
|
updateColumnVisibility = noop$4,
|
|
@@ -34492,7 +34509,7 @@ const DisplayOptions = /* @__PURE__ */ __name(({
|
|
|
34492
34509
|
});
|
|
34493
34510
|
let numVisible = 0;
|
|
34494
34511
|
const getFieldCheckbox = /* @__PURE__ */ __name((field, i2) => {
|
|
34495
|
-
const { displayName, isHidden, isForcedHidden, path: path2 } = field;
|
|
34512
|
+
const { displayName, isHidden, isForcedHidden, path: path2, subFrag } = field;
|
|
34496
34513
|
if (isForcedHidden) return;
|
|
34497
34514
|
if (!isHidden) numVisible++;
|
|
34498
34515
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -34509,7 +34526,15 @@ const DisplayOptions = /* @__PURE__ */ __name(({
|
|
|
34509
34526
|
updateColumnVisibility({ shouldShow: isHidden, path: path2 });
|
|
34510
34527
|
}, "onChange"),
|
|
34511
34528
|
checked: !isHidden,
|
|
34512
|
-
label: displayName
|
|
34529
|
+
label: /* @__PURE__ */ React__default.createElement("span", { style: { display: "flex", marginTop: -17 } }, displayName, subFrag && /* @__PURE__ */ React__default.createElement(
|
|
34530
|
+
InfoHelper,
|
|
34531
|
+
{
|
|
34532
|
+
icon: "warning-sign",
|
|
34533
|
+
intent: "warning",
|
|
34534
|
+
style: { marginLeft: 5 }
|
|
34535
|
+
},
|
|
34536
|
+
"Viewing this column may cause the table to load slower"
|
|
34537
|
+
))
|
|
34513
34538
|
}
|
|
34514
34539
|
);
|
|
34515
34540
|
}, "getFieldCheckbox");
|
|
@@ -34558,7 +34583,7 @@ const DisplayOptions = /* @__PURE__ */ __name(({
|
|
|
34558
34583
|
{
|
|
34559
34584
|
isOpen,
|
|
34560
34585
|
onClose: /* @__PURE__ */ __name(() => setIsOpen(false), "onClose"),
|
|
34561
|
-
content: /* @__PURE__ */ React__default.createElement(Menu, null, /* @__PURE__ */ React__default.createElement("div", { style: { padding: 10, paddingLeft: 20, paddingRight: 20 } }, /* @__PURE__ */ React__default.createElement("h5", { style: { marginBottom: 10 } }, "Display Density:"), /* @__PURE__ */ React__default.createElement("div", { className: Classes.SELECT + " tg-table-display-density" }, /* @__PURE__ */ React__default.createElement(
|
|
34586
|
+
content: /* @__PURE__ */ React__default.createElement(Menu, null, /* @__PURE__ */ React__default.createElement("div", { style: { padding: 10, paddingLeft: 20, paddingRight: 20 } }, /* @__PURE__ */ React__default.createElement("h5", { style: { marginBottom: 10, fontWeight: "bold" } }, "Display Density:"), /* @__PURE__ */ React__default.createElement("div", { className: Classes.SELECT + " tg-table-display-density" }, /* @__PURE__ */ React__default.createElement(
|
|
34562
34587
|
"select",
|
|
34563
34588
|
{
|
|
34564
34589
|
onChange: changeTableDensity,
|
|
@@ -34574,7 +34599,19 @@ const DisplayOptions = /* @__PURE__ */ __name(({
|
|
|
34574
34599
|
},
|
|
34575
34600
|
"Compact"
|
|
34576
34601
|
)
|
|
34577
|
-
)), /* @__PURE__ */ React__default.createElement(
|
|
34602
|
+
)), /* @__PURE__ */ React__default.createElement(
|
|
34603
|
+
"h5",
|
|
34604
|
+
{
|
|
34605
|
+
style: {
|
|
34606
|
+
fontWeight: "bold",
|
|
34607
|
+
marginBottom: 10,
|
|
34608
|
+
marginTop: 10,
|
|
34609
|
+
display: "flex"
|
|
34610
|
+
}
|
|
34611
|
+
},
|
|
34612
|
+
"Displayed Columns: ",
|
|
34613
|
+
doNotSearchHiddenColumns && /* @__PURE__ */ React__default.createElement(InfoHelper, null, "Note: Hidden columns will NOT be used when searching the datatable")
|
|
34614
|
+
), /* @__PURE__ */ React__default.createElement("div", { style: { maxHeight: 260, overflowY: "auto", padding: 2 } }, mainFields.map(getFieldCheckbox)), /* @__PURE__ */ React__default.createElement("div", null, fieldGroupMenu), hasOptionForForcedHidden && /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 15 } }, /* @__PURE__ */ React__default.createElement(
|
|
34578
34615
|
Switch,
|
|
34579
34616
|
{
|
|
34580
34617
|
label: "Show Empty Columns",
|
|
@@ -34595,9 +34632,10 @@ const DisplayOptions = /* @__PURE__ */ __name(({
|
|
|
34595
34632
|
{
|
|
34596
34633
|
onClick: resetDefaultVisibility,
|
|
34597
34634
|
title: "Display Options",
|
|
34635
|
+
icon: "reset",
|
|
34598
34636
|
minimal: true
|
|
34599
34637
|
},
|
|
34600
|
-
"Reset"
|
|
34638
|
+
"Reset Column Visibilites"
|
|
34601
34639
|
)
|
|
34602
34640
|
)))
|
|
34603
34641
|
},
|
|
@@ -51341,6 +51379,273 @@ const RenderCell = /* @__PURE__ */ __name(({
|
|
|
51341
51379
|
}
|
|
51342
51380
|
));
|
|
51343
51381
|
}, "RenderCell");
|
|
51382
|
+
function MenuItemLink({ text: text2, onClick, icon, navTo, active: active2, disabled }) {
|
|
51383
|
+
if (disabled) {
|
|
51384
|
+
return /* @__PURE__ */ React__default.createElement("li", { className: Classes.POPOVER_DISMISS }, /* @__PURE__ */ React__default.createElement(MenuItem, { icon, disabled: true, text: text2 }));
|
|
51385
|
+
}
|
|
51386
|
+
const handleLinkClick = /* @__PURE__ */ __name((e) => {
|
|
51387
|
+
e.target.closest(`.${Classes.POPOVER_DISMISS}`).click();
|
|
51388
|
+
}, "handleLinkClick");
|
|
51389
|
+
return /* @__PURE__ */ React__default.createElement("li", { className: Classes.POPOVER_DISMISS, onClick }, /* @__PURE__ */ React__default.createElement(
|
|
51390
|
+
Link,
|
|
51391
|
+
{
|
|
51392
|
+
onClick: handleLinkClick,
|
|
51393
|
+
to: navTo,
|
|
51394
|
+
className: classNames(Classes.MENU_ITEM, {
|
|
51395
|
+
[Classes.ACTIVE]: active2,
|
|
51396
|
+
[Classes.INTENT_PRIMARY]: active2
|
|
51397
|
+
})
|
|
51398
|
+
},
|
|
51399
|
+
icon && /* @__PURE__ */ React__default.createElement(Icon, { icon }),
|
|
51400
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "bp3-text-overflow-ellipsis bp3-fill" }, text2)
|
|
51401
|
+
));
|
|
51402
|
+
}
|
|
51403
|
+
__name(MenuItemLink, "MenuItemLink");
|
|
51404
|
+
const EnhancedMenuItem = compose(
|
|
51405
|
+
lifecycle({
|
|
51406
|
+
componentDidMount: /* @__PURE__ */ __name(function() {
|
|
51407
|
+
const { didMount = noop$4, className } = this.props;
|
|
51408
|
+
didMount({ className });
|
|
51409
|
+
}, "componentDidMount"),
|
|
51410
|
+
componentWillUnmount: /* @__PURE__ */ __name(function() {
|
|
51411
|
+
const { willUnmount = noop$4, className } = this.props;
|
|
51412
|
+
willUnmount({ className });
|
|
51413
|
+
}, "componentWillUnmount")
|
|
51414
|
+
}),
|
|
51415
|
+
branch(({ navTo }) => navTo, withRouter)
|
|
51416
|
+
)(function(_I) {
|
|
51417
|
+
var _J = _I, {
|
|
51418
|
+
navTo,
|
|
51419
|
+
context: context2,
|
|
51420
|
+
staticContext,
|
|
51421
|
+
didMount,
|
|
51422
|
+
willUnmount
|
|
51423
|
+
} = _J, props = __objRest(_J, [
|
|
51424
|
+
"navTo",
|
|
51425
|
+
"context",
|
|
51426
|
+
"staticContext",
|
|
51427
|
+
"didMount",
|
|
51428
|
+
"willUnmount"
|
|
51429
|
+
]);
|
|
51430
|
+
let MenuItemComp = MenuItem;
|
|
51431
|
+
if (navTo) {
|
|
51432
|
+
MenuItemComp = MenuItemLink;
|
|
51433
|
+
}
|
|
51434
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
51435
|
+
MenuItemComp,
|
|
51436
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
51437
|
+
popoverProps: {
|
|
51438
|
+
autoFocus: false
|
|
51439
|
+
}
|
|
51440
|
+
}, navTo && { navTo }), props), {
|
|
51441
|
+
onClick: props.onClick ? (...args) => {
|
|
51442
|
+
return props.onClick(...args, context2);
|
|
51443
|
+
} : void 0
|
|
51444
|
+
})
|
|
51445
|
+
);
|
|
51446
|
+
});
|
|
51447
|
+
function fnu(...args) {
|
|
51448
|
+
return args.find((v2) => v2 !== void 0);
|
|
51449
|
+
}
|
|
51450
|
+
__name(fnu, "fnu");
|
|
51451
|
+
const tickMenuEnhancer = /* @__PURE__ */ __name((def) => {
|
|
51452
|
+
const out = __spreadValues({}, def);
|
|
51453
|
+
if (out.checked !== void 0) {
|
|
51454
|
+
out.icon = out.checked ? "small-tick" : "blank";
|
|
51455
|
+
}
|
|
51456
|
+
return out;
|
|
51457
|
+
}, "tickMenuEnhancer");
|
|
51458
|
+
const commandMenuEnhancer = /* @__PURE__ */ __name((commands, config = {}) => (def, context2) => {
|
|
51459
|
+
const cmdId = typeof def === "string" ? def : def.cmd;
|
|
51460
|
+
let item = typeof def === "string" ? { cmd: def } : __spreadValues({}, def);
|
|
51461
|
+
const useTicks = fnu(item.useTicks, config.useTicks);
|
|
51462
|
+
delete item.useTicks;
|
|
51463
|
+
if (cmdId && commands[cmdId] && def.divider === void 0) {
|
|
51464
|
+
const command = commands[cmdId];
|
|
51465
|
+
const { isActive, isDisabled, isHidden } = command;
|
|
51466
|
+
const toggles = isActive !== void 0;
|
|
51467
|
+
item.hidden = fnu(item.hidden, isHidden);
|
|
51468
|
+
item.disabled = fnu(item.disabled, isDisabled);
|
|
51469
|
+
item.key = item.key || cmdId;
|
|
51470
|
+
item.submenu = item.submenu || command.submenu;
|
|
51471
|
+
item.component = item.component || command.component;
|
|
51472
|
+
if (toggles) {
|
|
51473
|
+
if (useTicks) {
|
|
51474
|
+
item.text = item.text || command.shortName || command.name;
|
|
51475
|
+
item.checked = item.checked || isActive;
|
|
51476
|
+
} else {
|
|
51477
|
+
item.text = item.text || (isActive ? command.name : command.inactiveName || command.name);
|
|
51478
|
+
item.icon = item.icon || (isActive ? command.icon : command.inactiveIcon || command.icon);
|
|
51479
|
+
}
|
|
51480
|
+
} else {
|
|
51481
|
+
item.text = item.text || command.name;
|
|
51482
|
+
item.icon = item.icon || command.icon;
|
|
51483
|
+
}
|
|
51484
|
+
item.hotkey = item.hotkey || command.hotkey;
|
|
51485
|
+
if (!item.onClick) {
|
|
51486
|
+
item.onClick = (event) => command.execute({
|
|
51487
|
+
event,
|
|
51488
|
+
context: context2,
|
|
51489
|
+
menuItem: item,
|
|
51490
|
+
viaMenu: true
|
|
51491
|
+
});
|
|
51492
|
+
}
|
|
51493
|
+
} else if (cmdId && !commands[cmdId]) {
|
|
51494
|
+
item.text = item.text || startCase(cmdId);
|
|
51495
|
+
item.disabled = true;
|
|
51496
|
+
}
|
|
51497
|
+
if (config.omitIcons) {
|
|
51498
|
+
item.icon = void 0;
|
|
51499
|
+
}
|
|
51500
|
+
if (config.forceIconAlignment !== false) {
|
|
51501
|
+
item.icon = item.icon || "blank";
|
|
51502
|
+
}
|
|
51503
|
+
if (useTicks) {
|
|
51504
|
+
item = tickMenuEnhancer(item);
|
|
51505
|
+
}
|
|
51506
|
+
return item;
|
|
51507
|
+
}, "commandMenuEnhancer");
|
|
51508
|
+
const ident = /* @__PURE__ */ __name((x2) => x2, "ident");
|
|
51509
|
+
const dividerShorthandEnhancer = /* @__PURE__ */ __name((def) => typeof def === "string" && def.startsWith("--") ? { divider: def.substr(2) } : def, "dividerShorthandEnhancer");
|
|
51510
|
+
const unwantedAttrs = [
|
|
51511
|
+
"isSimpleText",
|
|
51512
|
+
"justText",
|
|
51513
|
+
"submenu",
|
|
51514
|
+
"component",
|
|
51515
|
+
"hotkey",
|
|
51516
|
+
"changingProps",
|
|
51517
|
+
"showInSearchMenu",
|
|
51518
|
+
"hideFromMenuSearch"
|
|
51519
|
+
];
|
|
51520
|
+
const DynamicMenuItem = /* @__PURE__ */ __name(({
|
|
51521
|
+
def,
|
|
51522
|
+
enhancers = [ident],
|
|
51523
|
+
context: context2,
|
|
51524
|
+
doNotEnhanceTopLevelItem
|
|
51525
|
+
}) => {
|
|
51526
|
+
if (React__default.isValidElement(def)) return def;
|
|
51527
|
+
const item = [
|
|
51528
|
+
dividerShorthandEnhancer,
|
|
51529
|
+
...doNotEnhanceTopLevelItem ? [ident] : enhancers
|
|
51530
|
+
].reduce((v2, f2) => f2(v2, context2), def);
|
|
51531
|
+
let out;
|
|
51532
|
+
if (item.divider !== void 0) {
|
|
51533
|
+
out = /* @__PURE__ */ React__default.createElement(
|
|
51534
|
+
MenuDivider,
|
|
51535
|
+
__spreadValues({}, item.divider ? { title: item.divider, className: item.className } : {})
|
|
51536
|
+
);
|
|
51537
|
+
} else {
|
|
51538
|
+
const ItemComponent = item.component || EnhancedMenuItem;
|
|
51539
|
+
out = /* @__PURE__ */ React__default.createElement(
|
|
51540
|
+
ItemComponent,
|
|
51541
|
+
__spreadProps(__spreadValues({}, omit(item, unwantedAttrs)), {
|
|
51542
|
+
context: context2,
|
|
51543
|
+
icon: item.icon || item.iconName,
|
|
51544
|
+
labelElement: item.hotkey && /* @__PURE__ */ React__default.createElement(KeyCombo, { minimal: true, combo: item.hotkey }),
|
|
51545
|
+
text: item.text
|
|
51546
|
+
}),
|
|
51547
|
+
item.submenu ? item.submenu.filter(ident).map((def2, index2) => /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def: def2, enhancers, context: context2 }))) : void 0
|
|
51548
|
+
);
|
|
51549
|
+
}
|
|
51550
|
+
if (item.disabled && typeof item.disabled === "string") {
|
|
51551
|
+
item.tooltip = item.disabled;
|
|
51552
|
+
}
|
|
51553
|
+
if (item.tooltip) {
|
|
51554
|
+
out = /* @__PURE__ */ React__default.createElement(Tooltip, { content: item.tooltip }, out);
|
|
51555
|
+
}
|
|
51556
|
+
return item.hidden ? null : out;
|
|
51557
|
+
}, "DynamicMenuItem");
|
|
51558
|
+
const createDynamicMenu = /* @__PURE__ */ __name((menuDef, enhancers, context2) => {
|
|
51559
|
+
if (menuDef instanceof Array) {
|
|
51560
|
+
return menuDef.map((def, index2) => /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def, enhancers, context: context2 })));
|
|
51561
|
+
} else {
|
|
51562
|
+
return /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({}, { def: menuDef, enhancers, context: context2 }));
|
|
51563
|
+
}
|
|
51564
|
+
}, "createDynamicMenu");
|
|
51565
|
+
const createDynamicBarMenu = /* @__PURE__ */ __name((topMenuDef, enhancers, context2) => {
|
|
51566
|
+
return topMenuDef.map((topLevelItem) => {
|
|
51567
|
+
const def = __spreadValues({}, topLevelItem);
|
|
51568
|
+
if (def.submenu) {
|
|
51569
|
+
def.submenu = def.submenu.map((subdef, index2) => /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({ key: index2, def: subdef }, { enhancers, context: context2 })));
|
|
51570
|
+
}
|
|
51571
|
+
return def;
|
|
51572
|
+
});
|
|
51573
|
+
}, "createDynamicBarMenu");
|
|
51574
|
+
const createCommandMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
|
|
51575
|
+
return createDynamicMenu(
|
|
51576
|
+
menuDef,
|
|
51577
|
+
[commandMenuEnhancer(commands, config)],
|
|
51578
|
+
context2
|
|
51579
|
+
);
|
|
51580
|
+
}, "createCommandMenu");
|
|
51581
|
+
const createCommandBarMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
|
|
51582
|
+
return createDynamicBarMenu(
|
|
51583
|
+
menuDef,
|
|
51584
|
+
[commandMenuEnhancer(commands, config)],
|
|
51585
|
+
context2
|
|
51586
|
+
);
|
|
51587
|
+
}, "createCommandBarMenu");
|
|
51588
|
+
function showCommandContextMenu(menuDef, commands, config, event, onClose, context2) {
|
|
51589
|
+
return showContextMenu(
|
|
51590
|
+
menuDef,
|
|
51591
|
+
[commandMenuEnhancer(commands, config)],
|
|
51592
|
+
event,
|
|
51593
|
+
onClose,
|
|
51594
|
+
context2
|
|
51595
|
+
);
|
|
51596
|
+
}
|
|
51597
|
+
__name(showCommandContextMenu, "showCommandContextMenu");
|
|
51598
|
+
const createMenu = createDynamicMenu;
|
|
51599
|
+
function showContextMenu(menuDef, enhancers, event, onClose, context2, menuComp = Menu) {
|
|
51600
|
+
menuDef = filterMenuForCorrectness(menuDef);
|
|
51601
|
+
if (!menuDef) return;
|
|
51602
|
+
const MenuComponent = menuComp;
|
|
51603
|
+
event.persist && event.persist();
|
|
51604
|
+
ContextMenu.show(
|
|
51605
|
+
/* @__PURE__ */ React__default.createElement(MenuComponent, null, createDynamicMenu(menuDef, enhancers, context2)),
|
|
51606
|
+
{ left: event.clientX, top: event.clientY },
|
|
51607
|
+
onClose
|
|
51608
|
+
);
|
|
51609
|
+
event.stopPropagation && event.stopPropagation();
|
|
51610
|
+
event.preventDefault && event.preventDefault();
|
|
51611
|
+
}
|
|
51612
|
+
__name(showContextMenu, "showContextMenu");
|
|
51613
|
+
function filterMenuForCorrectness(menuDef) {
|
|
51614
|
+
return menuDef && menuDef.length && menuDef.filter(ident);
|
|
51615
|
+
}
|
|
51616
|
+
__name(filterMenuForCorrectness, "filterMenuForCorrectness");
|
|
51617
|
+
function getStringFromReactComponent(comp) {
|
|
51618
|
+
var _a;
|
|
51619
|
+
if (!comp) return "";
|
|
51620
|
+
if (isString$1(comp) || isNumber$1(comp)) return comp;
|
|
51621
|
+
if ((_a = comp.props) == null ? void 0 : _a.text) {
|
|
51622
|
+
return getStringFromReactComponent(comp.props.text);
|
|
51623
|
+
}
|
|
51624
|
+
const { children } = comp.props || {};
|
|
51625
|
+
if (!children) return "";
|
|
51626
|
+
if (isArray$2(children))
|
|
51627
|
+
return flatMap(children, getStringFromReactComponent).join("");
|
|
51628
|
+
if (isString$1(children)) return children;
|
|
51629
|
+
if (children.props) {
|
|
51630
|
+
return getStringFromReactComponent(children.props);
|
|
51631
|
+
}
|
|
51632
|
+
}
|
|
51633
|
+
__name(getStringFromReactComponent, "getStringFromReactComponent");
|
|
51634
|
+
function doesSearchValMatchText(searchVal, justText) {
|
|
51635
|
+
return fuzzysearch(
|
|
51636
|
+
searchVal ? searchVal.toLowerCase() : "",
|
|
51637
|
+
justText ? justText.toLowerCase() : ""
|
|
51638
|
+
);
|
|
51639
|
+
}
|
|
51640
|
+
__name(doesSearchValMatchText, "doesSearchValMatchText");
|
|
51641
|
+
const MenuItemWithTooltip = /* @__PURE__ */ __name((_K) => {
|
|
51642
|
+
var _L = _K, { tooltip } = _L, rest = __objRest(_L, ["tooltip"]);
|
|
51643
|
+
let out = /* @__PURE__ */ React__default.createElement(MenuItem, __spreadValues({}, rest));
|
|
51644
|
+
if (tooltip) {
|
|
51645
|
+
out = /* @__PURE__ */ React__default.createElement(Tooltip, { content: tooltip }, out);
|
|
51646
|
+
}
|
|
51647
|
+
return out;
|
|
51648
|
+
}, "MenuItemWithTooltip");
|
|
51344
51649
|
dayjs.extend(localizedFormat);
|
|
51345
51650
|
const RenderColumnHeader = /* @__PURE__ */ __name(({
|
|
51346
51651
|
recordIdToIsVisibleMap,
|
|
@@ -51352,8 +51657,13 @@ const RenderColumnHeader = /* @__PURE__ */ __name(({
|
|
|
51352
51657
|
entities,
|
|
51353
51658
|
extraCompact,
|
|
51354
51659
|
filters,
|
|
51660
|
+
resetDefaultVisibility,
|
|
51661
|
+
onlyOneVisibleColumn,
|
|
51355
51662
|
formName,
|
|
51356
51663
|
isCellEditable,
|
|
51664
|
+
updateColumnVisibility,
|
|
51665
|
+
schema,
|
|
51666
|
+
withDisplayOptions,
|
|
51357
51667
|
isLocalCall,
|
|
51358
51668
|
order: order2,
|
|
51359
51669
|
removeSingleFilter,
|
|
@@ -51449,6 +51759,55 @@ const RenderColumnHeader = /* @__PURE__ */ __name(({
|
|
|
51449
51759
|
<strong>${columnTitle}:</strong> <br>
|
|
51450
51760
|
${description} ${isUnique ? "<br>Must be unique" : ""}</div>`
|
|
51451
51761
|
}), {
|
|
51762
|
+
onContextMenu: /* @__PURE__ */ __name((e) => {
|
|
51763
|
+
if (!withDisplayOptions) {
|
|
51764
|
+
return;
|
|
51765
|
+
}
|
|
51766
|
+
e.preventDefault();
|
|
51767
|
+
e.persist();
|
|
51768
|
+
showContextMenu(
|
|
51769
|
+
[
|
|
51770
|
+
{
|
|
51771
|
+
text: "Hide Column",
|
|
51772
|
+
disabled: onlyOneVisibleColumn,
|
|
51773
|
+
icon: "eye-off",
|
|
51774
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
51775
|
+
updateColumnVisibility({
|
|
51776
|
+
shouldShow: false,
|
|
51777
|
+
path: path2
|
|
51778
|
+
});
|
|
51779
|
+
}, "onClick")
|
|
51780
|
+
},
|
|
51781
|
+
{
|
|
51782
|
+
text: "Hide Other Columns",
|
|
51783
|
+
icon: "eye-off",
|
|
51784
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
51785
|
+
updateColumnVisibility({
|
|
51786
|
+
shouldShow: false,
|
|
51787
|
+
paths: schema.fields.map((c2) => c2.path).filter(Boolean).filter((p2) => p2 !== path2)
|
|
51788
|
+
});
|
|
51789
|
+
}, "onClick")
|
|
51790
|
+
},
|
|
51791
|
+
{
|
|
51792
|
+
text: "Reset Column Visibilities",
|
|
51793
|
+
icon: "reset",
|
|
51794
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
51795
|
+
resetDefaultVisibility();
|
|
51796
|
+
}, "onClick")
|
|
51797
|
+
},
|
|
51798
|
+
{
|
|
51799
|
+
text: "Table Display Options",
|
|
51800
|
+
icon: "cog",
|
|
51801
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
51802
|
+
var _a, _b;
|
|
51803
|
+
(_b = (_a = e.target.closest(".data-table-container")) == null ? void 0 : _a.querySelector(".tg-table-display-options")) == null ? void 0 : _b.click();
|
|
51804
|
+
}, "onClick")
|
|
51805
|
+
}
|
|
51806
|
+
],
|
|
51807
|
+
void 0,
|
|
51808
|
+
e
|
|
51809
|
+
);
|
|
51810
|
+
}, "onContextMenu"),
|
|
51452
51811
|
"data-test": columnTitleTextified,
|
|
51453
51812
|
"data-path": path2,
|
|
51454
51813
|
"data-copy-text": columnTitleTextified,
|
|
@@ -51620,6 +51979,7 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
51620
51979
|
addFilters,
|
|
51621
51980
|
cellRenderer,
|
|
51622
51981
|
columns,
|
|
51982
|
+
resetDefaultVisibility,
|
|
51623
51983
|
currentParams,
|
|
51624
51984
|
compact,
|
|
51625
51985
|
editingCell,
|
|
@@ -51654,6 +52014,7 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
51654
52014
|
selectedCells,
|
|
51655
52015
|
setExpandedEntityIdMap,
|
|
51656
52016
|
setNewParams,
|
|
52017
|
+
updateColumnVisibility,
|
|
51657
52018
|
setOrder = noop$4,
|
|
51658
52019
|
setSelectedCells,
|
|
51659
52020
|
shouldShowSubComponent,
|
|
@@ -51667,7 +52028,8 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
51667
52028
|
withFilter: _withFilter,
|
|
51668
52029
|
withSort = true,
|
|
51669
52030
|
recordIdToIsVisibleMap,
|
|
51670
|
-
setRecordIdToIsVisibleMap
|
|
52031
|
+
setRecordIdToIsVisibleMap,
|
|
52032
|
+
withDisplayOptions
|
|
51671
52033
|
}) => {
|
|
51672
52034
|
const dispatch = useDispatch();
|
|
51673
52035
|
const change$1 = useCallback(
|
|
@@ -52085,15 +52447,20 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
52085
52447
|
const tableColumns = columns.map((column) => {
|
|
52086
52448
|
const tableColumn = __spreadProps(__spreadValues({}, column), {
|
|
52087
52449
|
Header: RenderColumnHeader({
|
|
52450
|
+
onlyOneVisibleColumn: columns.length === 1,
|
|
52088
52451
|
recordIdToIsVisibleMap,
|
|
52089
52452
|
setRecordIdToIsVisibleMap,
|
|
52090
52453
|
column,
|
|
52454
|
+
withDisplayOptions,
|
|
52091
52455
|
isLocalCall,
|
|
52092
52456
|
filters,
|
|
52093
52457
|
currentParams,
|
|
52094
52458
|
order: order2,
|
|
52459
|
+
resetDefaultVisibility,
|
|
52095
52460
|
setOrder,
|
|
52096
52461
|
withSort,
|
|
52462
|
+
schema,
|
|
52463
|
+
updateColumnVisibility,
|
|
52097
52464
|
formName,
|
|
52098
52465
|
extraCompact,
|
|
52099
52466
|
withFilter,
|
|
@@ -56286,11 +56653,12 @@ const itemSizeEstimators = {
|
|
|
56286
56653
|
normal: /* @__PURE__ */ __name(() => 33.34, "normal"),
|
|
56287
56654
|
comfortable: /* @__PURE__ */ __name(() => 41.34, "comfortable")
|
|
56288
56655
|
};
|
|
56289
|
-
const DataTable = /* @__PURE__ */ __name((
|
|
56290
|
-
var
|
|
56656
|
+
const DataTable = /* @__PURE__ */ __name((_M) => {
|
|
56657
|
+
var _N = _M, {
|
|
56291
56658
|
controlled_pageSize,
|
|
56292
56659
|
formName = "tgDataTable",
|
|
56293
56660
|
history,
|
|
56661
|
+
doNotSearchHiddenColumns,
|
|
56294
56662
|
isSimple,
|
|
56295
56663
|
isLocalCall = true,
|
|
56296
56664
|
isTableParamsConnected,
|
|
@@ -56301,10 +56669,11 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56301
56669
|
tableParams: _tableParams,
|
|
56302
56670
|
anyTouched,
|
|
56303
56671
|
blur
|
|
56304
|
-
} =
|
|
56672
|
+
} = _N, ownProps = __objRest(_N, [
|
|
56305
56673
|
"controlled_pageSize",
|
|
56306
56674
|
"formName",
|
|
56307
56675
|
"history",
|
|
56676
|
+
"doNotSearchHiddenColumns",
|
|
56308
56677
|
"isSimple",
|
|
56309
56678
|
"isLocalCall",
|
|
56310
56679
|
"isTableParamsConnected",
|
|
@@ -56618,7 +56987,8 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56618
56987
|
withSelectAll,
|
|
56619
56988
|
withSort,
|
|
56620
56989
|
withTitle = !isSimple,
|
|
56621
|
-
noExcessiveCheck
|
|
56990
|
+
noExcessiveCheck,
|
|
56991
|
+
isEntityCountLoading
|
|
56622
56992
|
} = props;
|
|
56623
56993
|
const _entities = useMemo(
|
|
56624
56994
|
() => ((reduxFormEntities == null ? void 0 : reduxFormEntities.length) ? reduxFormEntities : _origEntities) || [],
|
|
@@ -56642,7 +57012,25 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56642
57012
|
entities,
|
|
56643
57013
|
formName
|
|
56644
57014
|
]);
|
|
56645
|
-
const [tableConfig,
|
|
57015
|
+
const [tableConfig, _setTableConfig] = useState({ fieldOptions: [] });
|
|
57016
|
+
const setTableConfig = useCallback(
|
|
57017
|
+
(newConfig) => {
|
|
57018
|
+
_setTableConfig((prev) => {
|
|
57019
|
+
let newConfigVal = newConfig;
|
|
57020
|
+
if (typeof newConfig === "function") {
|
|
57021
|
+
newConfigVal = newConfig(prev);
|
|
57022
|
+
}
|
|
57023
|
+
if (!isEqual(prev.fieldOptions, newConfigVal.fieldOptions)) {
|
|
57024
|
+
change$1(
|
|
57025
|
+
"reduxFormReadOnlyFieldOptions",
|
|
57026
|
+
newConfigVal.fieldOptions || []
|
|
57027
|
+
);
|
|
57028
|
+
}
|
|
57029
|
+
return newConfigVal;
|
|
57030
|
+
});
|
|
57031
|
+
},
|
|
57032
|
+
[change$1]
|
|
57033
|
+
);
|
|
56646
57034
|
useEffect(() => {
|
|
56647
57035
|
if (withDisplayOptions) {
|
|
56648
57036
|
let newTableConfig = {};
|
|
@@ -56670,6 +57058,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56670
57058
|
convertedSchema,
|
|
56671
57059
|
// If the schema changes we want to take into account the synced tableConfig again
|
|
56672
57060
|
formName,
|
|
57061
|
+
setTableConfig,
|
|
56673
57062
|
syncDisplayOptionsToDb,
|
|
56674
57063
|
tableConfigurations,
|
|
56675
57064
|
withDisplayOptions,
|
|
@@ -56759,6 +57148,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56759
57148
|
convertedSchema,
|
|
56760
57149
|
currentParams,
|
|
56761
57150
|
entities,
|
|
57151
|
+
setTableConfig,
|
|
56762
57152
|
history,
|
|
56763
57153
|
isInfinite,
|
|
56764
57154
|
isOpenable,
|
|
@@ -56864,6 +57254,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
56864
57254
|
(_a = currentUser == null ? void 0 : currentUser.user) == null ? void 0 : _a.id,
|
|
56865
57255
|
deleteTableConfiguration,
|
|
56866
57256
|
formName,
|
|
57257
|
+
setTableConfig,
|
|
56867
57258
|
schema.fields,
|
|
56868
57259
|
syncDisplayOptionsToDb,
|
|
56869
57260
|
tableConfig,
|
|
@@ -58500,13 +58891,23 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
58500
58891
|
_selectedAndTotalMessage += `/ `;
|
|
58501
58892
|
}
|
|
58502
58893
|
if (showCount) {
|
|
58503
|
-
|
|
58894
|
+
if (isEntityCountLoading && entityCount < 1) {
|
|
58895
|
+
_selectedAndTotalMessage += `Loading...`;
|
|
58896
|
+
} else {
|
|
58897
|
+
_selectedAndTotalMessage += `${entityCount || 0} Total`;
|
|
58898
|
+
}
|
|
58504
58899
|
}
|
|
58505
58900
|
if (_selectedAndTotalMessage) {
|
|
58506
58901
|
_selectedAndTotalMessage = /* @__PURE__ */ React__default.createElement("div", null, _selectedAndTotalMessage);
|
|
58507
58902
|
}
|
|
58508
58903
|
return _selectedAndTotalMessage;
|
|
58509
|
-
}, [
|
|
58904
|
+
}, [
|
|
58905
|
+
entityCount,
|
|
58906
|
+
selectedRowCount,
|
|
58907
|
+
showCount,
|
|
58908
|
+
showNumSelected,
|
|
58909
|
+
isEntityCountLoading
|
|
58910
|
+
]);
|
|
58510
58911
|
const shouldShowPaging = !isInfinite && withPaging && (hidePageSizeWhenPossible ? entityCount > pageSize : true);
|
|
58511
58912
|
const SubComponentToUse = useMemo(() => {
|
|
58512
58913
|
if (SubComponent) {
|
|
@@ -58578,6 +58979,8 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
58578
58979
|
columns,
|
|
58579
58980
|
currentParams,
|
|
58580
58981
|
compact,
|
|
58982
|
+
// withDisplayOptions,
|
|
58983
|
+
resetDefaultVisibility,
|
|
58581
58984
|
editingCellSelectAll,
|
|
58582
58985
|
entities,
|
|
58583
58986
|
expandedEntityIdMap,
|
|
@@ -58615,6 +59018,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
58615
59018
|
startCellEdit,
|
|
58616
59019
|
SubComponent,
|
|
58617
59020
|
tableRef,
|
|
59021
|
+
updateColumnVisibility,
|
|
58618
59022
|
updateEntitiesHelper,
|
|
58619
59023
|
updateValidation,
|
|
58620
59024
|
withCheckboxes,
|
|
@@ -58652,7 +59056,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
58652
59056
|
expanded: expandedRows,
|
|
58653
59057
|
showPagination: false,
|
|
58654
59058
|
sortable: false,
|
|
58655
|
-
loading:
|
|
59059
|
+
loading: disabled,
|
|
58656
59060
|
defaultResized: resized,
|
|
58657
59061
|
onResizedChange: /* @__PURE__ */ __name((newResized = []) => {
|
|
58658
59062
|
const resizedToUse = newResized.map((column) => {
|
|
@@ -58670,7 +59074,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
58670
59074
|
ThComponent: ThComponent2,
|
|
58671
59075
|
getTrGroupProps: getTableRowProps,
|
|
58672
59076
|
getTdProps: getTableCellProps,
|
|
58673
|
-
NoDataComponent: /* @__PURE__ */ __name(({ children: children2 }) => isLoading ?
|
|
59077
|
+
NoDataComponent: /* @__PURE__ */ __name(({ children: children2 }) => isLoading ? /* @__PURE__ */ React__default.createElement("div", { className: "rt-noData" }, "Loading...") : /* @__PURE__ */ React__default.createElement("div", { className: "rt-noData" }, noRowsFoundMessage || children2), "NoDataComponent"),
|
|
58674
59078
|
LoadingComponent: /* @__PURE__ */ __name(({ loadingText, loading }) => /* @__PURE__ */ React__default.createElement(
|
|
58675
59079
|
DisabledLoadingComponent,
|
|
58676
59080
|
{
|
|
@@ -59017,6 +59421,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
|
|
|
59017
59421
|
/* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", flexWrap: "wrap" } }, additionalFooterButtons, !noFullscreenButton && toggleFullscreenButton, withDisplayOptions && /* @__PURE__ */ React__default.createElement(
|
|
59018
59422
|
DisplayOptions,
|
|
59019
59423
|
{
|
|
59424
|
+
doNotSearchHiddenColumns,
|
|
59020
59425
|
compact,
|
|
59021
59426
|
extraCompact,
|
|
59022
59427
|
disabled,
|
|
@@ -71810,8 +72215,8 @@ function AdvancedOptions({
|
|
|
71810
72215
|
), isOpen && /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }, content2 || children));
|
|
71811
72216
|
}
|
|
71812
72217
|
__name(AdvancedOptions, "AdvancedOptions");
|
|
71813
|
-
const TgHTMLSelect = /* @__PURE__ */ __name((
|
|
71814
|
-
var
|
|
72218
|
+
const TgHTMLSelect = /* @__PURE__ */ __name((_O) => {
|
|
72219
|
+
var _P = _O, { disabled } = _P, rest = __objRest(_P, ["disabled"]);
|
|
71815
72220
|
if (disabled) {
|
|
71816
72221
|
const opt = rest.options.find((o2) => o2.value === rest.value);
|
|
71817
72222
|
return /* @__PURE__ */ React__default.createElement("div", __spreadProps(__spreadValues({}, rest), { className: classNames("bp3-html-select", rest.className) }), opt.label);
|
|
@@ -71847,14 +72252,14 @@ function BlueprintError({ error }) {
|
|
|
71847
72252
|
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(Classes.FORM_GROUP, Classes.INTENT_DANGER) }, /* @__PURE__ */ React__default.createElement("div", { className: classNames(Classes.FORM_HELPER_TEXT, "preserve-newline") }, error));
|
|
71848
72253
|
}
|
|
71849
72254
|
__name(BlueprintError, "BlueprintError");
|
|
71850
|
-
function DropdownButton(
|
|
71851
|
-
var
|
|
72255
|
+
function DropdownButton(_Q) {
|
|
72256
|
+
var _R = _Q, {
|
|
71852
72257
|
disabled,
|
|
71853
72258
|
menu,
|
|
71854
72259
|
noRightIcon,
|
|
71855
72260
|
popoverProps,
|
|
71856
72261
|
className
|
|
71857
|
-
} =
|
|
72262
|
+
} = _R, rest = __objRest(_R, [
|
|
71858
72263
|
"disabled",
|
|
71859
72264
|
"menu",
|
|
71860
72265
|
"noRightIcon",
|
|
@@ -71972,7 +72377,34 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
71972
72377
|
}, _defaults),
|
|
71973
72378
|
[_defaults, controlled_pageSize]
|
|
71974
72379
|
);
|
|
71975
|
-
const
|
|
72380
|
+
const formValueStateSelector = /* @__PURE__ */ __name((state) => formValueSelector(formName)(
|
|
72381
|
+
state,
|
|
72382
|
+
"reduxFormQueryParams",
|
|
72383
|
+
"reduxFormSelectedEntityIdMap",
|
|
72384
|
+
"reduxFormReadOnlyFieldOptions"
|
|
72385
|
+
), "formValueStateSelector");
|
|
72386
|
+
const {
|
|
72387
|
+
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
72388
|
+
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {},
|
|
72389
|
+
reduxFormReadOnlyFieldOptions
|
|
72390
|
+
} = useSelector(formValueStateSelector);
|
|
72391
|
+
const convertedSchema = useMemo(() => {
|
|
72392
|
+
const pathToHiddenMap = {};
|
|
72393
|
+
reduxFormReadOnlyFieldOptions == null ? void 0 : reduxFormReadOnlyFieldOptions.forEach(({ path: path2, isHidden }) => {
|
|
72394
|
+
if (path2) pathToHiddenMap[path2] = isHidden;
|
|
72395
|
+
});
|
|
72396
|
+
const s2 = convertSchema(schema);
|
|
72397
|
+
s2.fields = s2.fields.map((f2) => {
|
|
72398
|
+
const isHidden = pathToHiddenMap[f2.path];
|
|
72399
|
+
if (pathToHiddenMap[f2.path] !== void 0) {
|
|
72400
|
+
return __spreadProps(__spreadValues({}, f2), {
|
|
72401
|
+
isHidden
|
|
72402
|
+
});
|
|
72403
|
+
}
|
|
72404
|
+
return f2;
|
|
72405
|
+
});
|
|
72406
|
+
return s2;
|
|
72407
|
+
}, [schema, reduxFormReadOnlyFieldOptions]);
|
|
71976
72408
|
if (isLocalCall) {
|
|
71977
72409
|
if (!noForm && (!formName || formName === "tgDataTable")) {
|
|
71978
72410
|
console.error(
|
|
@@ -71991,15 +72423,6 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
71991
72423
|
);
|
|
71992
72424
|
}
|
|
71993
72425
|
}
|
|
71994
|
-
const formValueStateSelector = /* @__PURE__ */ __name((state) => formValueSelector(formName)(
|
|
71995
|
-
state,
|
|
71996
|
-
"reduxFormQueryParams",
|
|
71997
|
-
"reduxFormSelectedEntityIdMap"
|
|
71998
|
-
), "formValueStateSelector");
|
|
71999
|
-
const {
|
|
72000
|
-
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
72001
|
-
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
72002
|
-
} = useSelector(formValueStateSelector);
|
|
72003
72426
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
72004
72427
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
72005
72428
|
_reduxFormSelectedEntityIdMap
|
|
@@ -72156,6 +72579,7 @@ function CollapsibleCard({
|
|
|
72156
72579
|
className,
|
|
72157
72580
|
style,
|
|
72158
72581
|
children,
|
|
72582
|
+
helperText: helperText2,
|
|
72159
72583
|
initialClosed = false,
|
|
72160
72584
|
toggle,
|
|
72161
72585
|
isOpen
|
|
@@ -72189,7 +72613,7 @@ function CollapsibleCard({
|
|
|
72189
72613
|
}
|
|
72190
72614
|
},
|
|
72191
72615
|
title
|
|
72192
|
-
), /* @__PURE__ */ React__default.createElement("div", null,
|
|
72616
|
+
), helperText2 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(InfoHelper, { children: helperText2 }), " "), open2 && /* @__PURE__ */ React__default.createElement("div", null, " ", openTitleElements)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(
|
|
72193
72617
|
Button,
|
|
72194
72618
|
{
|
|
72195
72619
|
icon: open2 ? "minimize" : "maximize",
|
|
@@ -75454,273 +75878,6 @@ const _ResizableDraggableDialog = class _ResizableDraggableDialog extends React_
|
|
|
75454
75878
|
};
|
|
75455
75879
|
__name(_ResizableDraggableDialog, "ResizableDraggableDialog");
|
|
75456
75880
|
let ResizableDraggableDialog = _ResizableDraggableDialog;
|
|
75457
|
-
function MenuItemLink({ text: text2, onClick, icon, navTo, active: active2, disabled }) {
|
|
75458
|
-
if (disabled) {
|
|
75459
|
-
return /* @__PURE__ */ React__default.createElement("li", { className: Classes.POPOVER_DISMISS }, /* @__PURE__ */ React__default.createElement(MenuItem, { icon, disabled: true, text: text2 }));
|
|
75460
|
-
}
|
|
75461
|
-
const handleLinkClick = /* @__PURE__ */ __name((e) => {
|
|
75462
|
-
e.target.closest(`.${Classes.POPOVER_DISMISS}`).click();
|
|
75463
|
-
}, "handleLinkClick");
|
|
75464
|
-
return /* @__PURE__ */ React__default.createElement("li", { className: Classes.POPOVER_DISMISS, onClick }, /* @__PURE__ */ React__default.createElement(
|
|
75465
|
-
Link,
|
|
75466
|
-
{
|
|
75467
|
-
onClick: handleLinkClick,
|
|
75468
|
-
to: navTo,
|
|
75469
|
-
className: classNames(Classes.MENU_ITEM, {
|
|
75470
|
-
[Classes.ACTIVE]: active2,
|
|
75471
|
-
[Classes.INTENT_PRIMARY]: active2
|
|
75472
|
-
})
|
|
75473
|
-
},
|
|
75474
|
-
icon && /* @__PURE__ */ React__default.createElement(Icon, { icon }),
|
|
75475
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "bp3-text-overflow-ellipsis bp3-fill" }, text2)
|
|
75476
|
-
));
|
|
75477
|
-
}
|
|
75478
|
-
__name(MenuItemLink, "MenuItemLink");
|
|
75479
|
-
const EnhancedMenuItem = compose(
|
|
75480
|
-
lifecycle({
|
|
75481
|
-
componentDidMount: /* @__PURE__ */ __name(function() {
|
|
75482
|
-
const { didMount = noop$4, className } = this.props;
|
|
75483
|
-
didMount({ className });
|
|
75484
|
-
}, "componentDidMount"),
|
|
75485
|
-
componentWillUnmount: /* @__PURE__ */ __name(function() {
|
|
75486
|
-
const { willUnmount = noop$4, className } = this.props;
|
|
75487
|
-
willUnmount({ className });
|
|
75488
|
-
}, "componentWillUnmount")
|
|
75489
|
-
}),
|
|
75490
|
-
branch(({ navTo }) => navTo, withRouter)
|
|
75491
|
-
)(function(_O) {
|
|
75492
|
-
var _P = _O, {
|
|
75493
|
-
navTo,
|
|
75494
|
-
context: context2,
|
|
75495
|
-
staticContext,
|
|
75496
|
-
didMount,
|
|
75497
|
-
willUnmount
|
|
75498
|
-
} = _P, props = __objRest(_P, [
|
|
75499
|
-
"navTo",
|
|
75500
|
-
"context",
|
|
75501
|
-
"staticContext",
|
|
75502
|
-
"didMount",
|
|
75503
|
-
"willUnmount"
|
|
75504
|
-
]);
|
|
75505
|
-
let MenuItemComp = MenuItem;
|
|
75506
|
-
if (navTo) {
|
|
75507
|
-
MenuItemComp = MenuItemLink;
|
|
75508
|
-
}
|
|
75509
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
75510
|
-
MenuItemComp,
|
|
75511
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
75512
|
-
popoverProps: {
|
|
75513
|
-
autoFocus: false
|
|
75514
|
-
}
|
|
75515
|
-
}, navTo && { navTo }), props), {
|
|
75516
|
-
onClick: props.onClick ? (...args) => {
|
|
75517
|
-
return props.onClick(...args, context2);
|
|
75518
|
-
} : void 0
|
|
75519
|
-
})
|
|
75520
|
-
);
|
|
75521
|
-
});
|
|
75522
|
-
function fnu(...args) {
|
|
75523
|
-
return args.find((v2) => v2 !== void 0);
|
|
75524
|
-
}
|
|
75525
|
-
__name(fnu, "fnu");
|
|
75526
|
-
const tickMenuEnhancer = /* @__PURE__ */ __name((def) => {
|
|
75527
|
-
const out = __spreadValues({}, def);
|
|
75528
|
-
if (out.checked !== void 0) {
|
|
75529
|
-
out.icon = out.checked ? "small-tick" : "blank";
|
|
75530
|
-
}
|
|
75531
|
-
return out;
|
|
75532
|
-
}, "tickMenuEnhancer");
|
|
75533
|
-
const commandMenuEnhancer = /* @__PURE__ */ __name((commands, config = {}) => (def, context2) => {
|
|
75534
|
-
const cmdId = typeof def === "string" ? def : def.cmd;
|
|
75535
|
-
let item = typeof def === "string" ? { cmd: def } : __spreadValues({}, def);
|
|
75536
|
-
const useTicks = fnu(item.useTicks, config.useTicks);
|
|
75537
|
-
delete item.useTicks;
|
|
75538
|
-
if (cmdId && commands[cmdId] && def.divider === void 0) {
|
|
75539
|
-
const command = commands[cmdId];
|
|
75540
|
-
const { isActive, isDisabled, isHidden } = command;
|
|
75541
|
-
const toggles = isActive !== void 0;
|
|
75542
|
-
item.hidden = fnu(item.hidden, isHidden);
|
|
75543
|
-
item.disabled = fnu(item.disabled, isDisabled);
|
|
75544
|
-
item.key = item.key || cmdId;
|
|
75545
|
-
item.submenu = item.submenu || command.submenu;
|
|
75546
|
-
item.component = item.component || command.component;
|
|
75547
|
-
if (toggles) {
|
|
75548
|
-
if (useTicks) {
|
|
75549
|
-
item.text = item.text || command.shortName || command.name;
|
|
75550
|
-
item.checked = item.checked || isActive;
|
|
75551
|
-
} else {
|
|
75552
|
-
item.text = item.text || (isActive ? command.name : command.inactiveName || command.name);
|
|
75553
|
-
item.icon = item.icon || (isActive ? command.icon : command.inactiveIcon || command.icon);
|
|
75554
|
-
}
|
|
75555
|
-
} else {
|
|
75556
|
-
item.text = item.text || command.name;
|
|
75557
|
-
item.icon = item.icon || command.icon;
|
|
75558
|
-
}
|
|
75559
|
-
item.hotkey = item.hotkey || command.hotkey;
|
|
75560
|
-
if (!item.onClick) {
|
|
75561
|
-
item.onClick = (event) => command.execute({
|
|
75562
|
-
event,
|
|
75563
|
-
context: context2,
|
|
75564
|
-
menuItem: item,
|
|
75565
|
-
viaMenu: true
|
|
75566
|
-
});
|
|
75567
|
-
}
|
|
75568
|
-
} else if (cmdId && !commands[cmdId]) {
|
|
75569
|
-
item.text = item.text || startCase(cmdId);
|
|
75570
|
-
item.disabled = true;
|
|
75571
|
-
}
|
|
75572
|
-
if (config.omitIcons) {
|
|
75573
|
-
item.icon = void 0;
|
|
75574
|
-
}
|
|
75575
|
-
if (config.forceIconAlignment !== false) {
|
|
75576
|
-
item.icon = item.icon || "blank";
|
|
75577
|
-
}
|
|
75578
|
-
if (useTicks) {
|
|
75579
|
-
item = tickMenuEnhancer(item);
|
|
75580
|
-
}
|
|
75581
|
-
return item;
|
|
75582
|
-
}, "commandMenuEnhancer");
|
|
75583
|
-
const ident = /* @__PURE__ */ __name((x2) => x2, "ident");
|
|
75584
|
-
const dividerShorthandEnhancer = /* @__PURE__ */ __name((def) => typeof def === "string" && def.startsWith("--") ? { divider: def.substr(2) } : def, "dividerShorthandEnhancer");
|
|
75585
|
-
const unwantedAttrs = [
|
|
75586
|
-
"isSimpleText",
|
|
75587
|
-
"justText",
|
|
75588
|
-
"submenu",
|
|
75589
|
-
"component",
|
|
75590
|
-
"hotkey",
|
|
75591
|
-
"changingProps",
|
|
75592
|
-
"showInSearchMenu",
|
|
75593
|
-
"hideFromMenuSearch"
|
|
75594
|
-
];
|
|
75595
|
-
const DynamicMenuItem = /* @__PURE__ */ __name(({
|
|
75596
|
-
def,
|
|
75597
|
-
enhancers = [ident],
|
|
75598
|
-
context: context2,
|
|
75599
|
-
doNotEnhanceTopLevelItem
|
|
75600
|
-
}) => {
|
|
75601
|
-
if (React__default.isValidElement(def)) return def;
|
|
75602
|
-
const item = [
|
|
75603
|
-
dividerShorthandEnhancer,
|
|
75604
|
-
...doNotEnhanceTopLevelItem ? [ident] : enhancers
|
|
75605
|
-
].reduce((v2, f2) => f2(v2, context2), def);
|
|
75606
|
-
let out;
|
|
75607
|
-
if (item.divider !== void 0) {
|
|
75608
|
-
out = /* @__PURE__ */ React__default.createElement(
|
|
75609
|
-
MenuDivider,
|
|
75610
|
-
__spreadValues({}, item.divider ? { title: item.divider, className: item.className } : {})
|
|
75611
|
-
);
|
|
75612
|
-
} else {
|
|
75613
|
-
const ItemComponent = item.component || EnhancedMenuItem;
|
|
75614
|
-
out = /* @__PURE__ */ React__default.createElement(
|
|
75615
|
-
ItemComponent,
|
|
75616
|
-
__spreadProps(__spreadValues({}, omit(item, unwantedAttrs)), {
|
|
75617
|
-
context: context2,
|
|
75618
|
-
icon: item.icon || item.iconName,
|
|
75619
|
-
labelElement: item.hotkey && /* @__PURE__ */ React__default.createElement(KeyCombo, { minimal: true, combo: item.hotkey }),
|
|
75620
|
-
text: item.text
|
|
75621
|
-
}),
|
|
75622
|
-
item.submenu ? item.submenu.filter(ident).map((def2, index2) => /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def: def2, enhancers, context: context2 }))) : void 0
|
|
75623
|
-
);
|
|
75624
|
-
}
|
|
75625
|
-
if (item.disabled && typeof item.disabled === "string") {
|
|
75626
|
-
item.tooltip = item.disabled;
|
|
75627
|
-
}
|
|
75628
|
-
if (item.tooltip) {
|
|
75629
|
-
out = /* @__PURE__ */ React__default.createElement(Tooltip, { content: item.tooltip }, out);
|
|
75630
|
-
}
|
|
75631
|
-
return item.hidden ? null : out;
|
|
75632
|
-
}, "DynamicMenuItem");
|
|
75633
|
-
const createDynamicMenu = /* @__PURE__ */ __name((menuDef, enhancers, context2) => {
|
|
75634
|
-
if (menuDef instanceof Array) {
|
|
75635
|
-
return menuDef.map((def, index2) => /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def, enhancers, context: context2 })));
|
|
75636
|
-
} else {
|
|
75637
|
-
return /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({}, { def: menuDef, enhancers, context: context2 }));
|
|
75638
|
-
}
|
|
75639
|
-
}, "createDynamicMenu");
|
|
75640
|
-
const createDynamicBarMenu = /* @__PURE__ */ __name((topMenuDef, enhancers, context2) => {
|
|
75641
|
-
return topMenuDef.map((topLevelItem) => {
|
|
75642
|
-
const def = __spreadValues({}, topLevelItem);
|
|
75643
|
-
if (def.submenu) {
|
|
75644
|
-
def.submenu = def.submenu.map((subdef, index2) => /* @__PURE__ */ React__default.createElement(DynamicMenuItem, __spreadValues({ key: index2, def: subdef }, { enhancers, context: context2 })));
|
|
75645
|
-
}
|
|
75646
|
-
return def;
|
|
75647
|
-
});
|
|
75648
|
-
}, "createDynamicBarMenu");
|
|
75649
|
-
const createCommandMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
|
|
75650
|
-
return createDynamicMenu(
|
|
75651
|
-
menuDef,
|
|
75652
|
-
[commandMenuEnhancer(commands, config)],
|
|
75653
|
-
context2
|
|
75654
|
-
);
|
|
75655
|
-
}, "createCommandMenu");
|
|
75656
|
-
const createCommandBarMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
|
|
75657
|
-
return createDynamicBarMenu(
|
|
75658
|
-
menuDef,
|
|
75659
|
-
[commandMenuEnhancer(commands, config)],
|
|
75660
|
-
context2
|
|
75661
|
-
);
|
|
75662
|
-
}, "createCommandBarMenu");
|
|
75663
|
-
function showCommandContextMenu(menuDef, commands, config, event, onClose, context2) {
|
|
75664
|
-
return showContextMenu(
|
|
75665
|
-
menuDef,
|
|
75666
|
-
[commandMenuEnhancer(commands, config)],
|
|
75667
|
-
event,
|
|
75668
|
-
onClose,
|
|
75669
|
-
context2
|
|
75670
|
-
);
|
|
75671
|
-
}
|
|
75672
|
-
__name(showCommandContextMenu, "showCommandContextMenu");
|
|
75673
|
-
const createMenu = createDynamicMenu;
|
|
75674
|
-
function showContextMenu(menuDef, enhancers, event, onClose, context2, menuComp = Menu) {
|
|
75675
|
-
menuDef = filterMenuForCorrectness(menuDef);
|
|
75676
|
-
if (!menuDef) return;
|
|
75677
|
-
const MenuComponent = menuComp;
|
|
75678
|
-
event.persist && event.persist();
|
|
75679
|
-
ContextMenu.show(
|
|
75680
|
-
/* @__PURE__ */ React__default.createElement(MenuComponent, null, createDynamicMenu(menuDef, enhancers, context2)),
|
|
75681
|
-
{ left: event.clientX, top: event.clientY },
|
|
75682
|
-
onClose
|
|
75683
|
-
);
|
|
75684
|
-
event.stopPropagation && event.stopPropagation();
|
|
75685
|
-
event.preventDefault && event.preventDefault();
|
|
75686
|
-
}
|
|
75687
|
-
__name(showContextMenu, "showContextMenu");
|
|
75688
|
-
function filterMenuForCorrectness(menuDef) {
|
|
75689
|
-
return menuDef && menuDef.length && menuDef.filter(ident);
|
|
75690
|
-
}
|
|
75691
|
-
__name(filterMenuForCorrectness, "filterMenuForCorrectness");
|
|
75692
|
-
function getStringFromReactComponent(comp) {
|
|
75693
|
-
var _a;
|
|
75694
|
-
if (!comp) return "";
|
|
75695
|
-
if (isString$1(comp) || isNumber$1(comp)) return comp;
|
|
75696
|
-
if ((_a = comp.props) == null ? void 0 : _a.text) {
|
|
75697
|
-
return getStringFromReactComponent(comp.props.text);
|
|
75698
|
-
}
|
|
75699
|
-
const { children } = comp.props || {};
|
|
75700
|
-
if (!children) return "";
|
|
75701
|
-
if (isArray$2(children))
|
|
75702
|
-
return flatMap(children, getStringFromReactComponent).join("");
|
|
75703
|
-
if (isString$1(children)) return children;
|
|
75704
|
-
if (children.props) {
|
|
75705
|
-
return getStringFromReactComponent(children.props);
|
|
75706
|
-
}
|
|
75707
|
-
}
|
|
75708
|
-
__name(getStringFromReactComponent, "getStringFromReactComponent");
|
|
75709
|
-
function doesSearchValMatchText(searchVal, justText) {
|
|
75710
|
-
return fuzzysearch(
|
|
75711
|
-
searchVal ? searchVal.toLowerCase() : "",
|
|
75712
|
-
justText ? justText.toLowerCase() : ""
|
|
75713
|
-
);
|
|
75714
|
-
}
|
|
75715
|
-
__name(doesSearchValMatchText, "doesSearchValMatchText");
|
|
75716
|
-
const MenuItemWithTooltip = /* @__PURE__ */ __name((_Q) => {
|
|
75717
|
-
var _R = _Q, { tooltip } = _R, rest = __objRest(_R, ["tooltip"]);
|
|
75718
|
-
let out = /* @__PURE__ */ React__default.createElement(MenuItem, __spreadValues({}, rest));
|
|
75719
|
-
if (tooltip) {
|
|
75720
|
-
out = /* @__PURE__ */ React__default.createElement(Tooltip, { content: tooltip }, out);
|
|
75721
|
-
}
|
|
75722
|
-
return out;
|
|
75723
|
-
}, "MenuItemWithTooltip");
|
|
75724
75881
|
function comboToLabel(def, useSymbols = true) {
|
|
75725
75882
|
const combo = typeof def === "string" ? def : def.combo;
|
|
75726
75883
|
if (useSymbols) {
|
|
@@ -78148,6 +78305,7 @@ export {
|
|
|
78148
78305
|
DateInputField,
|
|
78149
78306
|
DateRangeInputField,
|
|
78150
78307
|
DialogFooter,
|
|
78308
|
+
DividerWithText,
|
|
78151
78309
|
DropdownButton,
|
|
78152
78310
|
DynamicMenuItem,
|
|
78153
78311
|
EditableTextField,
|