@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.modern.js
CHANGED
|
@@ -58716,13 +58716,13 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58716
58716
|
}, []);
|
|
58717
58717
|
var data = useMemo(function () {
|
|
58718
58718
|
return {
|
|
58719
|
-
itemList: props.itemList || [props.item]
|
|
58719
|
+
itemList: props.itemList || [props.item],
|
|
58720
|
+
itemCount: props.itemList ? props.itemList.length : [props.item].length
|
|
58720
58721
|
};
|
|
58721
58722
|
}, []);
|
|
58722
58723
|
var progressBarRef = useRef(null);
|
|
58723
58724
|
var localeService = useInjection(SERVICE.LOCALE);
|
|
58724
58725
|
var action = props.actionText || localeService.create(LOCALE$1.ACTION + CTRL.DOT + props.actionCode);
|
|
58725
|
-
var itemCount = data.itemList.length;
|
|
58726
58726
|
useEffect(function () {
|
|
58727
58727
|
setIsCloseByOutsideClick(currentAction !== actionMap$1.progress);
|
|
58728
58728
|
if (currentAction === actionMap$1.before) {
|
|
@@ -58762,17 +58762,17 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58762
58762
|
if (props.isConfirm) {
|
|
58763
58763
|
var confText;
|
|
58764
58764
|
if (props.confirmText && props.confirmText()) {
|
|
58765
|
-
confText = props.confirmText(itemCount);
|
|
58765
|
+
confText = props.confirmText(data.itemCount);
|
|
58766
58766
|
} else {
|
|
58767
|
-
if (itemCount === 1) {
|
|
58767
|
+
if (data.itemCount === 1) {
|
|
58768
58768
|
confText = localeService.create(LOCALE$1.CONF_SINGLE, {
|
|
58769
58769
|
actionCode: action,
|
|
58770
|
-
itemCount: itemCount
|
|
58770
|
+
itemCount: data.itemCount
|
|
58771
58771
|
});
|
|
58772
58772
|
} else {
|
|
58773
58773
|
confText = localeService.create(LOCALE$1.CONF_MULTI, {
|
|
58774
58774
|
actionCode: action,
|
|
58775
|
-
itemCount: itemCount
|
|
58775
|
+
itemCount: data.itemCount
|
|
58776
58776
|
});
|
|
58777
58777
|
}
|
|
58778
58778
|
}
|
|
@@ -58801,13 +58801,13 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58801
58801
|
setActionResult(success, successResult, failResult);
|
|
58802
58802
|
if (success) {
|
|
58803
58803
|
if (props.successText && props.successText()) {
|
|
58804
|
-
setText(props.successText(itemCount));
|
|
58804
|
+
setText(props.successText(data.itemCount));
|
|
58805
58805
|
}
|
|
58806
58806
|
} else {
|
|
58807
58807
|
if (error && error.text) {
|
|
58808
58808
|
setText(error.text);
|
|
58809
58809
|
} else if (props.errorText) {
|
|
58810
|
-
setText(props.errorText(error, itemCount));
|
|
58810
|
+
setText(props.errorText(error, data.itemCount));
|
|
58811
58811
|
}
|
|
58812
58812
|
}
|
|
58813
58813
|
};
|
|
@@ -58818,28 +58818,28 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58818
58818
|
var key = [LOCALE$1.ACTION_MSG, props.actionCode, LOCALE$1.SUCCESS].join(CTRL.DOT);
|
|
58819
58819
|
setText(localeService.create(key, {
|
|
58820
58820
|
actionCode: action,
|
|
58821
|
-
count:
|
|
58821
|
+
count: successResult.length
|
|
58822
58822
|
}));
|
|
58823
58823
|
} else if (successResult.length && failResult.length) {
|
|
58824
58824
|
setIcon(styles$6['vitro-icon-warning']);
|
|
58825
58825
|
setState(styles$6['vitro-warning']);
|
|
58826
|
-
var _key = itemCount === 1 ? LOCALE$1.WARNING_SINGLE : LOCALE$1.WARNING_MULTI;
|
|
58826
|
+
var _key = data.itemCount === 1 ? LOCALE$1.WARNING_SINGLE : LOCALE$1.WARNING_MULTI;
|
|
58827
58827
|
setText(localeService.create(_key, {
|
|
58828
58828
|
actionCode: action,
|
|
58829
|
-
itemCount: itemCount
|
|
58829
|
+
itemCount: data.itemCount
|
|
58830
58830
|
}));
|
|
58831
58831
|
} else {
|
|
58832
58832
|
setIcon(styles$6['vitro-icon-error']);
|
|
58833
58833
|
setState(styles$6['vitro-error']);
|
|
58834
|
-
var _key2 = itemCount === 1 ? LOCALE$1.ERROR_SINGLE : LOCALE$1.ERROR_MULTI;
|
|
58834
|
+
var _key2 = data.itemCount === 1 ? LOCALE$1.ERROR_SINGLE : LOCALE$1.ERROR_MULTI;
|
|
58835
58835
|
setText(localeService.create(_key2, {
|
|
58836
58836
|
actionCode: action,
|
|
58837
|
-
itemCount: itemCount
|
|
58837
|
+
itemCount: data.itemCount
|
|
58838
58838
|
}));
|
|
58839
58839
|
}
|
|
58840
58840
|
};
|
|
58841
58841
|
var setProgress = function setProgress(index) {
|
|
58842
|
-
var percent = index * 100 / itemCount;
|
|
58842
|
+
var percent = index * 100 / data.itemCount;
|
|
58843
58843
|
if (progressBarRef.current) {
|
|
58844
58844
|
progressBarRef.current.style.width = percent + CTRL.PERCENT;
|
|
58845
58845
|
}
|
|
@@ -58848,9 +58848,9 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58848
58848
|
try {
|
|
58849
58849
|
init();
|
|
58850
58850
|
if (props.progressText) {
|
|
58851
|
-
setText(props.progressText(itemCount));
|
|
58851
|
+
setText(props.progressText(data.itemCount));
|
|
58852
58852
|
} else {
|
|
58853
|
-
if (itemCount === 1) {
|
|
58853
|
+
if (data.itemCount === 1) {
|
|
58854
58854
|
setText(localeService.create(LOCALE$1.PROGRESS_SINGLE, {
|
|
58855
58855
|
actionCode: action
|
|
58856
58856
|
}));
|
|
@@ -58858,7 +58858,7 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58858
58858
|
setText(localeService.create(LOCALE$1.PROGRESS_MULTI, {
|
|
58859
58859
|
idx: 1,
|
|
58860
58860
|
actionCode: action,
|
|
58861
|
-
itemCount: itemCount
|
|
58861
|
+
itemCount: data.itemCount
|
|
58862
58862
|
}));
|
|
58863
58863
|
}
|
|
58864
58864
|
}
|
|
@@ -58910,13 +58910,14 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
58910
58910
|
}, function () {
|
|
58911
58911
|
if (cancellationToken.cancel) {
|
|
58912
58912
|
data.itemList = data.itemList.slice(0, _i + 1);
|
|
58913
|
+
data.itemCount = data.itemList.length;
|
|
58913
58914
|
_interrupt = true;
|
|
58914
58915
|
return;
|
|
58915
58916
|
}
|
|
58916
|
-
if (itemCount > 1) {
|
|
58917
|
+
if (data.itemCount > 1) {
|
|
58917
58918
|
setText(localeService.create(LOCALE$1.PROGRESS_MULTI, {
|
|
58918
58919
|
idx: _i + 1,
|
|
58919
|
-
itemCount: itemCount,
|
|
58920
|
+
itemCount: data.itemCount,
|
|
58920
58921
|
actionCode: action
|
|
58921
58922
|
}));
|
|
58922
58923
|
} else {
|
|
@@ -59001,7 +59002,7 @@ var ActionHandler = function ActionHandler(props) {
|
|
|
59001
59002
|
}))), showItemCount && React__default.createElement("span", {
|
|
59002
59003
|
className: styles$6['vitro-small']
|
|
59003
59004
|
}, localeService.create(LOCALE$1.ITEM_COUNT, {
|
|
59004
|
-
itemCount: itemCount
|
|
59005
|
+
itemCount: data.itemCount
|
|
59005
59006
|
})), showInfo && React__default.createElement(ActionInfo, {
|
|
59006
59007
|
itemList: data.itemList,
|
|
59007
59008
|
successResult: successResult,
|
|
@@ -59966,6 +59967,8 @@ var TimePicker = function TimePicker(props) {
|
|
|
59966
59967
|
|
|
59967
59968
|
var styles$h = {"vitro-selected-item":"_lookup-picker-selected-item_vitro-selected-item_hw-euth"};
|
|
59968
59969
|
|
|
59970
|
+
var htmlValueStyles = {"vitro-item-html-value":"_lookup-picker-html-value_vitro-item-html-value_2QBoTey"};
|
|
59971
|
+
|
|
59969
59972
|
var SelectedValueList = function SelectedValueList(props) {
|
|
59970
59973
|
return React__default.createElement(React__default.Fragment, null, props.list.map(function (x) {
|
|
59971
59974
|
var title = props.selectedValueTemplate(x);
|
|
@@ -59973,7 +59976,9 @@ var SelectedValueList = function SelectedValueList(props) {
|
|
|
59973
59976
|
key: x.id,
|
|
59974
59977
|
className: styles$h['vitro-selected-item'],
|
|
59975
59978
|
title: title
|
|
59976
|
-
},
|
|
59979
|
+
}, props.getHtmlValue ? React__default.createElement("div", {
|
|
59980
|
+
className: htmlValueStyles['vitro-item-html-value']
|
|
59981
|
+
}, props.getHtmlValue(x)) : null, React__default.createElement("span", null, title), props.isMultiSelect && React__default.createElement("div", {
|
|
59977
59982
|
onClick: function onClick() {
|
|
59978
59983
|
return props.onOptionValueDelete(x.id);
|
|
59979
59984
|
},
|
|
@@ -59982,7 +59987,23 @@ var SelectedValueList = function SelectedValueList(props) {
|
|
|
59982
59987
|
}));
|
|
59983
59988
|
};
|
|
59984
59989
|
|
|
59985
|
-
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"};
|
|
59990
|
+
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"};
|
|
59991
|
+
|
|
59992
|
+
var ValueListItem = function ValueListItem(props) {
|
|
59993
|
+
return React__default.createElement("div", {
|
|
59994
|
+
key: props.item.id,
|
|
59995
|
+
className: styles$i['vitro-item'],
|
|
59996
|
+
onClick: function onClick() {
|
|
59997
|
+
return props.onSelect(props.item.id);
|
|
59998
|
+
}
|
|
59999
|
+
}, props.htmlValue ? React__default.createElement("div", {
|
|
60000
|
+
className: htmlValueStyles['vitro-item-html-value']
|
|
60001
|
+
}, props.htmlValue) : null, React__default.createElement("div", {
|
|
60002
|
+
dangerouslySetInnerHTML: {
|
|
60003
|
+
__html: props.createDisplayValue(props.item)
|
|
60004
|
+
}
|
|
60005
|
+
}));
|
|
60006
|
+
};
|
|
59986
60007
|
|
|
59987
60008
|
var FLAG = 'gi';
|
|
59988
60009
|
var ValueList = function ValueList(props) {
|
|
@@ -60005,15 +60026,11 @@ var ValueList = function ValueList(props) {
|
|
|
60005
60026
|
}, React__default.createElement(ScrollBar, {
|
|
60006
60027
|
onInit: setScrollableElement
|
|
60007
60028
|
}, props.isPending && React__default.createElement(Progress, null), !props.isPending && React__default.createElement(React__default.Fragment, null, props.list.length > 0 ? props.list.map(function (x) {
|
|
60008
|
-
return React__default.createElement(
|
|
60009
|
-
|
|
60010
|
-
|
|
60011
|
-
|
|
60012
|
-
|
|
60013
|
-
},
|
|
60014
|
-
dangerouslySetInnerHTML: {
|
|
60015
|
-
__html: createDisplayValue(x)
|
|
60016
|
-
}
|
|
60029
|
+
return React__default.createElement(ValueListItem, {
|
|
60030
|
+
item: x,
|
|
60031
|
+
onSelect: props.onOptionValueSelect,
|
|
60032
|
+
createDisplayValue: createDisplayValue,
|
|
60033
|
+
htmlValue: props.getHtmlValue && props.getHtmlValue(x)
|
|
60017
60034
|
});
|
|
60018
60035
|
}) : React__default.createElement("div", {
|
|
60019
60036
|
className: styles$i['vitro-placeholder-empty']
|
|
@@ -60071,6 +60088,23 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60071
60088
|
}, [props.selectedValueList]);
|
|
60072
60089
|
useEffect(function () {
|
|
60073
60090
|
valueListVisible && inputRef && inputRef.current && inputRef.current.focus();
|
|
60091
|
+
if (props.isReadOnly) {
|
|
60092
|
+
if (props.valueList) {
|
|
60093
|
+
updateFilteredValueList(props.valueList);
|
|
60094
|
+
} else if (props.getAllValueList) {
|
|
60095
|
+
setPending(true);
|
|
60096
|
+
var requestToken = {
|
|
60097
|
+
cancel: false
|
|
60098
|
+
};
|
|
60099
|
+
if (valueListRequestToken) {
|
|
60100
|
+
valueListRequestToken.cancel = true;
|
|
60101
|
+
}
|
|
60102
|
+
setValueListRequestToken(requestToken);
|
|
60103
|
+
props.getAllValueList().then(function (valueList) {
|
|
60104
|
+
return onGetValueList(valueList, requestToken);
|
|
60105
|
+
});
|
|
60106
|
+
}
|
|
60107
|
+
}
|
|
60074
60108
|
}, [valueListVisible]);
|
|
60075
60109
|
useEffect(function () {
|
|
60076
60110
|
if (props.selectedValue) {
|
|
@@ -60210,6 +60244,12 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60210
60244
|
classList.push(state);
|
|
60211
60245
|
return classList.join(CTRL.SPACE);
|
|
60212
60246
|
};
|
|
60247
|
+
var getHtmlValue = function getHtmlValue(item) {
|
|
60248
|
+
if (props.htmlValueTemplate && props.getHtmlValueTemplateProps) {
|
|
60249
|
+
return React__default.createElement(props.htmlValueTemplate, props.getHtmlValueTemplateProps(item));
|
|
60250
|
+
}
|
|
60251
|
+
return null;
|
|
60252
|
+
};
|
|
60213
60253
|
return React__default.createElement("div", {
|
|
60214
60254
|
className: getClassName(),
|
|
60215
60255
|
tabIndex: 1,
|
|
@@ -60226,7 +60266,8 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60226
60266
|
list: selectedValueList,
|
|
60227
60267
|
onOptionValueDelete: onOptionValueDelete,
|
|
60228
60268
|
selectedValueTemplate: selectedValueTemplate,
|
|
60229
|
-
isMultiSelect: props.isMultiSelect
|
|
60269
|
+
isMultiSelect: props.isMultiSelect,
|
|
60270
|
+
getHtmlValue: getHtmlValue
|
|
60230
60271
|
}) : !valueListVisible && React__default.createElement(React__default.Fragment, null, props.placeholder), !props.isDisabled && !props.isReadOnly && React__default.createElement("input", {
|
|
60231
60272
|
ref: inputRef,
|
|
60232
60273
|
value: inputValue,
|
|
@@ -60235,14 +60276,14 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60235
60276
|
onClick: onFocus,
|
|
60236
60277
|
disabled: props.isDisabled,
|
|
60237
60278
|
readOnly: props.isReadOnly
|
|
60238
|
-
}), !props.isDisabled &&
|
|
60279
|
+
}), !props.isDisabled && props.children, React__default.createElement("div", {
|
|
60239
60280
|
className: styles$j['vitro-right']
|
|
60240
60281
|
}, !props.isMultiSelect && selectedValueList && selectedValueList.length > 0 && !props.isDisabled && !props.isReadOnly && React__default.createElement("div", {
|
|
60241
60282
|
className: styles$j['vitro-button-close'],
|
|
60242
60283
|
onClick: function onClick() {
|
|
60243
60284
|
return onOptionValueDelete();
|
|
60244
60285
|
}
|
|
60245
|
-
}), !props.isDisabled &&
|
|
60286
|
+
}), !props.isDisabled && React__default.createElement("div", {
|
|
60246
60287
|
onClick: function onClick() {
|
|
60247
60288
|
return setValueListVisible(!valueListVisible);
|
|
60248
60289
|
},
|
|
@@ -60250,14 +60291,15 @@ var LookupPicker = function LookupPicker(props) {
|
|
|
60250
60291
|
}), props.isReadOnly ? React__default.createElement("span", {
|
|
60251
60292
|
className: styles$j['vitro-button-copy'],
|
|
60252
60293
|
onClick: copyValue
|
|
60253
|
-
}) : null)), !props.isDisabled &&
|
|
60294
|
+
}) : null)), !props.isDisabled && (!props.filterMinLength || props.filterMinLength <= inputValue.length) && React__default.createElement(ValueList, {
|
|
60254
60295
|
isPending: pending,
|
|
60255
60296
|
inputValue: inputValue,
|
|
60256
60297
|
list: filteredValueList,
|
|
60257
60298
|
filterValueTemplate: filterValueTemplate,
|
|
60258
60299
|
onOptionValueSelect: onOptionValueSelect,
|
|
60259
60300
|
isVisible: valueListVisible,
|
|
60260
|
-
emptyPlaceholder: props.emptyPlaceholder || localeService.create(LOCALE$3.PLACEHOLDER_EMPTY)
|
|
60301
|
+
emptyPlaceholder: props.emptyPlaceholder || localeService.create(LOCALE$3.PLACEHOLDER_EMPTY),
|
|
60302
|
+
getHtmlValue: getHtmlValue
|
|
60261
60303
|
}), props.errorMessage && React__default.createElement("span", {
|
|
60262
60304
|
className: styles$j['vitro-error-text']
|
|
60263
60305
|
}, props.errorMessage));
|
|
@@ -62166,7 +62208,7 @@ var CommandMenuDropdownButton = function CommandMenuDropdownButton(props) {
|
|
|
62166
62208
|
}), props.children));
|
|
62167
62209
|
};
|
|
62168
62210
|
|
|
62169
|
-
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"};
|
|
62211
|
+
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"};
|
|
62170
62212
|
|
|
62171
62213
|
var Item$1 = function Item(props) {
|
|
62172
62214
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", null, React__default.createElement(Icon, {
|
|
@@ -62188,6 +62230,8 @@ var TARGET;
|
|
|
62188
62230
|
})(TARGET || (TARGET = {}));
|
|
62189
62231
|
|
|
62190
62232
|
var w$6 = window;
|
|
62233
|
+
var PX_UNIT$3 = 'px';
|
|
62234
|
+
var WIDTH_AUTO = 'auto';
|
|
62191
62235
|
var LinkItem$1 = function LinkItem(props) {
|
|
62192
62236
|
var _useState = useState(false),
|
|
62193
62237
|
isHover = _useState[0],
|
|
@@ -62199,7 +62243,11 @@ var LinkItem$1 = function LinkItem(props) {
|
|
|
62199
62243
|
},
|
|
62200
62244
|
onMouseLeave: function onMouseLeave() {
|
|
62201
62245
|
return setIsHover(false);
|
|
62202
|
-
}
|
|
62246
|
+
},
|
|
62247
|
+
style: {
|
|
62248
|
+
width: props.linkItemWidth ? props.linkItemWidth + PX_UNIT$3 : WIDTH_AUTO
|
|
62249
|
+
},
|
|
62250
|
+
className: styles$o['vitro-item']
|
|
62203
62251
|
}, props.link && React__default.createElement(Link, {
|
|
62204
62252
|
to: props.link,
|
|
62205
62253
|
className: isActive ? styles$o['vitro-active'] : CTRL.EMPTY
|
|
@@ -62211,18 +62259,19 @@ var LinkItem$1 = function LinkItem(props) {
|
|
|
62211
62259
|
},
|
|
62212
62260
|
className: isActive ? styles$o['vitro-active'] : CTRL.EMPTY
|
|
62213
62261
|
}, React__default.createElement(Item$1, Object.assign({}, props, {
|
|
62214
|
-
isHover: isActive
|
|
62262
|
+
isHover: isActive
|
|
62215
62263
|
}))), props.href && React__default.createElement("a", {
|
|
62216
62264
|
href: props.href,
|
|
62217
62265
|
target: props.isExternal ? TARGET.BLANK : TARGET.SELF
|
|
62218
62266
|
}, React__default.createElement(Item$1, Object.assign({}, props, {
|
|
62219
|
-
isHover: isActive
|
|
62267
|
+
isHover: isActive
|
|
62220
62268
|
}))));
|
|
62221
62269
|
};
|
|
62222
62270
|
|
|
62223
62271
|
var Section = function Section(props) {
|
|
62224
62272
|
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) {
|
|
62225
62273
|
return React__default.createElement(LinkItem$1, Object.assign({
|
|
62274
|
+
linkItemWidth: props.linkItemWidth,
|
|
62226
62275
|
activeItem: props.activeItem,
|
|
62227
62276
|
key: i.text,
|
|
62228
62277
|
currentUrl: props.currentUrl
|
|
@@ -62230,19 +62279,22 @@ var Section = function Section(props) {
|
|
|
62230
62279
|
})));
|
|
62231
62280
|
};
|
|
62232
62281
|
|
|
62233
|
-
var SectionList = function
|
|
62282
|
+
var SectionList = forwardRef(function (props, ref) {
|
|
62234
62283
|
if (!props.itemList || props.itemList.length === 0) {
|
|
62235
62284
|
return null;
|
|
62236
62285
|
}
|
|
62237
|
-
return React__default.createElement("ul",
|
|
62286
|
+
return React__default.createElement("ul", {
|
|
62287
|
+
ref: ref
|
|
62288
|
+
}, props.itemList.map(function (section) {
|
|
62238
62289
|
return React__default.createElement(Section, Object.assign({
|
|
62290
|
+
linkItemWidth: props.linkItemWidth,
|
|
62239
62291
|
currentUrl: props.currentUrl,
|
|
62240
62292
|
activeItem: props.activeItem
|
|
62241
62293
|
}, section));
|
|
62242
62294
|
}));
|
|
62243
|
-
};
|
|
62295
|
+
});
|
|
62244
62296
|
|
|
62245
|
-
var styles$p = {"vitro-sidebar":"_sidebar_vitro-sidebar_1IxGYiU"};
|
|
62297
|
+
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"};
|
|
62246
62298
|
|
|
62247
62299
|
var Sidebar = function Sidebar(props) {
|
|
62248
62300
|
var _useState = useState(props.history.location.pathname),
|
|
@@ -62251,21 +62303,75 @@ var Sidebar = function Sidebar(props) {
|
|
|
62251
62303
|
var _useState2 = useState([]),
|
|
62252
62304
|
itemList = _useState2[0],
|
|
62253
62305
|
setItemList = _useState2[1];
|
|
62306
|
+
var _useState3 = useState(false),
|
|
62307
|
+
isMobileView = _useState3[0],
|
|
62308
|
+
setIsMobileView = _useState3[1];
|
|
62309
|
+
var _useState4 = useState(0),
|
|
62310
|
+
translate = _useState4[0],
|
|
62311
|
+
setTranslate = _useState4[1];
|
|
62312
|
+
var _useState5 = useState(0),
|
|
62313
|
+
linkItemWidth = _useState5[0],
|
|
62314
|
+
setLinkItemWidth = _useState5[1];
|
|
62315
|
+
var menuRef = useRef(null);
|
|
62316
|
+
var scrollableListRef = useRef(null);
|
|
62254
62317
|
props.history.listen(function (location) {
|
|
62255
62318
|
setCurrentUrl(location.pathname);
|
|
62256
62319
|
});
|
|
62257
62320
|
useEffect(function () {
|
|
62258
62321
|
if (props.sidebar === 1 && props.overflowItemList && props.overflowItemList.length > 0) {
|
|
62259
62322
|
setItemList([].concat(props.topItemList, props.overflowItemList));
|
|
62323
|
+
} else if (isMobileView) {
|
|
62324
|
+
var list = props.bottomItemList ? [].concat(props.topItemList, props.bottomItemList) : props.topItemList;
|
|
62325
|
+
setItemList(list);
|
|
62260
62326
|
} else {
|
|
62261
62327
|
setItemList(props.topItemList);
|
|
62262
62328
|
}
|
|
62263
|
-
}, [props.sidebar]);
|
|
62264
|
-
|
|
62329
|
+
}, [props.sidebar, isMobileView]);
|
|
62330
|
+
useEffect(function () {
|
|
62331
|
+
window.addEventListener(EVENT.RESIZE, handleResize);
|
|
62332
|
+
handleResize();
|
|
62333
|
+
return function () {
|
|
62334
|
+
window.removeEventListener(EVENT.RESIZE, handleResize);
|
|
62335
|
+
};
|
|
62336
|
+
}, []);
|
|
62337
|
+
useEffect(function () {
|
|
62338
|
+
handleResize();
|
|
62339
|
+
}, [window.innerWidth]);
|
|
62340
|
+
var handleResize = function handleResize() {
|
|
62341
|
+
window.innerWidth < 800 ? setIsMobileView(true) : setIsMobileView(false);
|
|
62342
|
+
if (window.innerWidth < 800 && menuRef.current) {
|
|
62343
|
+
var info = menuRef.current.getBoundingClientRect();
|
|
62344
|
+
var width = info.right - info.left;
|
|
62345
|
+
updateLinkItemWidth(width);
|
|
62346
|
+
}
|
|
62347
|
+
};
|
|
62348
|
+
var scroll = function scroll() {
|
|
62349
|
+
var container = menuRef.current;
|
|
62350
|
+
var scrollableList = scrollableListRef.current;
|
|
62351
|
+
if (container && scrollableList) {
|
|
62352
|
+
var info = container.getBoundingClientRect();
|
|
62353
|
+
var width = info.right - info.left;
|
|
62354
|
+
var translateValue = translate;
|
|
62355
|
+
if (container.scrollLeft + width >= container.scrollWidth) {
|
|
62356
|
+
translateValue = 0;
|
|
62357
|
+
} else {
|
|
62358
|
+
translateValue += width;
|
|
62359
|
+
}
|
|
62360
|
+
setTranslate(translateValue);
|
|
62361
|
+
scrollableList.style.transform = "translate(-" + translateValue + "px)";
|
|
62362
|
+
}
|
|
62363
|
+
};
|
|
62364
|
+
var updateLinkItemWidth = function updateLinkItemWidth(containerWidth) {
|
|
62365
|
+
var elemWidth = 76;
|
|
62366
|
+
var count = Math.floor(containerWidth / elemWidth);
|
|
62367
|
+
var width = containerWidth / count;
|
|
62368
|
+
setLinkItemWidth(width);
|
|
62369
|
+
};
|
|
62370
|
+
var className = styles$p['vitro-sidebar'] + (props.theme ? CTRL.SPACE + props.theme : CTRL.EMPTY) + CTRL.SPACE + (isMobileView ? 'vitro-bottom-menu' : CTRL.EMPTY);
|
|
62265
62371
|
return React__default.createElement("div", {
|
|
62266
62372
|
className: className,
|
|
62267
62373
|
id: 'vitro-sidebar'
|
|
62268
|
-
}, React__default.createElement(SectionList, {
|
|
62374
|
+
}, !isMobileView ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SectionList, {
|
|
62269
62375
|
itemList: itemList,
|
|
62270
62376
|
currentUrl: currentUrl,
|
|
62271
62377
|
activeItem: props.activeItem
|
|
@@ -62273,7 +62379,19 @@ var Sidebar = function Sidebar(props) {
|
|
|
62273
62379
|
itemList: props.bottomItemList,
|
|
62274
62380
|
currentUrl: currentUrl,
|
|
62275
62381
|
activeItem: props.activeItem
|
|
62276
|
-
}))
|
|
62382
|
+
})) : React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
62383
|
+
className: styles$p['vitro-scroll-container'],
|
|
62384
|
+
ref: menuRef
|
|
62385
|
+
}, React__default.createElement(SectionList, {
|
|
62386
|
+
itemList: itemList,
|
|
62387
|
+
currentUrl: currentUrl,
|
|
62388
|
+
activeItem: props.activeItem,
|
|
62389
|
+
ref: scrollableListRef,
|
|
62390
|
+
linkItemWidth: linkItemWidth
|
|
62391
|
+
})), React__default.createElement("button", {
|
|
62392
|
+
onClick: scroll,
|
|
62393
|
+
className: styles$p['vitro-button-more']
|
|
62394
|
+
})));
|
|
62277
62395
|
};
|
|
62278
62396
|
|
|
62279
62397
|
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"};
|
|
@@ -62488,5 +62606,135 @@ var DialogFooter = function DialogFooter(props) {
|
|
|
62488
62606
|
}));
|
|
62489
62607
|
};
|
|
62490
62608
|
|
|
62491
|
-
|
|
62609
|
+
var styles$w = {"vitro-avatar":"_avatar_vitro-avatar_P2tU-_r","vitro-avatar-big":"_avatar_vitro-avatar-big_pEmlX3a"};
|
|
62610
|
+
|
|
62611
|
+
var Avatar = function Avatar(props) {
|
|
62612
|
+
var getInitials = function getInitials() {
|
|
62613
|
+
var initials = CTRL.EMPTY;
|
|
62614
|
+
if (props.userName) {
|
|
62615
|
+
props.userName.split(CTRL.SPACE).forEach(function (name, i) {
|
|
62616
|
+
initials += i < 2 ? name[0] ? name[0] : CTRL.EMPTY : CTRL.EMPTY;
|
|
62617
|
+
});
|
|
62618
|
+
}
|
|
62619
|
+
return initials;
|
|
62620
|
+
};
|
|
62621
|
+
var getBackground = function getBackground() {
|
|
62622
|
+
if (props.image) {
|
|
62623
|
+
return props.image;
|
|
62624
|
+
} else if (props.userName) {
|
|
62625
|
+
return getBgColor(props.userName);
|
|
62626
|
+
}
|
|
62627
|
+
return CTRL.EMPTY;
|
|
62628
|
+
};
|
|
62629
|
+
var getHashOfString = function getHashOfString(str) {
|
|
62630
|
+
var hash = 0;
|
|
62631
|
+
for (var i = 0; i < str.length; i++) {
|
|
62632
|
+
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
|
62633
|
+
}
|
|
62634
|
+
hash = Math.abs(hash);
|
|
62635
|
+
return hash;
|
|
62636
|
+
};
|
|
62637
|
+
var normalizeHash = function normalizeHash(hash, min, max) {
|
|
62638
|
+
return Math.floor(hash % (max - min) + min);
|
|
62639
|
+
};
|
|
62640
|
+
var getHue = function getHue(name) {
|
|
62641
|
+
var min = 1000;
|
|
62642
|
+
var max = 360;
|
|
62643
|
+
var hash = getHashOfString(name);
|
|
62644
|
+
var normalizedHash = normalizeHash(hash, min, max);
|
|
62645
|
+
return normalizedHash;
|
|
62646
|
+
};
|
|
62647
|
+
var getBgColor = function getBgColor(name) {
|
|
62648
|
+
return "linear-gradient(0deg, hsla(" + getHue(name) + ", 58%, 55%, 1), hsla(" + (getHue(name) + 50) + ", 100%, 78%, 1))";
|
|
62649
|
+
};
|
|
62650
|
+
var className = styles$w['vitro-avatar'] + (props.isBigSize ? CTRL.SPACE + styles$w['vitro-avatar-big'] : CTRL.EMPTY);
|
|
62651
|
+
return React__default.createElement("div", {
|
|
62652
|
+
className: className,
|
|
62653
|
+
style: {
|
|
62654
|
+
background: getBackground()
|
|
62655
|
+
}
|
|
62656
|
+
}, getInitials());
|
|
62657
|
+
};
|
|
62658
|
+
|
|
62659
|
+
var styles$x = {"vitro-user-profile":"_user-profile_vitro-user-profile_11XpBoQ","vitro-dropdown-item":"_user-profile_vitro-dropdown-item_dSErsta"};
|
|
62660
|
+
|
|
62661
|
+
var UserProfileMenuItem = function UserProfileMenuItem(props) {
|
|
62662
|
+
var onClick = function onClick() {
|
|
62663
|
+
if (props.onClick) {
|
|
62664
|
+
props.onClick();
|
|
62665
|
+
}
|
|
62666
|
+
props.setDropdownState(false);
|
|
62667
|
+
};
|
|
62668
|
+
if (props.link) {
|
|
62669
|
+
return React__default.createElement("div", {
|
|
62670
|
+
className: styles$x['vitro-dropdown-item'],
|
|
62671
|
+
onClick: onClick
|
|
62672
|
+
}, React__default.createElement(Link, {
|
|
62673
|
+
to: props.link
|
|
62674
|
+
}, props.imageUrl && React__default.createElement(Icon, {
|
|
62675
|
+
defaultUrl: props.imageUrl,
|
|
62676
|
+
hoverUrl: props.hoverImageUrl
|
|
62677
|
+
}), props.text));
|
|
62678
|
+
}
|
|
62679
|
+
if (props.onClick) {
|
|
62680
|
+
return React__default.createElement("div", {
|
|
62681
|
+
className: styles$x['vitro-dropdown-item'],
|
|
62682
|
+
key: props.text,
|
|
62683
|
+
onClick: onClick
|
|
62684
|
+
}, props.imageUrl && React__default.createElement(Icon, {
|
|
62685
|
+
defaultUrl: props.imageUrl,
|
|
62686
|
+
hoverUrl: props.hoverImageUrl
|
|
62687
|
+
}), props.text);
|
|
62688
|
+
}
|
|
62689
|
+
return null;
|
|
62690
|
+
};
|
|
62691
|
+
|
|
62692
|
+
var UserProfile = function UserProfile(props) {
|
|
62693
|
+
var _useState = useState(false),
|
|
62694
|
+
dropdownOpen = _useState[0],
|
|
62695
|
+
setDropdownOpen = _useState[1];
|
|
62696
|
+
var toggle = function toggle() {
|
|
62697
|
+
return setDropdownOpen(function (prevState) {
|
|
62698
|
+
return !prevState;
|
|
62699
|
+
});
|
|
62700
|
+
};
|
|
62701
|
+
var createSurnameWithInitials = function createSurnameWithInitials(name) {
|
|
62702
|
+
var username = CTRL.EMPTY;
|
|
62703
|
+
if (name) {
|
|
62704
|
+
name.split(CTRL.SPACE).forEach(function (name, i) {
|
|
62705
|
+
if (i < 3) {
|
|
62706
|
+
username += i === 0 ? name + CTRL.SPACE : (name[0] ? name[0] : CTRL.EMPTY) + CTRL.DOT;
|
|
62707
|
+
}
|
|
62708
|
+
});
|
|
62709
|
+
}
|
|
62710
|
+
return username;
|
|
62711
|
+
};
|
|
62712
|
+
return React__default.createElement(Dropdown, {
|
|
62713
|
+
isOpen: dropdownOpen,
|
|
62714
|
+
toggle: toggle,
|
|
62715
|
+
className: styles$x['vitro-user-profile']
|
|
62716
|
+
}, React__default.createElement(DropdownToggle, {
|
|
62717
|
+
caret: true
|
|
62718
|
+
}, React__default.createElement("div", null, React__default.createElement("span", {
|
|
62719
|
+
className: styles$x['vitro-text-color-white']
|
|
62720
|
+
}, createSurnameWithInitials(props.userName)), React__default.createElement(Avatar, {
|
|
62721
|
+
userName: props.userName,
|
|
62722
|
+
isBigSize: true
|
|
62723
|
+
}))), React__default.createElement(DropdownMenu, {
|
|
62724
|
+
right: true
|
|
62725
|
+
}, props.dropdownMenuItemList && props.dropdownMenuItemList.length > 0 && props.dropdownMenuItemList.map(function (item) {
|
|
62726
|
+
return React__default.createElement(UserProfileMenuItem, Object.assign({
|
|
62727
|
+
setDropdownState: setDropdownOpen
|
|
62728
|
+
}, item));
|
|
62729
|
+
})));
|
|
62730
|
+
};
|
|
62731
|
+
|
|
62732
|
+
var UserLookupPicker = function UserLookupPicker(props) {
|
|
62733
|
+
return React__default.createElement(LookupPicker, Object.assign({}, props, {
|
|
62734
|
+
htmlValueTemplate: Avatar,
|
|
62735
|
+
getHtmlValueTemplateProps: props.getHtmlValueTemplateProps
|
|
62736
|
+
}));
|
|
62737
|
+
};
|
|
62738
|
+
|
|
62739
|
+
export { ActionHandlerConstants as ACTION_HANDLER, AlertConstants as ALERT, ActionHandler, Alert$1 as Alert, Avatar, Breadcrumbs, Button$2 as Button, CommandMenu, CommandMenuButton, CommandMenuDropdownButton, CommandMenuLookupPicker, CommandMenuSubItem, ComponentLoader, ComponentLoaderContextImpl, ControlGroup, DatePicker, Dialog, DialogContent, DialogFooter, Input, Label, Login, LookupPicker, MicroFrontend, PdfViewer, Sidebar, TableViewConstants as TABLE_VIEW, TreeViewConstants as TREE_VIEW, TabGroup, TableView, TaskTile, TelerikUploader, TelerikUploaderContextImpl, TimePicker, TopLevelMenu, TreeView, UserLookupPicker, UserProfile, View, commonEn, commonRu };
|
|
62492
62740
|
//# sourceMappingURL=index.modern.js.map
|