@mw-kit/mw-ui 1.7.95 → 1.7.97
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/dist/components/Calendar/components/Basic/components/MonthPicker/index.d.ts +1 -1
- package/dist/components/Filters/Filters/components/Submenu/interfaces.d.ts +0 -2
- package/dist/components/Filters/Filters/index.d.ts +1 -1
- package/dist/components/Filters/Filters/interfaces.d.ts +14 -18
- package/dist/components/Input/components/Select/hooks/Navigation/index.d.ts +1 -3
- package/dist/components/Input/components/Select/hooks/SelectMultiple/components/Label/index.d.ts +4 -4
- package/dist/components/Input/components/Select/hooks/interfaces.d.ts +5 -7
- package/dist/components/Menu/interfaces.d.ts +8 -11
- package/dist/index.js +148 -148
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +148 -148
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12229,7 +12229,7 @@ var EllipsisContainer$1 = function EllipsisContainer$1(props) {
|
|
|
12229
12229
|
};
|
|
12230
12230
|
|
|
12231
12231
|
var _templateObject$5, _templateObject2$5, _templateObject3$5, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20$1, _templateObject21$1, _templateObject22$1;
|
|
12232
|
-
var IconContainer = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n position: absolute;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 17px;\n\n background-color: transparent;\n border: none;\n box-shadow: none;\n padding: 0;\n
|
|
12232
|
+
var IconContainer = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n position: absolute;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 17px;\n\n background-color: transparent;\n border: none;\n box-shadow: none;\n padding: 0;\n"])));
|
|
12233
12233
|
var ChildrenContainer = styled__default(EllipsisContainer$1)(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 100%;\n height: 100%;\n bottom: 0;\n left: 0;\n line-height: 19px;\n display: flex;\n gap: calc(", " / 2);\n"])), function (_ref) {
|
|
12234
12234
|
var theme = _ref.theme;
|
|
12235
12235
|
return theme.spacings.s1;
|
|
@@ -13005,13 +13005,6 @@ var Delimiter = styled__default.div(_templateObject11$3 || (_templateObject11$3
|
|
|
13005
13005
|
return theme.colors.greyishBlue;
|
|
13006
13006
|
});
|
|
13007
13007
|
|
|
13008
|
-
var EmptyLabel = function EmptyLabel(_ref) {
|
|
13009
|
-
var label = _ref.label;
|
|
13010
|
-
return React__default.createElement(React__default.Fragment, {
|
|
13011
|
-
children: label
|
|
13012
|
-
});
|
|
13013
|
-
};
|
|
13014
|
-
|
|
13015
13008
|
var isVisible = function isVisible(elem, bound) {
|
|
13016
13009
|
var docViewTop = bound.scrollTop;
|
|
13017
13010
|
var docViewBottom = docViewTop + bound.offsetHeight;
|
|
@@ -13038,7 +13031,7 @@ var MenuComponent = function MenuComponent(props, ref) {
|
|
|
13038
13031
|
if (isVisible(element, scrollRef)) return;
|
|
13039
13032
|
scrollRef.scrollTo(0, element.offsetTop);
|
|
13040
13033
|
}, [highlight, scrollRef]);
|
|
13041
|
-
var absoluteContainerProps = filterObject(props, ['scrollSpacing', 'scrollTabIndex', '
|
|
13034
|
+
var absoluteContainerProps = filterObject(props, ['scrollSpacing', 'scrollTabIndex', 'onScrollEnd', 'before', 'after', 'close', 'options', 'loading', 'children', 'emptyContent', 'highlight'], {
|
|
13042
13035
|
itemSpacing: 's1'
|
|
13043
13036
|
});
|
|
13044
13037
|
return React__default.createElement(Container$2, Object.assign({}, absoluteContainerProps, {
|
|
@@ -13066,23 +13059,23 @@ var MenuComponent = function MenuComponent(props, ref) {
|
|
|
13066
13059
|
var onClick;
|
|
13067
13060
|
var disabled = option.disabled;
|
|
13068
13061
|
|
|
13069
|
-
var OptionContent = function OptionContent(
|
|
13070
|
-
var children =
|
|
13062
|
+
var OptionContent = function OptionContent(_ref) {
|
|
13063
|
+
var children = _ref.children;
|
|
13071
13064
|
return children;
|
|
13072
13065
|
};
|
|
13073
13066
|
|
|
13074
13067
|
if (!disabled) {
|
|
13075
|
-
var rule = (option.rules ||
|
|
13068
|
+
var rule = (option.rules || []).map(function (rule) {
|
|
13076
13069
|
return rule(index, data);
|
|
13077
13070
|
}).find(function (result) {
|
|
13078
13071
|
return result !== true;
|
|
13079
13072
|
});
|
|
13080
13073
|
|
|
13081
13074
|
if (rule === true || rule === undefined) {
|
|
13082
|
-
var _onClick = option.onClick ||
|
|
13075
|
+
var _onClick = option.onClick || function () {};
|
|
13083
13076
|
|
|
13084
13077
|
onClick = function onClick(e) {
|
|
13085
|
-
_onClick(index, option
|
|
13078
|
+
_onClick(index, option, e);
|
|
13086
13079
|
|
|
13087
13080
|
closeMenu();
|
|
13088
13081
|
};
|
|
@@ -13090,8 +13083,8 @@ var MenuComponent = function MenuComponent(props, ref) {
|
|
|
13090
13083
|
disabled = true;
|
|
13091
13084
|
|
|
13092
13085
|
if (rule !== false) {
|
|
13093
|
-
OptionContent = function OptionContent(
|
|
13094
|
-
var children =
|
|
13086
|
+
OptionContent = function OptionContent(_ref2) {
|
|
13087
|
+
var children = _ref2.children;
|
|
13095
13088
|
return React__default.createElement(semanticUiReact.Popup, Object.assign({
|
|
13096
13089
|
on: 'click',
|
|
13097
13090
|
position: 'left center',
|
|
@@ -13112,7 +13105,14 @@ var MenuComponent = function MenuComponent(props, ref) {
|
|
|
13112
13105
|
}
|
|
13113
13106
|
|
|
13114
13107
|
OptionContent.displayName = 'OptionContent';
|
|
13115
|
-
var
|
|
13108
|
+
var label = option.label;
|
|
13109
|
+
var labelOptions = filterObject(option, ['onClick', 'label', 'rules']);
|
|
13110
|
+
labelOptions.disabled = disabled;
|
|
13111
|
+
var LabelComponent = typeof label === 'function' ? label : function () {
|
|
13112
|
+
return React__default.createElement(React__default.Fragment, {
|
|
13113
|
+
children: label
|
|
13114
|
+
});
|
|
13115
|
+
};
|
|
13116
13116
|
return React__default.createElement(React__default.Fragment, {
|
|
13117
13117
|
key: index
|
|
13118
13118
|
}, React__default.createElement(OptionContent, null, React__default.createElement(Option, {
|
|
@@ -14646,9 +14646,9 @@ var EmptyContentContainer = styled__default.div(_templateObject3$d || (_template
|
|
|
14646
14646
|
});
|
|
14647
14647
|
var HiddenInput = styled__default.input(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteralLoose(["\n width: 0;\n height: 0;\n border-width: 0;\n padding: 0;\n position: absolute;\n outline: none;\n"])));
|
|
14648
14648
|
|
|
14649
|
-
var isAvailable = function isAvailable(index, option
|
|
14650
|
-
return !option.disabled && !(rules || []).some(function (rule) {
|
|
14651
|
-
return rule(index, option) !== true;
|
|
14649
|
+
var isAvailable = function isAvailable(index, option) {
|
|
14650
|
+
return !option.disabled && !(option.rules || []).some(function (rule) {
|
|
14651
|
+
return rule(index, option.data) !== true;
|
|
14652
14652
|
});
|
|
14653
14653
|
};
|
|
14654
14654
|
|
|
@@ -14657,8 +14657,7 @@ var useNavigation = function useNavigation(props) {
|
|
|
14657
14657
|
highlight = _props$highlight[0],
|
|
14658
14658
|
setHighlight = _props$highlight[1],
|
|
14659
14659
|
options = props.options,
|
|
14660
|
-
onSelectHighlight = props.onSelectHighlight
|
|
14661
|
-
rules = props.rules;
|
|
14660
|
+
onSelectHighlight = props.onSelectHighlight;
|
|
14662
14661
|
var onKeyDown = React.useCallback(function (e) {
|
|
14663
14662
|
if (e.key === 'ArrowDown') {
|
|
14664
14663
|
e.preventDefault();
|
|
@@ -14667,7 +14666,7 @@ var useNavigation = function useNavigation(props) {
|
|
|
14667
14666
|
var option = options[index];
|
|
14668
14667
|
if (!option) return current;
|
|
14669
14668
|
|
|
14670
|
-
if (isAvailable(index, option
|
|
14669
|
+
if (isAvailable(index, option)) {
|
|
14671
14670
|
return index;
|
|
14672
14671
|
}
|
|
14673
14672
|
|
|
@@ -14684,7 +14683,7 @@ var useNavigation = function useNavigation(props) {
|
|
|
14684
14683
|
var option = options[index];
|
|
14685
14684
|
if (!option) return current;
|
|
14686
14685
|
|
|
14687
|
-
if (isAvailable(index, option
|
|
14686
|
+
if (isAvailable(index, option)) {
|
|
14688
14687
|
return index;
|
|
14689
14688
|
}
|
|
14690
14689
|
|
|
@@ -14702,10 +14701,12 @@ var useNavigation = function useNavigation(props) {
|
|
|
14702
14701
|
onSelectHighlight(highlight, option);
|
|
14703
14702
|
}
|
|
14704
14703
|
}
|
|
14705
|
-
}, [highlight, options
|
|
14704
|
+
}, [highlight, options]);
|
|
14706
14705
|
|
|
14707
14706
|
var onFocus = function onFocus() {
|
|
14708
|
-
setHighlight(
|
|
14707
|
+
setHighlight(options.findIndex(function (e, i) {
|
|
14708
|
+
return isAvailable(i, e);
|
|
14709
|
+
}));
|
|
14709
14710
|
};
|
|
14710
14711
|
|
|
14711
14712
|
var onBlur = function onBlur() {
|
|
@@ -14754,22 +14755,40 @@ var Header$1 = function Header() {
|
|
|
14754
14755
|
}));
|
|
14755
14756
|
};
|
|
14756
14757
|
|
|
14757
|
-
var getOptions = function getOptions(options, selected) {
|
|
14758
|
-
return options.map(function (option) {
|
|
14758
|
+
var getOptions = function getOptions(onSelect, options, selected) {
|
|
14759
|
+
return options.map(function (option, index) {
|
|
14760
|
+
var value = option.value,
|
|
14761
|
+
onClick = option.onClick,
|
|
14762
|
+
rules = option.rules,
|
|
14763
|
+
disabled = option.disabled;
|
|
14759
14764
|
var isSelected = option.value === (selected === null || selected === void 0 ? void 0 : selected.value);
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14765
|
+
|
|
14766
|
+
var data = _extends({}, option.data, {
|
|
14767
|
+
selected: isSelected,
|
|
14768
|
+
value: value
|
|
14769
|
+
});
|
|
14770
|
+
|
|
14771
|
+
var LabelComponent = option.label;
|
|
14764
14772
|
var parsed = {
|
|
14773
|
+
label: typeof LabelComponent !== 'function' ? LabelComponent : function (_ref) {
|
|
14774
|
+
var disabled = _ref.disabled;
|
|
14775
|
+
return React__default.createElement(LabelComponent, Object.assign({}, {
|
|
14776
|
+
value: value,
|
|
14777
|
+
data: data,
|
|
14778
|
+
disabled: disabled
|
|
14779
|
+
}));
|
|
14780
|
+
},
|
|
14781
|
+
onClick: onClick || function () {
|
|
14782
|
+
onSelect(index, option);
|
|
14783
|
+
},
|
|
14784
|
+
disabled: disabled,
|
|
14785
|
+
rules: rules,
|
|
14765
14786
|
border: {
|
|
14766
14787
|
left: {
|
|
14767
14788
|
color: isSelected ? 'blue' : 'transparent'
|
|
14768
14789
|
}
|
|
14769
14790
|
},
|
|
14770
14791
|
data: data,
|
|
14771
|
-
label: option.label,
|
|
14772
|
-
disabled: option.disabled,
|
|
14773
14792
|
keepOpen: true
|
|
14774
14793
|
};
|
|
14775
14794
|
return parsed;
|
|
@@ -14786,32 +14805,28 @@ var getSelected = function getSelected(value, options) {
|
|
|
14786
14805
|
};
|
|
14787
14806
|
|
|
14788
14807
|
var getInputContent = function getInputContent(props, selectedOption) {
|
|
14789
|
-
if (
|
|
14790
|
-
var LabelComponent =
|
|
14791
|
-
return React__default.createElement(LabelComponent,
|
|
14808
|
+
if (typeof selectedOption.label !== 'function') return selectedOption.label;
|
|
14809
|
+
var LabelComponent = selectedOption.label;
|
|
14810
|
+
return React__default.createElement(LabelComponent, {
|
|
14811
|
+
data: _extends({}, selectedOption.data),
|
|
14812
|
+
value: selectedOption.value,
|
|
14792
14813
|
disabled: props.disabled || props.loading,
|
|
14793
14814
|
mode: 'placeholder'
|
|
14794
|
-
})
|
|
14815
|
+
});
|
|
14795
14816
|
};
|
|
14796
14817
|
|
|
14797
|
-
var useSelect = function useSelect(props,
|
|
14798
|
-
var highlight =
|
|
14799
|
-
setHighlight =
|
|
14800
|
-
var options =
|
|
14801
|
-
setOptions =
|
|
14802
|
-
|
|
14803
|
-
var _ref3 = typeof props.value === 'string' ? [getSelected(props.value, options), props.value] : [props.value, props.value.value],
|
|
14804
|
-
selectedOption = _ref3[0],
|
|
14805
|
-
value = _ref3[1];
|
|
14818
|
+
var useSelect = function useSelect(props, _ref2, _ref3, setOpen) {
|
|
14819
|
+
var highlight = _ref2[0],
|
|
14820
|
+
setHighlight = _ref2[1];
|
|
14821
|
+
var options = _ref3[0],
|
|
14822
|
+
setOptions = _ref3[1];
|
|
14806
14823
|
|
|
14807
|
-
var
|
|
14808
|
-
|
|
14809
|
-
|
|
14810
|
-
|
|
14811
|
-
var inputContent = selectedOption ? getInputContent(props, selectedOption) : props.value;
|
|
14824
|
+
var _ref4 = typeof props.value === 'string' ? [getSelected(props.value, options), props.value] : [props.value, props.value.value],
|
|
14825
|
+
selectedOption = _ref4[0],
|
|
14826
|
+
value = _ref4[1];
|
|
14812
14827
|
|
|
14813
14828
|
var onSelect = function onSelect(index, option) {
|
|
14814
|
-
if (!isAvailable(index, option
|
|
14829
|
+
if (!isAvailable(index, option)) {
|
|
14815
14830
|
return;
|
|
14816
14831
|
}
|
|
14817
14832
|
|
|
@@ -14820,6 +14835,11 @@ var useSelect = function useSelect(props, _ref, _ref2, setOpen) {
|
|
|
14820
14835
|
setOpen(false);
|
|
14821
14836
|
};
|
|
14822
14837
|
|
|
14838
|
+
var parsedOptions = getOptions(onSelect, options, selectedOption);
|
|
14839
|
+
|
|
14840
|
+
var onReset = function onReset() {};
|
|
14841
|
+
|
|
14842
|
+
var inputContent = selectedOption ? getInputContent(props, selectedOption) : props.value;
|
|
14823
14843
|
var parsed = {
|
|
14824
14844
|
parsedOptions: parsedOptions,
|
|
14825
14845
|
options: [options, setOptions],
|
|
@@ -14830,13 +14850,9 @@ var useSelect = function useSelect(props, _ref, _ref2, setOpen) {
|
|
|
14830
14850
|
before: React__default.createElement(React__default.Fragment, null, React__default.createElement(Header$1, null), React__default.createElement(HiddenInput, Object.assign({}, useNavigation({
|
|
14831
14851
|
highlight: [highlight, setHighlight],
|
|
14832
14852
|
options: options,
|
|
14833
|
-
onSelectHighlight: onSelect
|
|
14834
|
-
rules: props.rules
|
|
14853
|
+
onSelectHighlight: onSelect
|
|
14835
14854
|
})))),
|
|
14836
|
-
maxHeight: props.maxHeight || props.search ? '238px' : '180px'
|
|
14837
|
-
onClickOption: function onClickOption(index, option) {
|
|
14838
|
-
onSelect(index, option);
|
|
14839
|
-
}
|
|
14855
|
+
maxHeight: props.maxHeight || props.search ? '238px' : '180px'
|
|
14840
14856
|
},
|
|
14841
14857
|
getContext: function getContext(base, children) {
|
|
14842
14858
|
return React__default.createElement(Provider$1.Provider, {
|
|
@@ -14994,7 +15010,7 @@ var Label$2 = function Label(props) {
|
|
|
14994
15010
|
checked: checked.findIndex(function (e) {
|
|
14995
15011
|
return e.value === value;
|
|
14996
15012
|
}) !== -1,
|
|
14997
|
-
label: LabelComponent ? React__default.createElement(LabelComponent, Object.assign({}, props.option))
|
|
15013
|
+
label: typeof LabelComponent !== 'function' ? LabelComponent : React__default.createElement(LabelComponent, Object.assign({}, props.option)),
|
|
14998
15014
|
disabled: disabled,
|
|
14999
15015
|
onChange: function onChange(event) {
|
|
15000
15016
|
var isChecked = event.target.checked;
|
|
@@ -15027,16 +15043,28 @@ var Label$2 = function Label(props) {
|
|
|
15027
15043
|
});
|
|
15028
15044
|
};
|
|
15029
15045
|
|
|
15030
|
-
var getOptions$1 = function getOptions(options) {
|
|
15046
|
+
var getOptions$1 = function getOptions(options, value) {
|
|
15031
15047
|
return options.map(function (option) {
|
|
15048
|
+
var _label = option.label,
|
|
15049
|
+
onClick = option.onClick;
|
|
15032
15050
|
var data = {
|
|
15033
15051
|
data: option.data,
|
|
15034
15052
|
value: option.value
|
|
15035
15053
|
};
|
|
15036
15054
|
var parsed = {
|
|
15055
|
+
label: function label(option) {
|
|
15056
|
+
return React__default.createElement(Label$2, {
|
|
15057
|
+
option: _extends({}, data, {
|
|
15058
|
+
disabled: option.disabled
|
|
15059
|
+
}),
|
|
15060
|
+
label: _label,
|
|
15061
|
+
value: value
|
|
15062
|
+
});
|
|
15063
|
+
},
|
|
15064
|
+
onClick: onClick,
|
|
15037
15065
|
data: data,
|
|
15038
|
-
label: option.label,
|
|
15039
15066
|
disabled: option.disabled,
|
|
15067
|
+
rules: option.rules,
|
|
15040
15068
|
keepOpen: true
|
|
15041
15069
|
};
|
|
15042
15070
|
return parsed;
|
|
@@ -15069,7 +15097,7 @@ var useSelectMultiple = function useSelectMultiple(props, _ref, _ref2) {
|
|
|
15069
15097
|
checked = _useState[0],
|
|
15070
15098
|
setChecked = _useState[1];
|
|
15071
15099
|
|
|
15072
|
-
var parsedOptions = getOptions$1(options);
|
|
15100
|
+
var parsedOptions = getOptions$1(options, initial);
|
|
15073
15101
|
var inputContent = getInputContent$1(props.value);
|
|
15074
15102
|
|
|
15075
15103
|
var onReset = function onReset() {
|
|
@@ -15077,7 +15105,7 @@ var useSelectMultiple = function useSelectMultiple(props, _ref, _ref2) {
|
|
|
15077
15105
|
};
|
|
15078
15106
|
|
|
15079
15107
|
var onSelectHighlight = function onSelectHighlight(index, option) {
|
|
15080
|
-
if (!isAvailable(index, option
|
|
15108
|
+
if (!isAvailable(index, option)) {
|
|
15081
15109
|
return;
|
|
15082
15110
|
}
|
|
15083
15111
|
|
|
@@ -15109,24 +15137,13 @@ var useSelectMultiple = function useSelectMultiple(props, _ref, _ref2) {
|
|
|
15109
15137
|
before: React__default.createElement(React__default.Fragment, null, React__default.createElement(Header$2, null), React__default.createElement(HiddenInput, Object.assign({}, useNavigation({
|
|
15110
15138
|
highlight: [highlight, setHighlight],
|
|
15111
15139
|
options: options,
|
|
15112
|
-
onSelectHighlight: onSelectHighlight
|
|
15113
|
-
rules: props.rules
|
|
15140
|
+
onSelectHighlight: onSelectHighlight
|
|
15114
15141
|
})))),
|
|
15115
15142
|
after: {
|
|
15116
15143
|
fluid: true,
|
|
15117
15144
|
children: React__default.createElement(Footer$1, null)
|
|
15118
15145
|
},
|
|
15119
|
-
maxHeight: props.maxHeight || (props.selectAll ? '269px' : '224px')
|
|
15120
|
-
label: function label(option) {
|
|
15121
|
-
return React__default.createElement(Label$2, {
|
|
15122
|
-
option: _extends({}, option, {
|
|
15123
|
-
value: option.data.value,
|
|
15124
|
-
data: option.data.data
|
|
15125
|
-
}),
|
|
15126
|
-
label: props.optionLabel,
|
|
15127
|
-
value: initial
|
|
15128
|
-
});
|
|
15129
|
-
}
|
|
15146
|
+
maxHeight: props.maxHeight || (props.selectAll ? '269px' : '224px')
|
|
15130
15147
|
},
|
|
15131
15148
|
getContext: function getContext(base, children) {
|
|
15132
15149
|
return React__default.createElement(Provider$2.Provider, {
|
|
@@ -15225,7 +15242,7 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15225
15242
|
setPage(1);
|
|
15226
15243
|
};
|
|
15227
15244
|
|
|
15228
|
-
var inputProps = filterObject(props, ['type', 'onScrollEnd', 'position', 'value', 'onClear', 'placeholder', 'initialLoader', '
|
|
15245
|
+
var inputProps = filterObject(props, ['type', 'onScrollEnd', 'position', 'value', 'onClear', 'placeholder', 'initialLoader', 'onScrollEnd', 'position', 'center', 'maxHeight', 'emptyContent']);
|
|
15229
15246
|
|
|
15230
15247
|
var _onScrollEnd = props.onScrollEnd || function () {};
|
|
15231
15248
|
|
|
@@ -15347,11 +15364,6 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15347
15364
|
}, {
|
|
15348
15365
|
children: inputContent
|
|
15349
15366
|
})), React__default.createElement(Menu, Object.assign({}, menuProps, {
|
|
15350
|
-
rules: (props.rules || []).map(function (rule) {
|
|
15351
|
-
return function (index, data) {
|
|
15352
|
-
return rule(index, data.data);
|
|
15353
|
-
};
|
|
15354
|
-
}),
|
|
15355
15367
|
highlight: highlight,
|
|
15356
15368
|
open: open,
|
|
15357
15369
|
close: function close() {
|
|
@@ -15699,7 +15711,15 @@ var Component = React__default.forwardRef(function (props, ref) {
|
|
|
15699
15711
|
|
|
15700
15712
|
var options = Object.keys(countries).map(function (iso) {
|
|
15701
15713
|
return {
|
|
15702
|
-
label:
|
|
15714
|
+
label: function label(option) {
|
|
15715
|
+
var country = option.data;
|
|
15716
|
+
return React__default.createElement(Label$3, null, React__default.createElement(Flag, {
|
|
15717
|
+
iso: iso
|
|
15718
|
+
}), country.name, React__default.createElement("span", null, "+", country.ddi));
|
|
15719
|
+
},
|
|
15720
|
+
onClick: function onClick() {
|
|
15721
|
+
setCountry(countries[iso]);
|
|
15722
|
+
},
|
|
15703
15723
|
data: countries[iso]
|
|
15704
15724
|
};
|
|
15705
15725
|
});
|
|
@@ -15765,16 +15785,6 @@ var Component = React__default.forwardRef(function (props, ref) {
|
|
|
15765
15785
|
return setOpen(false);
|
|
15766
15786
|
},
|
|
15767
15787
|
options: options,
|
|
15768
|
-
onClickOption: function onClickOption(_index, _ref) {
|
|
15769
|
-
var iso = _ref.iso;
|
|
15770
|
-
return setCountry(countries[iso]);
|
|
15771
|
-
},
|
|
15772
|
-
label: function label(option) {
|
|
15773
|
-
var country = option.data;
|
|
15774
|
-
return React__default.createElement(Label$3, null, React__default.createElement(Flag, {
|
|
15775
|
-
iso: country.iso
|
|
15776
|
-
}), country.name, React__default.createElement("span", null, "+", country.ddi));
|
|
15777
|
-
},
|
|
15778
15788
|
width: '100%',
|
|
15779
15789
|
maxHeight: '165px',
|
|
15780
15790
|
bordered: true,
|
|
@@ -16847,29 +16857,6 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
|
16847
16857
|
ref: ref,
|
|
16848
16858
|
readOnly: true
|
|
16849
16859
|
}));
|
|
16850
|
-
var options = [{
|
|
16851
|
-
label: 'Hoje',
|
|
16852
|
-
data: {
|
|
16853
|
-
intervalType: 'day'
|
|
16854
|
-
}
|
|
16855
|
-
}, {
|
|
16856
|
-
label: 'Semana',
|
|
16857
|
-
data: {
|
|
16858
|
-
intervalType: 'week'
|
|
16859
|
-
}
|
|
16860
|
-
}, {
|
|
16861
|
-
label: 'Mês',
|
|
16862
|
-
data: {
|
|
16863
|
-
intervalType: 'month'
|
|
16864
|
-
}
|
|
16865
|
-
}, {
|
|
16866
|
-
label: 'Personalizado',
|
|
16867
|
-
data: {
|
|
16868
|
-
intervalType: 'custom'
|
|
16869
|
-
},
|
|
16870
|
-
keepOpen: true,
|
|
16871
|
-
caret: true
|
|
16872
|
-
}];
|
|
16873
16860
|
return React__default.createElement(RelativeContainer$5, {
|
|
16874
16861
|
ref: useOnClickOut(function () {
|
|
16875
16862
|
return setOpen(null);
|
|
@@ -16930,16 +16917,33 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
|
16930
16917
|
references: {
|
|
16931
16918
|
bottom: '35px'
|
|
16932
16919
|
},
|
|
16933
|
-
options:
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16920
|
+
options: [{
|
|
16921
|
+
label: 'Hoje',
|
|
16922
|
+
onClick: function onClick() {
|
|
16923
|
+
return setValue(intervalTypes.day.initial(props.min));
|
|
16924
|
+
},
|
|
16925
|
+
data: {}
|
|
16926
|
+
}, {
|
|
16927
|
+
label: 'Semana',
|
|
16928
|
+
onClick: function onClick() {
|
|
16929
|
+
return setValue(intervalTypes.week.initial(props.min));
|
|
16930
|
+
},
|
|
16931
|
+
data: {}
|
|
16932
|
+
}, {
|
|
16933
|
+
label: 'Mês',
|
|
16934
|
+
onClick: function onClick() {
|
|
16935
|
+
return setValue(intervalTypes.month.initial(props.min));
|
|
16936
|
+
},
|
|
16937
|
+
data: {}
|
|
16938
|
+
}, {
|
|
16939
|
+
label: 'Personalizado',
|
|
16940
|
+
onClick: function onClick() {
|
|
16941
|
+
return setOpen('calendar');
|
|
16942
|
+
},
|
|
16943
|
+
data: {},
|
|
16944
|
+
keepOpen: true,
|
|
16945
|
+
caret: true
|
|
16946
|
+
}],
|
|
16943
16947
|
width: '165px',
|
|
16944
16948
|
itemSpacing: 's3',
|
|
16945
16949
|
bordered: true
|
|
@@ -16950,9 +16954,9 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
|
16950
16954
|
open: open === 'calendar',
|
|
16951
16955
|
initialValue: value,
|
|
16952
16956
|
onSubmit: {
|
|
16953
|
-
onClick: function onClick(
|
|
16954
|
-
var start =
|
|
16955
|
-
end =
|
|
16957
|
+
onClick: function onClick(_ref2) {
|
|
16958
|
+
var start = _ref2[0],
|
|
16959
|
+
end = _ref2[1];
|
|
16956
16960
|
if (start === null || end === null) return;
|
|
16957
16961
|
setValue([start, end]);
|
|
16958
16962
|
setOpen(null);
|
|
@@ -17930,7 +17934,8 @@ var getInstance = function getInstance(props) {
|
|
|
17930
17934
|
var _getOptions = function _getOptions(value) {
|
|
17931
17935
|
try {
|
|
17932
17936
|
var options = intialOptions.filter(function (option) {
|
|
17933
|
-
|
|
17937
|
+
var label = isString(option.label) ? option.label : option.label.text;
|
|
17938
|
+
return strCmp(label, value, {
|
|
17934
17939
|
contain: true
|
|
17935
17940
|
});
|
|
17936
17941
|
});
|
|
@@ -18095,8 +18100,9 @@ var Submenu = function Submenu(props) {
|
|
|
18095
18100
|
|
|
18096
18101
|
var optionsParser = function optionsParser(option) {
|
|
18097
18102
|
return {
|
|
18098
|
-
label: option.label,
|
|
18099
|
-
|
|
18103
|
+
label: typeof option.label === 'string' ? option.label : option.label.element,
|
|
18104
|
+
onClick: onClickOption,
|
|
18105
|
+
data: {}
|
|
18100
18106
|
};
|
|
18101
18107
|
};
|
|
18102
18108
|
|
|
@@ -18114,8 +18120,6 @@ var Submenu = function Submenu(props) {
|
|
|
18114
18120
|
close: close,
|
|
18115
18121
|
width: isDynamic ? '275px' : '160px',
|
|
18116
18122
|
height: '261px',
|
|
18117
|
-
onClickOption: onClickOption,
|
|
18118
|
-
label: props.optionLabel,
|
|
18119
18123
|
containerSpacing: {
|
|
18120
18124
|
top: 's3',
|
|
18121
18125
|
left: 's1',
|
|
@@ -18160,11 +18164,16 @@ var FiltersMenu = function FiltersMenu(props) {
|
|
|
18160
18164
|
|
|
18161
18165
|
var items = props.items.map(function (item) {
|
|
18162
18166
|
return {
|
|
18163
|
-
label: item.label,
|
|
18167
|
+
label: typeof item.label === 'string' ? item.label : item.label.element,
|
|
18164
18168
|
delimiter: item.delimiter,
|
|
18165
18169
|
keepOpen: true,
|
|
18166
18170
|
caret: true,
|
|
18167
|
-
|
|
18171
|
+
onClick: function onClick(index) {
|
|
18172
|
+
setActive(function (prev) {
|
|
18173
|
+
return prev === index ? -1 : index;
|
|
18174
|
+
});
|
|
18175
|
+
},
|
|
18176
|
+
data: {}
|
|
18168
18177
|
};
|
|
18169
18178
|
});
|
|
18170
18179
|
var selected = active >= 0 && active < props.items.length ? props.items[active] : undefined;
|
|
@@ -18178,12 +18187,6 @@ var FiltersMenu = function FiltersMenu(props) {
|
|
|
18178
18187
|
close: close,
|
|
18179
18188
|
width: '160px',
|
|
18180
18189
|
maxHeight: '261px',
|
|
18181
|
-
onClickOption: function onClickOption(index) {
|
|
18182
|
-
setActive(function (prev) {
|
|
18183
|
-
return prev === index ? -1 : index;
|
|
18184
|
-
});
|
|
18185
|
-
},
|
|
18186
|
-
label: props.filterLabel,
|
|
18187
18190
|
containerSpacing: {
|
|
18188
18191
|
top: 's1',
|
|
18189
18192
|
left: 's1',
|
|
@@ -18201,7 +18204,6 @@ var FiltersMenu = function FiltersMenu(props) {
|
|
|
18201
18204
|
}
|
|
18202
18205
|
}, props.containerProps || {}), React__default.createElement(Submenu, {
|
|
18203
18206
|
item: selected,
|
|
18204
|
-
optionLabel: props.optionLabel && selected ? props.optionLabel[selected.name] : undefined,
|
|
18205
18207
|
close: function close() {
|
|
18206
18208
|
return setActive(-1);
|
|
18207
18209
|
},
|
|
@@ -18216,7 +18218,7 @@ var Filters = Object.assign(function (props) {
|
|
|
18216
18218
|
setAppliedFilters = props.setAppliedFilters,
|
|
18217
18219
|
containerProps = props.containerProps,
|
|
18218
18220
|
subContainerProps = props.subContainerProps;
|
|
18219
|
-
var buttonProps = filterObject(props, ['items', 'setAppliedFilters'
|
|
18221
|
+
var buttonProps = filterObject(props, ['items', 'setAppliedFilters']);
|
|
18220
18222
|
return React__default.createElement(Button$5, Object.assign({}, buttonProps, {
|
|
18221
18223
|
gap: 's4',
|
|
18222
18224
|
getContent: function getContent(open, close) {
|
|
@@ -18226,9 +18228,7 @@ var Filters = Object.assign(function (props) {
|
|
|
18226
18228
|
setAppliedFilters: setAppliedFilters,
|
|
18227
18229
|
items: items,
|
|
18228
18230
|
containerProps: containerProps,
|
|
18229
|
-
subContainerProps: subContainerProps
|
|
18230
|
-
filterLabel: props.filterLabel,
|
|
18231
|
-
optionLabel: props.optionLabel
|
|
18231
|
+
subContainerProps: subContainerProps
|
|
18232
18232
|
}));
|
|
18233
18233
|
}
|
|
18234
18234
|
}), "Filtros");
|