@vitrosoftware/common-ui-ts 1.1.24 → 1.1.25
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 +1 -0
- package/css/std/controls/alert/alert.css +15 -10
- package/css/std/controls/command-menu/command-menu-dropdown-button.css +7 -2
- package/css/std/controls/dialog/dialog-button-close.css +3 -5
- package/css/std/controls/dialog/dialog-button.css +4 -0
- package/css/std/controls/dialog/dialog-content.css +9 -21
- package/css/std/controls/dialog/dialog-footer.css +6 -5
- package/css/std/controls/dialog/dialog-header.css +27 -3
- package/css/std/controls/dialog/dialog.css +3 -8
- package/css/std/controls/lookup-picker/lookup-picker.css +1 -0
- package/css/std/controls/pdf-viewer/pdf-viewer.css +369 -139
- package/css/std/controls/tab-group/tab-group.css +4 -0
- package/css/std/controls/table-view/treegrid.css +5 -4
- package/css/std/controls/tree-view/tree-view.css +21 -3
- package/dist/constants/Event.d.ts +2 -1
- package/dist/controls/Dialog/Dialog.d.ts +16 -6
- package/dist/controls/Dialog/DialogButton.d.ts +2 -3
- package/dist/controls/Dialog/DialogComponent.d.ts +0 -1
- package/dist/controls/Dialog/DialogContent.d.ts +1 -0
- package/dist/controls/Dialog/DialogFooter.d.ts +5 -5
- package/dist/controls/Dialog/DialogHeader.d.ts +2 -0
- package/dist/controls/TabGroup/TabGroup.d.ts +1 -0
- package/dist/controls/TabGroup/TabGroupComponent.d.ts +1 -0
- package/dist/controls/TreeView/JsTreeViewContextImpl.d.ts +7 -0
- package/dist/controls/TreeView/TreeView.d.ts +2 -0
- package/dist/controls/TreeView/TreeViewConfig.d.ts +12 -6
- package/dist/controls/TreeView/TreeViewConstants.d.ts +23 -1
- package/dist/controls/TreeView/TreeViewContext.d.ts +7 -0
- package/dist/index.css +130 -88
- package/dist/index.d.ts +2 -2
- package/dist/index.js +216 -94
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +216 -94
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/controls/PdfViewer/js/pdf-viewer.js +213 -71
package/dist/index.modern.js
CHANGED
|
@@ -259,6 +259,7 @@ var EVENT;
|
|
|
259
259
|
EVENT["HISTORY_UPDATE"] = "vitro.history.update";
|
|
260
260
|
EVENT["HISTORY_CHANGED"] = "vitro.history.changed";
|
|
261
261
|
EVENT["DROP"] = "drop";
|
|
262
|
+
EVENT["CONTEXTMENU"] = "contextmenu";
|
|
262
263
|
})(EVENT || (EVENT = {}));
|
|
263
264
|
|
|
264
265
|
var styles$1 = {"vitro-breadcrumbs":"_breadcrumbs_vitro-breadcrumbs_3r4NcQY","vitro-breadcrumbs-list-wrap":"_breadcrumbs_vitro-breadcrumbs-list-wrap_1_JBrw0","vitro-breadcrumbs-list":"_breadcrumbs_vitro-breadcrumbs-list_1SNtgtJ","vitro-breadcrumbs-button":"_breadcrumbs_vitro-breadcrumbs-button_3fazq3c","vitro-root":"_breadcrumbs_vitro-root_1S5-6AY","vitro-drop-down-list":"_breadcrumbs_vitro-drop-down-list_2PhrR2a"};
|
|
@@ -20111,41 +20112,6 @@ var jstree = createCommonjsModule(function (module) {
|
|
|
20111
20112
|
}));
|
|
20112
20113
|
});
|
|
20113
20114
|
|
|
20114
|
-
var TreeViewConfig = /*#__PURE__*/function () {
|
|
20115
|
-
function TreeViewConfig() {}
|
|
20116
|
-
TreeViewConfig.getConfig = function getConfig() {
|
|
20117
|
-
return {
|
|
20118
|
-
core: {
|
|
20119
|
-
check_callback: true,
|
|
20120
|
-
themes: {
|
|
20121
|
-
dots: false
|
|
20122
|
-
},
|
|
20123
|
-
multiple: false,
|
|
20124
|
-
data: function data(obj, cb) {}
|
|
20125
|
-
},
|
|
20126
|
-
plugins: ["search", "unique", "types", "wholerow", "themes", "sort", "state"],
|
|
20127
|
-
types: {
|
|
20128
|
-
folder: {
|
|
20129
|
-
icon: "folder",
|
|
20130
|
-
new_node: "New Folder"
|
|
20131
|
-
},
|
|
20132
|
-
file: {
|
|
20133
|
-
icon: "file",
|
|
20134
|
-
valid_children: [""],
|
|
20135
|
-
new_node: "New File"
|
|
20136
|
-
}
|
|
20137
|
-
},
|
|
20138
|
-
checkbox: {
|
|
20139
|
-
three_state: false
|
|
20140
|
-
},
|
|
20141
|
-
contextmenu: function contextmenu() {
|
|
20142
|
-
return [];
|
|
20143
|
-
}
|
|
20144
|
-
};
|
|
20145
|
-
};
|
|
20146
|
-
return TreeViewConfig;
|
|
20147
|
-
}();
|
|
20148
|
-
|
|
20149
20115
|
var METHOD;
|
|
20150
20116
|
(function (METHOD) {
|
|
20151
20117
|
METHOD["GET_PATH"] = "get_path";
|
|
@@ -20165,6 +20131,13 @@ var METHOD;
|
|
|
20165
20131
|
METHOD["OPEN_NODE"] = "open_node";
|
|
20166
20132
|
METHOD["EDIT"] = "edit";
|
|
20167
20133
|
METHOD["GET_PARENT"] = "get_parent";
|
|
20134
|
+
METHOD["GET_CHECKED"] = "get_checked";
|
|
20135
|
+
METHOD["GET_UNDETERMINED"] = "get_undetermined";
|
|
20136
|
+
METHOD["GET_CHECKED_DESCENDANTS"] = "get_checked_descendants";
|
|
20137
|
+
METHOD["GET_TOP_CHECKED"] = "get_top_checked";
|
|
20138
|
+
METHOD["GET_BOTTOM_CHECKED"] = "get_bottom_checked";
|
|
20139
|
+
METHOD["IS_CHECKED"] = "is_checked";
|
|
20140
|
+
METHOD["IS_UNDETERMINED"] = "is_undetermined";
|
|
20168
20141
|
})(METHOD || (METHOD = {}));
|
|
20169
20142
|
var EVENT$1;
|
|
20170
20143
|
(function (EVENT) {
|
|
@@ -20178,14 +20151,84 @@ var NODE_TYPE;
|
|
|
20178
20151
|
NODE_TYPE["FOLDER"] = "folder";
|
|
20179
20152
|
NODE_TYPE["FILE"] = "file";
|
|
20180
20153
|
})(NODE_TYPE || (NODE_TYPE = {}));
|
|
20154
|
+
var PLUGIN;
|
|
20155
|
+
(function (PLUGIN) {
|
|
20156
|
+
PLUGIN["STATE"] = "state";
|
|
20157
|
+
PLUGIN["CHECKBOX"] = "checkbox";
|
|
20158
|
+
PLUGIN["SEARCH"] = "search";
|
|
20159
|
+
PLUGIN["UNIQUE"] = "unique";
|
|
20160
|
+
PLUGIN["TYPES"] = "types";
|
|
20161
|
+
PLUGIN["WHOLEROW"] = "wholerow";
|
|
20162
|
+
PLUGIN["THEMES"] = "themes";
|
|
20163
|
+
PLUGIN["SORT"] = "sort";
|
|
20164
|
+
})(PLUGIN || (PLUGIN = {}));
|
|
20165
|
+
var CASCADE;
|
|
20166
|
+
(function (CASCADE) {
|
|
20167
|
+
CASCADE["UP"] = "up";
|
|
20168
|
+
CASCADE["DOWN"] = "down";
|
|
20169
|
+
CASCADE["UNDETERMINED"] = "undetermined";
|
|
20170
|
+
})(CASCADE || (CASCADE = {}));
|
|
20181
20171
|
|
|
20182
20172
|
var TreeViewConstants = {
|
|
20183
20173
|
__proto__: null,
|
|
20184
20174
|
get METHOD () { return METHOD; },
|
|
20185
20175
|
get EVENT () { return EVENT$1; },
|
|
20186
|
-
get NODE_TYPE () { return NODE_TYPE; }
|
|
20176
|
+
get NODE_TYPE () { return NODE_TYPE; },
|
|
20177
|
+
get PLUGIN () { return PLUGIN; },
|
|
20178
|
+
get CASCADE () { return CASCADE; }
|
|
20187
20179
|
};
|
|
20188
20180
|
|
|
20181
|
+
var TreeViewConfig = /*#__PURE__*/function () {
|
|
20182
|
+
function TreeViewConfig() {}
|
|
20183
|
+
TreeViewConfig.getConfig = function getConfig(id, checkboxSelect, saveChecked) {
|
|
20184
|
+
return {
|
|
20185
|
+
core: {
|
|
20186
|
+
check_callback: true,
|
|
20187
|
+
themes: {
|
|
20188
|
+
dots: false
|
|
20189
|
+
},
|
|
20190
|
+
multiple: false,
|
|
20191
|
+
data: function data(obj, cb) {}
|
|
20192
|
+
},
|
|
20193
|
+
plugins: function () {
|
|
20194
|
+
var pluginList = [PLUGIN.UNIQUE, PLUGIN.TYPES, PLUGIN.WHOLEROW, PLUGIN.THEMES, PLUGIN.SORT, PLUGIN.STATE];
|
|
20195
|
+
if (checkboxSelect) {
|
|
20196
|
+
pluginList.push(PLUGIN.CHECKBOX);
|
|
20197
|
+
}
|
|
20198
|
+
return pluginList;
|
|
20199
|
+
}(),
|
|
20200
|
+
types: {
|
|
20201
|
+
folder: {
|
|
20202
|
+
icon: NODE_TYPE.FOLDER
|
|
20203
|
+
},
|
|
20204
|
+
file: {
|
|
20205
|
+
icon: NODE_TYPE.FILE,
|
|
20206
|
+
valid_children: [CTRL.EMPTY]
|
|
20207
|
+
}
|
|
20208
|
+
},
|
|
20209
|
+
state: {
|
|
20210
|
+
key: id,
|
|
20211
|
+
filter: function filter(state) {
|
|
20212
|
+
if (!saveChecked) {
|
|
20213
|
+
delete state.checkbox;
|
|
20214
|
+
}
|
|
20215
|
+
return state;
|
|
20216
|
+
}
|
|
20217
|
+
},
|
|
20218
|
+
checkbox: {
|
|
20219
|
+
visible: true,
|
|
20220
|
+
three_state: false,
|
|
20221
|
+
tie_selection: false,
|
|
20222
|
+
cascade: CASCADE.DOWN
|
|
20223
|
+
},
|
|
20224
|
+
contextmenu: function contextmenu() {
|
|
20225
|
+
return [];
|
|
20226
|
+
}
|
|
20227
|
+
};
|
|
20228
|
+
};
|
|
20229
|
+
return TreeViewConfig;
|
|
20230
|
+
}();
|
|
20231
|
+
|
|
20189
20232
|
var JsTreeViewContextImpl = /*#__PURE__*/function () {
|
|
20190
20233
|
function JsTreeViewContextImpl(jsTree) {
|
|
20191
20234
|
this.jsTree = jsTree;
|
|
@@ -20271,20 +20314,47 @@ var JsTreeViewContextImpl = /*#__PURE__*/function () {
|
|
|
20271
20314
|
_proto.getParent = function getParent(node) {
|
|
20272
20315
|
return this.jsTree.jstree(METHOD.GET_PARENT, node);
|
|
20273
20316
|
};
|
|
20317
|
+
_proto.getChecked = function getChecked(full) {
|
|
20318
|
+
return this.jsTree.jstree(METHOD.GET_CHECKED, full);
|
|
20319
|
+
};
|
|
20320
|
+
_proto.getUndetermined = function getUndetermined(full) {
|
|
20321
|
+
return this.jsTree.jstree(METHOD.GET_UNDETERMINED, full);
|
|
20322
|
+
};
|
|
20323
|
+
_proto.getCheckedChildList = function getCheckedChildList(id) {
|
|
20324
|
+
return this.jsTree.jstree(METHOD.GET_CHECKED_DESCENDANTS, id);
|
|
20325
|
+
};
|
|
20326
|
+
_proto.getTopChecked = function getTopChecked(full) {
|
|
20327
|
+
return this.jsTree.jstree(METHOD.GET_TOP_CHECKED, full);
|
|
20328
|
+
};
|
|
20329
|
+
_proto.getBottomChecked = function getBottomChecked(full) {
|
|
20330
|
+
return this.jsTree.jstree(METHOD.GET_BOTTOM_CHECKED, full);
|
|
20331
|
+
};
|
|
20332
|
+
_proto.isChecked = function isChecked(node) {
|
|
20333
|
+
return this.jsTree.jstree(METHOD.IS_CHECKED, node);
|
|
20334
|
+
};
|
|
20335
|
+
_proto.isUndetermined = function isUndetermined(node) {
|
|
20336
|
+
return this.jsTree.jstree(METHOD.IS_UNDETERMINED, node);
|
|
20337
|
+
};
|
|
20274
20338
|
return JsTreeViewContextImpl;
|
|
20275
20339
|
}();
|
|
20276
20340
|
|
|
20277
20341
|
var styles$3 = {"vitro-tree-view":"_tree-view_vitro-tree-view_3oii-CW"};
|
|
20278
20342
|
|
|
20343
|
+
var CSS_CLASS_JSTREE_NODE = 'jstree-node';
|
|
20279
20344
|
var TreeView = function TreeView(props) {
|
|
20280
20345
|
var _useState = useState(null),
|
|
20281
20346
|
jsTreeTreeView = _useState[0],
|
|
20282
20347
|
setJsTreeTreeView = _useState[1];
|
|
20283
20348
|
var jsTreeRef = useRef(null);
|
|
20284
|
-
var config = TreeViewConfig.getConfig();
|
|
20349
|
+
var config = TreeViewConfig.getConfig(props.id, props.isCheckboxSelect, props.isSaveCheckboxState);
|
|
20285
20350
|
var jsTreeView;
|
|
20286
20351
|
useEffect(function () {
|
|
20287
20352
|
config.core.data = props.getData;
|
|
20353
|
+
if (props.isCheckboxSelect) {
|
|
20354
|
+
jquery(document).on(EVENT.CONTEXTMENU, CTRL.DOT + CSS_CLASS_JSTREE_NODE, function (e) {
|
|
20355
|
+
return checkNode(e, jsTreeView);
|
|
20356
|
+
});
|
|
20357
|
+
}
|
|
20288
20358
|
jquery(jsTreeRef.current).jstree(config);
|
|
20289
20359
|
var jsTree = jquery(jsTreeRef.current);
|
|
20290
20360
|
jsTreeView = new JsTreeViewContextImpl(jsTree);
|
|
@@ -20292,18 +20362,33 @@ var TreeView = function TreeView(props) {
|
|
|
20292
20362
|
if (props.onInit) {
|
|
20293
20363
|
props.onInit(jsTreeView);
|
|
20294
20364
|
}
|
|
20365
|
+
return function () {
|
|
20366
|
+
jquery(document).off(EVENT.CONTEXTMENU, CTRL.DOT + CSS_CLASS_JSTREE_NODE, function (e) {
|
|
20367
|
+
return checkNode(e, jsTreeView);
|
|
20368
|
+
});
|
|
20369
|
+
};
|
|
20295
20370
|
}, [jsTreeRef]);
|
|
20296
20371
|
useEffect(function () {
|
|
20297
20372
|
return function () {
|
|
20298
|
-
if (jsTreeRef.current) {
|
|
20373
|
+
if (jsTreeTreeView && jsTreeRef.current) {
|
|
20299
20374
|
jsTreeTreeView.dispose();
|
|
20300
20375
|
}
|
|
20301
20376
|
};
|
|
20302
20377
|
}, []);
|
|
20378
|
+
var checkNode = function checkNode(e, treeView) {
|
|
20379
|
+
e.preventDefault();
|
|
20380
|
+
e.stopPropagation();
|
|
20381
|
+
var nodeId = e.currentTarget.id;
|
|
20382
|
+
var node = treeView.getNode(nodeId);
|
|
20383
|
+
if (!node.state.checked) {
|
|
20384
|
+
node.state.checked = true;
|
|
20385
|
+
treeView.redrawNode(node, false);
|
|
20386
|
+
}
|
|
20387
|
+
};
|
|
20303
20388
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
20304
20389
|
ref: jsTreeRef,
|
|
20305
20390
|
id: props.id,
|
|
20306
|
-
className: styles$3[
|
|
20391
|
+
className: styles$3['vitro-tree-view']
|
|
20307
20392
|
}));
|
|
20308
20393
|
};
|
|
20309
20394
|
|
|
@@ -60240,7 +60325,7 @@ var TabGroupComponent = function TabGroupComponent(props) {
|
|
|
60240
60325
|
}
|
|
60241
60326
|
}, [currentTab, props.itemList]);
|
|
60242
60327
|
return React__default.createElement("div", {
|
|
60243
|
-
className: styles$c['vitro-tab'],
|
|
60328
|
+
className: styles$c['vitro-tab'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY),
|
|
60244
60329
|
ref: ref
|
|
60245
60330
|
}, React__default.createElement(TabGroupHeader, {
|
|
60246
60331
|
itemList: props.itemList,
|
|
@@ -63209,11 +63294,12 @@ var CommandMenuSubItem = function CommandMenuSubItem(props) {
|
|
|
63209
63294
|
return React__default.createElement(DropdownItem$2, {
|
|
63210
63295
|
onClick: onClick,
|
|
63211
63296
|
toggle: props.toggle === false ? false : true
|
|
63297
|
+
}, React__default.createElement("div", {
|
|
63298
|
+
className: styles$u['vitro-icon']
|
|
63212
63299
|
}, props.imageUrl && React__default.createElement(Icon, {
|
|
63213
63300
|
defaultUrl: props.imageUrl,
|
|
63214
|
-
hoverUrl: props.imageHoverUrl
|
|
63215
|
-
|
|
63216
|
-
}), React__default.createElement("span", null, props.text));
|
|
63301
|
+
hoverUrl: props.imageHoverUrl
|
|
63302
|
+
})), React__default.createElement("span", null, props.text));
|
|
63217
63303
|
};
|
|
63218
63304
|
|
|
63219
63305
|
var CommandMenuItemHeader = function CommandMenuItemHeader(props) {
|
|
@@ -63531,9 +63617,9 @@ var Alert$1 = function Alert(props) {
|
|
|
63531
63617
|
return React__default.createElement("div", {
|
|
63532
63618
|
tabIndex: 1,
|
|
63533
63619
|
onBlur: onFocusOut,
|
|
63534
|
-
ref: ref
|
|
63620
|
+
ref: ref,
|
|
63621
|
+
className: className
|
|
63535
63622
|
}, React__default.createElement(BootstrapAlert, {
|
|
63536
|
-
className: className,
|
|
63537
63623
|
variant: props.type,
|
|
63538
63624
|
onClose: props.onClose
|
|
63539
63625
|
}, React__default.createElement("div", {
|
|
@@ -63569,52 +63655,27 @@ var DialogComponent = function DialogComponent(props) {
|
|
|
63569
63655
|
}, props.children);
|
|
63570
63656
|
};
|
|
63571
63657
|
|
|
63572
|
-
var
|
|
63573
|
-
|
|
63574
|
-
var DialogHeader = function DialogHeader(props) {
|
|
63575
|
-
return React__default.createElement("div", {
|
|
63576
|
-
className: headerStyles['vitro-dialog-header']
|
|
63577
|
-
}, props.title);
|
|
63578
|
-
};
|
|
63579
|
-
|
|
63580
|
-
var dialogStyles = {"vitro-dialog":"_dialog_vitro-dialog_2NzcRZg"};
|
|
63581
|
-
|
|
63582
|
-
var styles$z = {"vitro-dialog-button-close":"_dialog-button-close_vitro-dialog-button-close_1p27cEz","vitro-button-close":"_dialog-button-close_vitro-button-close_2BpzTR0"};
|
|
63658
|
+
var styles$z = {"vitro-dialog-content":"_dialog-content_vitro-dialog-content_qQNWu6x"};
|
|
63583
63659
|
|
|
63584
|
-
var
|
|
63585
|
-
var className = dialogStyles['vitro-dialog'];
|
|
63586
|
-
var onClose = function onClose() {
|
|
63587
|
-
if (props.onClose) {
|
|
63588
|
-
props.onClose();
|
|
63589
|
-
}
|
|
63590
|
-
};
|
|
63591
|
-
var onOutsideClick = function onOutsideClick(e) {
|
|
63592
|
-
if (e.target && e.target.className === className) {
|
|
63593
|
-
onClose();
|
|
63594
|
-
}
|
|
63595
|
-
};
|
|
63660
|
+
var DialogContent = function DialogContent(props) {
|
|
63596
63661
|
return React__default.createElement("div", {
|
|
63597
|
-
className: className
|
|
63598
|
-
|
|
63599
|
-
}, React__default.createElement(DialogComponent, {
|
|
63600
|
-
width: props.width,
|
|
63601
|
-
height: props.height
|
|
63602
|
-
}, props.isDismissible && React__default.createElement("button", {
|
|
63603
|
-
className: styles$z['vitro-dialog-button-close'],
|
|
63604
|
-
onClick: onClose
|
|
63605
|
-
}), React__default.createElement(DialogHeader, {
|
|
63606
|
-
title: props.title
|
|
63607
|
-
}), props.children.length ? props.children.map(function (child) {
|
|
63608
|
-
return React__default.cloneElement(child, _extends({}, props));
|
|
63609
|
-
}) : React__default.cloneElement(props.children, _extends({}, props))));
|
|
63662
|
+
className: styles$z['vitro-dialog-content'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY)
|
|
63663
|
+
}, props.children);
|
|
63610
63664
|
};
|
|
63611
63665
|
|
|
63612
|
-
var styles$A = {"vitro-dialog-
|
|
63666
|
+
var styles$A = {"vitro-dialog-header":"_dialog-header_vitro-dialog-header_2W3GraU","vitro-title":"_dialog-header_vitro-title_2k8SPhE","vitro-description":"_dialog-header_vitro-description_Hiq51VI","vitro-icon":"_dialog-header_vitro-icon_3GtsVWO"};
|
|
63613
63667
|
|
|
63614
|
-
var
|
|
63668
|
+
var DialogHeader = function DialogHeader(props) {
|
|
63615
63669
|
return React__default.createElement("div", {
|
|
63616
|
-
className: styles$A['vitro-dialog-
|
|
63617
|
-
}, props.
|
|
63670
|
+
className: styles$A['vitro-dialog-header']
|
|
63671
|
+
}, props.imageUrl && React__default.createElement(Icon, {
|
|
63672
|
+
defaultUrl: props.imageUrl,
|
|
63673
|
+
className: styles$A['vitro-icon']
|
|
63674
|
+
}), React__default.createElement("div", null, React__default.createElement("h1", {
|
|
63675
|
+
className: styles$A['vitro-title']
|
|
63676
|
+
}, props.title), props.description && React__default.createElement("h2", {
|
|
63677
|
+
className: styles$A['vitro-description']
|
|
63678
|
+
}, props.description)));
|
|
63618
63679
|
};
|
|
63619
63680
|
|
|
63620
63681
|
var styles$B = {"vitro-dialog-button":"_dialog-button_vitro-dialog-button_1fQ5l22"};
|
|
@@ -63625,6 +63686,8 @@ var DialogButton = function DialogButton(props) {
|
|
|
63625
63686
|
}));
|
|
63626
63687
|
};
|
|
63627
63688
|
|
|
63689
|
+
var dialogButtonCloseStyles = {"vitro-dialog-button-close":"_dialog-button-close_vitro-dialog-button-close_1p27cEz","vitro-button-close":"_dialog-button-close_vitro-button-close_2BpzTR0"};
|
|
63690
|
+
|
|
63628
63691
|
var DialogCloseButton = function DialogCloseButton(props) {
|
|
63629
63692
|
useEffect(function () {
|
|
63630
63693
|
window.document.addEventListener(EVENT.KEYDOWN, escFunction, false);
|
|
@@ -63641,7 +63704,7 @@ var DialogCloseButton = function DialogCloseButton(props) {
|
|
|
63641
63704
|
onClick: props.onClose,
|
|
63642
63705
|
text: props.text,
|
|
63643
63706
|
isDisabled: props.isDisabled,
|
|
63644
|
-
className:
|
|
63707
|
+
className: dialogButtonCloseStyles['vitro-button-close']
|
|
63645
63708
|
});
|
|
63646
63709
|
};
|
|
63647
63710
|
|
|
@@ -63655,18 +63718,77 @@ var LOCALE$5;
|
|
|
63655
63718
|
var styles$C = {"vitro-dialog-footer":"_dialog-footer_vitro-dialog-footer_2vUQ3aG"};
|
|
63656
63719
|
|
|
63657
63720
|
var DialogFooter = function DialogFooter(props) {
|
|
63721
|
+
var _props$buttonList, _props$buttonList2;
|
|
63658
63722
|
var localeService = useInjection(SERVICE.LOCALE);
|
|
63659
|
-
var labelClose = props.labelClose || localeService.create(props.
|
|
63660
|
-
var
|
|
63723
|
+
var labelClose = props.labelClose || localeService.create((_props$buttonList = props.buttonList) !== null && _props$buttonList !== void 0 && _props$buttonList.length ? LOCALE$5.ACTION_CANCEL : LOCALE$5.ACTION_CLOSE);
|
|
63724
|
+
var onClose = function onClose() {
|
|
63725
|
+
if (props.onClose) {
|
|
63726
|
+
props.onClose(props.dialog);
|
|
63727
|
+
}
|
|
63728
|
+
};
|
|
63661
63729
|
return React__default.createElement("div", {
|
|
63662
63730
|
className: styles$C['vitro-dialog-footer']
|
|
63663
|
-
}, props.
|
|
63664
|
-
text: labelAction,
|
|
63665
|
-
onClick: props.onActionClick
|
|
63666
|
-
}), props.isDismissible && React__default.createElement(DialogCloseButton, {
|
|
63731
|
+
}, props.isDismissible && props.onClose && React__default.createElement(DialogCloseButton, {
|
|
63667
63732
|
text: labelClose,
|
|
63668
|
-
|
|
63669
|
-
|
|
63733
|
+
isDisabled: !props.isDismissible,
|
|
63734
|
+
onClose: onClose
|
|
63735
|
+
}), (_props$buttonList2 = props.buttonList) !== null && _props$buttonList2 !== void 0 && _props$buttonList2.length ? props.buttonList.map(function (button) {
|
|
63736
|
+
return React__default.createElement(DialogButton, {
|
|
63737
|
+
text: button.text,
|
|
63738
|
+
onClick: function onClick() {
|
|
63739
|
+
return button.onClick(props.dialog);
|
|
63740
|
+
},
|
|
63741
|
+
isDisabled: button.isDisabled,
|
|
63742
|
+
className: button.className
|
|
63743
|
+
});
|
|
63744
|
+
}) : null);
|
|
63745
|
+
};
|
|
63746
|
+
|
|
63747
|
+
var dialogStyles = {"vitro-dialog":"_dialog_vitro-dialog_2NzcRZg"};
|
|
63748
|
+
|
|
63749
|
+
var Dialog = function Dialog(props) {
|
|
63750
|
+
var _props$buttonList;
|
|
63751
|
+
var _useState = useState(null),
|
|
63752
|
+
component = _useState[0],
|
|
63753
|
+
setComponent = _useState[1];
|
|
63754
|
+
var className = dialogStyles['vitro-dialog'];
|
|
63755
|
+
var showFooter = !props.isHideFooter && (((_props$buttonList = props.buttonList) === null || _props$buttonList === void 0 ? void 0 : _props$buttonList.length) || props.onClose);
|
|
63756
|
+
useEffect(function () {
|
|
63757
|
+
if (props.content) {
|
|
63758
|
+
var c = React__default.createElement(props.content.component, props.content.props);
|
|
63759
|
+
setComponent(c);
|
|
63760
|
+
}
|
|
63761
|
+
}, [props.content]);
|
|
63762
|
+
var onClose = function onClose() {
|
|
63763
|
+
if (props.onClose) {
|
|
63764
|
+
props.onClose(props.dialog);
|
|
63765
|
+
}
|
|
63766
|
+
};
|
|
63767
|
+
var onOutsideClick = function onOutsideClick(e) {
|
|
63768
|
+
if (e.target && e.target.className === className) {
|
|
63769
|
+
onClose();
|
|
63770
|
+
}
|
|
63771
|
+
};
|
|
63772
|
+
return React__default.createElement("div", {
|
|
63773
|
+
className: className,
|
|
63774
|
+
onClick: onOutsideClick
|
|
63775
|
+
}, React__default.createElement(DialogComponent, {
|
|
63776
|
+
width: props.width,
|
|
63777
|
+
height: props.height
|
|
63778
|
+
}, props.isDismissible && React__default.createElement("button", {
|
|
63779
|
+
className: dialogButtonCloseStyles['vitro-dialog-button-close'],
|
|
63780
|
+
onClick: onClose
|
|
63781
|
+
}), React__default.createElement(DialogHeader, {
|
|
63782
|
+
title: props.title,
|
|
63783
|
+
description: props.description,
|
|
63784
|
+
imageUrl: props.imageUrl
|
|
63785
|
+
}), component && React__default.createElement(DialogContent, null, component), props.children, showFooter ? React__default.createElement(DialogFooter, {
|
|
63786
|
+
dialog: props.dialog,
|
|
63787
|
+
buttonList: props.buttonList,
|
|
63788
|
+
labelClose: props.labelClose,
|
|
63789
|
+
onClose: props.onClose,
|
|
63790
|
+
isDismissible: props.isDismissible
|
|
63791
|
+
}) : null));
|
|
63670
63792
|
};
|
|
63671
63793
|
|
|
63672
63794
|
var styles$D = {"vitro-user-profile":"_user-profile_vitro-user-profile_11XpBoQ","vitro-dropdown-item":"_user-profile_vitro-dropdown-item_dSErsta"};
|