@mw-kit/mw-ui 1.7.94 → 1.7.96
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 +1 -3
- package/dist/components/Filters/Filters/interfaces.d.ts +4 -7
- package/dist/components/Input/components/Select/hooks/Navigation/index.d.ts +1 -3
- package/dist/components/Input/components/Select/hooks/Select/index.d.ts +2 -2
- package/dist/components/Input/components/Select/hooks/SelectMultiple/components/Label/index.d.ts +4 -4
- package/dist/components/Input/components/Select/hooks/SelectMultiple/index.d.ts +2 -2
- 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 +144 -146
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +144 -146
- 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,8 +14646,8 @@ 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) {
|
|
14649
|
+
var isAvailable = function isAvailable(index, option) {
|
|
14650
|
+
return !option.disabled && !(option.rules || []).some(function (rule) {
|
|
14651
14651
|
return rule(index, option) !== true;
|
|
14652
14652
|
});
|
|
14653
14653
|
};
|
|
@@ -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,7 +14701,7 @@ 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
14707
|
setHighlight(0);
|
|
@@ -14754,22 +14753,40 @@ var Header$1 = function Header() {
|
|
|
14754
14753
|
}));
|
|
14755
14754
|
};
|
|
14756
14755
|
|
|
14757
|
-
var getOptions = function getOptions(options, selected) {
|
|
14758
|
-
return options.map(function (option) {
|
|
14756
|
+
var getOptions = function getOptions(onSelect, options, selected) {
|
|
14757
|
+
return options.map(function (option, index) {
|
|
14758
|
+
var value = option.value,
|
|
14759
|
+
onClick = option.onClick,
|
|
14760
|
+
rules = option.rules,
|
|
14761
|
+
disabled = option.disabled;
|
|
14759
14762
|
var isSelected = option.value === (selected === null || selected === void 0 ? void 0 : selected.value);
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14763
|
+
|
|
14764
|
+
var data = _extends({}, option.data, {
|
|
14765
|
+
selected: isSelected,
|
|
14766
|
+
value: value
|
|
14767
|
+
});
|
|
14768
|
+
|
|
14769
|
+
var LabelComponent = option.label;
|
|
14764
14770
|
var parsed = {
|
|
14771
|
+
label: typeof LabelComponent !== 'function' ? LabelComponent : function (_ref) {
|
|
14772
|
+
var disabled = _ref.disabled;
|
|
14773
|
+
return React__default.createElement(LabelComponent, Object.assign({}, {
|
|
14774
|
+
value: value,
|
|
14775
|
+
data: data,
|
|
14776
|
+
disabled: disabled
|
|
14777
|
+
}));
|
|
14778
|
+
},
|
|
14779
|
+
onClick: onClick || function () {
|
|
14780
|
+
onSelect(index, option);
|
|
14781
|
+
},
|
|
14782
|
+
disabled: disabled,
|
|
14783
|
+
rules: rules,
|
|
14765
14784
|
border: {
|
|
14766
14785
|
left: {
|
|
14767
14786
|
color: isSelected ? 'blue' : 'transparent'
|
|
14768
14787
|
}
|
|
14769
14788
|
},
|
|
14770
14789
|
data: data,
|
|
14771
|
-
label: option.label,
|
|
14772
|
-
disabled: option.disabled,
|
|
14773
14790
|
keepOpen: true
|
|
14774
14791
|
};
|
|
14775
14792
|
return parsed;
|
|
@@ -14786,32 +14803,28 @@ var getSelected = function getSelected(value, options) {
|
|
|
14786
14803
|
};
|
|
14787
14804
|
|
|
14788
14805
|
var getInputContent = function getInputContent(props, selectedOption) {
|
|
14789
|
-
if (
|
|
14790
|
-
var LabelComponent =
|
|
14791
|
-
return React__default.createElement(LabelComponent,
|
|
14806
|
+
if (typeof selectedOption.label !== 'function') return selectedOption.label;
|
|
14807
|
+
var LabelComponent = selectedOption.label;
|
|
14808
|
+
return React__default.createElement(LabelComponent, {
|
|
14809
|
+
data: _extends({}, selectedOption.data),
|
|
14810
|
+
value: selectedOption.value,
|
|
14792
14811
|
disabled: props.disabled || props.loading,
|
|
14793
14812
|
mode: 'placeholder'
|
|
14794
|
-
})
|
|
14813
|
+
});
|
|
14795
14814
|
};
|
|
14796
14815
|
|
|
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];
|
|
14806
|
-
|
|
14807
|
-
var parsedOptions = getOptions(options, selectedOption);
|
|
14816
|
+
var useSelect = function useSelect(props, _ref2, _ref3, setOpen) {
|
|
14817
|
+
var highlight = _ref2[0],
|
|
14818
|
+
setHighlight = _ref2[1];
|
|
14819
|
+
var options = _ref3[0],
|
|
14820
|
+
setOptions = _ref3[1];
|
|
14808
14821
|
|
|
14809
|
-
var
|
|
14810
|
-
|
|
14811
|
-
|
|
14822
|
+
var _ref4 = typeof props.value === 'string' ? [getSelected(props.value, options), props.value] : [props.value, props.value.value],
|
|
14823
|
+
selectedOption = _ref4[0],
|
|
14824
|
+
value = _ref4[1];
|
|
14812
14825
|
|
|
14813
14826
|
var onSelect = function onSelect(index, option) {
|
|
14814
|
-
if (!isAvailable(index, option
|
|
14827
|
+
if (!isAvailable(index, option)) {
|
|
14815
14828
|
return;
|
|
14816
14829
|
}
|
|
14817
14830
|
|
|
@@ -14820,6 +14833,11 @@ var useSelect = function useSelect(props, _ref, _ref2, setOpen) {
|
|
|
14820
14833
|
setOpen(false);
|
|
14821
14834
|
};
|
|
14822
14835
|
|
|
14836
|
+
var parsedOptions = getOptions(onSelect, options, selectedOption);
|
|
14837
|
+
|
|
14838
|
+
var onReset = function onReset() {};
|
|
14839
|
+
|
|
14840
|
+
var inputContent = selectedOption ? getInputContent(props, selectedOption) : props.value;
|
|
14823
14841
|
var parsed = {
|
|
14824
14842
|
parsedOptions: parsedOptions,
|
|
14825
14843
|
options: [options, setOptions],
|
|
@@ -14830,13 +14848,9 @@ var useSelect = function useSelect(props, _ref, _ref2, setOpen) {
|
|
|
14830
14848
|
before: React__default.createElement(React__default.Fragment, null, React__default.createElement(Header$1, null), React__default.createElement(HiddenInput, Object.assign({}, useNavigation({
|
|
14831
14849
|
highlight: [highlight, setHighlight],
|
|
14832
14850
|
options: options,
|
|
14833
|
-
onSelectHighlight: onSelect
|
|
14834
|
-
rules: props.rules
|
|
14851
|
+
onSelectHighlight: onSelect
|
|
14835
14852
|
})))),
|
|
14836
|
-
maxHeight: props.maxHeight || props.search ? '238px' : '180px'
|
|
14837
|
-
onClickOption: function onClickOption(index, option) {
|
|
14838
|
-
onSelect(index, option);
|
|
14839
|
-
}
|
|
14853
|
+
maxHeight: props.maxHeight || props.search ? '238px' : '180px'
|
|
14840
14854
|
},
|
|
14841
14855
|
getContext: function getContext(base, children) {
|
|
14842
14856
|
return React__default.createElement(Provider$1.Provider, {
|
|
@@ -14994,7 +15008,7 @@ var Label$2 = function Label(props) {
|
|
|
14994
15008
|
checked: checked.findIndex(function (e) {
|
|
14995
15009
|
return e.value === value;
|
|
14996
15010
|
}) !== -1,
|
|
14997
|
-
label: LabelComponent ? React__default.createElement(LabelComponent, Object.assign({}, props.option))
|
|
15011
|
+
label: typeof LabelComponent !== 'function' ? LabelComponent : React__default.createElement(LabelComponent, Object.assign({}, props.option)),
|
|
14998
15012
|
disabled: disabled,
|
|
14999
15013
|
onChange: function onChange(event) {
|
|
15000
15014
|
var isChecked = event.target.checked;
|
|
@@ -15027,16 +15041,28 @@ var Label$2 = function Label(props) {
|
|
|
15027
15041
|
});
|
|
15028
15042
|
};
|
|
15029
15043
|
|
|
15030
|
-
var getOptions$1 = function getOptions(options) {
|
|
15044
|
+
var getOptions$1 = function getOptions(options, value) {
|
|
15031
15045
|
return options.map(function (option) {
|
|
15046
|
+
var _label = option.label,
|
|
15047
|
+
onClick = option.onClick;
|
|
15032
15048
|
var data = {
|
|
15033
15049
|
data: option.data,
|
|
15034
15050
|
value: option.value
|
|
15035
15051
|
};
|
|
15036
15052
|
var parsed = {
|
|
15053
|
+
label: function label(option) {
|
|
15054
|
+
return React__default.createElement(Label$2, {
|
|
15055
|
+
option: _extends({}, data, {
|
|
15056
|
+
disabled: option.disabled
|
|
15057
|
+
}),
|
|
15058
|
+
label: _label,
|
|
15059
|
+
value: value
|
|
15060
|
+
});
|
|
15061
|
+
},
|
|
15062
|
+
onClick: onClick,
|
|
15037
15063
|
data: data,
|
|
15038
|
-
label: option.label,
|
|
15039
15064
|
disabled: option.disabled,
|
|
15065
|
+
rules: option.rules,
|
|
15040
15066
|
keepOpen: true
|
|
15041
15067
|
};
|
|
15042
15068
|
return parsed;
|
|
@@ -15069,7 +15095,7 @@ var useSelectMultiple = function useSelectMultiple(props, _ref, _ref2) {
|
|
|
15069
15095
|
checked = _useState[0],
|
|
15070
15096
|
setChecked = _useState[1];
|
|
15071
15097
|
|
|
15072
|
-
var parsedOptions = getOptions$1(options);
|
|
15098
|
+
var parsedOptions = getOptions$1(options, initial);
|
|
15073
15099
|
var inputContent = getInputContent$1(props.value);
|
|
15074
15100
|
|
|
15075
15101
|
var onReset = function onReset() {
|
|
@@ -15077,7 +15103,7 @@ var useSelectMultiple = function useSelectMultiple(props, _ref, _ref2) {
|
|
|
15077
15103
|
};
|
|
15078
15104
|
|
|
15079
15105
|
var onSelectHighlight = function onSelectHighlight(index, option) {
|
|
15080
|
-
if (!isAvailable(index, option
|
|
15106
|
+
if (!isAvailable(index, option)) {
|
|
15081
15107
|
return;
|
|
15082
15108
|
}
|
|
15083
15109
|
|
|
@@ -15109,24 +15135,13 @@ var useSelectMultiple = function useSelectMultiple(props, _ref, _ref2) {
|
|
|
15109
15135
|
before: React__default.createElement(React__default.Fragment, null, React__default.createElement(Header$2, null), React__default.createElement(HiddenInput, Object.assign({}, useNavigation({
|
|
15110
15136
|
highlight: [highlight, setHighlight],
|
|
15111
15137
|
options: options,
|
|
15112
|
-
onSelectHighlight: onSelectHighlight
|
|
15113
|
-
rules: props.rules
|
|
15138
|
+
onSelectHighlight: onSelectHighlight
|
|
15114
15139
|
})))),
|
|
15115
15140
|
after: {
|
|
15116
15141
|
fluid: true,
|
|
15117
15142
|
children: React__default.createElement(Footer$1, null)
|
|
15118
15143
|
},
|
|
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
|
-
}
|
|
15144
|
+
maxHeight: props.maxHeight || (props.selectAll ? '269px' : '224px')
|
|
15130
15145
|
},
|
|
15131
15146
|
getContext: function getContext(base, children) {
|
|
15132
15147
|
return React__default.createElement(Provider$2.Provider, {
|
|
@@ -15225,7 +15240,7 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15225
15240
|
setPage(1);
|
|
15226
15241
|
};
|
|
15227
15242
|
|
|
15228
|
-
var inputProps = filterObject(props, ['type', 'onScrollEnd', 'position', 'value', 'onClear', 'placeholder', 'initialLoader', '
|
|
15243
|
+
var inputProps = filterObject(props, ['type', 'onScrollEnd', 'position', 'value', 'onClear', 'placeholder', 'initialLoader', 'onScrollEnd', 'position', 'center', 'maxHeight', 'emptyContent']);
|
|
15229
15244
|
|
|
15230
15245
|
var _onScrollEnd = props.onScrollEnd || function () {};
|
|
15231
15246
|
|
|
@@ -15347,11 +15362,6 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15347
15362
|
}, {
|
|
15348
15363
|
children: inputContent
|
|
15349
15364
|
})), 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
15365
|
highlight: highlight,
|
|
15356
15366
|
open: open,
|
|
15357
15367
|
close: function close() {
|
|
@@ -15699,7 +15709,15 @@ var Component = React__default.forwardRef(function (props, ref) {
|
|
|
15699
15709
|
|
|
15700
15710
|
var options = Object.keys(countries).map(function (iso) {
|
|
15701
15711
|
return {
|
|
15702
|
-
label:
|
|
15712
|
+
label: function label(option) {
|
|
15713
|
+
var country = option.data;
|
|
15714
|
+
return React__default.createElement(Label$3, null, React__default.createElement(Flag, {
|
|
15715
|
+
iso: iso
|
|
15716
|
+
}), country.name, React__default.createElement("span", null, "+", country.ddi));
|
|
15717
|
+
},
|
|
15718
|
+
onClick: function onClick() {
|
|
15719
|
+
setCountry(countries[iso]);
|
|
15720
|
+
},
|
|
15703
15721
|
data: countries[iso]
|
|
15704
15722
|
};
|
|
15705
15723
|
});
|
|
@@ -15765,16 +15783,6 @@ var Component = React__default.forwardRef(function (props, ref) {
|
|
|
15765
15783
|
return setOpen(false);
|
|
15766
15784
|
},
|
|
15767
15785
|
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
15786
|
width: '100%',
|
|
15779
15787
|
maxHeight: '165px',
|
|
15780
15788
|
bordered: true,
|
|
@@ -16847,29 +16855,6 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
|
16847
16855
|
ref: ref,
|
|
16848
16856
|
readOnly: true
|
|
16849
16857
|
}));
|
|
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
16858
|
return React__default.createElement(RelativeContainer$5, {
|
|
16874
16859
|
ref: useOnClickOut(function () {
|
|
16875
16860
|
return setOpen(null);
|
|
@@ -16930,16 +16915,33 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
|
16930
16915
|
references: {
|
|
16931
16916
|
bottom: '35px'
|
|
16932
16917
|
},
|
|
16933
|
-
options:
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16918
|
+
options: [{
|
|
16919
|
+
label: 'Hoje',
|
|
16920
|
+
onClick: function onClick() {
|
|
16921
|
+
return setValue(intervalTypes.day.initial(props.min));
|
|
16922
|
+
},
|
|
16923
|
+
data: {}
|
|
16924
|
+
}, {
|
|
16925
|
+
label: 'Semana',
|
|
16926
|
+
onClick: function onClick() {
|
|
16927
|
+
return setValue(intervalTypes.week.initial(props.min));
|
|
16928
|
+
},
|
|
16929
|
+
data: {}
|
|
16930
|
+
}, {
|
|
16931
|
+
label: 'Mês',
|
|
16932
|
+
onClick: function onClick() {
|
|
16933
|
+
return setValue(intervalTypes.month.initial(props.min));
|
|
16934
|
+
},
|
|
16935
|
+
data: {}
|
|
16936
|
+
}, {
|
|
16937
|
+
label: 'Personalizado',
|
|
16938
|
+
onClick: function onClick() {
|
|
16939
|
+
return setOpen('calendar');
|
|
16940
|
+
},
|
|
16941
|
+
data: {},
|
|
16942
|
+
keepOpen: true,
|
|
16943
|
+
caret: true
|
|
16944
|
+
}],
|
|
16943
16945
|
width: '165px',
|
|
16944
16946
|
itemSpacing: 's3',
|
|
16945
16947
|
bordered: true
|
|
@@ -16950,9 +16952,9 @@ var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
|
16950
16952
|
open: open === 'calendar',
|
|
16951
16953
|
initialValue: value,
|
|
16952
16954
|
onSubmit: {
|
|
16953
|
-
onClick: function onClick(
|
|
16954
|
-
var start =
|
|
16955
|
-
end =
|
|
16955
|
+
onClick: function onClick(_ref2) {
|
|
16956
|
+
var start = _ref2[0],
|
|
16957
|
+
end = _ref2[1];
|
|
16956
16958
|
if (start === null || end === null) return;
|
|
16957
16959
|
setValue([start, end]);
|
|
16958
16960
|
setOpen(null);
|
|
@@ -17930,7 +17932,8 @@ var getInstance = function getInstance(props) {
|
|
|
17930
17932
|
var _getOptions = function _getOptions(value) {
|
|
17931
17933
|
try {
|
|
17932
17934
|
var options = intialOptions.filter(function (option) {
|
|
17933
|
-
|
|
17935
|
+
var label = isString(option.label) ? option.label : option.label.text;
|
|
17936
|
+
return strCmp(label, value, {
|
|
17934
17937
|
contain: true
|
|
17935
17938
|
});
|
|
17936
17939
|
});
|
|
@@ -18095,8 +18098,9 @@ var Submenu = function Submenu(props) {
|
|
|
18095
18098
|
|
|
18096
18099
|
var optionsParser = function optionsParser(option) {
|
|
18097
18100
|
return {
|
|
18098
|
-
label: option.label,
|
|
18099
|
-
|
|
18101
|
+
label: typeof option.label === 'string' ? option.label : option.label.element,
|
|
18102
|
+
onClick: onClickOption,
|
|
18103
|
+
data: {}
|
|
18100
18104
|
};
|
|
18101
18105
|
};
|
|
18102
18106
|
|
|
@@ -18114,8 +18118,6 @@ var Submenu = function Submenu(props) {
|
|
|
18114
18118
|
close: close,
|
|
18115
18119
|
width: isDynamic ? '275px' : '160px',
|
|
18116
18120
|
height: '261px',
|
|
18117
|
-
onClickOption: onClickOption,
|
|
18118
|
-
label: props.optionLabel,
|
|
18119
18121
|
containerSpacing: {
|
|
18120
18122
|
top: 's3',
|
|
18121
18123
|
left: 's1',
|
|
@@ -18160,11 +18162,16 @@ var FiltersMenu = function FiltersMenu(props) {
|
|
|
18160
18162
|
|
|
18161
18163
|
var items = props.items.map(function (item) {
|
|
18162
18164
|
return {
|
|
18163
|
-
label: item.label,
|
|
18165
|
+
label: typeof item.label === 'string' ? item.label : item.label.element,
|
|
18164
18166
|
delimiter: item.delimiter,
|
|
18165
18167
|
keepOpen: true,
|
|
18166
18168
|
caret: true,
|
|
18167
|
-
|
|
18169
|
+
onClick: function onClick(index) {
|
|
18170
|
+
setActive(function (prev) {
|
|
18171
|
+
return prev === index ? -1 : index;
|
|
18172
|
+
});
|
|
18173
|
+
},
|
|
18174
|
+
data: {}
|
|
18168
18175
|
};
|
|
18169
18176
|
});
|
|
18170
18177
|
var selected = active >= 0 && active < props.items.length ? props.items[active] : undefined;
|
|
@@ -18178,12 +18185,6 @@ var FiltersMenu = function FiltersMenu(props) {
|
|
|
18178
18185
|
close: close,
|
|
18179
18186
|
width: '160px',
|
|
18180
18187
|
maxHeight: '261px',
|
|
18181
|
-
onClickOption: function onClickOption(index) {
|
|
18182
|
-
setActive(function (prev) {
|
|
18183
|
-
return prev === index ? -1 : index;
|
|
18184
|
-
});
|
|
18185
|
-
},
|
|
18186
|
-
label: props.filterLabel,
|
|
18187
18188
|
containerSpacing: {
|
|
18188
18189
|
top: 's1',
|
|
18189
18190
|
left: 's1',
|
|
@@ -18201,7 +18202,6 @@ var FiltersMenu = function FiltersMenu(props) {
|
|
|
18201
18202
|
}
|
|
18202
18203
|
}, props.containerProps || {}), React__default.createElement(Submenu, {
|
|
18203
18204
|
item: selected,
|
|
18204
|
-
optionLabel: props.optionLabel && selected ? props.optionLabel[selected.name] : undefined,
|
|
18205
18205
|
close: function close() {
|
|
18206
18206
|
return setActive(-1);
|
|
18207
18207
|
},
|
|
@@ -18216,7 +18216,7 @@ var Filters = Object.assign(function (props) {
|
|
|
18216
18216
|
setAppliedFilters = props.setAppliedFilters,
|
|
18217
18217
|
containerProps = props.containerProps,
|
|
18218
18218
|
subContainerProps = props.subContainerProps;
|
|
18219
|
-
var buttonProps = filterObject(props, ['items', 'setAppliedFilters'
|
|
18219
|
+
var buttonProps = filterObject(props, ['items', 'setAppliedFilters']);
|
|
18220
18220
|
return React__default.createElement(Button$5, Object.assign({}, buttonProps, {
|
|
18221
18221
|
gap: 's4',
|
|
18222
18222
|
getContent: function getContent(open, close) {
|
|
@@ -18226,9 +18226,7 @@ var Filters = Object.assign(function (props) {
|
|
|
18226
18226
|
setAppliedFilters: setAppliedFilters,
|
|
18227
18227
|
items: items,
|
|
18228
18228
|
containerProps: containerProps,
|
|
18229
|
-
subContainerProps: subContainerProps
|
|
18230
|
-
filterLabel: props.filterLabel,
|
|
18231
|
-
optionLabel: props.optionLabel
|
|
18229
|
+
subContainerProps: subContainerProps
|
|
18232
18230
|
}));
|
|
18233
18231
|
}
|
|
18234
18232
|
}), "Filtros");
|