@teselagen/ui 0.10.2 → 0.10.3

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/index.cjs.js CHANGED
@@ -3073,26 +3073,6 @@ const LoadingDots = /* @__PURE__ */ __name(() => {
3073
3073
  const FormSeparator = /* @__PURE__ */ __name(({ label = "or" } = {}) => {
3074
3074
  return /* @__PURE__ */ React.createElement("div", { className: "form-separator" }, /* @__PURE__ */ React.createElement("p", { style: { opacity: 0.8 } }, label));
3075
3075
  }, "FormSeparator");
3076
- const AssignDefaultsModeContext = React.createContext({
3077
- inAssignDefaultsMode: false,
3078
- // eslint-disable-next-line @typescript-eslint/no-empty-function
3079
- setAssignDefaultsMode: /* @__PURE__ */ __name(() => {
3080
- }, "setAssignDefaultsMode")
3081
- });
3082
- const workflowDefaultParamsObj = {
3083
- taskNumber: void 0,
3084
- workflowDefinitionName: void 0,
3085
- workflowDefinitionId: void 0,
3086
- workflowRunName: void 0,
3087
- workflowRunId: void 0,
3088
- toolName: void 0,
3089
- workflowToolTitle: void 0,
3090
- workflowToolDefinitionId: void 0,
3091
- workflowTaskCode: void 0
3092
- };
3093
- const WorkflowDefaultParamsContext = React.createContext(
3094
- workflowDefaultParamsObj
3095
- );
3096
3076
  var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3097
3077
  function getDefaultExportFromCjs(x2) {
3098
3078
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -3123,6 +3103,111 @@ function getAugmentedNamespace(n2) {
3123
3103
  return a2;
3124
3104
  }
3125
3105
  __name(getAugmentedNamespace, "getAugmentedNamespace");
3106
+ var classnames = { exports: {} };
3107
+ /*!
3108
+ Copyright (c) 2018 Jed Watson.
3109
+ Licensed under the MIT License (MIT), see
3110
+ http://jedwatson.github.io/classnames
3111
+ */
3112
+ var hasRequiredClassnames;
3113
+ function requireClassnames() {
3114
+ if (hasRequiredClassnames) return classnames.exports;
3115
+ hasRequiredClassnames = 1;
3116
+ (function(module2) {
3117
+ (function() {
3118
+ var hasOwn2 = {}.hasOwnProperty;
3119
+ function classNames2() {
3120
+ var classes = "";
3121
+ for (var i2 = 0; i2 < arguments.length; i2++) {
3122
+ var arg = arguments[i2];
3123
+ if (arg) {
3124
+ classes = appendClass(classes, parseValue(arg));
3125
+ }
3126
+ }
3127
+ return classes;
3128
+ }
3129
+ __name(classNames2, "classNames");
3130
+ function parseValue(arg) {
3131
+ if (typeof arg === "string" || typeof arg === "number") {
3132
+ return arg;
3133
+ }
3134
+ if (typeof arg !== "object") {
3135
+ return "";
3136
+ }
3137
+ if (Array.isArray(arg)) {
3138
+ return classNames2.apply(null, arg);
3139
+ }
3140
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
3141
+ return arg.toString();
3142
+ }
3143
+ var classes = "";
3144
+ for (var key in arg) {
3145
+ if (hasOwn2.call(arg, key) && arg[key]) {
3146
+ classes = appendClass(classes, key);
3147
+ }
3148
+ }
3149
+ return classes;
3150
+ }
3151
+ __name(parseValue, "parseValue");
3152
+ function appendClass(value, newClass) {
3153
+ if (!newClass) {
3154
+ return value;
3155
+ }
3156
+ if (value) {
3157
+ return value + " " + newClass;
3158
+ }
3159
+ return value + newClass;
3160
+ }
3161
+ __name(appendClass, "appendClass");
3162
+ if (module2.exports) {
3163
+ classNames2.default = classNames2;
3164
+ module2.exports = classNames2;
3165
+ } else {
3166
+ window.classNames = classNames2;
3167
+ }
3168
+ })();
3169
+ })(classnames);
3170
+ return classnames.exports;
3171
+ }
3172
+ __name(requireClassnames, "requireClassnames");
3173
+ var classnamesExports = requireClassnames();
3174
+ const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
3175
+ function DividerWithText({ text: text2, className, style }) {
3176
+ return /* @__PURE__ */ React.createElement(
3177
+ "div",
3178
+ {
3179
+ className: classNames(
3180
+ core.Classes.DIVIDER,
3181
+ "tg-blueprint-divider",
3182
+ { "tg-blueprint-divider-with-text": !!text2 },
3183
+ className
3184
+ ),
3185
+ style
3186
+ },
3187
+ text2 && /* @__PURE__ */ React.createElement("span", { className: "tg-blueprint-divider-text" }, text2)
3188
+ );
3189
+ }
3190
+ __name(DividerWithText, "DividerWithText");
3191
+ const AssignDefaultsModeContext = React.createContext({
3192
+ inAssignDefaultsMode: false,
3193
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
3194
+ setAssignDefaultsMode: /* @__PURE__ */ __name(() => {
3195
+ }, "setAssignDefaultsMode")
3196
+ });
3197
+ const workflowDefaultParamsObj = {
3198
+ taskNumber: void 0,
3199
+ workflowDefinitionName: void 0,
3200
+ workflowDefinitionId: void 0,
3201
+ workflowRunName: void 0,
3202
+ workflowRunId: void 0,
3203
+ toolName: void 0,
3204
+ workflowToolTitle: void 0,
3205
+ workflowToolDefinitionId: void 0,
3206
+ workflowTaskCode: void 0
3207
+ };
3208
+ const WorkflowDefaultParamsContext = React.createContext(
3209
+ workflowDefaultParamsObj
3210
+ );
3126
3211
  var propTypes$1 = { exports: {} };
3127
3212
  var ReactPropTypesSecret_1;
3128
3213
  var hasRequiredReactPropTypesSecret;
@@ -4588,75 +4673,6 @@ __name(reducer$1, "reducer$1");
4588
4673
  function noop$5() {
4589
4674
  }
4590
4675
  __name(noop$5, "noop$5");
4591
- var classnames = { exports: {} };
4592
- /*!
4593
- Copyright (c) 2018 Jed Watson.
4594
- Licensed under the MIT License (MIT), see
4595
- http://jedwatson.github.io/classnames
4596
- */
4597
- var hasRequiredClassnames;
4598
- function requireClassnames() {
4599
- if (hasRequiredClassnames) return classnames.exports;
4600
- hasRequiredClassnames = 1;
4601
- (function(module2) {
4602
- (function() {
4603
- var hasOwn2 = {}.hasOwnProperty;
4604
- function classNames2() {
4605
- var classes = "";
4606
- for (var i2 = 0; i2 < arguments.length; i2++) {
4607
- var arg = arguments[i2];
4608
- if (arg) {
4609
- classes = appendClass(classes, parseValue(arg));
4610
- }
4611
- }
4612
- return classes;
4613
- }
4614
- __name(classNames2, "classNames");
4615
- function parseValue(arg) {
4616
- if (typeof arg === "string" || typeof arg === "number") {
4617
- return arg;
4618
- }
4619
- if (typeof arg !== "object") {
4620
- return "";
4621
- }
4622
- if (Array.isArray(arg)) {
4623
- return classNames2.apply(null, arg);
4624
- }
4625
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
4626
- return arg.toString();
4627
- }
4628
- var classes = "";
4629
- for (var key in arg) {
4630
- if (hasOwn2.call(arg, key) && arg[key]) {
4631
- classes = appendClass(classes, key);
4632
- }
4633
- }
4634
- return classes;
4635
- }
4636
- __name(parseValue, "parseValue");
4637
- function appendClass(value, newClass) {
4638
- if (!newClass) {
4639
- return value;
4640
- }
4641
- if (value) {
4642
- return value + " " + newClass;
4643
- }
4644
- return value + newClass;
4645
- }
4646
- __name(appendClass, "appendClass");
4647
- if (module2.exports) {
4648
- classNames2.default = classNames2;
4649
- module2.exports = classNames2;
4650
- } else {
4651
- window.classNames = classNames2;
4652
- }
4653
- })();
4654
- })(classnames);
4655
- return classnames.exports;
4656
- }
4657
- __name(requireClassnames, "requireClassnames");
4658
- var classnamesExports = requireClassnames();
4659
- const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
4660
4676
  let nanoid = /* @__PURE__ */ __name((size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
4661
4677
  byte &= 63;
4662
4678
  if (byte < 36) {
@@ -19445,10 +19461,10 @@ function tableQueryParamsToHasuraClauses({
19445
19461
  const uniqueFieldsByPath = {};
19446
19462
  const searchTerms = searchTerm.split(",");
19447
19463
  schema.fields.forEach((field) => {
19448
- const { type: type2, path: path2, searchDisabled } = field;
19464
+ const { type: type2, path: path2, searchDisabled, isHidden } = field;
19449
19465
  if (uniqueFieldsByPath[path2]) return;
19450
19466
  uniqueFieldsByPath[path2] = true;
19451
- if (searchDisabled || field.filterDisabled || type2 === "color") return;
19467
+ if (searchDisabled || field.filterDisabled || type2 === "color" || isHidden) return;
19452
19468
  searchTerms.forEach((term) => {
19453
19469
  const filterValue = term.trim();
19454
19470
  if (type2 === "string" || type2 === "lookup") {
@@ -34480,6 +34496,7 @@ const DisplayOptions = /* @__PURE__ */ __name(({
34480
34496
  compact,
34481
34497
  extraCompact,
34482
34498
  disabled,
34499
+ doNotSearchHiddenColumns,
34483
34500
  hideDisplayOptionsIcon,
34484
34501
  resetDefaultVisibility = noop$4,
34485
34502
  updateColumnVisibility = noop$4,
@@ -34510,7 +34527,7 @@ const DisplayOptions = /* @__PURE__ */ __name(({
34510
34527
  });
34511
34528
  let numVisible = 0;
34512
34529
  const getFieldCheckbox = /* @__PURE__ */ __name((field, i2) => {
34513
- const { displayName, isHidden, isForcedHidden, path: path2 } = field;
34530
+ const { displayName, isHidden, isForcedHidden, path: path2, subFrag } = field;
34514
34531
  if (isForcedHidden) return;
34515
34532
  if (!isHidden) numVisible++;
34516
34533
  return /* @__PURE__ */ React.createElement(
@@ -34527,7 +34544,15 @@ const DisplayOptions = /* @__PURE__ */ __name(({
34527
34544
  updateColumnVisibility({ shouldShow: isHidden, path: path2 });
34528
34545
  }, "onChange"),
34529
34546
  checked: !isHidden,
34530
- label: displayName
34547
+ label: /* @__PURE__ */ React.createElement("span", { style: { display: "flex", marginTop: -17 } }, displayName, subFrag && /* @__PURE__ */ React.createElement(
34548
+ InfoHelper,
34549
+ {
34550
+ icon: "warning-sign",
34551
+ intent: "warning",
34552
+ style: { marginLeft: 5 }
34553
+ },
34554
+ "Viewing this column may cause the table to load slower"
34555
+ ))
34531
34556
  }
34532
34557
  );
34533
34558
  }, "getFieldCheckbox");
@@ -34576,7 +34601,7 @@ const DisplayOptions = /* @__PURE__ */ __name(({
34576
34601
  {
34577
34602
  isOpen,
34578
34603
  onClose: /* @__PURE__ */ __name(() => setIsOpen(false), "onClose"),
34579
- content: /* @__PURE__ */ React.createElement(core.Menu, null, /* @__PURE__ */ React.createElement("div", { style: { padding: 10, paddingLeft: 20, paddingRight: 20 } }, /* @__PURE__ */ React.createElement("h5", { style: { marginBottom: 10 } }, "Display Density:"), /* @__PURE__ */ React.createElement("div", { className: core.Classes.SELECT + " tg-table-display-density" }, /* @__PURE__ */ React.createElement(
34604
+ content: /* @__PURE__ */ React.createElement(core.Menu, null, /* @__PURE__ */ React.createElement("div", { style: { padding: 10, paddingLeft: 20, paddingRight: 20 } }, /* @__PURE__ */ React.createElement("h5", { style: { marginBottom: 10, fontWeight: "bold" } }, "Display Density:"), /* @__PURE__ */ React.createElement("div", { className: core.Classes.SELECT + " tg-table-display-density" }, /* @__PURE__ */ React.createElement(
34580
34605
  "select",
34581
34606
  {
34582
34607
  onChange: changeTableDensity,
@@ -34592,7 +34617,19 @@ const DisplayOptions = /* @__PURE__ */ __name(({
34592
34617
  },
34593
34618
  "Compact"
34594
34619
  )
34595
- )), /* @__PURE__ */ React.createElement("h5", { style: { marginBottom: 10, marginTop: 10 } }, "Displayed Columns:"), /* @__PURE__ */ React.createElement("div", { style: { maxHeight: 260, overflowY: "auto", padding: 2 } }, mainFields.map(getFieldCheckbox)), /* @__PURE__ */ React.createElement("div", null, fieldGroupMenu), hasOptionForForcedHidden && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 15 } }, /* @__PURE__ */ React.createElement(
34620
+ )), /* @__PURE__ */ React.createElement(
34621
+ "h5",
34622
+ {
34623
+ style: {
34624
+ fontWeight: "bold",
34625
+ marginBottom: 10,
34626
+ marginTop: 10,
34627
+ display: "flex"
34628
+ }
34629
+ },
34630
+ "Displayed Columns:  ",
34631
+ doNotSearchHiddenColumns && /* @__PURE__ */ React.createElement(InfoHelper, null, "Note: Hidden columns will NOT be used when searching the datatable")
34632
+ ), /* @__PURE__ */ React.createElement("div", { style: { maxHeight: 260, overflowY: "auto", padding: 2 } }, mainFields.map(getFieldCheckbox)), /* @__PURE__ */ React.createElement("div", null, fieldGroupMenu), hasOptionForForcedHidden && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 15 } }, /* @__PURE__ */ React.createElement(
34596
34633
  core.Switch,
34597
34634
  {
34598
34635
  label: "Show Empty Columns",
@@ -34613,9 +34650,10 @@ const DisplayOptions = /* @__PURE__ */ __name(({
34613
34650
  {
34614
34651
  onClick: resetDefaultVisibility,
34615
34652
  title: "Display Options",
34653
+ icon: "reset",
34616
34654
  minimal: true
34617
34655
  },
34618
- "Reset"
34656
+ "Reset Column Visibilites"
34619
34657
  )
34620
34658
  )))
34621
34659
  },
@@ -51359,6 +51397,273 @@ const RenderCell = /* @__PURE__ */ __name(({
51359
51397
  }
51360
51398
  ));
51361
51399
  }, "RenderCell");
51400
+ function MenuItemLink({ text: text2, onClick, icon, navTo, active: active2, disabled }) {
51401
+ if (disabled) {
51402
+ return /* @__PURE__ */ React.createElement("li", { className: core.Classes.POPOVER_DISMISS }, /* @__PURE__ */ React.createElement(core.MenuItem, { icon, disabled: true, text: text2 }));
51403
+ }
51404
+ const handleLinkClick = /* @__PURE__ */ __name((e) => {
51405
+ e.target.closest(`.${core.Classes.POPOVER_DISMISS}`).click();
51406
+ }, "handleLinkClick");
51407
+ return /* @__PURE__ */ React.createElement("li", { className: core.Classes.POPOVER_DISMISS, onClick }, /* @__PURE__ */ React.createElement(
51408
+ Link,
51409
+ {
51410
+ onClick: handleLinkClick,
51411
+ to: navTo,
51412
+ className: classNames(core.Classes.MENU_ITEM, {
51413
+ [core.Classes.ACTIVE]: active2,
51414
+ [core.Classes.INTENT_PRIMARY]: active2
51415
+ })
51416
+ },
51417
+ icon && /* @__PURE__ */ React.createElement(core.Icon, { icon }),
51418
+ /* @__PURE__ */ React.createElement("div", { className: "bp3-text-overflow-ellipsis bp3-fill" }, text2)
51419
+ ));
51420
+ }
51421
+ __name(MenuItemLink, "MenuItemLink");
51422
+ const EnhancedMenuItem = compose(
51423
+ lifecycle({
51424
+ componentDidMount: /* @__PURE__ */ __name(function() {
51425
+ const { didMount = noop$4, className } = this.props;
51426
+ didMount({ className });
51427
+ }, "componentDidMount"),
51428
+ componentWillUnmount: /* @__PURE__ */ __name(function() {
51429
+ const { willUnmount = noop$4, className } = this.props;
51430
+ willUnmount({ className });
51431
+ }, "componentWillUnmount")
51432
+ }),
51433
+ branch(({ navTo }) => navTo, withRouter)
51434
+ )(function(_I) {
51435
+ var _J = _I, {
51436
+ navTo,
51437
+ context: context2,
51438
+ staticContext,
51439
+ didMount,
51440
+ willUnmount
51441
+ } = _J, props = __objRest(_J, [
51442
+ "navTo",
51443
+ "context",
51444
+ "staticContext",
51445
+ "didMount",
51446
+ "willUnmount"
51447
+ ]);
51448
+ let MenuItemComp = core.MenuItem;
51449
+ if (navTo) {
51450
+ MenuItemComp = MenuItemLink;
51451
+ }
51452
+ return /* @__PURE__ */ React.createElement(
51453
+ MenuItemComp,
51454
+ __spreadProps(__spreadValues(__spreadValues({
51455
+ popoverProps: {
51456
+ autoFocus: false
51457
+ }
51458
+ }, navTo && { navTo }), props), {
51459
+ onClick: props.onClick ? (...args) => {
51460
+ return props.onClick(...args, context2);
51461
+ } : void 0
51462
+ })
51463
+ );
51464
+ });
51465
+ function fnu(...args) {
51466
+ return args.find((v2) => v2 !== void 0);
51467
+ }
51468
+ __name(fnu, "fnu");
51469
+ const tickMenuEnhancer = /* @__PURE__ */ __name((def) => {
51470
+ const out = __spreadValues({}, def);
51471
+ if (out.checked !== void 0) {
51472
+ out.icon = out.checked ? "small-tick" : "blank";
51473
+ }
51474
+ return out;
51475
+ }, "tickMenuEnhancer");
51476
+ const commandMenuEnhancer = /* @__PURE__ */ __name((commands, config = {}) => (def, context2) => {
51477
+ const cmdId = typeof def === "string" ? def : def.cmd;
51478
+ let item = typeof def === "string" ? { cmd: def } : __spreadValues({}, def);
51479
+ const useTicks = fnu(item.useTicks, config.useTicks);
51480
+ delete item.useTicks;
51481
+ if (cmdId && commands[cmdId] && def.divider === void 0) {
51482
+ const command = commands[cmdId];
51483
+ const { isActive, isDisabled, isHidden } = command;
51484
+ const toggles = isActive !== void 0;
51485
+ item.hidden = fnu(item.hidden, isHidden);
51486
+ item.disabled = fnu(item.disabled, isDisabled);
51487
+ item.key = item.key || cmdId;
51488
+ item.submenu = item.submenu || command.submenu;
51489
+ item.component = item.component || command.component;
51490
+ if (toggles) {
51491
+ if (useTicks) {
51492
+ item.text = item.text || command.shortName || command.name;
51493
+ item.checked = item.checked || isActive;
51494
+ } else {
51495
+ item.text = item.text || (isActive ? command.name : command.inactiveName || command.name);
51496
+ item.icon = item.icon || (isActive ? command.icon : command.inactiveIcon || command.icon);
51497
+ }
51498
+ } else {
51499
+ item.text = item.text || command.name;
51500
+ item.icon = item.icon || command.icon;
51501
+ }
51502
+ item.hotkey = item.hotkey || command.hotkey;
51503
+ if (!item.onClick) {
51504
+ item.onClick = (event) => command.execute({
51505
+ event,
51506
+ context: context2,
51507
+ menuItem: item,
51508
+ viaMenu: true
51509
+ });
51510
+ }
51511
+ } else if (cmdId && !commands[cmdId]) {
51512
+ item.text = item.text || startCase(cmdId);
51513
+ item.disabled = true;
51514
+ }
51515
+ if (config.omitIcons) {
51516
+ item.icon = void 0;
51517
+ }
51518
+ if (config.forceIconAlignment !== false) {
51519
+ item.icon = item.icon || "blank";
51520
+ }
51521
+ if (useTicks) {
51522
+ item = tickMenuEnhancer(item);
51523
+ }
51524
+ return item;
51525
+ }, "commandMenuEnhancer");
51526
+ const ident = /* @__PURE__ */ __name((x2) => x2, "ident");
51527
+ const dividerShorthandEnhancer = /* @__PURE__ */ __name((def) => typeof def === "string" && def.startsWith("--") ? { divider: def.substr(2) } : def, "dividerShorthandEnhancer");
51528
+ const unwantedAttrs = [
51529
+ "isSimpleText",
51530
+ "justText",
51531
+ "submenu",
51532
+ "component",
51533
+ "hotkey",
51534
+ "changingProps",
51535
+ "showInSearchMenu",
51536
+ "hideFromMenuSearch"
51537
+ ];
51538
+ const DynamicMenuItem = /* @__PURE__ */ __name(({
51539
+ def,
51540
+ enhancers = [ident],
51541
+ context: context2,
51542
+ doNotEnhanceTopLevelItem
51543
+ }) => {
51544
+ if (React.isValidElement(def)) return def;
51545
+ const item = [
51546
+ dividerShorthandEnhancer,
51547
+ ...doNotEnhanceTopLevelItem ? [ident] : enhancers
51548
+ ].reduce((v2, f2) => f2(v2, context2), def);
51549
+ let out;
51550
+ if (item.divider !== void 0) {
51551
+ out = /* @__PURE__ */ React.createElement(
51552
+ core.MenuDivider,
51553
+ __spreadValues({}, item.divider ? { title: item.divider, className: item.className } : {})
51554
+ );
51555
+ } else {
51556
+ const ItemComponent = item.component || EnhancedMenuItem;
51557
+ out = /* @__PURE__ */ React.createElement(
51558
+ ItemComponent,
51559
+ __spreadProps(__spreadValues({}, omit(item, unwantedAttrs)), {
51560
+ context: context2,
51561
+ icon: item.icon || item.iconName,
51562
+ labelElement: item.hotkey && /* @__PURE__ */ React.createElement(core.KeyCombo, { minimal: true, combo: item.hotkey }),
51563
+ text: item.text
51564
+ }),
51565
+ item.submenu ? item.submenu.filter(ident).map((def2, index2) => /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def: def2, enhancers, context: context2 }))) : void 0
51566
+ );
51567
+ }
51568
+ if (item.disabled && typeof item.disabled === "string") {
51569
+ item.tooltip = item.disabled;
51570
+ }
51571
+ if (item.tooltip) {
51572
+ out = /* @__PURE__ */ React.createElement(core.Tooltip, { content: item.tooltip }, out);
51573
+ }
51574
+ return item.hidden ? null : out;
51575
+ }, "DynamicMenuItem");
51576
+ const createDynamicMenu = /* @__PURE__ */ __name((menuDef, enhancers, context2) => {
51577
+ if (menuDef instanceof Array) {
51578
+ return menuDef.map((def, index2) => /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def, enhancers, context: context2 })));
51579
+ } else {
51580
+ return /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({}, { def: menuDef, enhancers, context: context2 }));
51581
+ }
51582
+ }, "createDynamicMenu");
51583
+ const createDynamicBarMenu = /* @__PURE__ */ __name((topMenuDef, enhancers, context2) => {
51584
+ return topMenuDef.map((topLevelItem) => {
51585
+ const def = __spreadValues({}, topLevelItem);
51586
+ if (def.submenu) {
51587
+ def.submenu = def.submenu.map((subdef, index2) => /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({ key: index2, def: subdef }, { enhancers, context: context2 })));
51588
+ }
51589
+ return def;
51590
+ });
51591
+ }, "createDynamicBarMenu");
51592
+ const createCommandMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
51593
+ return createDynamicMenu(
51594
+ menuDef,
51595
+ [commandMenuEnhancer(commands, config)],
51596
+ context2
51597
+ );
51598
+ }, "createCommandMenu");
51599
+ const createCommandBarMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
51600
+ return createDynamicBarMenu(
51601
+ menuDef,
51602
+ [commandMenuEnhancer(commands, config)],
51603
+ context2
51604
+ );
51605
+ }, "createCommandBarMenu");
51606
+ function showCommandContextMenu(menuDef, commands, config, event, onClose, context2) {
51607
+ return showContextMenu(
51608
+ menuDef,
51609
+ [commandMenuEnhancer(commands, config)],
51610
+ event,
51611
+ onClose,
51612
+ context2
51613
+ );
51614
+ }
51615
+ __name(showCommandContextMenu, "showCommandContextMenu");
51616
+ const createMenu = createDynamicMenu;
51617
+ function showContextMenu(menuDef, enhancers, event, onClose, context2, menuComp = core.Menu) {
51618
+ menuDef = filterMenuForCorrectness(menuDef);
51619
+ if (!menuDef) return;
51620
+ const MenuComponent = menuComp;
51621
+ event.persist && event.persist();
51622
+ core.ContextMenu.show(
51623
+ /* @__PURE__ */ React.createElement(MenuComponent, null, createDynamicMenu(menuDef, enhancers, context2)),
51624
+ { left: event.clientX, top: event.clientY },
51625
+ onClose
51626
+ );
51627
+ event.stopPropagation && event.stopPropagation();
51628
+ event.preventDefault && event.preventDefault();
51629
+ }
51630
+ __name(showContextMenu, "showContextMenu");
51631
+ function filterMenuForCorrectness(menuDef) {
51632
+ return menuDef && menuDef.length && menuDef.filter(ident);
51633
+ }
51634
+ __name(filterMenuForCorrectness, "filterMenuForCorrectness");
51635
+ function getStringFromReactComponent(comp) {
51636
+ var _a;
51637
+ if (!comp) return "";
51638
+ if (isString$1(comp) || isNumber$1(comp)) return comp;
51639
+ if ((_a = comp.props) == null ? void 0 : _a.text) {
51640
+ return getStringFromReactComponent(comp.props.text);
51641
+ }
51642
+ const { children } = comp.props || {};
51643
+ if (!children) return "";
51644
+ if (isArray$2(children))
51645
+ return flatMap(children, getStringFromReactComponent).join("");
51646
+ if (isString$1(children)) return children;
51647
+ if (children.props) {
51648
+ return getStringFromReactComponent(children.props);
51649
+ }
51650
+ }
51651
+ __name(getStringFromReactComponent, "getStringFromReactComponent");
51652
+ function doesSearchValMatchText(searchVal, justText) {
51653
+ return fuzzysearch(
51654
+ searchVal ? searchVal.toLowerCase() : "",
51655
+ justText ? justText.toLowerCase() : ""
51656
+ );
51657
+ }
51658
+ __name(doesSearchValMatchText, "doesSearchValMatchText");
51659
+ const MenuItemWithTooltip = /* @__PURE__ */ __name((_K) => {
51660
+ var _L = _K, { tooltip } = _L, rest = __objRest(_L, ["tooltip"]);
51661
+ let out = /* @__PURE__ */ React.createElement(core.MenuItem, __spreadValues({}, rest));
51662
+ if (tooltip) {
51663
+ out = /* @__PURE__ */ React.createElement(core.Tooltip, { content: tooltip }, out);
51664
+ }
51665
+ return out;
51666
+ }, "MenuItemWithTooltip");
51362
51667
  dayjs.extend(localizedFormat);
51363
51668
  const RenderColumnHeader = /* @__PURE__ */ __name(({
51364
51669
  recordIdToIsVisibleMap,
@@ -51370,8 +51675,13 @@ const RenderColumnHeader = /* @__PURE__ */ __name(({
51370
51675
  entities,
51371
51676
  extraCompact,
51372
51677
  filters,
51678
+ resetDefaultVisibility,
51679
+ onlyOneVisibleColumn,
51373
51680
  formName,
51374
51681
  isCellEditable,
51682
+ updateColumnVisibility,
51683
+ schema,
51684
+ withDisplayOptions,
51375
51685
  isLocalCall,
51376
51686
  order: order2,
51377
51687
  removeSingleFilter,
@@ -51467,6 +51777,55 @@ const RenderColumnHeader = /* @__PURE__ */ __name(({
51467
51777
  <strong>${columnTitle}:</strong> <br>
51468
51778
  ${description} ${isUnique ? "<br>Must be unique" : ""}</div>`
51469
51779
  }), {
51780
+ onContextMenu: /* @__PURE__ */ __name((e) => {
51781
+ if (!withDisplayOptions) {
51782
+ return;
51783
+ }
51784
+ e.preventDefault();
51785
+ e.persist();
51786
+ showContextMenu(
51787
+ [
51788
+ {
51789
+ text: "Hide Column",
51790
+ disabled: onlyOneVisibleColumn,
51791
+ icon: "eye-off",
51792
+ onClick: /* @__PURE__ */ __name(() => {
51793
+ updateColumnVisibility({
51794
+ shouldShow: false,
51795
+ path: path2
51796
+ });
51797
+ }, "onClick")
51798
+ },
51799
+ {
51800
+ text: "Hide Other Columns",
51801
+ icon: "eye-off",
51802
+ onClick: /* @__PURE__ */ __name(() => {
51803
+ updateColumnVisibility({
51804
+ shouldShow: false,
51805
+ paths: schema.fields.map((c2) => c2.path).filter(Boolean).filter((p2) => p2 !== path2)
51806
+ });
51807
+ }, "onClick")
51808
+ },
51809
+ {
51810
+ text: "Reset Column Visibilities",
51811
+ icon: "reset",
51812
+ onClick: /* @__PURE__ */ __name(() => {
51813
+ resetDefaultVisibility();
51814
+ }, "onClick")
51815
+ },
51816
+ {
51817
+ text: "Table Display Options",
51818
+ icon: "cog",
51819
+ onClick: /* @__PURE__ */ __name(() => {
51820
+ var _a, _b;
51821
+ (_b = (_a = e.target.closest(".data-table-container")) == null ? void 0 : _a.querySelector(".tg-table-display-options")) == null ? void 0 : _b.click();
51822
+ }, "onClick")
51823
+ }
51824
+ ],
51825
+ void 0,
51826
+ e
51827
+ );
51828
+ }, "onContextMenu"),
51470
51829
  "data-test": columnTitleTextified,
51471
51830
  "data-path": path2,
51472
51831
  "data-copy-text": columnTitleTextified,
@@ -51638,6 +51997,7 @@ const useColumns = /* @__PURE__ */ __name(({
51638
51997
  addFilters,
51639
51998
  cellRenderer,
51640
51999
  columns,
52000
+ resetDefaultVisibility,
51641
52001
  currentParams,
51642
52002
  compact,
51643
52003
  editingCell,
@@ -51672,6 +52032,7 @@ const useColumns = /* @__PURE__ */ __name(({
51672
52032
  selectedCells,
51673
52033
  setExpandedEntityIdMap,
51674
52034
  setNewParams,
52035
+ updateColumnVisibility,
51675
52036
  setOrder = noop$4,
51676
52037
  setSelectedCells,
51677
52038
  shouldShowSubComponent,
@@ -51685,7 +52046,8 @@ const useColumns = /* @__PURE__ */ __name(({
51685
52046
  withFilter: _withFilter,
51686
52047
  withSort = true,
51687
52048
  recordIdToIsVisibleMap,
51688
- setRecordIdToIsVisibleMap
52049
+ setRecordIdToIsVisibleMap,
52050
+ withDisplayOptions
51689
52051
  }) => {
51690
52052
  const dispatch = reactRedux.useDispatch();
51691
52053
  const change = React.useCallback(
@@ -52103,15 +52465,20 @@ const useColumns = /* @__PURE__ */ __name(({
52103
52465
  const tableColumns = columns.map((column) => {
52104
52466
  const tableColumn = __spreadProps(__spreadValues({}, column), {
52105
52467
  Header: RenderColumnHeader({
52468
+ onlyOneVisibleColumn: columns.length === 1,
52106
52469
  recordIdToIsVisibleMap,
52107
52470
  setRecordIdToIsVisibleMap,
52108
52471
  column,
52472
+ withDisplayOptions,
52109
52473
  isLocalCall,
52110
52474
  filters,
52111
52475
  currentParams,
52112
52476
  order: order2,
52477
+ resetDefaultVisibility,
52113
52478
  setOrder,
52114
52479
  withSort,
52480
+ schema,
52481
+ updateColumnVisibility,
52115
52482
  formName,
52116
52483
  extraCompact,
52117
52484
  withFilter,
@@ -56304,11 +56671,12 @@ const itemSizeEstimators = {
56304
56671
  normal: /* @__PURE__ */ __name(() => 33.34, "normal"),
56305
56672
  comfortable: /* @__PURE__ */ __name(() => 41.34, "comfortable")
56306
56673
  };
56307
- const DataTable = /* @__PURE__ */ __name((_I) => {
56308
- var _J = _I, {
56674
+ const DataTable = /* @__PURE__ */ __name((_M) => {
56675
+ var _N = _M, {
56309
56676
  controlled_pageSize,
56310
56677
  formName = "tgDataTable",
56311
56678
  history,
56679
+ doNotSearchHiddenColumns,
56312
56680
  isSimple,
56313
56681
  isLocalCall = true,
56314
56682
  isTableParamsConnected,
@@ -56319,10 +56687,11 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
56319
56687
  tableParams: _tableParams,
56320
56688
  anyTouched,
56321
56689
  blur
56322
- } = _J, ownProps = __objRest(_J, [
56690
+ } = _N, ownProps = __objRest(_N, [
56323
56691
  "controlled_pageSize",
56324
56692
  "formName",
56325
56693
  "history",
56694
+ "doNotSearchHiddenColumns",
56326
56695
  "isSimple",
56327
56696
  "isLocalCall",
56328
56697
  "isTableParamsConnected",
@@ -56636,7 +57005,8 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
56636
57005
  withSelectAll,
56637
57006
  withSort,
56638
57007
  withTitle = !isSimple,
56639
- noExcessiveCheck
57008
+ noExcessiveCheck,
57009
+ isEntityCountLoading
56640
57010
  } = props;
56641
57011
  const _entities = React.useMemo(
56642
57012
  () => ((reduxFormEntities == null ? void 0 : reduxFormEntities.length) ? reduxFormEntities : _origEntities) || [],
@@ -56660,7 +57030,25 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
56660
57030
  entities,
56661
57031
  formName
56662
57032
  ]);
56663
- const [tableConfig, setTableConfig] = React.useState({ fieldOptions: [] });
57033
+ const [tableConfig, _setTableConfig] = React.useState({ fieldOptions: [] });
57034
+ const setTableConfig = React.useCallback(
57035
+ (newConfig) => {
57036
+ _setTableConfig((prev) => {
57037
+ let newConfigVal = newConfig;
57038
+ if (typeof newConfig === "function") {
57039
+ newConfigVal = newConfig(prev);
57040
+ }
57041
+ if (!isEqual(prev.fieldOptions, newConfigVal.fieldOptions)) {
57042
+ change(
57043
+ "reduxFormReadOnlyFieldOptions",
57044
+ newConfigVal.fieldOptions || []
57045
+ );
57046
+ }
57047
+ return newConfigVal;
57048
+ });
57049
+ },
57050
+ [change]
57051
+ );
56664
57052
  React.useEffect(() => {
56665
57053
  if (withDisplayOptions) {
56666
57054
  let newTableConfig = {};
@@ -56777,6 +57165,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
56777
57165
  convertedSchema,
56778
57166
  currentParams,
56779
57167
  entities,
57168
+ setTableConfig,
56780
57169
  history,
56781
57170
  isInfinite,
56782
57171
  isOpenable,
@@ -56882,6 +57271,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
56882
57271
  (_a = currentUser == null ? void 0 : currentUser.user) == null ? void 0 : _a.id,
56883
57272
  deleteTableConfiguration,
56884
57273
  formName,
57274
+ setTableConfig,
56885
57275
  schema.fields,
56886
57276
  syncDisplayOptionsToDb,
56887
57277
  tableConfig,
@@ -58518,13 +58908,23 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
58518
58908
  _selectedAndTotalMessage += `/ `;
58519
58909
  }
58520
58910
  if (showCount) {
58521
- _selectedAndTotalMessage += `${entityCount || 0} Total`;
58911
+ if (isEntityCountLoading && entityCount < 1) {
58912
+ _selectedAndTotalMessage += `Loading...`;
58913
+ } else {
58914
+ _selectedAndTotalMessage += `${entityCount || 0} Total`;
58915
+ }
58522
58916
  }
58523
58917
  if (_selectedAndTotalMessage) {
58524
58918
  _selectedAndTotalMessage = /* @__PURE__ */ React.createElement("div", null, _selectedAndTotalMessage);
58525
58919
  }
58526
58920
  return _selectedAndTotalMessage;
58527
- }, [entityCount, selectedRowCount, showCount, showNumSelected]);
58921
+ }, [
58922
+ entityCount,
58923
+ selectedRowCount,
58924
+ showCount,
58925
+ showNumSelected,
58926
+ isEntityCountLoading
58927
+ ]);
58528
58928
  const shouldShowPaging = !isInfinite && withPaging && (hidePageSizeWhenPossible ? entityCount > pageSize : true);
58529
58929
  const SubComponentToUse = React.useMemo(() => {
58530
58930
  if (SubComponent) {
@@ -58596,6 +58996,8 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
58596
58996
  columns,
58597
58997
  currentParams,
58598
58998
  compact,
58999
+ withDisplayOptions,
59000
+ resetDefaultVisibility,
58599
59001
  editingCellSelectAll,
58600
59002
  entities,
58601
59003
  expandedEntityIdMap,
@@ -58633,6 +59035,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
58633
59035
  startCellEdit,
58634
59036
  SubComponent,
58635
59037
  tableRef,
59038
+ updateColumnVisibility,
58636
59039
  updateEntitiesHelper,
58637
59040
  updateValidation,
58638
59041
  withCheckboxes,
@@ -58670,7 +59073,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
58670
59073
  expanded: expandedRows,
58671
59074
  showPagination: false,
58672
59075
  sortable: false,
58673
- loading: isLoading || disabled,
59076
+ loading: disabled,
58674
59077
  defaultResized: resized,
58675
59078
  onResizedChange: /* @__PURE__ */ __name((newResized = []) => {
58676
59079
  const resizedToUse = newResized.map((column) => {
@@ -58688,7 +59091,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
58688
59091
  ThComponent: ThComponent2,
58689
59092
  getTrGroupProps: getTableRowProps,
58690
59093
  getTdProps: getTableCellProps,
58691
- NoDataComponent: /* @__PURE__ */ __name(({ children: children2 }) => isLoading ? null : /* @__PURE__ */ React.createElement("div", { className: "rt-noData" }, noRowsFoundMessage || children2), "NoDataComponent"),
59094
+ NoDataComponent: /* @__PURE__ */ __name(({ children: children2 }) => isLoading ? /* @__PURE__ */ React.createElement("div", { className: "rt-noData" }, "Loading...") : /* @__PURE__ */ React.createElement("div", { className: "rt-noData" }, noRowsFoundMessage || children2), "NoDataComponent"),
58692
59095
  LoadingComponent: /* @__PURE__ */ __name(({ loadingText, loading }) => /* @__PURE__ */ React.createElement(
58693
59096
  DisabledLoadingComponent,
58694
59097
  {
@@ -59035,6 +59438,7 @@ const DataTable = /* @__PURE__ */ __name((_I) => {
59035
59438
  /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexWrap: "wrap" } }, additionalFooterButtons, !noFullscreenButton && toggleFullscreenButton, withDisplayOptions && /* @__PURE__ */ React.createElement(
59036
59439
  DisplayOptions,
59037
59440
  {
59441
+ doNotSearchHiddenColumns,
59038
59442
  compact,
59039
59443
  extraCompact,
59040
59444
  disabled,
@@ -71828,8 +72232,8 @@ function AdvancedOptions({
71828
72232
  ), isOpen && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 10 } }, content2 || children));
71829
72233
  }
71830
72234
  __name(AdvancedOptions, "AdvancedOptions");
71831
- const TgHTMLSelect = /* @__PURE__ */ __name((_K) => {
71832
- var _L = _K, { disabled } = _L, rest = __objRest(_L, ["disabled"]);
72235
+ const TgHTMLSelect = /* @__PURE__ */ __name((_O) => {
72236
+ var _P = _O, { disabled } = _P, rest = __objRest(_P, ["disabled"]);
71833
72237
  if (disabled) {
71834
72238
  const opt = rest.options.find((o2) => o2.value === rest.value);
71835
72239
  return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, rest), { className: classNames("bp3-html-select", rest.className) }), opt.label);
@@ -71865,14 +72269,14 @@ function BlueprintError({ error }) {
71865
72269
  return /* @__PURE__ */ React.createElement("div", { className: classNames(core.Classes.FORM_GROUP, core.Classes.INTENT_DANGER) }, /* @__PURE__ */ React.createElement("div", { className: classNames(core.Classes.FORM_HELPER_TEXT, "preserve-newline") }, error));
71866
72270
  }
71867
72271
  __name(BlueprintError, "BlueprintError");
71868
- function DropdownButton(_M) {
71869
- var _N = _M, {
72272
+ function DropdownButton(_Q) {
72273
+ var _R = _Q, {
71870
72274
  disabled,
71871
72275
  menu,
71872
72276
  noRightIcon,
71873
72277
  popoverProps,
71874
72278
  className
71875
- } = _N, rest = __objRest(_N, [
72279
+ } = _R, rest = __objRest(_R, [
71876
72280
  "disabled",
71877
72281
  "menu",
71878
72282
  "noRightIcon",
@@ -71990,7 +72394,34 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
71990
72394
  }, _defaults),
71991
72395
  [_defaults, controlled_pageSize]
71992
72396
  );
71993
- const convertedSchema = React.useMemo(() => convertSchema(schema), [schema]);
72397
+ const formValueStateSelector = /* @__PURE__ */ __name((state) => reduxForm.formValueSelector(formName)(
72398
+ state,
72399
+ "reduxFormQueryParams",
72400
+ "reduxFormSelectedEntityIdMap",
72401
+ "reduxFormReadOnlyFieldOptions"
72402
+ ), "formValueStateSelector");
72403
+ const {
72404
+ reduxFormQueryParams: _reduxFormQueryParams = {},
72405
+ reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {},
72406
+ reduxFormReadOnlyFieldOptions
72407
+ } = reactRedux.useSelector(formValueStateSelector);
72408
+ const convertedSchema = React.useMemo(() => {
72409
+ const pathToHiddenMap = {};
72410
+ reduxFormReadOnlyFieldOptions == null ? void 0 : reduxFormReadOnlyFieldOptions.forEach(({ path: path2, isHidden }) => {
72411
+ if (path2) pathToHiddenMap[path2] = isHidden;
72412
+ });
72413
+ const s2 = convertSchema(schema);
72414
+ s2.fields = s2.fields.map((f2) => {
72415
+ const isHidden = pathToHiddenMap[f2.path];
72416
+ if (pathToHiddenMap[f2.path] !== void 0) {
72417
+ return __spreadProps(__spreadValues({}, f2), {
72418
+ isHidden
72419
+ });
72420
+ }
72421
+ return f2;
72422
+ });
72423
+ return s2;
72424
+ }, [schema, reduxFormReadOnlyFieldOptions]);
71994
72425
  if (isLocalCall) {
71995
72426
  if (!noForm && (!formName || formName === "tgDataTable")) {
71996
72427
  console.error(
@@ -72009,15 +72440,6 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
72009
72440
  );
72010
72441
  }
72011
72442
  }
72012
- const formValueStateSelector = /* @__PURE__ */ __name((state) => reduxForm.formValueSelector(formName)(
72013
- state,
72014
- "reduxFormQueryParams",
72015
- "reduxFormSelectedEntityIdMap"
72016
- ), "formValueStateSelector");
72017
- const {
72018
- reduxFormQueryParams: _reduxFormQueryParams = {},
72019
- reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
72020
- } = reactRedux.useSelector(formValueStateSelector);
72021
72443
  const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
72022
72444
  const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
72023
72445
  _reduxFormSelectedEntityIdMap
@@ -72174,6 +72596,7 @@ function CollapsibleCard({
72174
72596
  className,
72175
72597
  style,
72176
72598
  children,
72599
+ helperText: helperText2,
72177
72600
  initialClosed = false,
72178
72601
  toggle,
72179
72602
  isOpen
@@ -72207,7 +72630,7 @@ function CollapsibleCard({
72207
72630
  }
72208
72631
  },
72209
72632
  title
72210
- ), /* @__PURE__ */ React.createElement("div", null, open2 && openTitleElements)), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
72633
+ ), helperText2 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InfoHelper, { children: helperText2 }), "  "), open2 && /* @__PURE__ */ React.createElement("div", null, " ", openTitleElements)), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
72211
72634
  core.Button,
72212
72635
  {
72213
72636
  icon: open2 ? "minimize" : "maximize",
@@ -75472,273 +75895,6 @@ const _ResizableDraggableDialog = class _ResizableDraggableDialog extends React.
75472
75895
  };
75473
75896
  __name(_ResizableDraggableDialog, "ResizableDraggableDialog");
75474
75897
  let ResizableDraggableDialog = _ResizableDraggableDialog;
75475
- function MenuItemLink({ text: text2, onClick, icon, navTo, active: active2, disabled }) {
75476
- if (disabled) {
75477
- return /* @__PURE__ */ React.createElement("li", { className: core.Classes.POPOVER_DISMISS }, /* @__PURE__ */ React.createElement(core.MenuItem, { icon, disabled: true, text: text2 }));
75478
- }
75479
- const handleLinkClick = /* @__PURE__ */ __name((e) => {
75480
- e.target.closest(`.${core.Classes.POPOVER_DISMISS}`).click();
75481
- }, "handleLinkClick");
75482
- return /* @__PURE__ */ React.createElement("li", { className: core.Classes.POPOVER_DISMISS, onClick }, /* @__PURE__ */ React.createElement(
75483
- Link,
75484
- {
75485
- onClick: handleLinkClick,
75486
- to: navTo,
75487
- className: classNames(core.Classes.MENU_ITEM, {
75488
- [core.Classes.ACTIVE]: active2,
75489
- [core.Classes.INTENT_PRIMARY]: active2
75490
- })
75491
- },
75492
- icon && /* @__PURE__ */ React.createElement(core.Icon, { icon }),
75493
- /* @__PURE__ */ React.createElement("div", { className: "bp3-text-overflow-ellipsis bp3-fill" }, text2)
75494
- ));
75495
- }
75496
- __name(MenuItemLink, "MenuItemLink");
75497
- const EnhancedMenuItem = compose(
75498
- lifecycle({
75499
- componentDidMount: /* @__PURE__ */ __name(function() {
75500
- const { didMount = noop$4, className } = this.props;
75501
- didMount({ className });
75502
- }, "componentDidMount"),
75503
- componentWillUnmount: /* @__PURE__ */ __name(function() {
75504
- const { willUnmount = noop$4, className } = this.props;
75505
- willUnmount({ className });
75506
- }, "componentWillUnmount")
75507
- }),
75508
- branch(({ navTo }) => navTo, withRouter)
75509
- )(function(_O) {
75510
- var _P = _O, {
75511
- navTo,
75512
- context: context2,
75513
- staticContext,
75514
- didMount,
75515
- willUnmount
75516
- } = _P, props = __objRest(_P, [
75517
- "navTo",
75518
- "context",
75519
- "staticContext",
75520
- "didMount",
75521
- "willUnmount"
75522
- ]);
75523
- let MenuItemComp = core.MenuItem;
75524
- if (navTo) {
75525
- MenuItemComp = MenuItemLink;
75526
- }
75527
- return /* @__PURE__ */ React.createElement(
75528
- MenuItemComp,
75529
- __spreadProps(__spreadValues(__spreadValues({
75530
- popoverProps: {
75531
- autoFocus: false
75532
- }
75533
- }, navTo && { navTo }), props), {
75534
- onClick: props.onClick ? (...args) => {
75535
- return props.onClick(...args, context2);
75536
- } : void 0
75537
- })
75538
- );
75539
- });
75540
- function fnu(...args) {
75541
- return args.find((v2) => v2 !== void 0);
75542
- }
75543
- __name(fnu, "fnu");
75544
- const tickMenuEnhancer = /* @__PURE__ */ __name((def) => {
75545
- const out = __spreadValues({}, def);
75546
- if (out.checked !== void 0) {
75547
- out.icon = out.checked ? "small-tick" : "blank";
75548
- }
75549
- return out;
75550
- }, "tickMenuEnhancer");
75551
- const commandMenuEnhancer = /* @__PURE__ */ __name((commands, config = {}) => (def, context2) => {
75552
- const cmdId = typeof def === "string" ? def : def.cmd;
75553
- let item = typeof def === "string" ? { cmd: def } : __spreadValues({}, def);
75554
- const useTicks = fnu(item.useTicks, config.useTicks);
75555
- delete item.useTicks;
75556
- if (cmdId && commands[cmdId] && def.divider === void 0) {
75557
- const command = commands[cmdId];
75558
- const { isActive, isDisabled, isHidden } = command;
75559
- const toggles = isActive !== void 0;
75560
- item.hidden = fnu(item.hidden, isHidden);
75561
- item.disabled = fnu(item.disabled, isDisabled);
75562
- item.key = item.key || cmdId;
75563
- item.submenu = item.submenu || command.submenu;
75564
- item.component = item.component || command.component;
75565
- if (toggles) {
75566
- if (useTicks) {
75567
- item.text = item.text || command.shortName || command.name;
75568
- item.checked = item.checked || isActive;
75569
- } else {
75570
- item.text = item.text || (isActive ? command.name : command.inactiveName || command.name);
75571
- item.icon = item.icon || (isActive ? command.icon : command.inactiveIcon || command.icon);
75572
- }
75573
- } else {
75574
- item.text = item.text || command.name;
75575
- item.icon = item.icon || command.icon;
75576
- }
75577
- item.hotkey = item.hotkey || command.hotkey;
75578
- if (!item.onClick) {
75579
- item.onClick = (event) => command.execute({
75580
- event,
75581
- context: context2,
75582
- menuItem: item,
75583
- viaMenu: true
75584
- });
75585
- }
75586
- } else if (cmdId && !commands[cmdId]) {
75587
- item.text = item.text || startCase(cmdId);
75588
- item.disabled = true;
75589
- }
75590
- if (config.omitIcons) {
75591
- item.icon = void 0;
75592
- }
75593
- if (config.forceIconAlignment !== false) {
75594
- item.icon = item.icon || "blank";
75595
- }
75596
- if (useTicks) {
75597
- item = tickMenuEnhancer(item);
75598
- }
75599
- return item;
75600
- }, "commandMenuEnhancer");
75601
- const ident = /* @__PURE__ */ __name((x2) => x2, "ident");
75602
- const dividerShorthandEnhancer = /* @__PURE__ */ __name((def) => typeof def === "string" && def.startsWith("--") ? { divider: def.substr(2) } : def, "dividerShorthandEnhancer");
75603
- const unwantedAttrs = [
75604
- "isSimpleText",
75605
- "justText",
75606
- "submenu",
75607
- "component",
75608
- "hotkey",
75609
- "changingProps",
75610
- "showInSearchMenu",
75611
- "hideFromMenuSearch"
75612
- ];
75613
- const DynamicMenuItem = /* @__PURE__ */ __name(({
75614
- def,
75615
- enhancers = [ident],
75616
- context: context2,
75617
- doNotEnhanceTopLevelItem
75618
- }) => {
75619
- if (React.isValidElement(def)) return def;
75620
- const item = [
75621
- dividerShorthandEnhancer,
75622
- ...doNotEnhanceTopLevelItem ? [ident] : enhancers
75623
- ].reduce((v2, f2) => f2(v2, context2), def);
75624
- let out;
75625
- if (item.divider !== void 0) {
75626
- out = /* @__PURE__ */ React.createElement(
75627
- core.MenuDivider,
75628
- __spreadValues({}, item.divider ? { title: item.divider, className: item.className } : {})
75629
- );
75630
- } else {
75631
- const ItemComponent = item.component || EnhancedMenuItem;
75632
- out = /* @__PURE__ */ React.createElement(
75633
- ItemComponent,
75634
- __spreadProps(__spreadValues({}, omit(item, unwantedAttrs)), {
75635
- context: context2,
75636
- icon: item.icon || item.iconName,
75637
- labelElement: item.hotkey && /* @__PURE__ */ React.createElement(core.KeyCombo, { minimal: true, combo: item.hotkey }),
75638
- text: item.text
75639
- }),
75640
- item.submenu ? item.submenu.filter(ident).map((def2, index2) => /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def: def2, enhancers, context: context2 }))) : void 0
75641
- );
75642
- }
75643
- if (item.disabled && typeof item.disabled === "string") {
75644
- item.tooltip = item.disabled;
75645
- }
75646
- if (item.tooltip) {
75647
- out = /* @__PURE__ */ React.createElement(core.Tooltip, { content: item.tooltip }, out);
75648
- }
75649
- return item.hidden ? null : out;
75650
- }, "DynamicMenuItem");
75651
- const createDynamicMenu = /* @__PURE__ */ __name((menuDef, enhancers, context2) => {
75652
- if (menuDef instanceof Array) {
75653
- return menuDef.map((def, index2) => /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({ key: index2 }, { def, enhancers, context: context2 })));
75654
- } else {
75655
- return /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({}, { def: menuDef, enhancers, context: context2 }));
75656
- }
75657
- }, "createDynamicMenu");
75658
- const createDynamicBarMenu = /* @__PURE__ */ __name((topMenuDef, enhancers, context2) => {
75659
- return topMenuDef.map((topLevelItem) => {
75660
- const def = __spreadValues({}, topLevelItem);
75661
- if (def.submenu) {
75662
- def.submenu = def.submenu.map((subdef, index2) => /* @__PURE__ */ React.createElement(DynamicMenuItem, __spreadValues({ key: index2, def: subdef }, { enhancers, context: context2 })));
75663
- }
75664
- return def;
75665
- });
75666
- }, "createDynamicBarMenu");
75667
- const createCommandMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
75668
- return createDynamicMenu(
75669
- menuDef,
75670
- [commandMenuEnhancer(commands, config)],
75671
- context2
75672
- );
75673
- }, "createCommandMenu");
75674
- const createCommandBarMenu = /* @__PURE__ */ __name((menuDef, commands, config, context2) => {
75675
- return createDynamicBarMenu(
75676
- menuDef,
75677
- [commandMenuEnhancer(commands, config)],
75678
- context2
75679
- );
75680
- }, "createCommandBarMenu");
75681
- function showCommandContextMenu(menuDef, commands, config, event, onClose, context2) {
75682
- return showContextMenu(
75683
- menuDef,
75684
- [commandMenuEnhancer(commands, config)],
75685
- event,
75686
- onClose,
75687
- context2
75688
- );
75689
- }
75690
- __name(showCommandContextMenu, "showCommandContextMenu");
75691
- const createMenu = createDynamicMenu;
75692
- function showContextMenu(menuDef, enhancers, event, onClose, context2, menuComp = core.Menu) {
75693
- menuDef = filterMenuForCorrectness(menuDef);
75694
- if (!menuDef) return;
75695
- const MenuComponent = menuComp;
75696
- event.persist && event.persist();
75697
- core.ContextMenu.show(
75698
- /* @__PURE__ */ React.createElement(MenuComponent, null, createDynamicMenu(menuDef, enhancers, context2)),
75699
- { left: event.clientX, top: event.clientY },
75700
- onClose
75701
- );
75702
- event.stopPropagation && event.stopPropagation();
75703
- event.preventDefault && event.preventDefault();
75704
- }
75705
- __name(showContextMenu, "showContextMenu");
75706
- function filterMenuForCorrectness(menuDef) {
75707
- return menuDef && menuDef.length && menuDef.filter(ident);
75708
- }
75709
- __name(filterMenuForCorrectness, "filterMenuForCorrectness");
75710
- function getStringFromReactComponent(comp) {
75711
- var _a;
75712
- if (!comp) return "";
75713
- if (isString$1(comp) || isNumber$1(comp)) return comp;
75714
- if ((_a = comp.props) == null ? void 0 : _a.text) {
75715
- return getStringFromReactComponent(comp.props.text);
75716
- }
75717
- const { children } = comp.props || {};
75718
- if (!children) return "";
75719
- if (isArray$2(children))
75720
- return flatMap(children, getStringFromReactComponent).join("");
75721
- if (isString$1(children)) return children;
75722
- if (children.props) {
75723
- return getStringFromReactComponent(children.props);
75724
- }
75725
- }
75726
- __name(getStringFromReactComponent, "getStringFromReactComponent");
75727
- function doesSearchValMatchText(searchVal, justText) {
75728
- return fuzzysearch(
75729
- searchVal ? searchVal.toLowerCase() : "",
75730
- justText ? justText.toLowerCase() : ""
75731
- );
75732
- }
75733
- __name(doesSearchValMatchText, "doesSearchValMatchText");
75734
- const MenuItemWithTooltip = /* @__PURE__ */ __name((_Q) => {
75735
- var _R = _Q, { tooltip } = _R, rest = __objRest(_R, ["tooltip"]);
75736
- let out = /* @__PURE__ */ React.createElement(core.MenuItem, __spreadValues({}, rest));
75737
- if (tooltip) {
75738
- out = /* @__PURE__ */ React.createElement(core.Tooltip, { content: tooltip }, out);
75739
- }
75740
- return out;
75741
- }, "MenuItemWithTooltip");
75742
75898
  function comboToLabel(def, useSymbols = true) {
75743
75899
  const combo = typeof def === "string" ? def : def.combo;
75744
75900
  if (useSymbols) {
@@ -78165,6 +78321,7 @@ exports.DataTable = WrappedDT;
78165
78321
  exports.DateInputField = DateInputField;
78166
78322
  exports.DateRangeInputField = DateRangeInputField;
78167
78323
  exports.DialogFooter = DialogFooter;
78324
+ exports.DividerWithText = DividerWithText;
78168
78325
  exports.DropdownButton = DropdownButton;
78169
78326
  exports.DynamicMenuItem = DynamicMenuItem;
78170
78327
  exports.EditableTextField = EditableTextField;