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