@vitrosoftware/common-ui-ts 1.0.10 → 1.1.12
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/css/common.css +18 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.eot +0 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.ttf +0 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.woff +0 -0
- package/css/third-party/jquery-contextMenu/font/context-menu-icons.woff2 +0 -0
- package/css/third-party/jquery-contextMenu/jquery.contextMenu.min.css +16 -0
- package/css/third-party/jquery-svg/jquery.svg.css +10 -0
- package/css/third-party/jquery-ui/jquery-ui.min.css +28 -0
- package/css/third-party/jquery-ui/jquery-ui.structure.css +886 -0
- package/css/third-party/jquery-ui/jquery-ui.theme.min.css +26 -0
- package/css/third-party/jquery-ui/ui-icons_444444_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_555555_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_777620_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_777777_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
- package/css/third-party/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- package/css/third-party/sweetalert2/sweetalert2.css +1154 -0
- package/css/white/controls/action-handler/action-handler.css +9 -0
- package/css/white/controls/control-group/control-group.css +27 -0
- package/css/white/controls/pdf-viewer/compare-side-by-side.css +260 -0
- package/css/white/controls/pdf-viewer/compare.css +504 -0
- package/css/white/controls/pdf-viewer/custom.css +339 -0
- package/css/white/controls/pdf-viewer/debugger.css +113 -0
- package/css/white/controls/pdf-viewer/form.css +133 -0
- package/css/white/controls/pdf-viewer/img/close-compare-viewer.png +0 -0
- package/css/white/controls/pdf-viewer/img/close-compare-viewer_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/compare-overlay.png +0 -0
- package/css/white/controls/pdf-viewer/img/compare-side-by-side.png +0 -0
- package/css/white/controls/pdf-viewer/img/delete-active.png +0 -0
- package/css/white/controls/pdf-viewer/img/delete.png +0 -0
- package/css/white/controls/pdf-viewer/img/dlg-compare-ico.png +0 -0
- package/css/white/controls/pdf-viewer/img/do-compare.png +0 -0
- package/css/white/controls/pdf-viewer/img/draw-annotation.png +0 -0
- package/css/white/controls/pdf-viewer/img/finish-align.png +0 -0
- package/css/white/controls/pdf-viewer/img/finish-align_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/fit-to-view.png +0 -0
- package/css/white/controls/pdf-viewer/img/fit-to-view_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/hide-annotation.png +0 -0
- package/css/white/controls/pdf-viewer/img/hide-colors.png +0 -0
- package/css/white/controls/pdf-viewer/img/hide-colors_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/layer-unvisible.png +0 -0
- package/css/white/controls/pdf-viewer/img/layer-visible.png +0 -0
- package/css/white/controls/pdf-viewer/img/overlay.png +0 -0
- package/css/white/controls/pdf-viewer/img/overlay_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/pan.png +0 -0
- package/css/white/controls/pdf-viewer/img/pan_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/panel-visibility.png +0 -0
- package/css/white/controls/pdf-viewer/img/panel-visibility_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/show-annotation.png +0 -0
- package/css/white/controls/pdf-viewer/img/side-by-side.png +0 -0
- package/css/white/controls/pdf-viewer/img/side-by-side_active.png +0 -0
- package/css/white/controls/pdf-viewer/img/sidebar-notes-toggle.png +0 -0
- package/css/white/controls/pdf-viewer/img/zoom.png +0 -0
- package/css/white/controls/pdf-viewer/img/zoom_active.png +0 -0
- package/css/white/controls/pdf-viewer/pdf-viewer.css +635 -0
- package/css/white/controls/pdf-viewer/print.css +52 -0
- package/css/white/controls/pdf-viewer/sketchpad.css +16 -0
- package/css/white/controls/pdf-viewer/viewer-theme.css +82 -0
- package/css/white/controls/pdf-viewer/viewer.css +3066 -0
- package/css/white/controls/pdf-viewer/zoom.css +14 -0
- package/css/white/controls/tab-group/tab-group.css +110 -0
- package/css/white/controls/table-view/table-view-custom-date-edit.css +6 -0
- package/css/white/controls/table-view/table-view.css +3 -7
- package/css/white/controls/view/view.css +3 -0
- package/css/white/controls/view-part/view-part.css +3 -0
- package/dist/constants/Event.d.ts +4 -0
- package/dist/controls/ActionHandler/ActionHandler.d.ts +4 -3
- package/dist/controls/ControlGroup/ControlGroup.d.ts +7 -0
- package/dist/controls/PdfViewer/PdfViewer.d.ts +6 -0
- package/dist/controls/PdfViewer/PdfViewerContext.d.ts +7 -0
- package/dist/controls/PdfViewer/Viewer.d.ts +6 -0
- package/dist/controls/TabGroup/OverflowButton.d.ts +8 -0
- package/dist/controls/TabGroup/Tab.d.ts +10 -0
- package/dist/controls/TabGroup/TabGroup.d.ts +9 -0
- package/dist/controls/TabGroup/TabGroupComponent.d.ts +8 -0
- package/dist/controls/TabGroup/TabGroupConstants.d.ts +4 -0
- package/dist/controls/TabGroup/TabGroupHeader.d.ts +10 -0
- package/dist/controls/TabGroup/TabItem.d.ts +13 -0
- package/dist/controls/TreeView/JsTreeViewContextImpl.d.ts +1 -1
- package/dist/controls/TreeView/TreeViewContext.d.ts +1 -1
- package/dist/controls/View/View.d.ts +7 -0
- package/dist/controls/ViewPart/ViewPart.d.ts +8 -0
- package/dist/index.css +169 -11
- package/dist/index.d.ts +11 -1
- package/dist/index.js +933 -59
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +936 -66
- package/dist/index.modern.js.map +1 -1
- package/lib/autosize/autosize.min.js +1 -0
- package/lib/jquery-context-menu/jquery.contextMenu.min.js +2 -0
- package/lib/jquery-context-menu/jquery.ui.position.js +513 -0
- package/lib/jquery-ui/jquery-ui.min.js +13 -0
- package/lib/jquery.svg/jquery.svg.min.js +6 -0
- package/lib/jquery.svg/jquery.svganim.min.js +6 -0
- package/lib/jquery.svg/jquery.svgdom.min.js +6 -0
- package/lib/jquery.svg/jquery.svgfilter.min.js +6 -0
- package/lib/jquery.svg/jquery.svggraph.min.js +6 -0
- package/lib/jquery.svg/jquery.svgplot.min.js +6 -0
- package/lib/pdf-js/pdf.js +15614 -0
- package/lib/third-party.js +48552 -0
- package/package.json +9 -4
- package/src/controls/PdfViewer/js/init-viewer-page.js +18 -0
- package/src/controls/PdfViewer/js/pdf-viewer.js +16522 -0
- package/css/white/common.css +0 -12
- /package/css/{white/third-party → third-party}/jstree/32px.png +0 -0
- /package/css/{white/third-party → third-party}/jstree/40px.png +0 -0
- /package/css/{white/third-party → third-party}/jstree/style.min.css +0 -0
- /package/css/{white/third-party → third-party}/jstree/throbber.gif +0 -0
- /package/css/{white/third-party → third-party/kendo}/kendo.css +0 -0
- /package/css/{white/third-party → third-party/treegrid}/treegrid.css +0 -0
package/dist/index.modern.js
CHANGED
|
@@ -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
|
|
|
@@ -14,11 +14,11 @@ var Item = function Item(props) {
|
|
|
14
14
|
}, props.text);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
(function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})(
|
|
17
|
+
var EVENT;
|
|
18
|
+
(function (EVENT) {
|
|
19
|
+
EVENT["MOUSEDOWN"] = "mousedown";
|
|
20
|
+
EVENT["RESIZE"] = "resize";
|
|
21
|
+
})(EVENT || (EVENT = {}));
|
|
22
22
|
|
|
23
23
|
var styles = {"vitro-breadcrumbs":"_breadcrumbs_vitro-breadcrumbs_1H9SaWn","vitro-breadcrumbs-list-wrap":"_breadcrumbs_vitro-breadcrumbs-list-wrap_2ToVuJR","breadcrumbs-button":"_breadcrumbs_breadcrumbs-button_1rbdArs","vitro-breadcrumbs-list":"_breadcrumbs_vitro-breadcrumbs-list_2EcJLSD","site-name":"_breadcrumbs_site-name_3Tszwcr","opened":"_breadcrumbs_opened_20GYXvG","closed":"_breadcrumbs_closed_2nuvqpK","drop-down-list":"_breadcrumbs_drop-down-list_2zSbI1y"};
|
|
24
24
|
|
|
@@ -48,12 +48,12 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
48
48
|
updateBreadcrumbsView();
|
|
49
49
|
}, [windowWidth]);
|
|
50
50
|
useEffect(function () {
|
|
51
|
-
window.addEventListener(
|
|
52
|
-
window.addEventListener(
|
|
51
|
+
window.addEventListener(EVENT.MOUSEDOWN, clickOutside);
|
|
52
|
+
window.addEventListener(EVENT.RESIZE, handleResize);
|
|
53
53
|
handleResize();
|
|
54
54
|
return function () {
|
|
55
|
-
window.addEventListener(
|
|
56
|
-
window.addEventListener(
|
|
55
|
+
window.addEventListener(EVENT.MOUSEDOWN, clickOutside);
|
|
56
|
+
window.addEventListener(EVENT.RESIZE, handleResize);
|
|
57
57
|
};
|
|
58
58
|
}, []);
|
|
59
59
|
useEffect(function () {
|
|
@@ -159,12 +159,12 @@ var TopLevelMenu = function TopLevelMenu(props) {
|
|
|
159
159
|
updateTopLevelMenuView();
|
|
160
160
|
}, [windowWidth]);
|
|
161
161
|
useEffect(function () {
|
|
162
|
-
window.addEventListener(
|
|
163
|
-
window.addEventListener(
|
|
162
|
+
window.addEventListener(EVENT.MOUSEDOWN, clickOutside);
|
|
163
|
+
window.addEventListener(EVENT.RESIZE, handleResize);
|
|
164
164
|
handleResize();
|
|
165
165
|
return function () {
|
|
166
|
-
window.addEventListener(
|
|
167
|
-
window.addEventListener(
|
|
166
|
+
window.addEventListener(EVENT.MOUSEDOWN, clickOutside);
|
|
167
|
+
window.addEventListener(EVENT.RESIZE, handleResize);
|
|
168
168
|
};
|
|
169
169
|
}, []);
|
|
170
170
|
var handleResize = function handleResize() {
|
|
@@ -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
|
}
|
|
@@ -19874,12 +19878,12 @@ var METHOD;
|
|
|
19874
19878
|
METHOD["EDIT"] = "edit";
|
|
19875
19879
|
METHOD["GET_PARENT"] = "get_parent";
|
|
19876
19880
|
})(METHOD || (METHOD = {}));
|
|
19877
|
-
var EVENT;
|
|
19881
|
+
var EVENT$1;
|
|
19878
19882
|
(function (EVENT) {
|
|
19879
19883
|
EVENT["CLOSE_NODE"] = "close_node.jstree";
|
|
19880
19884
|
EVENT["SELECT_NODE"] = "select_node.jstree";
|
|
19881
19885
|
EVENT["LOADED"] = "loaded.jstree";
|
|
19882
|
-
})(EVENT || (EVENT = {}));
|
|
19886
|
+
})(EVENT$1 || (EVENT$1 = {}));
|
|
19883
19887
|
var NODE_TYPE;
|
|
19884
19888
|
(function (NODE_TYPE) {
|
|
19885
19889
|
NODE_TYPE["FOLDER"] = "folder";
|
|
@@ -19889,7 +19893,7 @@ var NODE_TYPE;
|
|
|
19889
19893
|
var TreeViewConstants = {
|
|
19890
19894
|
__proto__: null,
|
|
19891
19895
|
get METHOD () { return METHOD; },
|
|
19892
|
-
get EVENT () { return EVENT; },
|
|
19896
|
+
get EVENT () { return EVENT$1; },
|
|
19893
19897
|
get NODE_TYPE () { return NODE_TYPE; }
|
|
19894
19898
|
};
|
|
19895
19899
|
|
|
@@ -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 = {};
|
|
@@ -20298,7 +20316,7 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
|
|
|
20298
20316
|
return TreeGridTableViewContextImpl;
|
|
20299
20317
|
}();
|
|
20300
20318
|
|
|
20301
|
-
var EVENT$
|
|
20319
|
+
var EVENT$2;
|
|
20302
20320
|
(function (EVENT) {
|
|
20303
20321
|
EVENT["ON_SELECT"] = "OnSelect";
|
|
20304
20322
|
EVENT["ON_DATA_SEND"] = "OnDataSend";
|
|
@@ -20331,7 +20349,7 @@ var EVENT$1;
|
|
|
20331
20349
|
EVENT["ON_START_DRAG"] = "OnStartDrag";
|
|
20332
20350
|
EVENT["ON_SUGGEST"] = "OnSuggest";
|
|
20333
20351
|
EVENT["ON_VALUE_CHANGED"] = "OnValueChanged";
|
|
20334
|
-
})(EVENT$
|
|
20352
|
+
})(EVENT$2 || (EVENT$2 = {}));
|
|
20335
20353
|
var URL;
|
|
20336
20354
|
(function (URL) {
|
|
20337
20355
|
URL["LAYOUT"] = "Layout";
|
|
@@ -20446,7 +20464,7 @@ var NUMBER_FORMAT;
|
|
|
20446
20464
|
|
|
20447
20465
|
var TableViewConstants = {
|
|
20448
20466
|
__proto__: null,
|
|
20449
|
-
get EVENT () { return EVENT$
|
|
20467
|
+
get EVENT () { return EVENT$2; },
|
|
20450
20468
|
get URL () { return URL; },
|
|
20451
20469
|
get CONTROLLER () { return CONTROLLER; },
|
|
20452
20470
|
get CACHE () { return CACHE; },
|
|
@@ -20508,7 +20526,7 @@ var TreeGrid = function TreeGrid(props) {
|
|
|
20508
20526
|
}
|
|
20509
20527
|
if (props.onSelect) {
|
|
20510
20528
|
var onSelectEventHandler = {
|
|
20511
|
-
id: EVENT$
|
|
20529
|
+
id: EVENT$2.ON_SELECT,
|
|
20512
20530
|
process: props.onSelect
|
|
20513
20531
|
};
|
|
20514
20532
|
grid.setEventHandler(onSelectEventHandler);
|
|
@@ -20517,7 +20535,7 @@ var TreeGrid = function TreeGrid(props) {
|
|
|
20517
20535
|
props.onInit(grid, next);
|
|
20518
20536
|
}
|
|
20519
20537
|
var onDateSendEventHandler = {
|
|
20520
|
-
id: EVENT$
|
|
20538
|
+
id: EVENT$2.ON_DATA_SEND,
|
|
20521
20539
|
process: onDataSendHandler
|
|
20522
20540
|
};
|
|
20523
20541
|
grid.setEventHandler(onDateSendEventHandler);
|
|
@@ -20535,7 +20553,7 @@ var TreeGrid = function TreeGrid(props) {
|
|
|
20535
20553
|
};
|
|
20536
20554
|
useEffect(function () {
|
|
20537
20555
|
disposeTableViewById(props.id);
|
|
20538
|
-
w$1.TGSetEvent(EVENT$
|
|
20556
|
+
w$1.TGSetEvent(EVENT$2.ON_LOADED, props.id, function (grid, next) {
|
|
20539
20557
|
return onGridLoaded(grid, next);
|
|
20540
20558
|
});
|
|
20541
20559
|
if (props.layout || props.data) {
|
|
@@ -20691,12 +20709,12 @@ var MicroFrontend = function MicroFrontend(props) {
|
|
|
20691
20709
|
});
|
|
20692
20710
|
};
|
|
20693
20711
|
|
|
20694
|
-
var EVENTS
|
|
20712
|
+
var EVENTS;
|
|
20695
20713
|
(function (EVENTS) {
|
|
20696
20714
|
EVENTS["UPLOAD_SUCCESS"] = "vitro.upload.success";
|
|
20697
20715
|
EVENTS["ADD_FILE"] = "vitro.file.add";
|
|
20698
20716
|
EVENTS["READY_STATE_CHANGE"] = "readystatechange";
|
|
20699
|
-
})(EVENTS
|
|
20717
|
+
})(EVENTS || (EVENTS = {}));
|
|
20700
20718
|
|
|
20701
20719
|
var $ = window.$;
|
|
20702
20720
|
var TelerikUploaderContextImpl = /*#__PURE__*/function () {
|
|
@@ -20729,7 +20747,7 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
|
|
|
20729
20747
|
};
|
|
20730
20748
|
_proto.initAuthorization = function initAuthorization(e, token) {
|
|
20731
20749
|
var xhr = e.XMLHttpRequest;
|
|
20732
|
-
xhr.addEventListener(EVENTS
|
|
20750
|
+
xhr.addEventListener(EVENTS.READY_STATE_CHANGE, function () {
|
|
20733
20751
|
if (xhr.readyState === 1) {
|
|
20734
20752
|
xhr.setRequestHeader('AuthorizationToken', token);
|
|
20735
20753
|
}
|
|
@@ -20742,7 +20760,7 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
|
|
|
20742
20760
|
}
|
|
20743
20761
|
};
|
|
20744
20762
|
_proto.success = function success(e) {
|
|
20745
|
-
var event = new CustomEvent(EVENTS
|
|
20763
|
+
var event = new CustomEvent(EVENTS.UPLOAD_SUCCESS, {
|
|
20746
20764
|
detail: this
|
|
20747
20765
|
});
|
|
20748
20766
|
window.dispatchEvent(event);
|
|
@@ -20823,8 +20841,8 @@ var TelerikUploader = function TelerikUploader(props) {
|
|
|
20823
20841
|
}, [uploaderRef]);
|
|
20824
20842
|
useEffect(function () {
|
|
20825
20843
|
if (kendoUploader) {
|
|
20826
|
-
window.addEventListener(EVENTS
|
|
20827
|
-
window.addEventListener(EVENTS
|
|
20844
|
+
window.addEventListener(EVENTS.UPLOAD_SUCCESS, onUploadSuccess);
|
|
20845
|
+
window.addEventListener(EVENTS.ADD_FILE, addFile);
|
|
20828
20846
|
}
|
|
20829
20847
|
}, [kendoUploader]);
|
|
20830
20848
|
var addFile = function addFile() {
|
|
@@ -20961,6 +20979,21 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
20961
20979
|
}());
|
|
20962
20980
|
});
|
|
20963
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
|
+
|
|
20964
20997
|
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
20965
20998
|
if (source == null) return {};
|
|
20966
20999
|
var target = {};
|
|
@@ -20974,6 +21007,14 @@ function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
|
20974
21007
|
return target;
|
|
20975
21008
|
}
|
|
20976
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
|
+
|
|
20977
21018
|
function useUncontrolledProp(propValue, defaultValue, handler) {
|
|
20978
21019
|
var wasPropRef = useRef(propValue !== undefined);
|
|
20979
21020
|
|
|
@@ -21002,6 +21043,24 @@ function useUncontrolledProp(propValue, defaultValue, handler) {
|
|
|
21002
21043
|
setState(value);
|
|
21003
21044
|
}, [handler])];
|
|
21004
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
|
+
}
|
|
21005
21064
|
|
|
21006
21065
|
function _setPrototypeOf(o, p) {
|
|
21007
21066
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
@@ -54038,6 +54097,129 @@ var isDOM = typeof document !== 'undefined';
|
|
|
54038
54097
|
|
|
54039
54098
|
var useIsomorphicEffect = isDOM || isReactNative ? useLayoutEffect : useEffect;
|
|
54040
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
|
+
|
|
54041
54223
|
const fadeStyles = {
|
|
54042
54224
|
[ENTERING]: 'show',
|
|
54043
54225
|
[ENTERED]: 'show'
|
|
@@ -54109,6 +54291,9 @@ function createWithBsPrefix(prefix, {
|
|
|
54109
54291
|
return BsComponent;
|
|
54110
54292
|
}
|
|
54111
54293
|
|
|
54294
|
+
const context = /*#__PURE__*/createContext(null);
|
|
54295
|
+
context.displayName = 'CardHeaderContext';
|
|
54296
|
+
|
|
54112
54297
|
/**
|
|
54113
54298
|
* Returns a ref that is immediately updated with the new value
|
|
54114
54299
|
*
|
|
@@ -54210,6 +54395,46 @@ function useTimeout() {
|
|
|
54210
54395
|
}, []);
|
|
54211
54396
|
}
|
|
54212
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
|
+
|
|
54213
54438
|
var has$2 = Object.prototype.hasOwnProperty;
|
|
54214
54439
|
|
|
54215
54440
|
function find(iter, tar, key) {
|
|
@@ -56012,8 +56237,8 @@ const createPopper = popperGenerator({
|
|
|
56012
56237
|
defaultModifiers: [hide$1, popperOffsets$1, computeStyles$1, eventListeners, offset$1, flip$1, preventOverflow$1, arrow$1]
|
|
56013
56238
|
});
|
|
56014
56239
|
|
|
56015
|
-
const _excluded = ["enabled", "placement", "strategy", "modifiers"];
|
|
56016
|
-
function _objectWithoutPropertiesLoose$
|
|
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; }
|
|
56017
56242
|
const disabledApplyStylesModifier = {
|
|
56018
56243
|
name: 'applyStyles',
|
|
56019
56244
|
enabled: false,
|
|
@@ -56080,7 +56305,7 @@ function usePopper(referenceElement, popperElement, _ref = {}) {
|
|
|
56080
56305
|
strategy = 'absolute',
|
|
56081
56306
|
modifiers = EMPTY_MODIFIERS
|
|
56082
56307
|
} = _ref,
|
|
56083
|
-
config = _objectWithoutPropertiesLoose$
|
|
56308
|
+
config = _objectWithoutPropertiesLoose$4(_ref, _excluded$2);
|
|
56084
56309
|
const prevModifiers = useRef(modifiers);
|
|
56085
56310
|
const popperInstanceRef = useRef();
|
|
56086
56311
|
const update = useCallback(() => {
|
|
@@ -56394,6 +56619,24 @@ function mergeOptionsWithPopperConfig({
|
|
|
56394
56619
|
});
|
|
56395
56620
|
}
|
|
56396
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
|
+
|
|
56397
56640
|
const Context = /*#__PURE__*/createContext(canUseDOM ? window : undefined);
|
|
56398
56641
|
|
|
56399
56642
|
/**
|
|
@@ -56406,6 +56649,198 @@ function useWindow() {
|
|
|
56406
56649
|
return useContext(Context);
|
|
56407
56650
|
}
|
|
56408
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
|
+
|
|
56409
56844
|
const resolveContainerRef = (ref, document) => {
|
|
56410
56845
|
if (!canUseDOM) return null;
|
|
56411
56846
|
if (ref == null) return (document || ownerDocument()).body;
|
|
@@ -56565,7 +57000,179 @@ function hasClass(element, className) {
|
|
|
56565
57000
|
return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
|
|
56566
57001
|
}
|
|
56567
57002
|
|
|
56568
|
-
|
|
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 = () => {};
|
|
56569
57176
|
/**
|
|
56570
57177
|
* The `useRootClose` hook registers your callback on the document
|
|
56571
57178
|
* when rendered. Powers the `<Overlay/>` component. This is used achieve modal
|
|
@@ -56582,7 +57189,7 @@ function useRootClose(ref, onRootClose, {
|
|
|
56582
57189
|
disabled,
|
|
56583
57190
|
clickTrigger
|
|
56584
57191
|
} = {}) {
|
|
56585
|
-
const onClose = onRootClose || noop$
|
|
57192
|
+
const onClose = onRootClose || noop$3;
|
|
56586
57193
|
useClickOutside(ref, onClose, {
|
|
56587
57194
|
disabled,
|
|
56588
57195
|
clickTrigger
|
|
@@ -57005,12 +57612,12 @@ function OverlayTrigger({
|
|
|
57005
57612
|
});
|
|
57006
57613
|
}
|
|
57007
57614
|
|
|
57008
|
-
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"};
|
|
57009
57616
|
|
|
57010
|
-
var _excluded$
|
|
57617
|
+
var _excluded$5 = ["popper", "children", "show"];
|
|
57011
57618
|
var UpdatingPopover = React__default.forwardRef(function (_ref, ref) {
|
|
57012
57619
|
var children = _ref.children,
|
|
57013
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
57620
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
57014
57621
|
return React__default.createElement("div", {
|
|
57015
57622
|
className: styles$5["vitro-action-handler"]
|
|
57016
57623
|
}, React__default.createElement(Popover$1, Object.assign({
|
|
@@ -57074,26 +57681,29 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57074
57681
|
var _useState3 = useState(false),
|
|
57075
57682
|
show = _useState3[0],
|
|
57076
57683
|
setShow = _useState3[1];
|
|
57077
|
-
var _useState4 = useState(
|
|
57078
|
-
|
|
57079
|
-
|
|
57080
|
-
var _useState5 = useState(
|
|
57081
|
-
|
|
57082
|
-
|
|
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];
|
|
57083
57693
|
var localeService = useInjection(SERVICE.LOCALE);
|
|
57084
57694
|
useEffect(function () {
|
|
57085
|
-
setIsCloseByOutsideClick(
|
|
57695
|
+
setIsCloseByOutsideClick(currentAction !== actionMap.progress);
|
|
57086
57696
|
if (currentAction === actionMap.before) setIcon(styles$5['vitro-icon-before']);
|
|
57087
57697
|
if (currentAction === actionMap.progress) {
|
|
57088
57698
|
setIcon(styles$5['vitro-icon-progress']);
|
|
57089
57699
|
}
|
|
57090
57700
|
}, [currentAction]);
|
|
57091
57701
|
useEffect(function () {
|
|
57092
|
-
if (!props.
|
|
57702
|
+
if (!props.isShowProgress && !props.isShowAfterAction && !props.isConfirm) {
|
|
57093
57703
|
onStart();
|
|
57094
57704
|
} else {
|
|
57095
|
-
if (props.
|
|
57096
|
-
setShow(props.
|
|
57705
|
+
if (props.isShow) {
|
|
57706
|
+
setShow(props.isShow);
|
|
57097
57707
|
if (props.isConfirm) {
|
|
57098
57708
|
init();
|
|
57099
57709
|
} else {
|
|
@@ -57133,7 +57743,7 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57133
57743
|
if (props.onAfterAction) {
|
|
57134
57744
|
props.onAfterAction(error, successResult, failResult);
|
|
57135
57745
|
}
|
|
57136
|
-
if (!props.
|
|
57746
|
+
if (!props.isShowAfterAction) {
|
|
57137
57747
|
window.document.body.click();
|
|
57138
57748
|
return;
|
|
57139
57749
|
}
|
|
@@ -57141,6 +57751,9 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57141
57751
|
if (props.onAfterActionClose) {
|
|
57142
57752
|
props.onAfterActionClose(error, successResult, failResult);
|
|
57143
57753
|
}
|
|
57754
|
+
if (props.isBlockInterface) {
|
|
57755
|
+
setBlockInterface(false);
|
|
57756
|
+
}
|
|
57144
57757
|
window.document.body.click();
|
|
57145
57758
|
}, props.durationMs || 2000);
|
|
57146
57759
|
setIcon(success ? styles$5['vitro-icon-success'] : styles$5['vitro-icon-error']);
|
|
@@ -57192,7 +57805,10 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57192
57805
|
}
|
|
57193
57806
|
}
|
|
57194
57807
|
setCurrentAction(actionMap.progress);
|
|
57195
|
-
if (
|
|
57808
|
+
if (props.isBlockInterface) {
|
|
57809
|
+
setBlockInterface(true);
|
|
57810
|
+
}
|
|
57811
|
+
if (!props.isShowProgress && !props.isShowAfterAction && !props.isConfirm) {
|
|
57196
57812
|
setIsCloseByOutsideClick(true);
|
|
57197
57813
|
window.document.body.click();
|
|
57198
57814
|
}
|
|
@@ -57237,7 +57853,7 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57237
57853
|
}
|
|
57238
57854
|
};
|
|
57239
57855
|
var onEnter = function onEnter() {
|
|
57240
|
-
if (!props.
|
|
57856
|
+
if (!props.isShowProgress && !props.isShowAfterAction && !props.isConfirm) {
|
|
57241
57857
|
window.document.body.click();
|
|
57242
57858
|
}
|
|
57243
57859
|
if (currentAction !== actionMap.progress) {
|
|
@@ -57252,6 +57868,11 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57252
57868
|
window.document.body.click();
|
|
57253
57869
|
}
|
|
57254
57870
|
};
|
|
57871
|
+
var onHide = function onHide() {
|
|
57872
|
+
if (isCloseByOutsideClick) {
|
|
57873
|
+
setShow(false);
|
|
57874
|
+
}
|
|
57875
|
+
};
|
|
57255
57876
|
var showButtonGroup = props.isConfirm && (currentAction === actionMap.before || currentAction === actionMap.progress && itemCount > 1);
|
|
57256
57877
|
return React__default.createElement(React__default.Fragment, null, props.children && React__default.createElement(OverlayTrigger, {
|
|
57257
57878
|
trigger: TRIGGER.CLICK,
|
|
@@ -57259,40 +57880,289 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
57259
57880
|
rootClose: isCloseByOutsideClick,
|
|
57260
57881
|
placement: props.placement || PLACEMENT.TOP,
|
|
57261
57882
|
overlay: React__default.createElement(UpdatingPopover, null, React__default.createElement("div", {
|
|
57262
|
-
className: styles$5[
|
|
57883
|
+
className: styles$5['vitro-flex']
|
|
57263
57884
|
}, icon && React__default.createElement("div", {
|
|
57264
57885
|
className: icon
|
|
57265
|
-
}), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button, {
|
|
57886
|
+
}), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button$1, {
|
|
57266
57887
|
onClick: onStart,
|
|
57267
57888
|
text: localeService.create(LOCALE.YES) || props.labelYes,
|
|
57268
57889
|
disabled: currentAction !== actionMap.before
|
|
57269
|
-
}), React__default.createElement(Button, {
|
|
57890
|
+
}), React__default.createElement(Button$1, {
|
|
57270
57891
|
onClick: cancel,
|
|
57271
57892
|
text: localeService.create(LOCALE.NO) || props.labelNo,
|
|
57272
|
-
className: styles$5[
|
|
57893
|
+
className: styles$5['vitro-button-close']
|
|
57273
57894
|
})))
|
|
57274
57895
|
}, React__default.createElement("div", null, props.children)), props.target && !props.children && React__default.createElement(Overlay$1, {
|
|
57275
57896
|
show: show,
|
|
57276
57897
|
target: props.target,
|
|
57277
57898
|
rootClose: isCloseByOutsideClick,
|
|
57278
|
-
onHide:
|
|
57279
|
-
return setShow(false);
|
|
57280
|
-
},
|
|
57899
|
+
onHide: onHide,
|
|
57281
57900
|
placement: props.placement || PLACEMENT.TOP
|
|
57282
57901
|
}, React__default.createElement(UpdatingPopover, null, React__default.createElement("div", {
|
|
57283
|
-
className: styles$5[
|
|
57902
|
+
className: styles$5['vitro-flex']
|
|
57284
57903
|
}, icon && React__default.createElement("div", {
|
|
57285
57904
|
className: icon
|
|
57286
|
-
}), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button, {
|
|
57905
|
+
}), text), showButtonGroup && React__default.createElement(ButtonGroup, null, React__default.createElement(Button$1, {
|
|
57287
57906
|
onClick: onStart,
|
|
57288
57907
|
text: localeService.create(LOCALE.YES) || props.labelYes,
|
|
57289
57908
|
disabled: currentAction !== actionMap.before
|
|
57290
|
-
}), React__default.createElement(Button, {
|
|
57909
|
+
}), React__default.createElement(Button$1, {
|
|
57291
57910
|
onClick: cancel,
|
|
57292
57911
|
text: localeService.create(LOCALE.NO) || props.labelNo,
|
|
57293
|
-
className: styles$5[
|
|
57294
|
-
}))))
|
|
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
|
+
}));
|
|
58129
|
+
};
|
|
58130
|
+
|
|
58131
|
+
var w$4 = window;
|
|
58132
|
+
var Viewer = function Viewer(props) {
|
|
58133
|
+
var init = function init() {
|
|
58134
|
+
if (w$4.initPdfViewer) {
|
|
58135
|
+
w$4.initPdfViewer(props.context);
|
|
58136
|
+
}
|
|
58137
|
+
};
|
|
58138
|
+
useEffect(function () {
|
|
58139
|
+
if (props.context.file) {
|
|
58140
|
+
init();
|
|
58141
|
+
}
|
|
58142
|
+
}, [props.context.file]);
|
|
58143
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
58144
|
+
};
|
|
58145
|
+
|
|
58146
|
+
var PdfViewer = function PdfViewer(props) {
|
|
58147
|
+
var scriptList = [{
|
|
58148
|
+
"url": "resource/pdfViewer/js/init-viewer-page.js",
|
|
58149
|
+
"id": "vitro-script-init-pdf-viewer"
|
|
58150
|
+
}, {
|
|
58151
|
+
"url": "resource/pdfViewer/js/pdf-viewer.js",
|
|
58152
|
+
"id": "vitro-script-pdf-viewer"
|
|
58153
|
+
}];
|
|
58154
|
+
return React__default.createElement(ScriptLoader, {
|
|
58155
|
+
urlList: scriptList.map(function (x) {
|
|
58156
|
+
return x.url;
|
|
58157
|
+
}),
|
|
58158
|
+
idList: scriptList.map(function (x) {
|
|
58159
|
+
return x.id;
|
|
58160
|
+
}),
|
|
58161
|
+
placeholder: React__default.createElement(Progress, null)
|
|
58162
|
+
}, React__default.createElement(Viewer, {
|
|
58163
|
+
context: props.context
|
|
58164
|
+
}));
|
|
57295
58165
|
};
|
|
57296
58166
|
|
|
57297
|
-
export { ActionHandlerConstants as ACTION_HANDLER, ActionHandler, Breadcrumbs, ComponentLoader, ComponentLoaderContextImpl, MicroFrontend, TableViewConstants as TABLE_VIEW, TreeViewConstants as TREE_VIEW, TableView, TelerikUploader, TelerikUploaderContextImpl, TopLevelMenu, TreeView };
|
|
58167
|
+
export { ActionHandlerConstants as ACTION_HANDLER, ActionHandler, Breadcrumbs, ComponentLoader, ComponentLoaderContextImpl, ControlGroup, MicroFrontend, PdfViewer, TableViewConstants as TABLE_VIEW, TreeViewConstants as TREE_VIEW, TabGroup, TableView, TelerikUploader, TelerikUploaderContextImpl, TopLevelMenu, TreeView, View };
|
|
57298
58168
|
//# sourceMappingURL=index.modern.js.map
|