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