@vitrosoftware/common-ui-ts 1.1.13 → 1.1.15
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 +7 -1
- package/css/std/controls/avatar/avatar.css +21 -0
- package/css/std/controls/command-menu/command-menu-button.css +10 -0
- package/css/std/controls/command-menu/command-menu-dropdown-button.css +19 -0
- package/css/std/controls/lookup-picker/lookup-picker-html-value.css +8 -0
- package/css/std/controls/lookup-picker/lookup-picker-selected-item.css +3 -1
- package/css/std/controls/lookup-picker/lookup-picker-value-list.css +19 -4
- package/css/std/controls/sidebar/sidebar-item.css +74 -13
- package/css/std/controls/sidebar/sidebar.css +45 -19
- package/css/std/controls/table-view/table-view.css +1 -1
- package/css/std/controls/table-view/treegrid.css +4 -0
- package/css/std/controls/uploader/uploader.css +11 -2
- package/css/std/controls/user-profile/user-profile.css +77 -0
- package/dist/controls/Avatar/Avatar.d.ts +8 -0
- package/dist/controls/LookupPicker/LookupPicker.d.ts +6 -1
- package/dist/controls/LookupPicker/SelectedValueList.d.ts +4 -1
- package/dist/controls/LookupPicker/ValueList.d.ts +4 -1
- package/dist/controls/LookupPicker/ValueListItem.d.ts +11 -0
- package/dist/controls/Sidebar/LinkItem.d.ts +1 -0
- package/dist/controls/Sidebar/Section.d.ts +1 -0
- package/dist/controls/Sidebar/SectionList.d.ts +3 -2
- package/dist/controls/Sidebar/Sidebar.d.ts +1 -0
- package/dist/controls/UserLookupPicker/UserLookupPicker.d.ts +38 -0
- package/dist/controls/UserProfile/UserProfile.d.ts +12 -0
- package/dist/controls/UserProfile/UserProfileMenuItem.d.ts +11 -0
- package/dist/index.css +304 -41
- package/dist/index.d.ts +6 -0
- package/dist/index.js +299 -48
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +297 -49
- package/dist/index.modern.js.map +1 -1
- package/lib/third-party.js +97104 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -58719,13 +58719,13 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58719
58719
|
}, []);
|
|
58720
58720
|
var data = React.useMemo(function () {
|
|
58721
58721
|
return {
|
|
58722
|
-
itemList: props.itemList || [props.item]
|
|
58722
|
+
itemList: props.itemList || [props.item],
|
|
58723
|
+
itemCount: props.itemList ? props.itemList.length : [props.item].length
|
|
58723
58724
|
};
|
|
58724
58725
|
}, []);
|
|
58725
58726
|
var progressBarRef = React.useRef(null);
|
|
58726
58727
|
var localeService = inversifyReact.useInjection(SERVICE.LOCALE);
|
|
58727
58728
|
var action = props.actionText || localeService.create(LOCALE$1.ACTION + CTRL.DOT + props.actionCode);
|
|
58728
|
-
var itemCount = data.itemList.length;
|
|
58729
58729
|
React.useEffect(function () {
|
|
58730
58730
|
setIsCloseByOutsideClick(currentAction !== actionMap$1.progress);
|
|
58731
58731
|
if (currentAction === actionMap$1.before) {
|
|
@@ -58765,17 +58765,17 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58765
58765
|
if (props.isConfirm) {
|
|
58766
58766
|
var confText;
|
|
58767
58767
|
if (props.confirmText && props.confirmText()) {
|
|
58768
|
-
confText = props.confirmText(itemCount);
|
|
58768
|
+
confText = props.confirmText(data.itemCount);
|
|
58769
58769
|
} else {
|
|
58770
|
-
if (itemCount === 1) {
|
|
58770
|
+
if (data.itemCount === 1) {
|
|
58771
58771
|
confText = localeService.create(LOCALE$1.CONF_SINGLE, {
|
|
58772
58772
|
actionCode: action,
|
|
58773
|
-
itemCount: itemCount
|
|
58773
|
+
itemCount: data.itemCount
|
|
58774
58774
|
});
|
|
58775
58775
|
} else {
|
|
58776
58776
|
confText = localeService.create(LOCALE$1.CONF_MULTI, {
|
|
58777
58777
|
actionCode: action,
|
|
58778
|
-
itemCount: itemCount
|
|
58778
|
+
itemCount: data.itemCount
|
|
58779
58779
|
});
|
|
58780
58780
|
}
|
|
58781
58781
|
}
|
|
@@ -58804,13 +58804,13 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58804
58804
|
setActionResult(success, successResult, failResult);
|
|
58805
58805
|
if (success) {
|
|
58806
58806
|
if (props.successText && props.successText()) {
|
|
58807
|
-
setText(props.successText(itemCount));
|
|
58807
|
+
setText(props.successText(data.itemCount));
|
|
58808
58808
|
}
|
|
58809
58809
|
} else {
|
|
58810
58810
|
if (error && error.text) {
|
|
58811
58811
|
setText(error.text);
|
|
58812
58812
|
} else if (props.errorText) {
|
|
58813
|
-
setText(props.errorText(error, itemCount));
|
|
58813
|
+
setText(props.errorText(error, data.itemCount));
|
|
58814
58814
|
}
|
|
58815
58815
|
}
|
|
58816
58816
|
};
|
|
@@ -58821,28 +58821,28 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58821
58821
|
var key = [LOCALE$1.ACTION_MSG, props.actionCode, LOCALE$1.SUCCESS].join(CTRL.DOT);
|
|
58822
58822
|
setText(localeService.create(key, {
|
|
58823
58823
|
actionCode: action,
|
|
58824
|
-
count:
|
|
58824
|
+
count: successResult.length
|
|
58825
58825
|
}));
|
|
58826
58826
|
} else if (successResult.length && failResult.length) {
|
|
58827
58827
|
setIcon(styles$6['vitro-icon-warning']);
|
|
58828
58828
|
setState(styles$6['vitro-warning']);
|
|
58829
|
-
var _key = itemCount === 1 ? LOCALE$1.WARNING_SINGLE : LOCALE$1.WARNING_MULTI;
|
|
58829
|
+
var _key = data.itemCount === 1 ? LOCALE$1.WARNING_SINGLE : LOCALE$1.WARNING_MULTI;
|
|
58830
58830
|
setText(localeService.create(_key, {
|
|
58831
58831
|
actionCode: action,
|
|
58832
|
-
itemCount: itemCount
|
|
58832
|
+
itemCount: data.itemCount
|
|
58833
58833
|
}));
|
|
58834
58834
|
} else {
|
|
58835
58835
|
setIcon(styles$6['vitro-icon-error']);
|
|
58836
58836
|
setState(styles$6['vitro-error']);
|
|
58837
|
-
var _key2 = itemCount === 1 ? LOCALE$1.ERROR_SINGLE : LOCALE$1.ERROR_MULTI;
|
|
58837
|
+
var _key2 = data.itemCount === 1 ? LOCALE$1.ERROR_SINGLE : LOCALE$1.ERROR_MULTI;
|
|
58838
58838
|
setText(localeService.create(_key2, {
|
|
58839
58839
|
actionCode: action,
|
|
58840
|
-
itemCount: itemCount
|
|
58840
|
+
itemCount: data.itemCount
|
|
58841
58841
|
}));
|
|
58842
58842
|
}
|
|
58843
58843
|
};
|
|
58844
58844
|
var setProgress = function setProgress(index) {
|
|
58845
|
-
var percent = index * 100 / itemCount;
|
|
58845
|
+
var percent = index * 100 / data.itemCount;
|
|
58846
58846
|
if (progressBarRef.current) {
|
|
58847
58847
|
progressBarRef.current.style.width = percent + CTRL.PERCENT;
|
|
58848
58848
|
}
|
|
@@ -58851,9 +58851,9 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58851
58851
|
try {
|
|
58852
58852
|
init();
|
|
58853
58853
|
if (props.progressText) {
|
|
58854
|
-
setText(props.progressText(itemCount));
|
|
58854
|
+
setText(props.progressText(data.itemCount));
|
|
58855
58855
|
} else {
|
|
58856
|
-
if (itemCount === 1) {
|
|
58856
|
+
if (data.itemCount === 1) {
|
|
58857
58857
|
setText(localeService.create(LOCALE$1.PROGRESS_SINGLE, {
|
|
58858
58858
|
actionCode: action
|
|
58859
58859
|
}));
|
|
@@ -58861,7 +58861,7 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58861
58861
|
setText(localeService.create(LOCALE$1.PROGRESS_MULTI, {
|
|
58862
58862
|
idx: 1,
|
|
58863
58863
|
actionCode: action,
|
|
58864
|
-
itemCount: itemCount
|
|
58864
|
+
itemCount: data.itemCount
|
|
58865
58865
|
}));
|
|
58866
58866
|
}
|
|
58867
58867
|
}
|
|
@@ -58913,13 +58913,14 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58913
58913
|
}, function () {
|
|
58914
58914
|
if (cancellationToken.cancel) {
|
|
58915
58915
|
data.itemList = data.itemList.slice(0, _i + 1);
|
|
58916
|
+
data.itemCount = data.itemList.length;
|
|
58916
58917
|
_interrupt = true;
|
|
58917
58918
|
return;
|
|
58918
58919
|
}
|
|
58919
|
-
if (itemCount > 1) {
|
|
58920
|
+
if (data.itemCount > 1) {
|
|
58920
58921
|
setText(localeService.create(LOCALE$1.PROGRESS_MULTI, {
|
|
58921
58922
|
idx: _i + 1,
|
|
58922
|
-
itemCount: itemCount,
|
|
58923
|
+
itemCount: data.itemCount,
|
|
58923
58924
|
actionCode: action
|
|
58924
58925
|
}));
|
|
58925
58926
|
} else {
|
|
@@ -59004,7 +59005,7 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
59004
59005
|
}))), showItemCount && React__default.createElement("span", {
|
|
59005
59006
|
className: styles$6['vitro-small']
|
|
59006
59007
|
}, localeService.create(LOCALE$1.ITEM_COUNT, {
|
|
59007
|
-
itemCount: itemCount
|
|
59008
|
+
itemCount: data.itemCount
|
|
59008
59009
|
})), showInfo && React__default.createElement(ActionInfo, {
|
|
59009
59010
|
itemList: data.itemList,
|
|
59010
59011
|
successResult: successResult,
|
|
@@ -59969,6 +59970,8 @@ var TimePicker = function TimePicker(props) {
|
|
|
59969
59970
|
|
|
59970
59971
|
var styles$h = {"vitro-selected-item":"_lookup-picker-selected-item_vitro-selected-item_hw-euth"};
|
|
59971
59972
|
|
|
59973
|
+
var htmlValueStyles = {"vitro-item-html-value":"_lookup-picker-html-value_vitro-item-html-value_2QBoTey"};
|
|
59974
|
+
|
|
59972
59975
|
var SelectedValueList = function SelectedValueList(props) {
|
|
59973
59976
|
return React__default.createElement(React__default.Fragment, null, props.list.map(function (x) {
|
|
59974
59977
|
var title = props.selectedValueTemplate(x);
|
|
@@ -59976,7 +59979,9 @@ var SelectedValueList = function SelectedValueList(props) {
|
|
|
59976
59979
|
key: x.id,
|
|
59977
59980
|
className: styles$h['vitro-selected-item'],
|
|
59978
59981
|
title: title
|
|
59979
|
-
},
|
|
59982
|
+
}, props.getHtmlValue ? React__default.createElement("div", {
|
|
59983
|
+
className: htmlValueStyles['vitro-item-html-value']
|
|
59984
|
+
}, props.getHtmlValue(x)) : null, React__default.createElement("span", null, title), props.isMultiSelect && React__default.createElement("div", {
|
|
59980
59985
|
onClick: function onClick() {
|
|
59981
59986
|
return props.onOptionValueDelete(x.id);
|
|
59982
59987
|
},
|
|
@@ -59985,7 +59990,23 @@ var SelectedValueList = function SelectedValueList(props) {
|
|
|
59985
59990
|
}));
|
|
59986
59991
|
};
|
|
59987
59992
|
|
|
59988
|
-
var styles$i = {"vitro-value-list":"_lookup-picker-value-list_vitro-value-list_LSdCMjq","vitro-item":"_lookup-picker-value-list_vitro-item_7yZBz5u","vitro-placeholder-empty":"_lookup-picker-value-list_vitro-placeholder-empty_fTVHWwc","vitro-keyword-highlight":"_lookup-picker-value-list_vitro-keyword-highlight_1uESHan","vitro-display-none":"_lookup-picker-value-list_vitro-display-none_2kDzC6K"};
|
|
59993
|
+
var styles$i = {"vitro-value-list":"_lookup-picker-value-list_vitro-value-list_LSdCMjq","vitro-item":"_lookup-picker-value-list_vitro-item_7yZBz5u","vitro-item-html-value":"_lookup-picker-value-list_vitro-item-html-value_1yl9tXx","vitro-placeholder-empty":"_lookup-picker-value-list_vitro-placeholder-empty_fTVHWwc","vitro-keyword-highlight":"_lookup-picker-value-list_vitro-keyword-highlight_1uESHan","vitro-display-none":"_lookup-picker-value-list_vitro-display-none_2kDzC6K"};
|
|
59994
|
+
|
|
59995
|
+
var ValueListItem = function ValueListItem(props) {
|
|
59996
|
+
return React__default.createElement("div", {
|
|
59997
|
+
key: props.item.id,
|
|
59998
|
+
className: styles$i['vitro-item'],
|
|
59999
|
+
onClick: function onClick() {
|
|
60000
|
+
return props.onSelect(props.item.id);
|
|
60001
|
+
}
|
|
60002
|
+
}, props.htmlValue ? React__default.createElement("div", {
|
|
60003
|
+
className: htmlValueStyles['vitro-item-html-value']
|
|
60004
|
+
}, props.htmlValue) : null, React__default.createElement("div", {
|
|
60005
|
+
dangerouslySetInnerHTML: {
|
|
60006
|
+
__html: props.createDisplayValue(props.item)
|
|
60007
|
+
}
|
|
60008
|
+
}));
|
|
60009
|
+
};
|
|
59989
60010
|
|
|
59990
60011
|
var FLAG = 'gi';
|
|
59991
60012
|
var ValueList = function ValueList(props) {
|
|
@@ -60008,15 +60029,11 @@ var ValueList = function ValueList(props) {
|
|
|
60008
60029
|
}, React__default.createElement(commonUi.ScrollBar, {
|
|
60009
60030
|
onInit: setScrollableElement
|
|
60010
60031
|
}, props.isPending && React__default.createElement(commonUi.Progress, null), !props.isPending && React__default.createElement(React__default.Fragment, null, props.list.length > 0 ? props.list.map(function (x) {
|
|
60011
|
-
return React__default.createElement(
|
|
60012
|
-
|
|
60013
|
-
|
|
60014
|
-
|
|
60015
|
-
|
|
60016
|
-
},
|
|
60017
|
-
dangerouslySetInnerHTML: {
|
|
60018
|
-
__html: createDisplayValue(x)
|
|
60019
|
-
}
|
|
60032
|
+
return React__default.createElement(ValueListItem, {
|
|
60033
|
+
item: x,
|
|
60034
|
+
onSelect: props.onOptionValueSelect,
|
|
60035
|
+
createDisplayValue: createDisplayValue,
|
|
60036
|
+
htmlValue: props.getHtmlValue && props.getHtmlValue(x)
|
|
60020
60037
|
});
|
|
60021
60038
|
}) : React__default.createElement("div", {
|
|
60022
60039
|
className: styles$i['vitro-placeholder-empty']
|
|
@@ -60074,6 +60091,23 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60074
60091
|
}, [props.selectedValueList]);
|
|
60075
60092
|
React.useEffect(function () {
|
|
60076
60093
|
valueListVisible && inputRef && inputRef.current && inputRef.current.focus();
|
|
60094
|
+
if (props.isReadOnly) {
|
|
60095
|
+
if (props.valueList) {
|
|
60096
|
+
updateFilteredValueList(props.valueList);
|
|
60097
|
+
} else if (props.getAllValueList) {
|
|
60098
|
+
setPending(true);
|
|
60099
|
+
var requestToken = {
|
|
60100
|
+
cancel: false
|
|
60101
|
+
};
|
|
60102
|
+
if (valueListRequestToken) {
|
|
60103
|
+
valueListRequestToken.cancel = true;
|
|
60104
|
+
}
|
|
60105
|
+
setValueListRequestToken(requestToken);
|
|
60106
|
+
props.getAllValueList().then(function (valueList) {
|
|
60107
|
+
return onGetValueList(valueList, requestToken);
|
|
60108
|
+
});
|
|
60109
|
+
}
|
|
60110
|
+
}
|
|
60077
60111
|
}, [valueListVisible]);
|
|
60078
60112
|
React.useEffect(function () {
|
|
60079
60113
|
if (props.selectedValue) {
|
|
@@ -60213,6 +60247,12 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60213
60247
|
classList.push(state);
|
|
60214
60248
|
return classList.join(CTRL.SPACE);
|
|
60215
60249
|
};
|
|
60250
|
+
var getHtmlValue = function getHtmlValue(item) {
|
|
60251
|
+
if (props.htmlValueTemplate && props.getHtmlValueTemplateProps) {
|
|
60252
|
+
return React__default.createElement(props.htmlValueTemplate, props.getHtmlValueTemplateProps(item));
|
|
60253
|
+
}
|
|
60254
|
+
return null;
|
|
60255
|
+
};
|
|
60216
60256
|
return React__default.createElement("div", {
|
|
60217
60257
|
className: getClassName(),
|
|
60218
60258
|
tabIndex: 1,
|
|
@@ -60229,7 +60269,8 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60229
60269
|
list: selectedValueList,
|
|
60230
60270
|
onOptionValueDelete: onOptionValueDelete,
|
|
60231
60271
|
selectedValueTemplate: selectedValueTemplate,
|
|
60232
|
-
isMultiSelect: props.isMultiSelect
|
|
60272
|
+
isMultiSelect: props.isMultiSelect,
|
|
60273
|
+
getHtmlValue: getHtmlValue
|
|
60233
60274
|
}) : !valueListVisible && React__default.createElement(React__default.Fragment, null, props.placeholder), !props.isDisabled && !props.isReadOnly && React__default.createElement("input", {
|
|
60234
60275
|
ref: inputRef,
|
|
60235
60276
|
value: inputValue,
|
|
@@ -60238,14 +60279,14 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60238
60279
|
onClick: onFocus,
|
|
60239
60280
|
disabled: props.isDisabled,
|
|
60240
60281
|
readOnly: props.isReadOnly
|
|
60241
|
-
}), !props.isDisabled &&
|
|
60282
|
+
}), !props.isDisabled && props.children, React__default.createElement("div", {
|
|
60242
60283
|
className: styles$j['vitro-right']
|
|
60243
60284
|
}, !props.isMultiSelect && selectedValueList && selectedValueList.length > 0 && !props.isDisabled && !props.isReadOnly && React__default.createElement("div", {
|
|
60244
60285
|
className: styles$j['vitro-button-close'],
|
|
60245
60286
|
onClick: function onClick() {
|
|
60246
60287
|
return onOptionValueDelete();
|
|
60247
60288
|
}
|
|
60248
|
-
}), !props.isDisabled &&
|
|
60289
|
+
}), !props.isDisabled && React__default.createElement("div", {
|
|
60249
60290
|
onClick: function onClick() {
|
|
60250
60291
|
return setValueListVisible(!valueListVisible);
|
|
60251
60292
|
},
|
|
@@ -60253,14 +60294,15 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60253
60294
|
}), props.isReadOnly ? React__default.createElement("span", {
|
|
60254
60295
|
className: styles$j['vitro-button-copy'],
|
|
60255
60296
|
onClick: copyValue
|
|
60256
|
-
}) : null)), !props.isDisabled &&
|
|
60297
|
+
}) : null)), !props.isDisabled && (!props.filterMinLength || props.filterMinLength <= inputValue.length) && React__default.createElement(ValueList, {
|
|
60257
60298
|
isPending: pending,
|
|
60258
60299
|
inputValue: inputValue,
|
|
60259
60300
|
list: filteredValueList,
|
|
60260
60301
|
filterValueTemplate: filterValueTemplate,
|
|
60261
60302
|
onOptionValueSelect: onOptionValueSelect,
|
|
60262
60303
|
isVisible: valueListVisible,
|
|
60263
|
-
emptyPlaceholder: props.emptyPlaceholder || localeService.create(LOCALE$3.PLACEHOLDER_EMPTY)
|
|
60304
|
+
emptyPlaceholder: props.emptyPlaceholder || localeService.create(LOCALE$3.PLACEHOLDER_EMPTY),
|
|
60305
|
+
getHtmlValue: getHtmlValue
|
|
60264
60306
|
}), props.errorMessage && React__default.createElement("span", {
|
|
60265
60307
|
className: styles$j['vitro-error-text']
|
|
60266
60308
|
}, props.errorMessage));
|
|
@@ -62169,7 +62211,7 @@ var CommandMenuDropdownButton = function CommandMenuDropdownButton(props) {
|
|
|
62169
62211
|
}), props.children));
|
|
62170
62212
|
};
|
|
62171
62213
|
|
|
62172
|
-
var styles$o = {"vitro-active":"_sidebar-item_vitro-active_7p5iOhY","vitro-icon-text":"_sidebar-item_vitro-icon-text_3ROhyLK","vitro-item-text":"_sidebar-item_vitro-item-text_1kK_aIZ","vitro-icon":"_sidebar-item_vitro-icon_2B88tow"};
|
|
62214
|
+
var styles$o = {"vitro-active":"_sidebar-item_vitro-active_7p5iOhY","vitro-icon-text":"_sidebar-item_vitro-icon-text_3ROhyLK","vitro-item-text":"_sidebar-item_vitro-item-text_1kK_aIZ","vitro-icon":"_sidebar-item_vitro-icon_2B88tow","vitro-item":"_sidebar-item_vitro-item_1BR_7F0"};
|
|
62173
62215
|
|
|
62174
62216
|
var Item$1 = function Item(props) {
|
|
62175
62217
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", null, React__default.createElement(commonUi.Icon, {
|
|
@@ -62191,6 +62233,8 @@ var TARGET;
|
|
|
62191
62233
|
})(TARGET || (TARGET = {}));
|
|
62192
62234
|
|
|
62193
62235
|
var w$6 = window;
|
|
62236
|
+
var PX_UNIT$3 = 'px';
|
|
62237
|
+
var WIDTH_AUTO = 'auto';
|
|
62194
62238
|
var LinkItem$1 = function LinkItem(props) {
|
|
62195
62239
|
var _useState = React.useState(false),
|
|
62196
62240
|
isHover = _useState[0],
|
|
@@ -62202,7 +62246,11 @@ var LinkItem$1 = function LinkItem(props) {
|
|
|
62202
62246
|
},
|
|
62203
62247
|
onMouseLeave: function onMouseLeave() {
|
|
62204
62248
|
return setIsHover(false);
|
|
62205
|
-
}
|
|
62249
|
+
},
|
|
62250
|
+
style: {
|
|
62251
|
+
width: props.linkItemWidth ? props.linkItemWidth + PX_UNIT$3 : WIDTH_AUTO
|
|
62252
|
+
},
|
|
62253
|
+
className: styles$o['vitro-item']
|
|
62206
62254
|
}, props.link && React__default.createElement(Link, {
|
|
62207
62255
|
to: props.link,
|
|
62208
62256
|
className: isActive ? styles$o['vitro-active'] : CTRL.EMPTY
|
|
@@ -62214,18 +62262,19 @@ var LinkItem$1 = function LinkItem(props) {
|
|
|
62214
62262
|
},
|
|
62215
62263
|
className: isActive ? styles$o['vitro-active'] : CTRL.EMPTY
|
|
62216
62264
|
}, React__default.createElement(Item$1, Object.assign({}, props, {
|
|
62217
|
-
isHover: isActive
|
|
62265
|
+
isHover: isActive
|
|
62218
62266
|
}))), props.href && React__default.createElement("a", {
|
|
62219
62267
|
href: props.href,
|
|
62220
62268
|
target: props.isExternal ? TARGET.BLANK : TARGET.SELF
|
|
62221
62269
|
}, React__default.createElement(Item$1, Object.assign({}, props, {
|
|
62222
|
-
isHover: isActive
|
|
62270
|
+
isHover: isActive
|
|
62223
62271
|
}))));
|
|
62224
62272
|
};
|
|
62225
62273
|
|
|
62226
62274
|
var Section = function Section(props) {
|
|
62227
62275
|
return React__default.createElement("li", null, props.text && React__default.createElement("span", null, props.text), React__default.createElement("ul", null, props.itemList && props.itemList.map(function (i) {
|
|
62228
62276
|
return React__default.createElement(LinkItem$1, Object.assign({
|
|
62277
|
+
linkItemWidth: props.linkItemWidth,
|
|
62229
62278
|
activeItem: props.activeItem,
|
|
62230
62279
|
key: i.text,
|
|
62231
62280
|
currentUrl: props.currentUrl
|
|
@@ -62233,19 +62282,22 @@ var Section = function Section(props) {
|
|
|
62233
62282
|
})));
|
|
62234
62283
|
};
|
|
62235
62284
|
|
|
62236
|
-
var SectionList = function
|
|
62285
|
+
var SectionList = React.forwardRef(function (props, ref) {
|
|
62237
62286
|
if (!props.itemList || props.itemList.length === 0) {
|
|
62238
62287
|
return null;
|
|
62239
62288
|
}
|
|
62240
|
-
return React__default.createElement("ul",
|
|
62289
|
+
return React__default.createElement("ul", {
|
|
62290
|
+
ref: ref
|
|
62291
|
+
}, props.itemList.map(function (section) {
|
|
62241
62292
|
return React__default.createElement(Section, Object.assign({
|
|
62293
|
+
linkItemWidth: props.linkItemWidth,
|
|
62242
62294
|
currentUrl: props.currentUrl,
|
|
62243
62295
|
activeItem: props.activeItem
|
|
62244
62296
|
}, section));
|
|
62245
62297
|
}));
|
|
62246
|
-
};
|
|
62298
|
+
});
|
|
62247
62299
|
|
|
62248
|
-
var styles$p = {"vitro-sidebar":"_sidebar_vitro-sidebar_1IxGYiU"};
|
|
62300
|
+
var styles$p = {"vitro-sidebar":"_sidebar_vitro-sidebar_1IxGYiU","vitro-scroll-container":"_sidebar_vitro-scroll-container_3K-iJy8","vitro-button-more":"_sidebar_vitro-button-more_3s9oZY9"};
|
|
62249
62301
|
|
|
62250
62302
|
var Sidebar = function Sidebar(props) {
|
|
62251
62303
|
var _useState = React.useState(props.history.location.pathname),
|
|
@@ -62254,21 +62306,75 @@ var Sidebar = function Sidebar(props) {
|
|
|
62254
62306
|
var _useState2 = React.useState([]),
|
|
62255
62307
|
itemList = _useState2[0],
|
|
62256
62308
|
setItemList = _useState2[1];
|
|
62309
|
+
var _useState3 = React.useState(false),
|
|
62310
|
+
isMobileView = _useState3[0],
|
|
62311
|
+
setIsMobileView = _useState3[1];
|
|
62312
|
+
var _useState4 = React.useState(0),
|
|
62313
|
+
translate = _useState4[0],
|
|
62314
|
+
setTranslate = _useState4[1];
|
|
62315
|
+
var _useState5 = React.useState(0),
|
|
62316
|
+
linkItemWidth = _useState5[0],
|
|
62317
|
+
setLinkItemWidth = _useState5[1];
|
|
62318
|
+
var menuRef = React.useRef(null);
|
|
62319
|
+
var scrollableListRef = React.useRef(null);
|
|
62257
62320
|
props.history.listen(function (location) {
|
|
62258
62321
|
setCurrentUrl(location.pathname);
|
|
62259
62322
|
});
|
|
62260
62323
|
React.useEffect(function () {
|
|
62261
62324
|
if (props.sidebar === 1 && props.overflowItemList && props.overflowItemList.length > 0) {
|
|
62262
62325
|
setItemList([].concat(props.topItemList, props.overflowItemList));
|
|
62326
|
+
} else if (isMobileView) {
|
|
62327
|
+
var list = props.bottomItemList ? [].concat(props.topItemList, props.bottomItemList) : props.topItemList;
|
|
62328
|
+
setItemList(list);
|
|
62263
62329
|
} else {
|
|
62264
62330
|
setItemList(props.topItemList);
|
|
62265
62331
|
}
|
|
62266
|
-
}, [props.sidebar]);
|
|
62267
|
-
|
|
62332
|
+
}, [props.sidebar, isMobileView]);
|
|
62333
|
+
React.useEffect(function () {
|
|
62334
|
+
window.addEventListener(EVENT.RESIZE, handleResize);
|
|
62335
|
+
handleResize();
|
|
62336
|
+
return function () {
|
|
62337
|
+
window.removeEventListener(EVENT.RESIZE, handleResize);
|
|
62338
|
+
};
|
|
62339
|
+
}, []);
|
|
62340
|
+
React.useEffect(function () {
|
|
62341
|
+
handleResize();
|
|
62342
|
+
}, [window.innerWidth]);
|
|
62343
|
+
var handleResize = function handleResize() {
|
|
62344
|
+
window.innerWidth < 800 ? setIsMobileView(true) : setIsMobileView(false);
|
|
62345
|
+
if (window.innerWidth < 800 && menuRef.current) {
|
|
62346
|
+
var info = menuRef.current.getBoundingClientRect();
|
|
62347
|
+
var width = info.right - info.left;
|
|
62348
|
+
updateLinkItemWidth(width);
|
|
62349
|
+
}
|
|
62350
|
+
};
|
|
62351
|
+
var scroll = function scroll() {
|
|
62352
|
+
var container = menuRef.current;
|
|
62353
|
+
var scrollableList = scrollableListRef.current;
|
|
62354
|
+
if (container && scrollableList) {
|
|
62355
|
+
var info = container.getBoundingClientRect();
|
|
62356
|
+
var width = info.right - info.left;
|
|
62357
|
+
var translateValue = translate;
|
|
62358
|
+
if (container.scrollLeft + width >= container.scrollWidth) {
|
|
62359
|
+
translateValue = 0;
|
|
62360
|
+
} else {
|
|
62361
|
+
translateValue += width;
|
|
62362
|
+
}
|
|
62363
|
+
setTranslate(translateValue);
|
|
62364
|
+
scrollableList.style.transform = "translate(-" + translateValue + "px)";
|
|
62365
|
+
}
|
|
62366
|
+
};
|
|
62367
|
+
var updateLinkItemWidth = function updateLinkItemWidth(containerWidth) {
|
|
62368
|
+
var elemWidth = 76;
|
|
62369
|
+
var count = Math.floor(containerWidth / elemWidth);
|
|
62370
|
+
var width = containerWidth / count;
|
|
62371
|
+
setLinkItemWidth(width);
|
|
62372
|
+
};
|
|
62373
|
+
var className = styles$p['vitro-sidebar'] + (props.theme ? CTRL.SPACE + props.theme : CTRL.EMPTY) + CTRL.SPACE + (isMobileView ? 'vitro-bottom-menu' : CTRL.EMPTY);
|
|
62268
62374
|
return React__default.createElement("div", {
|
|
62269
62375
|
className: className,
|
|
62270
62376
|
id: 'vitro-sidebar'
|
|
62271
|
-
}, React__default.createElement(SectionList, {
|
|
62377
|
+
}, !isMobileView ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SectionList, {
|
|
62272
62378
|
itemList: itemList,
|
|
62273
62379
|
currentUrl: currentUrl,
|
|
62274
62380
|
activeItem: props.activeItem
|
|
@@ -62276,7 +62382,19 @@ var Sidebar = function Sidebar(props) {
|
|
|
62276
62382
|
itemList: props.bottomItemList,
|
|
62277
62383
|
currentUrl: currentUrl,
|
|
62278
62384
|
activeItem: props.activeItem
|
|
62279
|
-
}))
|
|
62385
|
+
})) : React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
62386
|
+
className: styles$p['vitro-scroll-container'],
|
|
62387
|
+
ref: menuRef
|
|
62388
|
+
}, React__default.createElement(SectionList, {
|
|
62389
|
+
itemList: itemList,
|
|
62390
|
+
currentUrl: currentUrl,
|
|
62391
|
+
activeItem: props.activeItem,
|
|
62392
|
+
ref: scrollableListRef,
|
|
62393
|
+
linkItemWidth: linkItemWidth
|
|
62394
|
+
})), React__default.createElement("button", {
|
|
62395
|
+
onClick: scroll,
|
|
62396
|
+
className: styles$p['vitro-button-more']
|
|
62397
|
+
})));
|
|
62280
62398
|
};
|
|
62281
62399
|
|
|
62282
62400
|
var styles$q = {"vitro-task-tile":"_task-tile_vitro-task-tile_35bZu48","vitro-active":"_task-tile_vitro-active_11W9nJz","vitro-content":"_task-tile_vitro-content_rl2ERCQ","vitro-description":"_task-tile_vitro-description_qtyUbLy","vitro-comment":"_task-tile_vitro-comment_2im2AJj","vitro-title":"_task-tile_vitro-title_1pXrIrB","vitro-top-right":"_task-tile_vitro-top-right_19tbPX4","vitro-dropdown-button":"_task-tile_vitro-dropdown-button_2YgEUdg","vitro-bottom-right":"_task-tile_vitro-bottom-right_2E9WAle","vitro-button-cancel":"_task-tile_vitro-button-cancel_1lgja1K"};
|
|
@@ -62491,10 +62609,141 @@ var DialogFooter = function DialogFooter(props) {
|
|
|
62491
62609
|
}));
|
|
62492
62610
|
};
|
|
62493
62611
|
|
|
62612
|
+
var styles$w = {"vitro-avatar":"_avatar_vitro-avatar_P2tU-_r","vitro-avatar-big":"_avatar_vitro-avatar-big_pEmlX3a"};
|
|
62613
|
+
|
|
62614
|
+
var Avatar = function Avatar(props) {
|
|
62615
|
+
var getInitials = function getInitials() {
|
|
62616
|
+
var initials = CTRL.EMPTY;
|
|
62617
|
+
if (props.userName) {
|
|
62618
|
+
props.userName.split(CTRL.SPACE).forEach(function (name, i) {
|
|
62619
|
+
initials += i < 2 ? name[0] ? name[0] : CTRL.EMPTY : CTRL.EMPTY;
|
|
62620
|
+
});
|
|
62621
|
+
}
|
|
62622
|
+
return initials;
|
|
62623
|
+
};
|
|
62624
|
+
var getBackground = function getBackground() {
|
|
62625
|
+
if (props.image) {
|
|
62626
|
+
return props.image;
|
|
62627
|
+
} else if (props.userName) {
|
|
62628
|
+
return getBgColor(props.userName);
|
|
62629
|
+
}
|
|
62630
|
+
return CTRL.EMPTY;
|
|
62631
|
+
};
|
|
62632
|
+
var getHashOfString = function getHashOfString(str) {
|
|
62633
|
+
var hash = 0;
|
|
62634
|
+
for (var i = 0; i < str.length; i++) {
|
|
62635
|
+
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
|
62636
|
+
}
|
|
62637
|
+
hash = Math.abs(hash);
|
|
62638
|
+
return hash;
|
|
62639
|
+
};
|
|
62640
|
+
var normalizeHash = function normalizeHash(hash, min, max) {
|
|
62641
|
+
return Math.floor(hash % (max - min) + min);
|
|
62642
|
+
};
|
|
62643
|
+
var getHue = function getHue(name) {
|
|
62644
|
+
var min = 1000;
|
|
62645
|
+
var max = 360;
|
|
62646
|
+
var hash = getHashOfString(name);
|
|
62647
|
+
var normalizedHash = normalizeHash(hash, min, max);
|
|
62648
|
+
return normalizedHash;
|
|
62649
|
+
};
|
|
62650
|
+
var getBgColor = function getBgColor(name) {
|
|
62651
|
+
return "linear-gradient(0deg, hsla(" + getHue(name) + ", 58%, 55%, 1), hsla(" + (getHue(name) + 50) + ", 100%, 78%, 1))";
|
|
62652
|
+
};
|
|
62653
|
+
var className = styles$w['vitro-avatar'] + (props.isBigSize ? CTRL.SPACE + styles$w['vitro-avatar-big'] : CTRL.EMPTY);
|
|
62654
|
+
return React__default.createElement("div", {
|
|
62655
|
+
className: className,
|
|
62656
|
+
style: {
|
|
62657
|
+
background: getBackground()
|
|
62658
|
+
}
|
|
62659
|
+
}, getInitials());
|
|
62660
|
+
};
|
|
62661
|
+
|
|
62662
|
+
var styles$x = {"vitro-user-profile":"_user-profile_vitro-user-profile_11XpBoQ","vitro-dropdown-item":"_user-profile_vitro-dropdown-item_dSErsta"};
|
|
62663
|
+
|
|
62664
|
+
var UserProfileMenuItem = function UserProfileMenuItem(props) {
|
|
62665
|
+
var onClick = function onClick() {
|
|
62666
|
+
if (props.onClick) {
|
|
62667
|
+
props.onClick();
|
|
62668
|
+
}
|
|
62669
|
+
props.setDropdownState(false);
|
|
62670
|
+
};
|
|
62671
|
+
if (props.link) {
|
|
62672
|
+
return React__default.createElement("div", {
|
|
62673
|
+
className: styles$x['vitro-dropdown-item'],
|
|
62674
|
+
onClick: onClick
|
|
62675
|
+
}, React__default.createElement(Link, {
|
|
62676
|
+
to: props.link
|
|
62677
|
+
}, props.imageUrl && React__default.createElement(commonUi.Icon, {
|
|
62678
|
+
defaultUrl: props.imageUrl,
|
|
62679
|
+
hoverUrl: props.hoverImageUrl
|
|
62680
|
+
}), props.text));
|
|
62681
|
+
}
|
|
62682
|
+
if (props.onClick) {
|
|
62683
|
+
return React__default.createElement("div", {
|
|
62684
|
+
className: styles$x['vitro-dropdown-item'],
|
|
62685
|
+
key: props.text,
|
|
62686
|
+
onClick: onClick
|
|
62687
|
+
}, props.imageUrl && React__default.createElement(commonUi.Icon, {
|
|
62688
|
+
defaultUrl: props.imageUrl,
|
|
62689
|
+
hoverUrl: props.hoverImageUrl
|
|
62690
|
+
}), props.text);
|
|
62691
|
+
}
|
|
62692
|
+
return null;
|
|
62693
|
+
};
|
|
62694
|
+
|
|
62695
|
+
var UserProfile = function UserProfile(props) {
|
|
62696
|
+
var _useState = React.useState(false),
|
|
62697
|
+
dropdownOpen = _useState[0],
|
|
62698
|
+
setDropdownOpen = _useState[1];
|
|
62699
|
+
var toggle = function toggle() {
|
|
62700
|
+
return setDropdownOpen(function (prevState) {
|
|
62701
|
+
return !prevState;
|
|
62702
|
+
});
|
|
62703
|
+
};
|
|
62704
|
+
var createSurnameWithInitials = function createSurnameWithInitials(name) {
|
|
62705
|
+
var username = CTRL.EMPTY;
|
|
62706
|
+
if (name) {
|
|
62707
|
+
name.split(CTRL.SPACE).forEach(function (name, i) {
|
|
62708
|
+
if (i < 3) {
|
|
62709
|
+
username += i === 0 ? name + CTRL.SPACE : (name[0] ? name[0] : CTRL.EMPTY) + CTRL.DOT;
|
|
62710
|
+
}
|
|
62711
|
+
});
|
|
62712
|
+
}
|
|
62713
|
+
return username;
|
|
62714
|
+
};
|
|
62715
|
+
return React__default.createElement(Dropdown, {
|
|
62716
|
+
isOpen: dropdownOpen,
|
|
62717
|
+
toggle: toggle,
|
|
62718
|
+
className: styles$x['vitro-user-profile']
|
|
62719
|
+
}, React__default.createElement(DropdownToggle, {
|
|
62720
|
+
caret: true
|
|
62721
|
+
}, React__default.createElement("div", null, React__default.createElement("span", {
|
|
62722
|
+
className: styles$x['vitro-text-color-white']
|
|
62723
|
+
}, createSurnameWithInitials(props.userName)), React__default.createElement(Avatar, {
|
|
62724
|
+
userName: props.userName,
|
|
62725
|
+
isBigSize: true
|
|
62726
|
+
}))), React__default.createElement(DropdownMenu, {
|
|
62727
|
+
right: true
|
|
62728
|
+
}, props.dropdownMenuItemList && props.dropdownMenuItemList.length > 0 && props.dropdownMenuItemList.map(function (item) {
|
|
62729
|
+
return React__default.createElement(UserProfileMenuItem, Object.assign({
|
|
62730
|
+
setDropdownState: setDropdownOpen
|
|
62731
|
+
}, item));
|
|
62732
|
+
})));
|
|
62733
|
+
};
|
|
62734
|
+
|
|
62735
|
+
var UserLookupPicker = function UserLookupPicker(props) {
|
|
62736
|
+
return React__default.createElement(LookupPicker, Object.assign({}, props, {
|
|
62737
|
+
htmlValueTemplate: Avatar,
|
|
62738
|
+
getHtmlValueTemplateProps: props.getHtmlValueTemplateProps
|
|
62739
|
+
}));
|
|
62740
|
+
};
|
|
62741
|
+
|
|
62494
62742
|
exports.ACTION_HANDLER = ActionHandlerConstants;
|
|
62495
62743
|
exports.ALERT = AlertConstants;
|
|
62496
62744
|
exports.ActionHandler = ActionHandler;
|
|
62497
62745
|
exports.Alert = Alert$1;
|
|
62746
|
+
exports.Avatar = Avatar;
|
|
62498
62747
|
exports.Breadcrumbs = Breadcrumbs;
|
|
62499
62748
|
exports.Button = Button$2;
|
|
62500
62749
|
exports.CommandMenu = CommandMenu;
|
|
@@ -62526,6 +62775,8 @@ exports.TelerikUploaderContextImpl = TelerikUploaderContextImpl;
|
|
|
62526
62775
|
exports.TimePicker = TimePicker;
|
|
62527
62776
|
exports.TopLevelMenu = TopLevelMenu;
|
|
62528
62777
|
exports.TreeView = TreeView;
|
|
62778
|
+
exports.UserLookupPicker = UserLookupPicker;
|
|
62779
|
+
exports.UserProfile = UserProfile;
|
|
62529
62780
|
exports.View = View;
|
|
62530
62781
|
exports.commonEn = commonEn;
|
|
62531
62782
|
exports.commonRu = commonRu;
|