@vitrosoftware/common-ui-ts 1.0.9 → 1.1.11

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.
Files changed (31) hide show
  1. package/css/white/common.css +0 -1
  2. package/css/white/controls/action-handler/action-handler.css +9 -0
  3. package/css/white/controls/control-group/control-group.css +27 -0
  4. package/css/white/controls/tab-group/tab-group.css +110 -0
  5. package/css/white/controls/table-view/table-view-custom-date-edit.css +6 -0
  6. package/css/white/controls/table-view/table-view.css +4 -1
  7. package/css/white/controls/view/view.css +3 -0
  8. package/css/white/controls/view-part/view-part.css +3 -0
  9. package/css/white/third-party/treegrid.css +7 -1
  10. package/dist/controls/ActionHandler/ActionHandler.d.ts +4 -3
  11. package/dist/controls/ControlGroup/ControlGroup.d.ts +7 -0
  12. package/dist/controls/TabGroup/OverflowButton.d.ts +8 -0
  13. package/dist/controls/TabGroup/Tab.d.ts +10 -0
  14. package/dist/controls/TabGroup/TabGroup.d.ts +9 -0
  15. package/dist/controls/TabGroup/TabGroupComponent.d.ts +8 -0
  16. package/dist/controls/TabGroup/TabGroupConstants.d.ts +4 -0
  17. package/dist/controls/TabGroup/TabGroupHeader.d.ts +10 -0
  18. package/dist/controls/TabGroup/TabItem.d.ts +13 -0
  19. package/dist/controls/TableView/TableViewContext.d.ts +13 -1
  20. package/dist/controls/TableView/TreeGridTableViewContextImpl.d.ts +12 -0
  21. package/dist/controls/TreeView/JsTreeViewContextImpl.d.ts +1 -1
  22. package/dist/controls/TreeView/TreeViewContext.d.ts +1 -1
  23. package/dist/controls/View/View.d.ts +7 -0
  24. package/dist/controls/ViewPart/ViewPart.d.ts +8 -0
  25. package/dist/index.css +160 -2
  26. package/dist/index.d.ts +7 -0
  27. package/dist/index.js +909 -220
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.modern.js +913 -227
  30. package/dist/index.modern.js.map +1 -1
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import React__default, { useState, useRef, useEffect, useMemo, useCallback, useContext, createContext, useLayoutEffect, forwardRef, cloneElement, Children } from 'react';
2
- import { ScriptLoader, Progress, ButtonGroup, Button } from '@vitrosoftware/common-ui';
1
+ import React__default, { useState, useRef, useEffect, useMemo, useCallback, useContext, createContext, useLayoutEffect, forwardRef, cloneElement, useReducer, Children } from 'react';
2
+ import { ScriptLoader, Progress, ButtonGroup, Button as Button$1, DropdownButton, Image } from '@vitrosoftware/common-ui';
3
3
  import { useInjection } from 'inversify-react';
4
4
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
5
5
 
@@ -212,6 +212,10 @@ var TopLevelMenu = function TopLevelMenu(props) {
212
212
 
213
213
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
214
214
 
215
+ function unwrapExports (x) {
216
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
217
+ }
218
+
215
219
  function createCommonjsModule(fn, module) {
216
220
  return module = { exports: {} }, fn(module, module.exports), module.exports;
217
221
  }
@@ -19968,8 +19972,8 @@ var JsTreeViewContextImpl = /*#__PURE__*/function () {
19968
19972
  this.deselectAll();
19969
19973
  this.jsTree.jstree(METHOD.SELECT_NODE, node);
19970
19974
  };
19971
- _proto.openNode = function openNode(node) {
19972
- this.jsTree.jstree(METHOD.OPEN_NODE, node);
19975
+ _proto.openNode = function openNode(node, callback, durationMs) {
19976
+ this.jsTree.jstree(METHOD.OPEN_NODE, node, callback, durationMs);
19973
19977
  };
19974
19978
  _proto.editNode = function editNode() {
19975
19979
  var selected = this.getSelected();
@@ -20031,6 +20035,20 @@ function _createClass(Constructor, protoProps, staticProps) {
20031
20035
  });
20032
20036
  return Constructor;
20033
20037
  }
20038
+ function _extends() {
20039
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
20040
+ for (var i = 1; i < arguments.length; i++) {
20041
+ var source = arguments[i];
20042
+ for (var key in source) {
20043
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
20044
+ target[key] = source[key];
20045
+ }
20046
+ }
20047
+ }
20048
+ return target;
20049
+ };
20050
+ return _extends.apply(this, arguments);
20051
+ }
20034
20052
  function _objectWithoutPropertiesLoose(source, excluded) {
20035
20053
  if (source == null) return {};
20036
20054
  var target = {};
@@ -20216,6 +20234,36 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
20216
20234
  _proto.isVisibleGantt = function isVisibleGantt() {
20217
20235
  return this.grid.Cols.gantt.Visible;
20218
20236
  };
20237
+ _proto.setAttribute = function setAttribute(row, col, attribute, value, refresh, undo) {
20238
+ this.grid.SetAttribute(row, col, attribute, value, refresh, undo);
20239
+ };
20240
+ _proto.getRows = function getRows() {
20241
+ return this.grid.Rows;
20242
+ };
20243
+ _proto.getMainTag = function getMainTag() {
20244
+ return this.grid.MainTag;
20245
+ };
20246
+ _proto.focusCell = function focusCell(row, col) {
20247
+ this.grid.Focus(row, col);
20248
+ };
20249
+ _proto.getType = function getType(row, col) {
20250
+ return this.grid.GetType(row, col);
20251
+ };
20252
+ _proto.setStringEdit = function setStringEdit(row, col, value, timeout) {
20253
+ this.grid.SetStringEdit(row, col, value, timeout);
20254
+ };
20255
+ _proto.getValue = function getValue(row, col) {
20256
+ return this.grid.GetValue(row, col);
20257
+ };
20258
+ _proto.getFocusedCols = function getFocusedCols() {
20259
+ return this.grid.GetFocusedCols();
20260
+ };
20261
+ _proto.getFocusedRows = function getFocusedRows() {
20262
+ return this.grid.GetFocusedRows();
20263
+ };
20264
+ _proto.getFilter = function getFilter(spec) {
20265
+ return this.grid.GetFilter(spec);
20266
+ };
20219
20267
  _createClass(TreeGridTableViewContextImpl, [{
20220
20268
  key: "columnList",
20221
20269
  get: function get() {
@@ -20931,6 +20979,21 @@ var classnames = createCommonjsModule(function (module) {
20931
20979
  }());
20932
20980
  });
20933
20981
 
20982
+ function _extends$1() {
20983
+ _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
20984
+ for (var i = 1; i < arguments.length; i++) {
20985
+ var source = arguments[i];
20986
+ for (var key in source) {
20987
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
20988
+ target[key] = source[key];
20989
+ }
20990
+ }
20991
+ }
20992
+ return target;
20993
+ };
20994
+ return _extends$1.apply(this, arguments);
20995
+ }
20996
+
20934
20997
  function _objectWithoutPropertiesLoose$1(source, excluded) {
20935
20998
  if (source == null) return {};
20936
20999
  var target = {};
@@ -20944,6 +21007,14 @@ function _objectWithoutPropertiesLoose$1(source, excluded) {
20944
21007
  return target;
20945
21008
  }
20946
21009
 
21010
+ function defaultKey(key) {
21011
+ return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
21012
+ }
21013
+
21014
+ function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return typeof key === "symbol" ? key : String(key); }
21015
+
21016
+ function _toPrimitive$1(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
21017
+
20947
21018
  function useUncontrolledProp(propValue, defaultValue, handler) {
20948
21019
  var wasPropRef = useRef(propValue !== undefined);
20949
21020
 
@@ -20972,6 +21043,24 @@ function useUncontrolledProp(propValue, defaultValue, handler) {
20972
21043
  setState(value);
20973
21044
  }, [handler])];
20974
21045
  }
21046
+ function useUncontrolled(props, config) {
21047
+ return Object.keys(config).reduce(function (result, fieldName) {
21048
+ var _extends2;
21049
+
21050
+ var _ref = result,
21051
+ defaultValue = _ref[defaultKey(fieldName)],
21052
+ propsValue = _ref[fieldName],
21053
+ rest = _objectWithoutPropertiesLoose$1(_ref, [defaultKey(fieldName), fieldName].map(_toPropertyKey$1));
21054
+
21055
+ var handlerName = config[fieldName];
21056
+
21057
+ var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]),
21058
+ value = _useUncontrolledProp[0],
21059
+ handler = _useUncontrolledProp[1];
21060
+
21061
+ return _extends$1({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2));
21062
+ }, props);
21063
+ }
20975
21064
 
20976
21065
  function _setPrototypeOf(o, p) {
20977
21066
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
@@ -54008,6 +54097,129 @@ var isDOM = typeof document !== 'undefined';
54008
54097
 
54009
54098
  var useIsomorphicEffect = isDOM || isReactNative ? useLayoutEffect : useEffect;
54010
54099
 
54100
+ const _excluded = ["as", "disabled"];
54101
+ function _objectWithoutPropertiesLoose$2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
54102
+ function isTrivialHref(href) {
54103
+ return !href || href.trim() === '#';
54104
+ }
54105
+ function useButtonProps({
54106
+ tagName,
54107
+ disabled,
54108
+ href,
54109
+ target,
54110
+ rel,
54111
+ role,
54112
+ onClick,
54113
+ tabIndex = 0,
54114
+ type
54115
+ }) {
54116
+ if (!tagName) {
54117
+ if (href != null || target != null || rel != null) {
54118
+ tagName = 'a';
54119
+ } else {
54120
+ tagName = 'button';
54121
+ }
54122
+ }
54123
+ const meta = {
54124
+ tagName
54125
+ };
54126
+ if (tagName === 'button') {
54127
+ return [{
54128
+ type: type || 'button',
54129
+ disabled
54130
+ }, meta];
54131
+ }
54132
+ const handleClick = event => {
54133
+ if (disabled || tagName === 'a' && isTrivialHref(href)) {
54134
+ event.preventDefault();
54135
+ }
54136
+ if (disabled) {
54137
+ event.stopPropagation();
54138
+ return;
54139
+ }
54140
+ onClick == null ? void 0 : onClick(event);
54141
+ };
54142
+ const handleKeyDown = event => {
54143
+ if (event.key === ' ') {
54144
+ event.preventDefault();
54145
+ handleClick(event);
54146
+ }
54147
+ };
54148
+ if (tagName === 'a') {
54149
+ // Ensure there's a href so Enter can trigger anchor button.
54150
+ href || (href = '#');
54151
+ if (disabled) {
54152
+ href = undefined;
54153
+ }
54154
+ }
54155
+ return [{
54156
+ role: role != null ? role : 'button',
54157
+ // explicitly undefined so that it overrides the props disabled in a spread
54158
+ // e.g. <Tag {...props} {...hookProps} />
54159
+ disabled: undefined,
54160
+ tabIndex: disabled ? undefined : tabIndex,
54161
+ href,
54162
+ target: tagName === 'a' ? target : undefined,
54163
+ 'aria-disabled': !disabled ? undefined : disabled,
54164
+ rel: tagName === 'a' ? rel : undefined,
54165
+ onClick: handleClick,
54166
+ onKeyDown: handleKeyDown
54167
+ }, meta];
54168
+ }
54169
+ const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
54170
+ let {
54171
+ as: asProp,
54172
+ disabled
54173
+ } = _ref,
54174
+ props = _objectWithoutPropertiesLoose$2(_ref, _excluded);
54175
+ const [buttonProps, {
54176
+ tagName: Component
54177
+ }] = useButtonProps(Object.assign({
54178
+ tagName: asProp,
54179
+ disabled
54180
+ }, props));
54181
+ return /*#__PURE__*/jsx(Component, Object.assign({}, props, buttonProps, {
54182
+ ref: ref
54183
+ }));
54184
+ });
54185
+ Button.displayName = 'Button';
54186
+
54187
+ const _excluded$1 = ["onKeyDown"];
54188
+ function _objectWithoutPropertiesLoose$3(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
54189
+ function isTrivialHref$1(href) {
54190
+ return !href || href.trim() === '#';
54191
+ }
54192
+ /**
54193
+ * An generic `<a>` component that covers a few A11y cases, ensuring that
54194
+ * cases where the `href` is missing or trivial like "#" are treated like buttons.
54195
+ */
54196
+ const Anchor = /*#__PURE__*/forwardRef((_ref, ref) => {
54197
+ let {
54198
+ onKeyDown
54199
+ } = _ref,
54200
+ props = _objectWithoutPropertiesLoose$3(_ref, _excluded$1);
54201
+ const [buttonProps] = useButtonProps(Object.assign({
54202
+ tagName: 'a'
54203
+ }, props));
54204
+ const handleKeyDown = useEventCallback(e => {
54205
+ buttonProps.onKeyDown(e);
54206
+ onKeyDown == null ? void 0 : onKeyDown(e);
54207
+ });
54208
+ if (isTrivialHref$1(props.href) || props.role === 'button') {
54209
+ return /*#__PURE__*/jsx("a", Object.assign({
54210
+ ref: ref
54211
+ }, props, buttonProps, {
54212
+ onKeyDown: handleKeyDown
54213
+ }));
54214
+ }
54215
+ return /*#__PURE__*/jsx("a", Object.assign({
54216
+ ref: ref
54217
+ }, props, {
54218
+ onKeyDown: onKeyDown
54219
+ }));
54220
+ });
54221
+ Anchor.displayName = 'Anchor';
54222
+
54011
54223
  const fadeStyles = {
54012
54224
  [ENTERING]: 'show',
54013
54225
  [ENTERED]: 'show'
@@ -54079,6 +54291,9 @@ function createWithBsPrefix(prefix, {
54079
54291
  return BsComponent;
54080
54292
  }
54081
54293
 
54294
+ const context = /*#__PURE__*/createContext(null);
54295
+ context.displayName = 'CardHeaderContext';
54296
+
54082
54297
  /**
54083
54298
  * Returns a ref that is immediately updated with the new value
54084
54299
  *
@@ -54180,6 +54395,46 @@ function useTimeout() {
54180
54395
  }, []);
54181
54396
  }
54182
54397
 
54398
+ var toArray = Function.prototype.bind.call(Function.prototype.call, [].slice);
54399
+ /**
54400
+ * Runs `querySelectorAll` on a given element.
54401
+ *
54402
+ * @param element the element
54403
+ * @param selector the selector
54404
+ */
54405
+
54406
+ function qsa(element, selector) {
54407
+ return toArray(element.querySelectorAll(selector));
54408
+ }
54409
+
54410
+ /**
54411
+ * Returns a function that triggers a component update. the hook equivalent to
54412
+ * `this.forceUpdate()` in a class component. In most cases using a state value directly
54413
+ * is preferable but may be required in some advanced usages of refs for interop or
54414
+ * when direct DOM manipulation is required.
54415
+ *
54416
+ * ```ts
54417
+ * const forceUpdate = useForceUpdate();
54418
+ *
54419
+ * const updateOnClick = useCallback(() => {
54420
+ * forceUpdate()
54421
+ * }, [forceUpdate])
54422
+ *
54423
+ * return <button type="button" onClick={updateOnClick}>Hi there</button>
54424
+ * ```
54425
+ */
54426
+
54427
+ function useForceUpdate() {
54428
+ // The toggling state value is designed to defeat React optimizations for skipping
54429
+ // updates when they are stricting equal to the last state value
54430
+ var _useReducer = useReducer(function (state) {
54431
+ return !state;
54432
+ }, false),
54433
+ dispatch = _useReducer[1];
54434
+
54435
+ return dispatch;
54436
+ }
54437
+
54183
54438
  var has$2 = Object.prototype.hasOwnProperty;
54184
54439
 
54185
54440
  function find(iter, tar, key) {
@@ -54640,17 +54895,7 @@ function effect(_ref2) {
54640
54895
  }
54641
54896
  }
54642
54897
 
54643
- if (process.env.NODE_ENV !== "production") {
54644
- if (!isHTMLElement(arrowElement)) {
54645
- 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(' '));
54646
- }
54647
- }
54648
-
54649
54898
  if (!contains(state.elements.popper, arrowElement)) {
54650
- if (process.env.NODE_ENV !== "production") {
54651
- console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
54652
- }
54653
-
54654
54899
  return;
54655
54900
  }
54656
54901
 
@@ -54792,17 +55037,6 @@ function computeStyles(_ref5) {
54792
55037
  adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
54793
55038
  _options$roundOffsets = options.roundOffsets,
54794
55039
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
54795
-
54796
- if (process.env.NODE_ENV !== "production") {
54797
- var transitionProperty = getComputedStyle$1(state.elements.popper).transitionProperty || '';
54798
-
54799
- if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
54800
- return transitionProperty.indexOf(property) >= 0;
54801
- })) {
54802
- 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(' '));
54803
- }
54804
- }
54805
-
54806
55040
  var commonStyles = {
54807
55041
  placement: getBasePlacement(state.placement),
54808
55042
  variation: getVariation(state.placement),
@@ -55243,10 +55477,6 @@ function computeAutoPlacement(state, options) {
55243
55477
 
55244
55478
  if (allowedPlacements.length === 0) {
55245
55479
  allowedPlacements = placements$1;
55246
-
55247
- if (process.env.NODE_ENV !== "production") {
55248
- 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(' '));
55249
- }
55250
55480
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
55251
55481
 
55252
55482
 
@@ -55798,108 +56028,6 @@ function debounce(fn) {
55798
56028
  };
55799
56029
  }
55800
56030
 
55801
- function format(str) {
55802
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
55803
- args[_key - 1] = arguments[_key];
55804
- }
55805
-
55806
- return [].concat(args).reduce(function (p, c) {
55807
- return p.replace(/%s/, c);
55808
- }, str);
55809
- }
55810
-
55811
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
55812
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
55813
- var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
55814
- function validateModifiers(modifiers) {
55815
- modifiers.forEach(function (modifier) {
55816
- [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
55817
- .filter(function (value, index, self) {
55818
- return self.indexOf(value) === index;
55819
- }).forEach(function (key) {
55820
- switch (key) {
55821
- case 'name':
55822
- if (typeof modifier.name !== 'string') {
55823
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
55824
- }
55825
-
55826
- break;
55827
-
55828
- case 'enabled':
55829
- if (typeof modifier.enabled !== 'boolean') {
55830
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
55831
- }
55832
-
55833
- break;
55834
-
55835
- case 'phase':
55836
- if (modifierPhases.indexOf(modifier.phase) < 0) {
55837
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
55838
- }
55839
-
55840
- break;
55841
-
55842
- case 'fn':
55843
- if (typeof modifier.fn !== 'function') {
55844
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
55845
- }
55846
-
55847
- break;
55848
-
55849
- case 'effect':
55850
- if (modifier.effect != null && typeof modifier.effect !== 'function') {
55851
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
55852
- }
55853
-
55854
- break;
55855
-
55856
- case 'requires':
55857
- if (modifier.requires != null && !Array.isArray(modifier.requires)) {
55858
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
55859
- }
55860
-
55861
- break;
55862
-
55863
- case 'requiresIfExists':
55864
- if (!Array.isArray(modifier.requiresIfExists)) {
55865
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
55866
- }
55867
-
55868
- break;
55869
-
55870
- case 'options':
55871
- case 'data':
55872
- break;
55873
-
55874
- default:
55875
- console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
55876
- return "\"" + s + "\"";
55877
- }).join(', ') + "; but \"" + key + "\" was provided.");
55878
- }
55879
-
55880
- modifier.requires && modifier.requires.forEach(function (requirement) {
55881
- if (modifiers.find(function (mod) {
55882
- return mod.name === requirement;
55883
- }) == null) {
55884
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
55885
- }
55886
- });
55887
- });
55888
- });
55889
- }
55890
-
55891
- function uniqueBy(arr, fn) {
55892
- var identifiers = new Set();
55893
- return arr.filter(function (item) {
55894
- var identifier = fn(item);
55895
-
55896
- if (!identifiers.has(identifier)) {
55897
- identifiers.add(identifier);
55898
- return true;
55899
- }
55900
- });
55901
- }
55902
-
55903
56031
  function mergeByName(modifiers) {
55904
56032
  var merged = modifiers.reduce(function (merged, current) {
55905
56033
  var existing = merged[current.name];
@@ -55915,8 +56043,6 @@ function mergeByName(modifiers) {
55915
56043
  });
55916
56044
  }
55917
56045
 
55918
- var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
55919
- 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.';
55920
56046
  var DEFAULT_OPTIONS = {
55921
56047
  placement: 'bottom',
55922
56048
  modifiers: [],
@@ -55978,42 +56104,7 @@ function popperGenerator(generatorOptions) {
55978
56104
 
55979
56105
  state.orderedModifiers = orderedModifiers.filter(function (m) {
55980
56106
  return m.enabled;
55981
- }); // Validate the provided modifiers so that the consumer will get warned
55982
- // if one of the modifiers is invalid for any reason
55983
-
55984
- if (process.env.NODE_ENV !== "production") {
55985
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
55986
- var name = _ref.name;
55987
- return name;
55988
- });
55989
- validateModifiers(modifiers);
55990
-
55991
- if (getBasePlacement(state.options.placement) === auto) {
55992
- var flipModifier = state.orderedModifiers.find(function (_ref2) {
55993
- var name = _ref2.name;
55994
- return name === 'flip';
55995
- });
55996
-
55997
- if (!flipModifier) {
55998
- console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
55999
- }
56000
- }
56001
-
56002
- var _getComputedStyle = getComputedStyle$1(popper),
56003
- marginTop = _getComputedStyle.marginTop,
56004
- marginRight = _getComputedStyle.marginRight,
56005
- marginBottom = _getComputedStyle.marginBottom,
56006
- marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
56007
- // cause bugs with positioning, so we'll warn the consumer
56008
-
56009
-
56010
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
56011
- return parseFloat(margin);
56012
- })) {
56013
- 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(' '));
56014
- }
56015
- }
56016
-
56107
+ });
56017
56108
  runModifierEffects();
56018
56109
  return instance.update();
56019
56110
  },
@@ -56033,10 +56124,6 @@ function popperGenerator(generatorOptions) {
56033
56124
  // anymore
56034
56125
 
56035
56126
  if (!areValidElements(reference, popper)) {
56036
- if (process.env.NODE_ENV !== "production") {
56037
- console.error(INVALID_ELEMENT_ERROR);
56038
- }
56039
-
56040
56127
  return;
56041
56128
  } // Store the reference and popper rects to be read by modifiers
56042
56129
 
@@ -56059,18 +56146,8 @@ function popperGenerator(generatorOptions) {
56059
56146
  state.orderedModifiers.forEach(function (modifier) {
56060
56147
  return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
56061
56148
  });
56062
- var __debug_loops__ = 0;
56063
56149
 
56064
56150
  for (var index = 0; index < state.orderedModifiers.length; index++) {
56065
- if (process.env.NODE_ENV !== "production") {
56066
- __debug_loops__ += 1;
56067
-
56068
- if (__debug_loops__ > 100) {
56069
- console.error(INFINITE_LOOP_ERROR);
56070
- break;
56071
- }
56072
- }
56073
-
56074
56151
  if (state.reset === true) {
56075
56152
  state.reset = false;
56076
56153
  index = -1;
@@ -56108,10 +56185,6 @@ function popperGenerator(generatorOptions) {
56108
56185
  };
56109
56186
 
56110
56187
  if (!areValidElements(reference, popper)) {
56111
- if (process.env.NODE_ENV !== "production") {
56112
- console.error(INVALID_ELEMENT_ERROR);
56113
- }
56114
-
56115
56188
  return instance;
56116
56189
  }
56117
56190
 
@@ -56126,11 +56199,11 @@ function popperGenerator(generatorOptions) {
56126
56199
  // one.
56127
56200
 
56128
56201
  function runModifierEffects() {
56129
- state.orderedModifiers.forEach(function (_ref3) {
56130
- var name = _ref3.name,
56131
- _ref3$options = _ref3.options,
56132
- options = _ref3$options === void 0 ? {} : _ref3$options,
56133
- effect = _ref3.effect;
56202
+ state.orderedModifiers.forEach(function (_ref) {
56203
+ var name = _ref.name,
56204
+ _ref$options = _ref.options,
56205
+ options = _ref$options === void 0 ? {} : _ref$options,
56206
+ effect = _ref.effect;
56134
56207
 
56135
56208
  if (typeof effect === 'function') {
56136
56209
  var cleanupFn = effect({
@@ -56164,8 +56237,8 @@ const createPopper = popperGenerator({
56164
56237
  defaultModifiers: [hide$1, popperOffsets$1, computeStyles$1, eventListeners, offset$1, flip$1, preventOverflow$1, arrow$1]
56165
56238
  });
56166
56239
 
56167
- const _excluded = ["enabled", "placement", "strategy", "modifiers"];
56168
- function _objectWithoutPropertiesLoose$2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
56240
+ const _excluded$2 = ["enabled", "placement", "strategy", "modifiers"];
56241
+ function _objectWithoutPropertiesLoose$4(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
56169
56242
  const disabledApplyStylesModifier = {
56170
56243
  name: 'applyStyles',
56171
56244
  enabled: false,
@@ -56232,7 +56305,7 @@ function usePopper(referenceElement, popperElement, _ref = {}) {
56232
56305
  strategy = 'absolute',
56233
56306
  modifiers = EMPTY_MODIFIERS
56234
56307
  } = _ref,
56235
- config = _objectWithoutPropertiesLoose$2(_ref, _excluded);
56308
+ config = _objectWithoutPropertiesLoose$4(_ref, _excluded$2);
56236
56309
  const prevModifiers = useRef(modifiers);
56237
56310
  const popperInstanceRef = useRef();
56238
56311
  const update = useCallback(() => {
@@ -56442,12 +56515,16 @@ function useClickOutside(ref, onClickOutside = noop$1, {
56442
56515
  }
56443
56516
  });
56444
56517
  useEffect(() => {
56518
+ var _ownerWindow$event, _ownerWindow$parent;
56445
56519
  if (disabled || ref == null) return undefined;
56446
56520
  const doc = ownerDocument(getRefTarget(ref));
56521
+ const ownerWindow = doc.defaultView || window;
56447
56522
 
56448
56523
  // Store the current event to avoid triggering handlers immediately
56524
+ // For things rendered in an iframe, the event might originate on the parent window
56525
+ // so we should fall back to that global event if the local one doesn't exist
56449
56526
  // https://github.com/facebook/react/issues/20074
56450
- let currentEvent = (doc.defaultView || window).event;
56527
+ let currentEvent = (_ownerWindow$event = ownerWindow.event) != null ? _ownerWindow$event : (_ownerWindow$parent = ownerWindow.parent) == null ? void 0 : _ownerWindow$parent.event;
56451
56528
  let removeInitialTriggerListener = null;
56452
56529
  if (InitialTriggerEvents[clickTrigger]) {
56453
56530
  removeInitialTriggerListener = listen(doc, InitialTriggerEvents[clickTrigger], handleInitialMouse, true);
@@ -56542,6 +56619,24 @@ function mergeOptionsWithPopperConfig({
56542
56619
  });
56543
56620
  }
56544
56621
 
56622
+ const SelectableContext = /*#__PURE__*/createContext(null);
56623
+ const makeEventKey = (eventKey, href = null) => {
56624
+ if (eventKey != null) return String(eventKey);
56625
+ return href || null;
56626
+ };
56627
+
56628
+ const NavContext = /*#__PURE__*/createContext(null);
56629
+ NavContext.displayName = 'NavContext';
56630
+
56631
+ const ATTRIBUTE_PREFIX = `data-rr-ui-`;
56632
+ const PROPERTY_PREFIX = `rrUi`;
56633
+ function dataAttr(property) {
56634
+ return `${ATTRIBUTE_PREFIX}${property}`;
56635
+ }
56636
+ function dataProp(property) {
56637
+ return `${PROPERTY_PREFIX}${property}`;
56638
+ }
56639
+
56545
56640
  const Context = /*#__PURE__*/createContext(canUseDOM ? window : undefined);
56546
56641
 
56547
56642
  /**
@@ -56554,6 +56649,198 @@ function useWindow() {
56554
56649
  return useContext(Context);
56555
56650
  }
56556
56651
 
56652
+ // TODO: check
56653
+
56654
+ const context$1 = /*#__PURE__*/createContext(null);
56655
+ context$1.displayName = 'NavbarContext';
56656
+
56657
+ const TabContext = /*#__PURE__*/createContext(null);
56658
+
56659
+ const _excluded$3 = ["as", "active", "eventKey"];
56660
+ function _objectWithoutPropertiesLoose$5(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
56661
+ function useNavItem({
56662
+ key,
56663
+ onClick,
56664
+ active,
56665
+ id,
56666
+ role,
56667
+ disabled
56668
+ }) {
56669
+ const parentOnSelect = useContext(SelectableContext);
56670
+ const navContext = useContext(NavContext);
56671
+ const tabContext = useContext(TabContext);
56672
+ let isActive = active;
56673
+ const props = {
56674
+ role
56675
+ };
56676
+ if (navContext) {
56677
+ if (!role && navContext.role === 'tablist') props.role = 'tab';
56678
+ const contextControllerId = navContext.getControllerId(key != null ? key : null);
56679
+ const contextControlledId = navContext.getControlledId(key != null ? key : null);
56680
+
56681
+ // @ts-ignore
56682
+ props[dataAttr('event-key')] = key;
56683
+ props.id = contextControllerId || id;
56684
+ isActive = active == null && key != null ? navContext.activeKey === key : active;
56685
+
56686
+ /**
56687
+ * Simplified scenario for `mountOnEnter`.
56688
+ *
56689
+ * While it would make sense to keep 'aria-controls' for tabs that have been mounted at least
56690
+ * once, it would also complicate the code quite a bit, for very little gain.
56691
+ * The following implementation is probably good enough.
56692
+ *
56693
+ * @see https://github.com/react-restart/ui/pull/40#issuecomment-1009971561
56694
+ */
56695
+ if (isActive || !(tabContext != null && tabContext.unmountOnExit) && !(tabContext != null && tabContext.mountOnEnter)) props['aria-controls'] = contextControlledId;
56696
+ }
56697
+ if (props.role === 'tab') {
56698
+ props['aria-selected'] = isActive;
56699
+ if (!isActive) {
56700
+ props.tabIndex = -1;
56701
+ }
56702
+ if (disabled) {
56703
+ props.tabIndex = -1;
56704
+ props['aria-disabled'] = true;
56705
+ }
56706
+ }
56707
+ props.onClick = useEventCallback(e => {
56708
+ if (disabled) return;
56709
+ onClick == null ? void 0 : onClick(e);
56710
+ if (key == null) {
56711
+ return;
56712
+ }
56713
+ if (parentOnSelect && !e.isPropagationStopped()) {
56714
+ parentOnSelect(key, e);
56715
+ }
56716
+ });
56717
+ return [props, {
56718
+ isActive
56719
+ }];
56720
+ }
56721
+ const NavItem = /*#__PURE__*/forwardRef((_ref, ref) => {
56722
+ let {
56723
+ as: Component = Button,
56724
+ active,
56725
+ eventKey
56726
+ } = _ref,
56727
+ options = _objectWithoutPropertiesLoose$5(_ref, _excluded$3);
56728
+ const [props, meta] = useNavItem(Object.assign({
56729
+ key: makeEventKey(eventKey, options.href),
56730
+ active
56731
+ }, options));
56732
+
56733
+ // @ts-ignore
56734
+ props[dataAttr('active')] = meta.isActive;
56735
+ return /*#__PURE__*/jsx(Component, Object.assign({}, options, props, {
56736
+ ref: ref
56737
+ }));
56738
+ });
56739
+ NavItem.displayName = 'NavItem';
56740
+
56741
+ const _excluded$4 = ["as", "onSelect", "activeKey", "role", "onKeyDown"];
56742
+ function _objectWithoutPropertiesLoose$6(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
56743
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
56744
+ const noop$2 = () => {};
56745
+ const EVENT_KEY_ATTR = dataAttr('event-key');
56746
+ const Nav = /*#__PURE__*/forwardRef((_ref, ref) => {
56747
+ let {
56748
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
56749
+ as: Component = 'div',
56750
+ onSelect,
56751
+ activeKey,
56752
+ role,
56753
+ onKeyDown
56754
+ } = _ref,
56755
+ props = _objectWithoutPropertiesLoose$6(_ref, _excluded$4);
56756
+ // A ref and forceUpdate for refocus, b/c we only want to trigger when needed
56757
+ // and don't want to reset the set in the effect
56758
+ const forceUpdate = useForceUpdate();
56759
+ const needsRefocusRef = useRef(false);
56760
+ const parentOnSelect = useContext(SelectableContext);
56761
+ const tabContext = useContext(TabContext);
56762
+ let getControlledId, getControllerId;
56763
+ if (tabContext) {
56764
+ role = role || 'tablist';
56765
+ activeKey = tabContext.activeKey;
56766
+ // TODO: do we need to duplicate these?
56767
+ getControlledId = tabContext.getControlledId;
56768
+ getControllerId = tabContext.getControllerId;
56769
+ }
56770
+ const listNode = useRef(null);
56771
+ const getNextActiveTab = offset => {
56772
+ const currentListNode = listNode.current;
56773
+ if (!currentListNode) return null;
56774
+ const items = qsa(currentListNode, `[${EVENT_KEY_ATTR}]:not([aria-disabled=true])`);
56775
+ const activeChild = currentListNode.querySelector('[aria-selected=true]');
56776
+ if (!activeChild || activeChild !== document.activeElement) return null;
56777
+ const index = items.indexOf(activeChild);
56778
+ if (index === -1) return null;
56779
+ let nextIndex = index + offset;
56780
+ if (nextIndex >= items.length) nextIndex = 0;
56781
+ if (nextIndex < 0) nextIndex = items.length - 1;
56782
+ return items[nextIndex];
56783
+ };
56784
+ const handleSelect = (key, event) => {
56785
+ if (key == null) return;
56786
+ onSelect == null ? void 0 : onSelect(key, event);
56787
+ parentOnSelect == null ? void 0 : parentOnSelect(key, event);
56788
+ };
56789
+ const handleKeyDown = event => {
56790
+ onKeyDown == null ? void 0 : onKeyDown(event);
56791
+ if (!tabContext) {
56792
+ return;
56793
+ }
56794
+ let nextActiveChild;
56795
+ switch (event.key) {
56796
+ case 'ArrowLeft':
56797
+ case 'ArrowUp':
56798
+ nextActiveChild = getNextActiveTab(-1);
56799
+ break;
56800
+ case 'ArrowRight':
56801
+ case 'ArrowDown':
56802
+ nextActiveChild = getNextActiveTab(1);
56803
+ break;
56804
+ default:
56805
+ return;
56806
+ }
56807
+ if (!nextActiveChild) return;
56808
+ event.preventDefault();
56809
+ handleSelect(nextActiveChild.dataset[dataProp('EventKey')] || null, event);
56810
+ needsRefocusRef.current = true;
56811
+ forceUpdate();
56812
+ };
56813
+ useEffect(() => {
56814
+ if (listNode.current && needsRefocusRef.current) {
56815
+ const activeChild = listNode.current.querySelector(`[${EVENT_KEY_ATTR}][aria-selected=true]`);
56816
+ activeChild == null ? void 0 : activeChild.focus();
56817
+ }
56818
+ needsRefocusRef.current = false;
56819
+ });
56820
+ const mergedRef = useMergedRefs(ref, listNode);
56821
+ return /*#__PURE__*/jsx(SelectableContext.Provider, {
56822
+ value: handleSelect,
56823
+ children: /*#__PURE__*/jsx(NavContext.Provider, {
56824
+ value: {
56825
+ role,
56826
+ // used by NavLink to determine it's role
56827
+ activeKey: makeEventKey(activeKey),
56828
+ getControlledId: getControlledId || noop$2,
56829
+ getControllerId: getControllerId || noop$2
56830
+ },
56831
+ children: /*#__PURE__*/jsx(Component, Object.assign({}, props, {
56832
+ onKeyDown: handleKeyDown,
56833
+ ref: mergedRef,
56834
+ role: role
56835
+ }))
56836
+ })
56837
+ });
56838
+ });
56839
+ Nav.displayName = 'Nav';
56840
+ var BaseNav = Object.assign(Nav, {
56841
+ Item: NavItem
56842
+ });
56843
+
56557
56844
  const resolveContainerRef = (ref, document) => {
56558
56845
  if (!canUseDOM) return null;
56559
56846
  if (ref == null) return (document || ownerDocument()).body;
@@ -56713,7 +57000,179 @@ function hasClass(element, className) {
56713
57000
  return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
56714
57001
  }
56715
57002
 
56716
- const noop$2 = () => {};
57003
+ var createChainableTypeChecker_1 = createCommonjsModule(function (module, exports) {
57004
+
57005
+ Object.defineProperty(exports, "__esModule", {
57006
+ value: true
57007
+ });
57008
+ exports.default = createChainableTypeChecker;
57009
+ /**
57010
+ * Copyright 2013-present, Facebook, Inc.
57011
+ * All rights reserved.
57012
+ *
57013
+ * This source code is licensed under the BSD-style license found in the
57014
+ * LICENSE file in the root directory of this source tree. An additional grant
57015
+ * of patent rights can be found in the PATENTS file in the same directory.
57016
+ */
57017
+
57018
+ // Mostly taken from ReactPropTypes.
57019
+
57020
+ function createChainableTypeChecker(validate) {
57021
+ function checkType(isRequired, props, propName, componentName, location, propFullName) {
57022
+ var componentNameSafe = componentName || '<<anonymous>>';
57023
+ var propFullNameSafe = propFullName || propName;
57024
+
57025
+ if (props[propName] == null) {
57026
+ if (isRequired) {
57027
+ return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
57028
+ }
57029
+
57030
+ return null;
57031
+ }
57032
+
57033
+ for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
57034
+ args[_key - 6] = arguments[_key];
57035
+ }
57036
+
57037
+ return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
57038
+ }
57039
+
57040
+ var chainedCheckType = checkType.bind(null, false);
57041
+ chainedCheckType.isRequired = checkType.bind(null, true);
57042
+
57043
+ return chainedCheckType;
57044
+ }
57045
+ module.exports = exports['default'];
57046
+ });
57047
+
57048
+ unwrapExports(createChainableTypeChecker_1);
57049
+
57050
+ var all_1 = createCommonjsModule(function (module, exports) {
57051
+
57052
+ Object.defineProperty(exports, "__esModule", {
57053
+ value: true
57054
+ });
57055
+ exports.default = all;
57056
+
57057
+
57058
+
57059
+ var _createChainableTypeChecker2 = _interopRequireDefault(createChainableTypeChecker_1);
57060
+
57061
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57062
+
57063
+ function all() {
57064
+ for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
57065
+ validators[_key] = arguments[_key];
57066
+ }
57067
+
57068
+ function allPropTypes() {
57069
+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
57070
+ args[_key2] = arguments[_key2];
57071
+ }
57072
+
57073
+ var error = null;
57074
+
57075
+ validators.forEach(function (validator) {
57076
+ if (error != null) {
57077
+ return;
57078
+ }
57079
+
57080
+ var result = validator.apply(undefined, args);
57081
+ if (result != null) {
57082
+ error = result;
57083
+ }
57084
+ });
57085
+
57086
+ return error;
57087
+ }
57088
+
57089
+ return (0, _createChainableTypeChecker2.default)(allPropTypes);
57090
+ }
57091
+ module.exports = exports['default'];
57092
+ });
57093
+
57094
+ unwrapExports(all_1);
57095
+
57096
+ var NavItem$1 = createWithBsPrefix('nav-item');
57097
+
57098
+ const NavLink = /*#__PURE__*/forwardRef(({
57099
+ bsPrefix,
57100
+ className,
57101
+ as: Component = Anchor,
57102
+ active,
57103
+ eventKey,
57104
+ disabled = false,
57105
+ ...props
57106
+ }, ref) => {
57107
+ bsPrefix = useBootstrapPrefix(bsPrefix, 'nav-link');
57108
+ const [navItemProps, meta] = useNavItem({
57109
+ key: makeEventKey(eventKey, props.href),
57110
+ active,
57111
+ disabled,
57112
+ ...props
57113
+ });
57114
+ return /*#__PURE__*/jsx(Component, {
57115
+ ...props,
57116
+ ...navItemProps,
57117
+ ref: ref,
57118
+ disabled: disabled,
57119
+ className: classnames(className, bsPrefix, disabled && 'disabled', meta.isActive && 'active')
57120
+ });
57121
+ });
57122
+ NavLink.displayName = 'NavLink';
57123
+
57124
+ const Nav$1 = /*#__PURE__*/forwardRef((uncontrolledProps, ref) => {
57125
+ const {
57126
+ as = 'div',
57127
+ bsPrefix: initialBsPrefix,
57128
+ variant,
57129
+ fill = false,
57130
+ justify = false,
57131
+ navbar,
57132
+ navbarScroll,
57133
+ className,
57134
+ activeKey,
57135
+ ...props
57136
+ } = useUncontrolled(uncontrolledProps, {
57137
+ activeKey: 'onSelect'
57138
+ });
57139
+ const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'nav');
57140
+ let navbarBsPrefix;
57141
+ let cardHeaderBsPrefix;
57142
+ let isNavbar = false;
57143
+ const navbarContext = useContext(context$1);
57144
+ const cardHeaderContext = useContext(context);
57145
+ if (navbarContext) {
57146
+ navbarBsPrefix = navbarContext.bsPrefix;
57147
+ isNavbar = navbar == null ? true : navbar;
57148
+ } else if (cardHeaderContext) {
57149
+ ({
57150
+ cardHeaderBsPrefix
57151
+ } = cardHeaderContext);
57152
+ }
57153
+ return /*#__PURE__*/jsx(BaseNav, {
57154
+ as: as,
57155
+ ref: ref,
57156
+ activeKey: activeKey,
57157
+ className: classnames(className, {
57158
+ [bsPrefix]: !isNavbar,
57159
+ [`${navbarBsPrefix}-nav`]: isNavbar,
57160
+ [`${navbarBsPrefix}-nav-scroll`]: isNavbar && navbarScroll,
57161
+ [`${cardHeaderBsPrefix}-${variant}`]: !!cardHeaderBsPrefix,
57162
+ [`${bsPrefix}-${variant}`]: !!variant,
57163
+ [`${bsPrefix}-fill`]: fill,
57164
+ [`${bsPrefix}-justified`]: justify
57165
+ }),
57166
+ ...props
57167
+ });
57168
+ });
57169
+ Nav$1.displayName = 'Nav';
57170
+ var Nav$2 = Object.assign(Nav$1, {
57171
+ Item: NavItem$1,
57172
+ Link: NavLink
57173
+ });
57174
+
57175
+ const noop$3 = () => {};
56717
57176
  /**
56718
57177
  * The `useRootClose` hook registers your callback on the document
56719
57178
  * when rendered. Powers the `<Overlay/>` component. This is used achieve modal
@@ -56730,7 +57189,7 @@ function useRootClose(ref, onRootClose, {
56730
57189
  disabled,
56731
57190
  clickTrigger
56732
57191
  } = {}) {
56733
- const onClose = onRootClose || noop$2;
57192
+ const onClose = onRootClose || noop$3;
56734
57193
  useClickOutside(ref, onClose, {
56735
57194
  disabled,
56736
57195
  clickTrigger
@@ -57153,12 +57612,12 @@ function OverlayTrigger({
57153
57612
  });
57154
57613
  }
57155
57614
 
57156
- var styles$5 = {"vitro-action-handler":"_action-handler_vitro-action-handler_1_HNxCd","vitro-icon-before":"_action-handler_vitro-icon-before_3vTdV08","vitro-icon-progress":"_action-handler_vitro-icon-progress_28liEuB","vitro-icon-success":"_action-handler_vitro-icon-success_1jnQDIv","vitro-icon-error":"_action-handler_vitro-icon-error_3OPWhCB","vitro-button-close":"_action-handler_vitro-button-close_33qzSIU","vitro-flex":"_action-handler_vitro-flex_3Pyc7fz"};
57615
+ var styles$5 = {"vitro-action-handler":"_action-handler_vitro-action-handler_1_HNxCd","vitro-icon-before":"_action-handler_vitro-icon-before_3vTdV08","vitro-icon-progress":"_action-handler_vitro-icon-progress_28liEuB","vitro-icon-success":"_action-handler_vitro-icon-success_1jnQDIv","vitro-icon-error":"_action-handler_vitro-icon-error_3OPWhCB","vitro-button-close":"_action-handler_vitro-button-close_33qzSIU","vitro-flex":"_action-handler_vitro-flex_3Pyc7fz","vitro-interface-blur":"_action-handler_vitro-interface-blur_e0d8w42"};
57157
57616
 
57158
- var _excluded$1 = ["popper", "children", "show"];
57617
+ var _excluded$5 = ["popper", "children", "show"];
57159
57618
  var UpdatingPopover = React__default.forwardRef(function (_ref, ref) {
57160
57619
  var children = _ref.children,
57161
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
57620
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
57162
57621
  return React__default.createElement("div", {
57163
57622
  className: styles$5["vitro-action-handler"]
57164
57623
  }, React__default.createElement(Popover$1, Object.assign({
@@ -57222,26 +57681,29 @@ var ActionHandler = function ActionHandler(props) {
57222
57681
  var _useState3 = useState(false),
57223
57682
  show = _useState3[0],
57224
57683
  setShow = _useState3[1];
57225
- var _useState4 = useState(actionMap.before),
57226
- currentAction = _useState4[0],
57227
- setCurrentAction = _useState4[1];
57228
- var _useState5 = useState(null),
57229
- icon = _useState5[0],
57230
- setIcon = _useState5[1];
57684
+ var _useState4 = useState(false),
57685
+ blockInterface = _useState4[0],
57686
+ setBlockInterface = _useState4[1];
57687
+ var _useState5 = useState(actionMap.before),
57688
+ currentAction = _useState5[0],
57689
+ setCurrentAction = _useState5[1];
57690
+ var _useState6 = useState(null),
57691
+ icon = _useState6[0],
57692
+ setIcon = _useState6[1];
57231
57693
  var localeService = useInjection(SERVICE.LOCALE);
57232
57694
  useEffect(function () {
57233
- setIsCloseByOutsideClick(true);
57695
+ setIsCloseByOutsideClick(currentAction !== actionMap.progress);
57234
57696
  if (currentAction === actionMap.before) setIcon(styles$5['vitro-icon-before']);
57235
57697
  if (currentAction === actionMap.progress) {
57236
57698
  setIcon(styles$5['vitro-icon-progress']);
57237
57699
  }
57238
57700
  }, [currentAction]);
57239
57701
  useEffect(function () {
57240
- if (!props.showProgress && !props.showAfterAction && !props.isConfirm) {
57702
+ if (!props.isShowProgress && !props.isShowAfterAction && !props.isConfirm) {
57241
57703
  onStart();
57242
57704
  } else {
57243
- if (props.show) {
57244
- setShow(props.show);
57705
+ if (props.isShow) {
57706
+ setShow(props.isShow);
57245
57707
  if (props.isConfirm) {
57246
57708
  init();
57247
57709
  } else {
@@ -57281,7 +57743,7 @@ var ActionHandler = function ActionHandler(props) {
57281
57743
  if (props.onAfterAction) {
57282
57744
  props.onAfterAction(error, successResult, failResult);
57283
57745
  }
57284
- if (!props.showAfterAction) {
57746
+ if (!props.isShowAfterAction) {
57285
57747
  window.document.body.click();
57286
57748
  return;
57287
57749
  }
@@ -57289,6 +57751,9 @@ var ActionHandler = function ActionHandler(props) {
57289
57751
  if (props.onAfterActionClose) {
57290
57752
  props.onAfterActionClose(error, successResult, failResult);
57291
57753
  }
57754
+ if (props.isBlockInterface) {
57755
+ setBlockInterface(false);
57756
+ }
57292
57757
  window.document.body.click();
57293
57758
  }, props.durationMs || 2000);
57294
57759
  setIcon(success ? styles$5['vitro-icon-success'] : styles$5['vitro-icon-error']);
@@ -57340,7 +57805,10 @@ var ActionHandler = function ActionHandler(props) {
57340
57805
  }
57341
57806
  }
57342
57807
  setCurrentAction(actionMap.progress);
57343
- if (!props.showProgress && !props.showAfterAction && !props.isConfirm) {
57808
+ if (props.isBlockInterface) {
57809
+ setBlockInterface(true);
57810
+ }
57811
+ if (!props.isShowProgress && !props.isShowAfterAction && !props.isConfirm) {
57344
57812
  setIsCloseByOutsideClick(true);
57345
57813
  window.document.body.click();
57346
57814
  }
@@ -57385,7 +57853,7 @@ var ActionHandler = function ActionHandler(props) {
57385
57853
  }
57386
57854
  };
57387
57855
  var onEnter = function onEnter() {
57388
- if (!props.showProgress && !props.showAfterAction && !props.isConfirm) {
57856
+ if (!props.isShowProgress && !props.isShowAfterAction && !props.isConfirm) {
57389
57857
  window.document.body.click();
57390
57858
  }
57391
57859
  if (currentAction !== actionMap.progress) {
@@ -57400,6 +57868,11 @@ var ActionHandler = function ActionHandler(props) {
57400
57868
  window.document.body.click();
57401
57869
  }
57402
57870
  };
57871
+ var onHide = function onHide() {
57872
+ if (isCloseByOutsideClick) {
57873
+ setShow(false);
57874
+ }
57875
+ };
57403
57876
  var showButtonGroup = props.isConfirm && (currentAction === actionMap.before || currentAction === actionMap.progress && itemCount > 1);
57404
57877
  return React__default.createElement(React__default.Fragment, null, props.children && React__default.createElement(OverlayTrigger, {
57405
57878
  trigger: TRIGGER.CLICK,
@@ -57407,40 +57880,253 @@ var ActionHandler = function ActionHandler(props) {
57407
57880
  rootClose: isCloseByOutsideClick,
57408
57881
  placement: props.placement || PLACEMENT.TOP,
57409
57882
  overlay: React__default.createElement(UpdatingPopover, null, React__default.createElement("div", {
57410
- className: styles$5["vitro-flex"]
57883
+ className: styles$5['vitro-flex']
57411
57884
  }, icon && React__default.createElement("div", {
57412
57885
  className: icon
57413
- }), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button, {
57886
+ }), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button$1, {
57414
57887
  onClick: onStart,
57415
57888
  text: localeService.create(LOCALE.YES) || props.labelYes,
57416
57889
  disabled: currentAction !== actionMap.before
57417
- }), React__default.createElement(Button, {
57890
+ }), React__default.createElement(Button$1, {
57418
57891
  onClick: cancel,
57419
57892
  text: localeService.create(LOCALE.NO) || props.labelNo,
57420
- className: styles$5["vitro-button-close"]
57893
+ className: styles$5['vitro-button-close']
57421
57894
  })))
57422
57895
  }, React__default.createElement("div", null, props.children)), props.target && !props.children && React__default.createElement(Overlay$1, {
57423
57896
  show: show,
57424
57897
  target: props.target,
57425
57898
  rootClose: isCloseByOutsideClick,
57426
- onHide: function onHide() {
57427
- return setShow(false);
57428
- },
57899
+ onHide: onHide,
57429
57900
  placement: props.placement || PLACEMENT.TOP
57430
57901
  }, React__default.createElement(UpdatingPopover, null, React__default.createElement("div", {
57431
- className: styles$5["vitro-flex"]
57902
+ className: styles$5['vitro-flex']
57432
57903
  }, icon && React__default.createElement("div", {
57433
57904
  className: icon
57434
- }), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button, {
57905
+ }), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button$1, {
57435
57906
  onClick: onStart,
57436
57907
  text: localeService.create(LOCALE.YES) || props.labelYes,
57437
57908
  disabled: currentAction !== actionMap.before
57438
- }), React__default.createElement(Button, {
57909
+ }), React__default.createElement(Button$1, {
57439
57910
  onClick: cancel,
57440
57911
  text: localeService.create(LOCALE.NO) || props.labelNo,
57441
- className: styles$5["vitro-button-close"]
57442
- })))));
57912
+ className: styles$5['vitro-button-close']
57913
+ })))), blockInterface && React__default.createElement("div", {
57914
+ className: styles$5['vitro-interface-blur']
57915
+ }));
57916
+ };
57917
+
57918
+ var styles$6 = {"vitro-view-part":"_view-part_vitro-view-part_1jRQS_n"};
57919
+
57920
+ var ViewPart = function ViewPart(props) {
57921
+ var _useState = useState(null),
57922
+ component = _useState[0],
57923
+ setComponent = _useState[1];
57924
+ useEffect(function () {
57925
+ if (props.component) {
57926
+ var _component = React__default.createElement(props.component, props.props);
57927
+ setComponent(_component);
57928
+ } else {
57929
+ setComponent(null);
57930
+ }
57931
+ }, [props.component]);
57932
+ return React__default.createElement("div", {
57933
+ className: styles$6["vitro-view-part"]
57934
+ }, component);
57935
+ };
57936
+
57937
+ var styles$7 = {"vitro-view":"_view_vitro-view_1PIFv5i"};
57938
+
57939
+ var styles$8 = {"vitro-tab":"_tab-group_vitro-tab_1JjKD6A","vitro-item":"_tab-group_vitro-item_1rEUKKg","active":"_tab-group_active_1bm9FlF","vitro-dropdown-button":"_tab-group_vitro-dropdown-button_2khJUBS"};
57940
+
57941
+ var OverflowButton = function OverflowButton(props) {
57942
+ if (!props.list || !props.list.length) return null;
57943
+ return React__default.createElement(DropdownButton, {
57944
+ className: styles$8['vitro-dropdown-button'],
57945
+ itemList: props.list.map(function (x, i) {
57946
+ return _extends({}, x, {
57947
+ value: props.offset + i,
57948
+ key: x.text,
57949
+ onClick: function onClick() {
57950
+ return props.onSelect(props.offset + i);
57951
+ }
57952
+ });
57953
+ })
57954
+ });
57955
+ };
57956
+
57957
+ var Tab = function Tab(props) {
57958
+ return React__default.createElement("div", {
57959
+ key: props.index,
57960
+ className: styles$8['vitro-item']
57961
+ }, React__default.createElement(Nav$2.Item, {
57962
+ className: props.active ? styles$8['active'] : undefined,
57963
+ onClick: function onClick() {
57964
+ return props.onClick(props.index);
57965
+ }
57966
+ }, React__default.createElement(Nav$2.Link, {
57967
+ eventKey: props.eventKey
57968
+ }, React__default.createElement("span", null, props.icon && React__default.createElement(Image, {
57969
+ src: props.icon
57970
+ }), props.title))));
57971
+ };
57972
+
57973
+ var TabGroupHeader = function TabGroupHeader(props) {
57974
+ var overflowTabList = [];
57975
+ var tabMinWidth = 120;
57976
+ return React__default.createElement(Nav$2, null, props.width > 0 && props.itemList && props.itemList.map(function (item, index) {
57977
+ if ((index + 1) * tabMinWidth < props.width || !props.wrap) {
57978
+ return React__default.createElement(Tab, {
57979
+ key: item.text,
57980
+ index: index,
57981
+ active: index === props.currentTab,
57982
+ onClick: props.changeTab,
57983
+ eventKey: item.eventKey,
57984
+ icon: item.icon,
57985
+ title: item.text
57986
+ });
57987
+ }
57988
+ overflowTabList.push(item);
57989
+ return null;
57990
+ }), props.itemList && props.wrap && React__default.createElement(OverflowButton, {
57991
+ list: overflowTabList,
57992
+ offset: props.itemList.length - overflowTabList.length,
57993
+ onSelect: props.changeTab
57994
+ }));
57995
+ };
57996
+
57997
+ var w$3 = window;
57998
+ var TabGroupComponent = function TabGroupComponent(props) {
57999
+ var _useState = useState(0),
58000
+ width = _useState[0],
58001
+ setWidth = _useState[1];
58002
+ var _useState2 = useState(0),
58003
+ currentTab = _useState2[0],
58004
+ setCurrentTab = _useState2[1];
58005
+ var _useState3 = useState(null),
58006
+ component = _useState3[0],
58007
+ setComponent = _useState3[1];
58008
+ var changeTab = function changeTab(index) {
58009
+ setCurrentTab(index);
58010
+ if (props.onChange) {
58011
+ props.onChange(index);
58012
+ }
58013
+ };
58014
+ var ref = useRef(null);
58015
+ useEffect(function () {
58016
+ if (ref.current) {
58017
+ setWidth(ref.current.offsetWidth);
58018
+ if (props.wrap) {
58019
+ if (w$3.addResizeListener) {
58020
+ w$3.addResizeListener(ref.current, function () {
58021
+ return setWidth(ref.current.offsetWidth);
58022
+ });
58023
+ }
58024
+ }
58025
+ }
58026
+ }, [ref.current]);
58027
+ useEffect(function () {
58028
+ if (props.itemList) {
58029
+ if (props.itemList[currentTab] && props.itemList[currentTab].content) {
58030
+ var c = React__default.createElement(props.itemList[currentTab].content.component, props.itemList[currentTab].content.props);
58031
+ setComponent(c);
58032
+ } else if (props.itemList[0]) {
58033
+ setCurrentTab(0);
58034
+ }
58035
+ } else {
58036
+ setComponent(null);
58037
+ }
58038
+ }, [currentTab, props.itemList]);
58039
+ return React__default.createElement("div", {
58040
+ className: styles$8['vitro-tab'],
58041
+ ref: ref
58042
+ }, React__default.createElement(TabGroupHeader, {
58043
+ itemList: props.itemList,
58044
+ width: width,
58045
+ currentTab: currentTab,
58046
+ changeTab: changeTab,
58047
+ wrap: props.wrap
58048
+ }), React__default.createElement("div", {
58049
+ className: 'vitro-content'
58050
+ }, component));
58051
+ };
58052
+
58053
+ var tabScriptList = [{
58054
+ url: 'js/resizeEventListener.js',
58055
+ id: 'vitro-script-event-resizer'
58056
+ }, {
58057
+ url: 'js/perfect-scrollbar.min.js',
58058
+ id: 'vitro-script-perfect-scroll'
58059
+ }];
58060
+
58061
+ var TabGroup = function TabGroup(props) {
58062
+ var scriptList = tabScriptList;
58063
+ return props.wrap ? React__default.createElement(ScriptLoader, {
58064
+ urlList: scriptList.map(function (x) {
58065
+ return x.url;
58066
+ }),
58067
+ idList: scriptList.map(function (x) {
58068
+ return x.id;
58069
+ }),
58070
+ placeholder: props.placeholder
58071
+ }, React__default.createElement(TabGroupComponent, Object.assign({}, props))) : React__default.createElement(TabGroupComponent, Object.assign({}, props));
58072
+ };
58073
+
58074
+ var styles$9 = {"vitro-control":"_control-group_vitro-control_O12WSU5","vitro-control-row":"_control-group_vitro-control-row_3H0qlpT","vitro-label":"_control-group_vitro-label_3M058up"};
58075
+
58076
+ var ControlGroup = function ControlGroup(props) {
58077
+ if (props.horizontal) {
58078
+ return React__default.createElement("div", {
58079
+ className: 'container ' + styles$9['vitro-control']
58080
+ }, React__default.createElement("div", {
58081
+ className: props.as
58082
+ }, props.children));
58083
+ }
58084
+ return React__default.createElement("div", {
58085
+ className: styles$9['vitro-control-row']
58086
+ }, props.children);
58087
+ };
58088
+
58089
+ var View = function View(props) {
58090
+ var _useState = useState([]),
58091
+ tabList = _useState[0],
58092
+ setTabList = _useState[1];
58093
+ var createTabList = function createTabList(tabList) {
58094
+ return tabList.map(function (tab) {
58095
+ return {
58096
+ text: tab.text,
58097
+ content: {
58098
+ component: GetGroupControl,
58099
+ props: {
58100
+ item: props.item,
58101
+ componentList: tab.componentList
58102
+ }
58103
+ }
58104
+ };
58105
+ });
58106
+ };
58107
+ useEffect(function () {
58108
+ if (props.tabList) {
58109
+ setTabList(createTabList(props.tabList));
58110
+ }
58111
+ }, [props.tabList]);
58112
+ return tabList && React__default.createElement("div", {
58113
+ className: styles$7["vitro-view"]
58114
+ }, React__default.createElement(TabGroup, {
58115
+ itemList: tabList,
58116
+ wrap: true
58117
+ }));
58118
+ };
58119
+ var GetGroupControl = function GetGroupControl(props) {
58120
+ return React__default.createElement(ControlGroup, {
58121
+ horizontal: true
58122
+ }, props.componentList.map(function (viewPart) {
58123
+ return React__default.createElement(ViewPart, {
58124
+ component: viewPart.component,
58125
+ settings: viewPart.settings,
58126
+ props: props
58127
+ });
58128
+ }));
57443
58129
  };
57444
58130
 
57445
- export { ActionHandlerConstants as ACTION_HANDLER, ActionHandler, Breadcrumbs, ComponentLoader, ComponentLoaderContextImpl, MicroFrontend, TableViewConstants as TABLE_VIEW, TreeViewConstants as TREE_VIEW, TableView, TelerikUploader, TelerikUploaderContextImpl, TopLevelMenu, TreeView };
58131
+ export { ActionHandlerConstants as ACTION_HANDLER, ActionHandler, Breadcrumbs, ComponentLoader, ComponentLoaderContextImpl, ControlGroup, MicroFrontend, TableViewConstants as TABLE_VIEW, TreeViewConstants as TREE_VIEW, TabGroup, TableView, TelerikUploader, TelerikUploaderContextImpl, TopLevelMenu, TreeView, View };
57446
58132
  //# sourceMappingURL=index.modern.js.map