@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
@@ -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["vitro-tree-view"]
20391
+ className: styles$3['vitro-tree-view']
20307
20392
  }));
20308
20393
  };
20309
20394
 
@@ -21122,9 +21207,15 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21122
21207
  });
21123
21208
  };
21124
21209
  _proto.upload = function upload(e) {
21210
+ var _this = this;
21125
21211
  this.initAuthorization(e, this.token);
21126
21212
  this.fileList = [].concat(this.fileList, e.files);
21127
21213
  this.toggleButtons(true);
21214
+ if (this.settings.async.isAutoUpload && this.settings.getFileImage) {
21215
+ e.files.forEach(function (file) {
21216
+ _this.setFileImage(file);
21217
+ });
21218
+ }
21128
21219
  if (this.settings.upload) {
21129
21220
  this.settings.upload(e);
21130
21221
  }
@@ -21164,7 +21255,7 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21164
21255
  this.setProgressBar(info.percent);
21165
21256
  };
21166
21257
  _proto.complete = function complete(e) {
21167
- var _this = this;
21258
+ var _this2 = this;
21168
21259
  this.progressInfo.addClass('vitro-upload-complete');
21169
21260
  this.subtitle.empty();
21170
21261
  this.title.text(this.localeService.create(LOCALE.SUCCESS, {
@@ -21178,14 +21269,20 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21178
21269
  this.setProgressBar(100);
21179
21270
  if (this.settings.isAutoReset) {
21180
21271
  window.setTimeout(function () {
21181
- _this.clearAllFiles();
21182
- _this.toggleButtons(false);
21272
+ _this2.clearAllFiles();
21273
+ _this2.toggleButtons(false);
21183
21274
  }, this.settings.resetDurationMs || 5000);
21184
21275
  }
21185
21276
  };
21186
21277
  _proto.select = function select(e) {
21278
+ var _this3 = this;
21187
21279
  this.container.classList.remove('vitro-dropzone-active');
21188
21280
  this.container.classList.add('vitro-upload-active');
21281
+ if (!this.settings.async.isAutoUpload && this.settings.getFileImage) {
21282
+ e.files.forEach(function (file) {
21283
+ _this3.setFileImage(file);
21284
+ });
21285
+ }
21189
21286
  };
21190
21287
  _proto.clear = function clear(e) {
21191
21288
  this.container.classList.remove('vitro-upload-active');
@@ -21209,6 +21306,13 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
21209
21306
  _proto.setAthorizationToken = function setAthorizationToken(token) {
21210
21307
  this.token = token;
21211
21308
  };
21309
+ _proto.setFileImage = function setFileImage(file) {
21310
+ if (this.settings.getFileImage) {
21311
+ var image = this.settings.getFileImage(file.name);
21312
+ var fileImage = $$1("<img class='vitro-file-icon'>").attr('src', image);
21313
+ $$1(this.container).find(".k-file[data-uid='" + file.uid + "'] .k-file-group-wrapper").replaceWith(fileImage);
21314
+ }
21315
+ };
21212
21316
  _proto.setProgressBar = function setProgressBar(percent) {
21213
21317
  this.progressBar.style.width = percent + CTRL.PERCENT;
21214
21318
  if (percent == 100) {
@@ -57660,10 +57764,10 @@ DropdownMenu.defaultProps = defaultProps;
57660
57764
  // SSR case multiple copies of React Aria is not supported.
57661
57765
  const $b5e257d569688ac6$var$defaultContext = {
57662
57766
  prefix: String(Math.round(Math.random() * 10000000000)),
57663
- current: 0,
57664
- isSSR: false
57767
+ current: 0
57665
57768
  };
57666
57769
  const $b5e257d569688ac6$var$SSRContext = /*#__PURE__*/ (React__default).createContext($b5e257d569688ac6$var$defaultContext);
57770
+ const $b5e257d569688ac6$var$IsSSRContext = /*#__PURE__*/ (React__default).createContext(false);
57667
57771
  let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
57668
57772
  let $b5e257d569688ac6$var$componentIds = new WeakMap();
57669
57773
  function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
@@ -57736,8 +57840,7 @@ function $b5e257d569688ac6$export$535bd6ca7f90a273() {
57736
57840
  // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.
57737
57841
  if (typeof (React__default)["useSyncExternalStore"] === "function") return (React__default)["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
57738
57842
  // eslint-disable-next-line react-hooks/rules-of-hooks
57739
- let cur = (useContext)($b5e257d569688ac6$var$SSRContext);
57740
- return cur.isSSR;
57843
+ return (useContext)($b5e257d569688ac6$var$IsSSRContext);
57741
57844
  }
57742
57845
  //# sourceMappingURL=module.js.map
57743
57846
 
@@ -60222,7 +60325,7 @@ var TabGroupComponent = function TabGroupComponent(props) {
60222
60325
  }
60223
60326
  }, [currentTab, props.itemList]);
60224
60327
  return React__default.createElement("div", {
60225
- className: styles$c['vitro-tab'],
60328
+ className: styles$c['vitro-tab'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY),
60226
60329
  ref: ref
60227
60330
  }, React__default.createElement(TabGroupHeader, {
60228
60331
  itemList: props.itemList,
@@ -63191,11 +63294,12 @@ var CommandMenuSubItem = function CommandMenuSubItem(props) {
63191
63294
  return React__default.createElement(DropdownItem$2, {
63192
63295
  onClick: onClick,
63193
63296
  toggle: props.toggle === false ? false : true
63297
+ }, React__default.createElement("div", {
63298
+ className: styles$u['vitro-icon']
63194
63299
  }, props.imageUrl && React__default.createElement(Icon, {
63195
63300
  defaultUrl: props.imageUrl,
63196
- hoverUrl: props.imageHoverUrl,
63197
- className: styles$u['vitro-icon']
63198
- }), React__default.createElement("span", null, props.text));
63301
+ hoverUrl: props.imageHoverUrl
63302
+ })), React__default.createElement("span", null, props.text));
63199
63303
  };
63200
63304
 
63201
63305
  var CommandMenuItemHeader = function CommandMenuItemHeader(props) {
@@ -63513,9 +63617,9 @@ var Alert$1 = function Alert(props) {
63513
63617
  return React__default.createElement("div", {
63514
63618
  tabIndex: 1,
63515
63619
  onBlur: onFocusOut,
63516
- ref: ref
63620
+ ref: ref,
63621
+ className: className
63517
63622
  }, React__default.createElement(BootstrapAlert, {
63518
- className: className,
63519
63623
  variant: props.type,
63520
63624
  onClose: props.onClose
63521
63625
  }, React__default.createElement("div", {
@@ -63551,52 +63655,27 @@ var DialogComponent = function DialogComponent(props) {
63551
63655
  }, props.children);
63552
63656
  };
63553
63657
 
63554
- var headerStyles = {"vitro-dialog-header":"_dialog-header_vitro-dialog-header_2W3GraU"};
63658
+ var styles$z = {"vitro-dialog-content":"_dialog-content_vitro-dialog-content_qQNWu6x"};
63555
63659
 
63556
- var DialogHeader = function DialogHeader(props) {
63557
- return React__default.createElement("div", {
63558
- className: headerStyles['vitro-dialog-header']
63559
- }, props.title);
63560
- };
63561
-
63562
- var dialogStyles = {"vitro-dialog":"_dialog_vitro-dialog_2NzcRZg"};
63563
-
63564
- 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"};
63565
-
63566
- var Dialog = function Dialog(props) {
63567
- var className = dialogStyles['vitro-dialog'];
63568
- var onClose = function onClose() {
63569
- if (props.onClose) {
63570
- props.onClose();
63571
- }
63572
- };
63573
- var onOutsideClick = function onOutsideClick(e) {
63574
- if (e.target && e.target.className === className) {
63575
- onClose();
63576
- }
63577
- };
63660
+ var DialogContent = function DialogContent(props) {
63578
63661
  return React__default.createElement("div", {
63579
- className: className,
63580
- onClick: onOutsideClick
63581
- }, React__default.createElement(DialogComponent, {
63582
- width: props.width,
63583
- height: props.height
63584
- }, props.isDismissible && React__default.createElement("button", {
63585
- className: styles$z['vitro-dialog-button-close'],
63586
- onClick: onClose
63587
- }), React__default.createElement(DialogHeader, {
63588
- title: props.title
63589
- }), props.children.length ? props.children.map(function (child) {
63590
- return React__default.cloneElement(child, _extends({}, props));
63591
- }) : 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);
63592
63664
  };
63593
63665
 
63594
- var styles$A = {"vitro-dialog-content":"_dialog-content_vitro-dialog-content_qQNWu6x"};
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"};
63595
63667
 
63596
- var DialogContent = function DialogContent(props) {
63668
+ var DialogHeader = function DialogHeader(props) {
63597
63669
  return React__default.createElement("div", {
63598
- className: styles$A['vitro-dialog-content']
63599
- }, props.children);
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)));
63600
63679
  };
63601
63680
 
63602
63681
  var styles$B = {"vitro-dialog-button":"_dialog-button_vitro-dialog-button_1fQ5l22"};
@@ -63607,6 +63686,8 @@ var DialogButton = function DialogButton(props) {
63607
63686
  }));
63608
63687
  };
63609
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
+
63610
63691
  var DialogCloseButton = function DialogCloseButton(props) {
63611
63692
  useEffect(function () {
63612
63693
  window.document.addEventListener(EVENT.KEYDOWN, escFunction, false);
@@ -63623,7 +63704,7 @@ var DialogCloseButton = function DialogCloseButton(props) {
63623
63704
  onClick: props.onClose,
63624
63705
  text: props.text,
63625
63706
  isDisabled: props.isDisabled,
63626
- className: styles$z['vitro-button-close']
63707
+ className: dialogButtonCloseStyles['vitro-button-close']
63627
63708
  });
63628
63709
  };
63629
63710
 
@@ -63637,18 +63718,77 @@ var LOCALE$5;
63637
63718
  var styles$C = {"vitro-dialog-footer":"_dialog-footer_vitro-dialog-footer_2vUQ3aG"};
63638
63719
 
63639
63720
  var DialogFooter = function DialogFooter(props) {
63721
+ var _props$buttonList, _props$buttonList2;
63640
63722
  var localeService = useInjection(SERVICE.LOCALE);
63641
- var labelClose = props.labelClose || localeService.create(props.onActionClick ? LOCALE$5.ACTION_CANCEL : LOCALE$5.ACTION_CLOSE);
63642
- var labelAction = props.labelAction || localeService.create(LOCALE$5.ACTION_SAVE);
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
+ };
63643
63729
  return React__default.createElement("div", {
63644
63730
  className: styles$C['vitro-dialog-footer']
63645
- }, props.children, props.onActionClick && React__default.createElement(DialogButton, {
63646
- text: labelAction,
63647
- onClick: props.onActionClick
63648
- }), props.isDismissible && React__default.createElement(DialogCloseButton, {
63731
+ }, props.isDismissible && props.onClose && React__default.createElement(DialogCloseButton, {
63649
63732
  text: labelClose,
63650
- onClose: props.onClose ? props.onClose : function () {}
63651
- }));
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));
63652
63792
  };
63653
63793
 
63654
63794
  var styles$D = {"vitro-user-profile":"_user-profile_vitro-user-profile_11XpBoQ","vitro-dropdown-item":"_user-profile_vitro-dropdown-item_dSErsta"};