@vitrosoftware/common-ui-ts 1.0.8 → 1.0.10

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/dist/index.js CHANGED
@@ -20017,36 +20017,6 @@ var TreeView = function TreeView(props) {
20017
20017
  }));
20018
20018
  };
20019
20019
 
20020
- var TABLE_VIEW_EVENTS;
20021
- (function (TABLE_VIEW_EVENTS) {
20022
- TABLE_VIEW_EVENTS["ON_SELECT"] = "OnSelect";
20023
- TABLE_VIEW_EVENTS["ON_DATA_SEND"] = "OnDataSend";
20024
- TABLE_VIEW_EVENTS["ON_LOADED"] = "OnLoaded";
20025
- })(TABLE_VIEW_EVENTS || (TABLE_VIEW_EVENTS = {}));
20026
- var TABLE_VIEW_URL;
20027
- (function (TABLE_VIEW_URL) {
20028
- TABLE_VIEW_URL["LAYOUT"] = "Layout";
20029
- TABLE_VIEW_URL["DATA"] = "Data";
20030
- TABLE_VIEW_URL["PAGE"] = "Page";
20031
- TABLE_VIEW_URL["TREEGRID_TEXT"] = "treegrid/Text_ru-RU.xml";
20032
- })(TABLE_VIEW_URL || (TABLE_VIEW_URL = {}));
20033
- var TABLE_VIEW_CONTROLLER;
20034
- (function (TABLE_VIEW_CONTROLLER) {
20035
- TABLE_VIEW_CONTROLLER["REQUEST"] = "TableViewRequest";
20036
- })(TABLE_VIEW_CONTROLLER || (TABLE_VIEW_CONTROLLER = {}));
20037
- var TABLE_VIEW_CACHE;
20038
- (function (TABLE_VIEW_CACHE) {
20039
- TABLE_VIEW_CACHE[TABLE_VIEW_CACHE["DEFAULT"] = 2] = "DEFAULT";
20040
- })(TABLE_VIEW_CACHE || (TABLE_VIEW_CACHE = {}));
20041
-
20042
- var TableViewConstants = {
20043
- __proto__: null,
20044
- get TABLE_VIEW_EVENTS () { return TABLE_VIEW_EVENTS; },
20045
- get TABLE_VIEW_URL () { return TABLE_VIEW_URL; },
20046
- get TABLE_VIEW_CONTROLLER () { return TABLE_VIEW_CONTROLLER; },
20047
- get TABLE_VIEW_CACHE () { return TABLE_VIEW_CACHE; }
20048
- };
20049
-
20050
20020
  function _defineProperties(target, props) {
20051
20021
  for (var i = 0; i < props.length; i++) {
20052
20022
  var descriptor = props[i];
@@ -20249,6 +20219,36 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
20249
20219
  _proto.isVisibleGantt = function isVisibleGantt() {
20250
20220
  return this.grid.Cols.gantt.Visible;
20251
20221
  };
20222
+ _proto.setAttribute = function setAttribute(row, col, attribute, value, refresh, undo) {
20223
+ this.grid.SetAttribute(row, col, attribute, value, refresh, undo);
20224
+ };
20225
+ _proto.getRows = function getRows() {
20226
+ return this.grid.Rows;
20227
+ };
20228
+ _proto.getMainTag = function getMainTag() {
20229
+ return this.grid.MainTag;
20230
+ };
20231
+ _proto.focusCell = function focusCell(row, col) {
20232
+ this.grid.Focus(row, col);
20233
+ };
20234
+ _proto.getType = function getType(row, col) {
20235
+ return this.grid.GetType(row, col);
20236
+ };
20237
+ _proto.setStringEdit = function setStringEdit(row, col, value, timeout) {
20238
+ this.grid.SetStringEdit(row, col, value, timeout);
20239
+ };
20240
+ _proto.getValue = function getValue(row, col) {
20241
+ return this.grid.GetValue(row, col);
20242
+ };
20243
+ _proto.getFocusedCols = function getFocusedCols() {
20244
+ return this.grid.GetFocusedCols();
20245
+ };
20246
+ _proto.getFocusedRows = function getFocusedRows() {
20247
+ return this.grid.GetFocusedRows();
20248
+ };
20249
+ _proto.getFilter = function getFilter(spec) {
20250
+ return this.grid.GetFilter(spec);
20251
+ };
20252
20252
  _createClass(TreeGridTableViewContextImpl, [{
20253
20253
  key: "columnList",
20254
20254
  get: function get() {
@@ -20301,6 +20301,171 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
20301
20301
  return TreeGridTableViewContextImpl;
20302
20302
  }();
20303
20303
 
20304
+ var EVENT$1;
20305
+ (function (EVENT) {
20306
+ EVENT["ON_SELECT"] = "OnSelect";
20307
+ EVENT["ON_DATA_SEND"] = "OnDataSend";
20308
+ EVENT["ON_LOADED"] = "OnLoaded";
20309
+ EVENT["ON_CLICK"] = "OnClick";
20310
+ EVENT["ON_BLUR"] = "OnBlur";
20311
+ EVENT["ON_DBL_CLICK"] = "OnDblClick";
20312
+ EVENT["ON_CONTEXT_MENU"] = "OnContextMenu";
20313
+ EVENT["ON_DEL"] = "OnDel";
20314
+ EVENT["ON_AFTER_VALUE_CHANGED"] = "OnAfterValueChanged";
20315
+ EVENT["ON_CAN_DROP"] = "OnCanDrop";
20316
+ EVENT["ON_CAN_EDIT"] = "OnCanEdit";
20317
+ EVENT["ON_CUSTOM_END_EDIT"] = "OnCustomEndEdit";
20318
+ EVENT["ON_CUSTOM_START_EDIT"] = "OnCustomStartEdit";
20319
+ EVENT["ON_ENDED_DRAG"] = "OnEndedDrag";
20320
+ EVENT["ON_FILTER_OPERATOR"] = "OnFilterOperator";
20321
+ EVENT["ON_FILTER"] = "OnFilter";
20322
+ EVENT["ON_GANTT_CHANGED"] = "OnGanttChanged";
20323
+ EVENT["ON_GET_CLASS"] = "OnGetClass";
20324
+ EVENT["ON_GET_DEFAULTS"] = "OnGetDefaults";
20325
+ EVENT["ON_GET_HTML_VALUE"] = "OnGetHtmlValue";
20326
+ EVENT["ON_GET_INPUT_VALUE"] = "OnGetInputValue";
20327
+ EVENT["ON_GET_MENU"] = "OnGetMenu";
20328
+ EVENT["ON_READY"] = "OnReady";
20329
+ EVENT["ON_RENDER_PAGE_FINISH"] = "OnRenderPageFinish";
20330
+ EVENT["ON_RENDER_START"] = "OnRenderStart";
20331
+ EVENT["ON_ROW_UNDELETE"] = "OnRowUndelete";
20332
+ EVENT["ON_SET_INPUT_VALUE"] = "OnSetInputValue";
20333
+ EVENT["ON_SORT"] = "OnSort";
20334
+ EVENT["ON_START_DRAG"] = "OnStartDrag";
20335
+ EVENT["ON_SUGGEST"] = "OnSuggest";
20336
+ EVENT["ON_VALUE_CHANGED"] = "OnValueChanged";
20337
+ })(EVENT$1 || (EVENT$1 = {}));
20338
+ var URL;
20339
+ (function (URL) {
20340
+ URL["LAYOUT"] = "Layout";
20341
+ URL["DATA"] = "Data";
20342
+ URL["PAGE"] = "Page";
20343
+ URL["TREEGRID_TEXT"] = "treegrid/Text_ru-RU.xml";
20344
+ })(URL || (URL = {}));
20345
+ var CONTROLLER;
20346
+ (function (CONTROLLER) {
20347
+ CONTROLLER["REQUEST"] = "TableViewRequest";
20348
+ })(CONTROLLER || (CONTROLLER = {}));
20349
+ var CACHE;
20350
+ (function (CACHE) {
20351
+ CACHE[CACHE["DEFAULT"] = 2] = "DEFAULT";
20352
+ })(CACHE || (CACHE = {}));
20353
+ var COLUMN;
20354
+ (function (COLUMN) {
20355
+ COLUMN["GANTT"] = "gantt";
20356
+ COLUMN["GANTT_CLASS"] = "GanttGanttClass";
20357
+ COLUMN["GANTT_ICONS"] = "GanttGanttIcons";
20358
+ })(COLUMN || (COLUMN = {}));
20359
+ var ROW_TYPE;
20360
+ (function (ROW_TYPE) {
20361
+ ROW_TYPE["HEADER"] = "Header";
20362
+ ROW_TYPE["DATA"] = "Data";
20363
+ ROW_TYPE["FILTER"] = "Filter";
20364
+ })(ROW_TYPE || (ROW_TYPE = {}));
20365
+ var CELL_TYPE;
20366
+ (function (CELL_TYPE) {
20367
+ CELL_TYPE["DATE"] = "Date";
20368
+ CELL_TYPE["TEXT"] = "Text";
20369
+ CELL_TYPE["LINES"] = "Lines";
20370
+ CELL_TYPE["PASS"] = "Pass";
20371
+ CELL_TYPE["INT"] = "Int";
20372
+ CELL_TYPE["FLOAT"] = "Float";
20373
+ CELL_TYPE["ENUM"] = "Enum";
20374
+ CELL_TYPE["RADIO"] = "Radio";
20375
+ CELL_TYPE["SELECT"] = "Select";
20376
+ CELL_TYPE["HTML"] = "Html";
20377
+ CELL_TYPE["ICON"] = "Icon";
20378
+ CELL_TYPE["LIST"] = "List";
20379
+ })(CELL_TYPE || (CELL_TYPE = {}));
20380
+ var ATTRIBUTE;
20381
+ (function (ATTRIBUTE) {
20382
+ ATTRIBUTE["BUTTON"] = "Button";
20383
+ ATTRIBUTE["ON_CLICK_SIDE_BUTTON"] = "OnClickSideButton";
20384
+ ATTRIBUTE["ICON"] = "Icon";
20385
+ ATTRIBUTE["ICON_ALIGN"] = "IconAlign";
20386
+ ATTRIBUTE["DEFAULT_FILTER"] = "DefaultFilter";
20387
+ ATTRIBUTE["MENU_ITEMS"] = "MenuItems";
20388
+ ATTRIBUTE["RANGE"] = "Range";
20389
+ ATTRIBUTE["FULL_VALUE"] = "FullValue";
20390
+ ATTRIBUTE["ORIG_NAME"] = "Orig";
20391
+ ATTRIBUTE["ALIGN"] = "Align";
20392
+ ATTRIBUTE["TIP"] = "Tip";
20393
+ })(ATTRIBUTE || (ATTRIBUTE = {}));
20394
+ var DRAG_ITEM_TYPE;
20395
+ (function (DRAG_ITEM_TYPE) {
20396
+ DRAG_ITEM_TYPE[DRAG_ITEM_TYPE["CANNOT_DROP"] = 0] = "CANNOT_DROP";
20397
+ DRAG_ITEM_TYPE[DRAG_ITEM_TYPE["ABOVE_TOROW"] = 1] = "ABOVE_TOROW";
20398
+ DRAG_ITEM_TYPE[DRAG_ITEM_TYPE["TO_THE_END_OF_CHILDREN"] = 2] = "TO_THE_END_OF_CHILDREN";
20399
+ DRAG_ITEM_TYPE[DRAG_ITEM_TYPE["BELOW_TOROW"] = 3] = "BELOW_TOROW";
20400
+ })(DRAG_ITEM_TYPE || (DRAG_ITEM_TYPE = {}));
20401
+ var FILTER_TYPE;
20402
+ (function (FILTER_TYPE) {
20403
+ FILTER_TYPE[FILTER_TYPE["NONE"] = 0] = "NONE";
20404
+ FILTER_TYPE[FILTER_TYPE["EQUAL"] = 1] = "EQUAL";
20405
+ FILTER_TYPE[FILTER_TYPE["NOT_EQUAL"] = 2] = "NOT_EQUAL";
20406
+ FILTER_TYPE[FILTER_TYPE["LESS_THAN"] = 3] = "LESS_THAN";
20407
+ FILTER_TYPE[FILTER_TYPE["LESS_THAN_OR_EQUAL"] = 4] = "LESS_THAN_OR_EQUAL";
20408
+ FILTER_TYPE[FILTER_TYPE["GREATER_THAN"] = 5] = "GREATER_THAN";
20409
+ FILTER_TYPE[FILTER_TYPE["GREATER_THAN_OR_EQUAL"] = 6] = "GREATER_THAN_OR_EQUAL";
20410
+ FILTER_TYPE[FILTER_TYPE["BEGINS_WITH"] = 7] = "BEGINS_WITH";
20411
+ FILTER_TYPE[FILTER_TYPE["DOES_NOT_BEGIN_WITH"] = 8] = "DOES_NOT_BEGIN_WITH";
20412
+ FILTER_TYPE[FILTER_TYPE["ENDS_WITH"] = 9] = "ENDS_WITH";
20413
+ FILTER_TYPE[FILTER_TYPE["DOES_NOT_END_WITH"] = 10] = "DOES_NOT_END_WITH";
20414
+ FILTER_TYPE[FILTER_TYPE["CONTAINS"] = 11] = "CONTAINS";
20415
+ FILTER_TYPE[FILTER_TYPE["DOES_NOT_CONTAIN"] = 12] = "DOES_NOT_CONTAIN";
20416
+ })(FILTER_TYPE || (FILTER_TYPE = {}));
20417
+ var REFRESH_MODE;
20418
+ (function (REFRESH_MODE) {
20419
+ REFRESH_MODE["ROW"] = "row";
20420
+ REFRESH_MODE["PAGE"] = "page";
20421
+ REFRESH_MODE["NONE"] = "none";
20422
+ })(REFRESH_MODE || (REFRESH_MODE = {}));
20423
+ var DEFAULT;
20424
+ (function (DEFAULT) {
20425
+ DEFAULT[DEFAULT["SUGGEST_DELAY"] = 200] = "SUGGEST_DELAY";
20426
+ DEFAULT[DEFAULT["PAGE_LENGTH"] = 50] = "PAGE_LENGTH";
20427
+ DEFAULT["PAGE"] = "2";
20428
+ DEFAULT["DEFAULTS"] = "Defaults";
20429
+ DEFAULT["TIP"] = "*Value*";
20430
+ })(DEFAULT || (DEFAULT = {}));
20431
+ var ALIGN;
20432
+ (function (ALIGN) {
20433
+ ALIGN["CENTER"] = "Center";
20434
+ ALIGN["RIGHT"] = "Right";
20435
+ })(ALIGN || (ALIGN = {}));
20436
+ var ROW_ID;
20437
+ (function (ROW_ID) {
20438
+ ROW_ID["TOTAL"] = "totalRow";
20439
+ })(ROW_ID || (ROW_ID = {}));
20440
+ var NUMBER_FORMAT;
20441
+ (function (NUMBER_FORMAT) {
20442
+ NUMBER_FORMAT["GENERAL"] = "g";
20443
+ NUMBER_FORMAT["FIXED"] = "f";
20444
+ NUMBER_FORMAT["CURRENCY"] = "c";
20445
+ NUMBER_FORMAT["PERCENT"] = "p";
20446
+ NUMBER_FORMAT["ROUNDED"] = "r";
20447
+ NUMBER_FORMAT["SCIENTIFIC"] = "e";
20448
+ })(NUMBER_FORMAT || (NUMBER_FORMAT = {}));
20449
+
20450
+ var TableViewConstants = {
20451
+ __proto__: null,
20452
+ get EVENT () { return EVENT$1; },
20453
+ get URL () { return URL; },
20454
+ get CONTROLLER () { return CONTROLLER; },
20455
+ get CACHE () { return CACHE; },
20456
+ get COLUMN () { return COLUMN; },
20457
+ get ROW_TYPE () { return ROW_TYPE; },
20458
+ get CELL_TYPE () { return CELL_TYPE; },
20459
+ get ATTRIBUTE () { return ATTRIBUTE; },
20460
+ get DRAG_ITEM_TYPE () { return DRAG_ITEM_TYPE; },
20461
+ get FILTER_TYPE () { return FILTER_TYPE; },
20462
+ get REFRESH_MODE () { return REFRESH_MODE; },
20463
+ get DEFAULT () { return DEFAULT; },
20464
+ get ALIGN () { return ALIGN; },
20465
+ get ROW_ID () { return ROW_ID; },
20466
+ get NUMBER_FORMAT () { return NUMBER_FORMAT; }
20467
+ };
20468
+
20304
20469
  var styles$3 = {"vitro-table-view":"_table-view_vitro-table-view_2O0cRRX"};
20305
20470
 
20306
20471
  var w$1 = window;
@@ -20346,7 +20511,7 @@ var TreeGrid = function TreeGrid(props) {
20346
20511
  }
20347
20512
  if (props.onSelect) {
20348
20513
  var onSelectEventHandler = {
20349
- id: TABLE_VIEW_EVENTS.ON_SELECT,
20514
+ id: EVENT$1.ON_SELECT,
20350
20515
  process: props.onSelect
20351
20516
  };
20352
20517
  grid.setEventHandler(onSelectEventHandler);
@@ -20355,7 +20520,7 @@ var TreeGrid = function TreeGrid(props) {
20355
20520
  props.onInit(grid, next);
20356
20521
  }
20357
20522
  var onDateSendEventHandler = {
20358
- id: TABLE_VIEW_EVENTS.ON_DATA_SEND,
20523
+ id: EVENT$1.ON_DATA_SEND,
20359
20524
  process: onDataSendHandler
20360
20525
  };
20361
20526
  grid.setEventHandler(onDateSendEventHandler);
@@ -20367,13 +20532,13 @@ var TreeGrid = function TreeGrid(props) {
20367
20532
  if (props.createGridUrl) {
20368
20533
  return props.createGridUrl(dataKey);
20369
20534
  } else {
20370
- var controller = props.controller || TABLE_VIEW_CONTROLLER.REQUEST;
20535
+ var controller = props.controller || CONTROLLER.REQUEST;
20371
20536
  return '/api/' + controller + '/' + dataKey + '/' + props.listCode;
20372
20537
  }
20373
20538
  };
20374
20539
  React.useEffect(function () {
20375
20540
  disposeTableViewById(props.id);
20376
- w$1.TGSetEvent(TABLE_VIEW_EVENTS.ON_LOADED, props.id, function (grid, next) {
20541
+ w$1.TGSetEvent(EVENT$1.ON_LOADED, props.id, function (grid, next) {
20377
20542
  return onGridLoaded(grid, next);
20378
20543
  });
20379
20544
  if (props.layout || props.data) {
@@ -20386,29 +20551,29 @@ var TreeGrid = function TreeGrid(props) {
20386
20551
  Data: props.data
20387
20552
  },
20388
20553
  Text: {
20389
- Url: props.textUrl || TABLE_VIEW_URL.TREEGRID_TEXT
20554
+ Url: props.textUrl || URL.TREEGRID_TEXT
20390
20555
  },
20391
20556
  Debug: props.debug || '',
20392
- Cache: props.cache || TABLE_VIEW_CACHE.DEFAULT,
20557
+ Cache: props.cache || CACHE.DEFAULT,
20393
20558
  CacheVersion: props.cacheVersion
20394
20559
  }, "vitro-table-view" + props.id);
20395
20560
  } else {
20396
20561
  w$1.TreeGrid({
20397
20562
  id: props.id,
20398
20563
  Layout: {
20399
- Url: createGridUrl(TABLE_VIEW_URL.LAYOUT)
20564
+ Url: createGridUrl(URL.LAYOUT)
20400
20565
  },
20401
20566
  Data: {
20402
- Url: createGridUrl(TABLE_VIEW_URL.DATA)
20567
+ Url: createGridUrl(URL.DATA)
20403
20568
  },
20404
20569
  Page: {
20405
- Url: createGridUrl(TABLE_VIEW_URL.PAGE)
20570
+ Url: createGridUrl(URL.PAGE)
20406
20571
  },
20407
20572
  Text: {
20408
- Url: props.textUrl || TABLE_VIEW_URL.TREEGRID_TEXT
20573
+ Url: props.textUrl || URL.TREEGRID_TEXT
20409
20574
  },
20410
20575
  Debug: props.debug || '',
20411
- Cache: props.cache || TABLE_VIEW_CACHE.DEFAULT,
20576
+ Cache: props.cache || CACHE.DEFAULT,
20412
20577
  CacheVersion: props.cacheVersion
20413
20578
  }, "vitro-table-view" + props.id);
20414
20579
  }
@@ -54508,17 +54673,7 @@ function effect(_ref2) {
54508
54673
  }
54509
54674
  }
54510
54675
 
54511
- if (process.env.NODE_ENV !== "production") {
54512
- if (!isHTMLElement(arrowElement)) {
54513
- console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
54514
- }
54515
- }
54516
-
54517
54676
  if (!contains(state.elements.popper, arrowElement)) {
54518
- if (process.env.NODE_ENV !== "production") {
54519
- console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
54520
- }
54521
-
54522
54677
  return;
54523
54678
  }
54524
54679
 
@@ -54660,17 +54815,6 @@ function computeStyles(_ref5) {
54660
54815
  adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
54661
54816
  _options$roundOffsets = options.roundOffsets,
54662
54817
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
54663
-
54664
- if (process.env.NODE_ENV !== "production") {
54665
- var transitionProperty = getComputedStyle$1(state.elements.popper).transitionProperty || '';
54666
-
54667
- if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
54668
- return transitionProperty.indexOf(property) >= 0;
54669
- })) {
54670
- console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
54671
- }
54672
- }
54673
-
54674
54818
  var commonStyles = {
54675
54819
  placement: getBasePlacement(state.placement),
54676
54820
  variation: getVariation(state.placement),
@@ -55111,10 +55255,6 @@ function computeAutoPlacement(state, options) {
55111
55255
 
55112
55256
  if (allowedPlacements.length === 0) {
55113
55257
  allowedPlacements = placements$1;
55114
-
55115
- if (process.env.NODE_ENV !== "production") {
55116
- console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
55117
- }
55118
55258
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
55119
55259
 
55120
55260
 
@@ -55666,108 +55806,6 @@ function debounce(fn) {
55666
55806
  };
55667
55807
  }
55668
55808
 
55669
- function format(str) {
55670
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
55671
- args[_key - 1] = arguments[_key];
55672
- }
55673
-
55674
- return [].concat(args).reduce(function (p, c) {
55675
- return p.replace(/%s/, c);
55676
- }, str);
55677
- }
55678
-
55679
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
55680
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
55681
- var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
55682
- function validateModifiers(modifiers) {
55683
- modifiers.forEach(function (modifier) {
55684
- [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
55685
- .filter(function (value, index, self) {
55686
- return self.indexOf(value) === index;
55687
- }).forEach(function (key) {
55688
- switch (key) {
55689
- case 'name':
55690
- if (typeof modifier.name !== 'string') {
55691
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
55692
- }
55693
-
55694
- break;
55695
-
55696
- case 'enabled':
55697
- if (typeof modifier.enabled !== 'boolean') {
55698
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
55699
- }
55700
-
55701
- break;
55702
-
55703
- case 'phase':
55704
- if (modifierPhases.indexOf(modifier.phase) < 0) {
55705
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
55706
- }
55707
-
55708
- break;
55709
-
55710
- case 'fn':
55711
- if (typeof modifier.fn !== 'function') {
55712
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
55713
- }
55714
-
55715
- break;
55716
-
55717
- case 'effect':
55718
- if (modifier.effect != null && typeof modifier.effect !== 'function') {
55719
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
55720
- }
55721
-
55722
- break;
55723
-
55724
- case 'requires':
55725
- if (modifier.requires != null && !Array.isArray(modifier.requires)) {
55726
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
55727
- }
55728
-
55729
- break;
55730
-
55731
- case 'requiresIfExists':
55732
- if (!Array.isArray(modifier.requiresIfExists)) {
55733
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
55734
- }
55735
-
55736
- break;
55737
-
55738
- case 'options':
55739
- case 'data':
55740
- break;
55741
-
55742
- default:
55743
- console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
55744
- return "\"" + s + "\"";
55745
- }).join(', ') + "; but \"" + key + "\" was provided.");
55746
- }
55747
-
55748
- modifier.requires && modifier.requires.forEach(function (requirement) {
55749
- if (modifiers.find(function (mod) {
55750
- return mod.name === requirement;
55751
- }) == null) {
55752
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
55753
- }
55754
- });
55755
- });
55756
- });
55757
- }
55758
-
55759
- function uniqueBy(arr, fn) {
55760
- var identifiers = new Set();
55761
- return arr.filter(function (item) {
55762
- var identifier = fn(item);
55763
-
55764
- if (!identifiers.has(identifier)) {
55765
- identifiers.add(identifier);
55766
- return true;
55767
- }
55768
- });
55769
- }
55770
-
55771
55809
  function mergeByName(modifiers) {
55772
55810
  var merged = modifiers.reduce(function (merged, current) {
55773
55811
  var existing = merged[current.name];
@@ -55783,8 +55821,6 @@ function mergeByName(modifiers) {
55783
55821
  });
55784
55822
  }
55785
55823
 
55786
- var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
55787
- var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
55788
55824
  var DEFAULT_OPTIONS = {
55789
55825
  placement: 'bottom',
55790
55826
  modifiers: [],
@@ -55846,42 +55882,7 @@ function popperGenerator(generatorOptions) {
55846
55882
 
55847
55883
  state.orderedModifiers = orderedModifiers.filter(function (m) {
55848
55884
  return m.enabled;
55849
- }); // Validate the provided modifiers so that the consumer will get warned
55850
- // if one of the modifiers is invalid for any reason
55851
-
55852
- if (process.env.NODE_ENV !== "production") {
55853
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
55854
- var name = _ref.name;
55855
- return name;
55856
- });
55857
- validateModifiers(modifiers);
55858
-
55859
- if (getBasePlacement(state.options.placement) === auto) {
55860
- var flipModifier = state.orderedModifiers.find(function (_ref2) {
55861
- var name = _ref2.name;
55862
- return name === 'flip';
55863
- });
55864
-
55865
- if (!flipModifier) {
55866
- console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
55867
- }
55868
- }
55869
-
55870
- var _getComputedStyle = getComputedStyle$1(popper),
55871
- marginTop = _getComputedStyle.marginTop,
55872
- marginRight = _getComputedStyle.marginRight,
55873
- marginBottom = _getComputedStyle.marginBottom,
55874
- marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
55875
- // cause bugs with positioning, so we'll warn the consumer
55876
-
55877
-
55878
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
55879
- return parseFloat(margin);
55880
- })) {
55881
- console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
55882
- }
55883
- }
55884
-
55885
+ });
55885
55886
  runModifierEffects();
55886
55887
  return instance.update();
55887
55888
  },
@@ -55901,10 +55902,6 @@ function popperGenerator(generatorOptions) {
55901
55902
  // anymore
55902
55903
 
55903
55904
  if (!areValidElements(reference, popper)) {
55904
- if (process.env.NODE_ENV !== "production") {
55905
- console.error(INVALID_ELEMENT_ERROR);
55906
- }
55907
-
55908
55905
  return;
55909
55906
  } // Store the reference and popper rects to be read by modifiers
55910
55907
 
@@ -55927,18 +55924,8 @@ function popperGenerator(generatorOptions) {
55927
55924
  state.orderedModifiers.forEach(function (modifier) {
55928
55925
  return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
55929
55926
  });
55930
- var __debug_loops__ = 0;
55931
55927
 
55932
55928
  for (var index = 0; index < state.orderedModifiers.length; index++) {
55933
- if (process.env.NODE_ENV !== "production") {
55934
- __debug_loops__ += 1;
55935
-
55936
- if (__debug_loops__ > 100) {
55937
- console.error(INFINITE_LOOP_ERROR);
55938
- break;
55939
- }
55940
- }
55941
-
55942
55929
  if (state.reset === true) {
55943
55930
  state.reset = false;
55944
55931
  index = -1;
@@ -55976,10 +55963,6 @@ function popperGenerator(generatorOptions) {
55976
55963
  };
55977
55964
 
55978
55965
  if (!areValidElements(reference, popper)) {
55979
- if (process.env.NODE_ENV !== "production") {
55980
- console.error(INVALID_ELEMENT_ERROR);
55981
- }
55982
-
55983
55966
  return instance;
55984
55967
  }
55985
55968
 
@@ -55994,11 +55977,11 @@ function popperGenerator(generatorOptions) {
55994
55977
  // one.
55995
55978
 
55996
55979
  function runModifierEffects() {
55997
- state.orderedModifiers.forEach(function (_ref3) {
55998
- var name = _ref3.name,
55999
- _ref3$options = _ref3.options,
56000
- options = _ref3$options === void 0 ? {} : _ref3$options,
56001
- effect = _ref3.effect;
55980
+ state.orderedModifiers.forEach(function (_ref) {
55981
+ var name = _ref.name,
55982
+ _ref$options = _ref.options,
55983
+ options = _ref$options === void 0 ? {} : _ref$options,
55984
+ effect = _ref.effect;
56002
55985
 
56003
55986
  if (typeof effect === 'function') {
56004
55987
  var cleanupFn = effect({
@@ -56310,12 +56293,16 @@ function useClickOutside(ref, onClickOutside = noop$1, {
56310
56293
  }
56311
56294
  });
56312
56295
  React.useEffect(() => {
56296
+ var _ownerWindow$event, _ownerWindow$parent;
56313
56297
  if (disabled || ref == null) return undefined;
56314
56298
  const doc = ownerDocument(getRefTarget(ref));
56299
+ const ownerWindow = doc.defaultView || window;
56315
56300
 
56316
56301
  // Store the current event to avoid triggering handlers immediately
56302
+ // For things rendered in an iframe, the event might originate on the parent window
56303
+ // so we should fall back to that global event if the local one doesn't exist
56317
56304
  // https://github.com/facebook/react/issues/20074
56318
- let currentEvent = (doc.defaultView || window).event;
56305
+ let currentEvent = (_ownerWindow$event = ownerWindow.event) != null ? _ownerWindow$event : (_ownerWindow$parent = ownerWindow.parent) == null ? void 0 : _ownerWindow$parent.event;
56319
56306
  let removeInitialTriggerListener = null;
56320
56307
  if (InitialTriggerEvents[clickTrigger]) {
56321
56308
  removeInitialTriggerListener = listen(doc, InitialTriggerEvents[clickTrigger], handleInitialMouse, true);