@vitrosoftware/common-ui-ts 1.1.22 → 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 (39) 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 -2
  15. package/css/std/controls/uploader/uploader.css +4 -0
  16. package/dist/constants/Event.d.ts +2 -1
  17. package/dist/controls/Dialog/Dialog.d.ts +16 -6
  18. package/dist/controls/Dialog/DialogButton.d.ts +2 -3
  19. package/dist/controls/Dialog/DialogComponent.d.ts +0 -1
  20. package/dist/controls/Dialog/DialogContent.d.ts +1 -0
  21. package/dist/controls/Dialog/DialogFooter.d.ts +5 -5
  22. package/dist/controls/Dialog/DialogHeader.d.ts +2 -0
  23. package/dist/controls/TabGroup/TabGroup.d.ts +1 -0
  24. package/dist/controls/TabGroup/TabGroupComponent.d.ts +1 -0
  25. package/dist/controls/TelerikUploader/TelerikUploaderContextImpl.d.ts +1 -0
  26. package/dist/controls/TelerikUploader/TelerikUploaderSettings.d.ts +1 -0
  27. package/dist/controls/TreeView/JsTreeViewContextImpl.d.ts +7 -0
  28. package/dist/controls/TreeView/TreeView.d.ts +2 -0
  29. package/dist/controls/TreeView/TreeViewConfig.d.ts +12 -6
  30. package/dist/controls/TreeView/TreeViewConstants.d.ts +23 -1
  31. package/dist/controls/TreeView/TreeViewContext.d.ts +7 -0
  32. package/dist/index.css +134 -88
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +241 -101
  35. package/dist/index.js.map +1 -1
  36. package/dist/index.modern.js +241 -101
  37. package/dist/index.modern.js.map +1 -1
  38. package/package.json +2 -2
  39. package/src/controls/PdfViewer/js/pdf-viewer.js +213 -71
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
 
@@ -21124,9 +21209,15 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21124
21209
  });
21125
21210
  };
21126
21211
  _proto.upload = function upload(e) {
21212
+ var _this = this;
21127
21213
  this.initAuthorization(e, this.token);
21128
21214
  this.fileList = [].concat(this.fileList, e.files);
21129
21215
  this.toggleButtons(true);
21216
+ if (this.settings.async.isAutoUpload && this.settings.getFileImage) {
21217
+ e.files.forEach(function (file) {
21218
+ _this.setFileImage(file);
21219
+ });
21220
+ }
21130
21221
  if (this.settings.upload) {
21131
21222
  this.settings.upload(e);
21132
21223
  }
@@ -21166,7 +21257,7 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21166
21257
  this.setProgressBar(info.percent);
21167
21258
  };
21168
21259
  _proto.complete = function complete(e) {
21169
- var _this = this;
21260
+ var _this2 = this;
21170
21261
  this.progressInfo.addClass('vitro-upload-complete');
21171
21262
  this.subtitle.empty();
21172
21263
  this.title.text(this.localeService.create(LOCALE.SUCCESS, {
@@ -21180,14 +21271,20 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21180
21271
  this.setProgressBar(100);
21181
21272
  if (this.settings.isAutoReset) {
21182
21273
  window.setTimeout(function () {
21183
- _this.clearAllFiles();
21184
- _this.toggleButtons(false);
21274
+ _this2.clearAllFiles();
21275
+ _this2.toggleButtons(false);
21185
21276
  }, this.settings.resetDurationMs || 5000);
21186
21277
  }
21187
21278
  };
21188
21279
  _proto.select = function select(e) {
21280
+ var _this3 = this;
21189
21281
  this.container.classList.remove('vitro-dropzone-active');
21190
21282
  this.container.classList.add('vitro-upload-active');
21283
+ if (!this.settings.async.isAutoUpload && this.settings.getFileImage) {
21284
+ e.files.forEach(function (file) {
21285
+ _this3.setFileImage(file);
21286
+ });
21287
+ }
21191
21288
  };
21192
21289
  _proto.clear = function clear(e) {
21193
21290
  this.container.classList.remove('vitro-upload-active');
@@ -21211,6 +21308,13 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21211
21308
  _proto.setAthorizationToken = function setAthorizationToken(token) {
21212
21309
  this.token = token;
21213
21310
  };
21311
+ _proto.setFileImage = function setFileImage(file) {
21312
+ if (this.settings.getFileImage) {
21313
+ var image = this.settings.getFileImage(file.name);
21314
+ var fileImage = $$1("<img class='vitro-file-icon'>").attr('src', image);
21315
+ $$1(this.container).find(".k-file[data-uid='" + file.uid + "'] .k-file-group-wrapper").replaceWith(fileImage);
21316
+ }
21317
+ };
21214
21318
  _proto.setProgressBar = function setProgressBar(percent) {
21215
21319
  this.progressBar.style.width = percent + CTRL.PERCENT;
21216
21320
  if (percent == 100) {
@@ -57662,10 +57766,10 @@ DropdownMenu.defaultProps = defaultProps;
57662
57766
  // SSR case multiple copies of React Aria is not supported.
57663
57767
  const $b5e257d569688ac6$var$defaultContext = {
57664
57768
  prefix: String(Math.round(Math.random() * 10000000000)),
57665
- current: 0,
57666
- isSSR: false
57769
+ current: 0
57667
57770
  };
57668
57771
  const $b5e257d569688ac6$var$SSRContext = /*#__PURE__*/ (React__default).createContext($b5e257d569688ac6$var$defaultContext);
57772
+ const $b5e257d569688ac6$var$IsSSRContext = /*#__PURE__*/ (React__default).createContext(false);
57669
57773
  let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
57670
57774
  let $b5e257d569688ac6$var$componentIds = new WeakMap();
57671
57775
  function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
@@ -57738,8 +57842,7 @@ function $b5e257d569688ac6$export$535bd6ca7f90a273() {
57738
57842
  // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.
57739
57843
  if (typeof (React__default)["useSyncExternalStore"] === "function") return (React__default)["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
57740
57844
  // eslint-disable-next-line react-hooks/rules-of-hooks
57741
- let cur = (React.useContext)($b5e257d569688ac6$var$SSRContext);
57742
- return cur.isSSR;
57845
+ return (React.useContext)($b5e257d569688ac6$var$IsSSRContext);
57743
57846
  }
57744
57847
 
57745
57848
  const isRoleMenu = el => {
@@ -60223,7 +60326,7 @@ var TabGroupComponent = function TabGroupComponent(props) {
60223
60326
  }
60224
60327
  }, [currentTab, props.itemList]);
60225
60328
  return React__default.createElement("div", {
60226
- className: styles$c['vitro-tab'],
60329
+ className: styles$c['vitro-tab'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY),
60227
60330
  ref: ref
60228
60331
  }, React__default.createElement(TabGroupHeader, {
60229
60332
  itemList: props.itemList,
@@ -63192,11 +63295,12 @@ var CommandMenuSubItem = function CommandMenuSubItem(props) {
63192
63295
  return React__default.createElement(DropdownItem$2, {
63193
63296
  onClick: onClick,
63194
63297
  toggle: props.toggle === false ? false : true
63298
+ }, React__default.createElement("div", {
63299
+ className: styles$u['vitro-icon']
63195
63300
  }, props.imageUrl && React__default.createElement(Icon, {
63196
63301
  defaultUrl: props.imageUrl,
63197
- hoverUrl: props.imageHoverUrl,
63198
- className: styles$u['vitro-icon']
63199
- }), React__default.createElement("span", null, props.text));
63302
+ hoverUrl: props.imageHoverUrl
63303
+ })), React__default.createElement("span", null, props.text));
63200
63304
  };
63201
63305
 
63202
63306
  var CommandMenuItemHeader = function CommandMenuItemHeader(props) {
@@ -63514,9 +63618,9 @@ var Alert$1 = function Alert(props) {
63514
63618
  return React__default.createElement("div", {
63515
63619
  tabIndex: 1,
63516
63620
  onBlur: onFocusOut,
63517
- ref: ref
63621
+ ref: ref,
63622
+ className: className
63518
63623
  }, React__default.createElement(BootstrapAlert, {
63519
- className: className,
63520
63624
  variant: props.type,
63521
63625
  onClose: props.onClose
63522
63626
  }, React__default.createElement("div", {
@@ -63552,52 +63656,27 @@ var DialogComponent = function DialogComponent(props) {
63552
63656
  }, props.children);
63553
63657
  };
63554
63658
 
63555
- var headerStyles = {"vitro-dialog-header":"_dialog-header_vitro-dialog-header_2W3GraU"};
63659
+ var styles$z = {"vitro-dialog-content":"_dialog-content_vitro-dialog-content_qQNWu6x"};
63556
63660
 
63557
- var DialogHeader = function DialogHeader(props) {
63558
- return React__default.createElement("div", {
63559
- className: headerStyles['vitro-dialog-header']
63560
- }, props.title);
63561
- };
63562
-
63563
- var dialogStyles = {"vitro-dialog":"_dialog_vitro-dialog_2NzcRZg"};
63564
-
63565
- 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"};
63566
-
63567
- var Dialog = function Dialog(props) {
63568
- var className = dialogStyles['vitro-dialog'];
63569
- var onClose = function onClose() {
63570
- if (props.onClose) {
63571
- props.onClose();
63572
- }
63573
- };
63574
- var onOutsideClick = function onOutsideClick(e) {
63575
- if (e.target && e.target.className === className) {
63576
- onClose();
63577
- }
63578
- };
63661
+ var DialogContent = function DialogContent(props) {
63579
63662
  return React__default.createElement("div", {
63580
- className: className,
63581
- onClick: onOutsideClick
63582
- }, React__default.createElement(DialogComponent, {
63583
- width: props.width,
63584
- height: props.height
63585
- }, props.isDismissible && React__default.createElement("button", {
63586
- className: styles$z['vitro-dialog-button-close'],
63587
- onClick: onClose
63588
- }), React__default.createElement(DialogHeader, {
63589
- title: props.title
63590
- }), props.children.length ? props.children.map(function (child) {
63591
- return React__default.cloneElement(child, _extends({}, props));
63592
- }) : 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);
63593
63665
  };
63594
63666
 
63595
- 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"};
63596
63668
 
63597
- var DialogContent = function DialogContent(props) {
63669
+ var DialogHeader = function DialogHeader(props) {
63598
63670
  return React__default.createElement("div", {
63599
- className: styles$A['vitro-dialog-content']
63600
- }, 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)));
63601
63680
  };
63602
63681
 
63603
63682
  var styles$B = {"vitro-dialog-button":"_dialog-button_vitro-dialog-button_1fQ5l22"};
@@ -63608,6 +63687,8 @@ var DialogButton = function DialogButton(props) {
63608
63687
  }));
63609
63688
  };
63610
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
+
63611
63692
  var DialogCloseButton = function DialogCloseButton(props) {
63612
63693
  React.useEffect(function () {
63613
63694
  window.document.addEventListener(exports.EVENT.KEYDOWN, escFunction, false);
@@ -63624,7 +63705,7 @@ var DialogCloseButton = function DialogCloseButton(props) {
63624
63705
  onClick: props.onClose,
63625
63706
  text: props.text,
63626
63707
  isDisabled: props.isDisabled,
63627
- className: styles$z['vitro-button-close']
63708
+ className: dialogButtonCloseStyles['vitro-button-close']
63628
63709
  });
63629
63710
  };
63630
63711
 
@@ -63638,18 +63719,77 @@ var LOCALE$5;
63638
63719
  var styles$C = {"vitro-dialog-footer":"_dialog-footer_vitro-dialog-footer_2vUQ3aG"};
63639
63720
 
63640
63721
  var DialogFooter = function DialogFooter(props) {
63722
+ var _props$buttonList, _props$buttonList2;
63641
63723
  var localeService = inversifyReact.useInjection(SERVICE.LOCALE);
63642
- var labelClose = props.labelClose || localeService.create(props.onActionClick ? LOCALE$5.ACTION_CANCEL : LOCALE$5.ACTION_CLOSE);
63643
- 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
+ };
63644
63730
  return React__default.createElement("div", {
63645
63731
  className: styles$C['vitro-dialog-footer']
63646
- }, props.children, props.onActionClick && React__default.createElement(DialogButton, {
63647
- text: labelAction,
63648
- onClick: props.onActionClick
63649
- }), props.isDismissible && React__default.createElement(DialogCloseButton, {
63732
+ }, props.isDismissible && props.onClose && React__default.createElement(DialogCloseButton, {
63650
63733
  text: labelClose,
63651
- onClose: props.onClose ? props.onClose : function () {}
63652
- }));
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));
63653
63793
  };
63654
63794
 
63655
63795
  var styles$D = {"vitro-user-profile":"_user-profile_vitro-user-profile_11XpBoQ","vitro-dropdown-item":"_user-profile_vitro-dropdown-item_dSErsta"};