@onesy/ui-react 1.0.71 → 1.0.72
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/Calendar/Calendar.js +1 -1
- package/Select/Select.d.ts +1 -0
- package/Select/Select.js +3 -3
- package/esm/Calendar/Calendar.js +1 -1
- package/esm/Select/Select.js +3 -2
- package/esm/index.js +1 -1
- package/package.json +1 -1
package/Calendar/Calendar.js
CHANGED
@@ -144,7 +144,7 @@ const useStyle = (0, style_react_1.style)(theme => ({
|
|
144
144
|
}
|
145
145
|
}
|
146
146
|
}), { name: 'onesy-Calendar' });
|
147
|
-
// [l('millisecond'), l('milliseconds'), l('second'), l('minute'), l('minutes'), l('hour'), l('hours'), l('day'), l('days'), l('
|
147
|
+
// [l('millisecond'), l('milliseconds'), l('second'), l('minute'), l('minutes'), l('hour'), l('hours'), l('day'), l('days'), l('week'), l('weeks'), l('month'), l('months'), l('year')];
|
148
148
|
// [l('January'), l('February'), l('March'), l('April'), l('May'), l('June'), l('July'), l('August'), l('September'), l('October'), l('November'), l('December')];
|
149
149
|
// [l('Jan'), l('Feb'), l('Mar'), l('Apr'), l('May'), l('Jun'), l('Jul'), l('Aug'), l('Sep'), l('Oct'), l('Nov'), l('Dec')];
|
150
150
|
// [l('Monday'), l('Tuesday'), l('Wednesday'), l('Thursday'), l('Friday'), l('Saturday'), l('Sunday'];
|
package/Select/Select.d.ts
CHANGED
package/Select/Select.js
CHANGED
@@ -121,13 +121,13 @@ const Select = react_1.default.forwardRef((props_, ref) => {
|
|
121
121
|
const Chips = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Chips) || Chips_1.default; }, [theme]);
|
122
122
|
const TextField = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.TextField) || TextField_1.default; }, [theme]);
|
123
123
|
const IconButton = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.IconButton) || IconButton_1.default; }, [theme]);
|
124
|
-
const { tonal = true, color = 'primary', size = 'regular', version = 'filled', value: value_, valueDefault, onChange: onChange_, options, name, multiple, prefix, sufix, start, end, autoWidth = true, getLabel: getLabel_, fullWidth, chip, clear, readOnly, noSelectText, disabled, renderValues: renderValues_, renderChip, IconClear = IconMaterialCloseW100_1.default, IconDropdown = IconMaterialArrowDropDownW100_1.default, inputProps, InputWrapperProps, WrapperProps, ChipProps, ChiProps, ListProps = {
|
124
|
+
const { tonal = true, color = 'primary', size = 'regular', version = 'filled', value: value_, valueDefault, onChange: onChange_, options, name, multiple, prefix, sufix, start, end, autoWidth = true, getLabel: getLabel_, getOptionName, fullWidth, chip, clear, readOnly, noSelectText, disabled, renderValues: renderValues_, renderChip, IconClear = IconMaterialCloseW100_1.default, IconDropdown = IconMaterialArrowDropDownW100_1.default, inputProps, InputWrapperProps, WrapperProps, ChipProps, ChiProps, ListProps = {
|
125
125
|
style: {
|
126
126
|
maxHeight: 250,
|
127
127
|
overflowY: 'auto',
|
128
128
|
overflowX: 'hidden'
|
129
129
|
}
|
130
|
-
}, MenuProps: MenuPropsProps, ListItemProps, ListItemTypeProps, IconButtonProps, IconProps, className, style, children: children_ } = props, other = __rest(props, ["tonal", "color", "size", "version", "value", "valueDefault", "onChange", "options", "name", "multiple", "prefix", "sufix", "start", "end", "autoWidth", "getLabel", "fullWidth", "chip", "clear", "readOnly", "noSelectText", "disabled", "renderValues", "renderChip", "IconClear", "IconDropdown", "inputProps", "InputWrapperProps", "WrapperProps", "ChipProps", "ChiProps", "ListProps", "MenuProps", "ListItemProps", "ListItemTypeProps", "IconButtonProps", "IconProps", "className", "style", "children"]);
|
130
|
+
}, MenuProps: MenuPropsProps, ListItemProps, ListItemTypeProps, IconButtonProps, IconProps, className, style, children: children_ } = props, other = __rest(props, ["tonal", "color", "size", "version", "value", "valueDefault", "onChange", "options", "name", "multiple", "prefix", "sufix", "start", "end", "autoWidth", "getLabel", "getOptionName", "fullWidth", "chip", "clear", "readOnly", "noSelectText", "disabled", "renderValues", "renderChip", "IconClear", "IconDropdown", "inputProps", "InputWrapperProps", "WrapperProps", "ChipProps", "ChiProps", "ListProps", "MenuProps", "ListItemProps", "ListItemTypeProps", "IconButtonProps", "IconProps", "className", "style", "children"]);
|
131
131
|
const children = react_1.default.Children.toArray(children_);
|
132
132
|
const [value, setValue] = react_1.default.useState(() => {
|
133
133
|
const values = valueDefault !== undefined ? valueDefault : value_;
|
@@ -364,7 +364,7 @@ const Select = react_1.default.forwardRef((props_, ref) => {
|
|
364
364
|
chip && classes.chip,
|
365
365
|
open && classes.open,
|
366
366
|
readOnly && classes.readOnly
|
367
|
-
]), justify: other.align }, { children: renderValues(value) })) })), (!!items.length || children) && ((0, jsx_runtime_1.jsx)(Menu, Object.assign({ ref: refs.menu, open: open, portal: false, onClose: () => onClose(false), anchorElement: refs.root.current, transformOrigin: 'center top', transformOriginSwitch: 'center bottom', maxWidth: 'unset', size: size, menuItems: !!items.length ? (items.map((item, index) => ((0, jsx_runtime_1.jsx)(ListItem, Object.assign({ role: 'option', selected: item.selected !== undefined ? item.selected : multiple ? value.includes(item === null || item === void 0 ? void 0 : item.value) : value === (item === null || item === void 0 ? void 0 : item.value), preselected: item.preselected !== undefined ? item.preselected : !(multiple ? value.includes(item === null || item === void 0 ? void 0 : item.value) : value === (item === null || item === void 0 ? void 0 : item.value)), onMouseUp: onMouseUp, onMouseDown: onMouseDown, primary: ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: sizeListItem === 'large' ? 'b1' : sizeListItem === 'regular' ? 'b2' : 'b3' }, ListItemTypeProps, { children: item.name }))), value: item.value, size: (MenuProps === null || MenuProps === void 0 ? void 0 : MenuProps.size) || size, button: true }, ListItemProps, item.props, { onClick: (event) => {
|
367
|
+
]), justify: other.align }, { children: renderValues(value) })) })), (!!items.length || children) && ((0, jsx_runtime_1.jsx)(Menu, Object.assign({ ref: refs.menu, open: open, portal: false, onClose: () => onClose(false), anchorElement: refs.root.current, transformOrigin: 'center top', transformOriginSwitch: 'center bottom', maxWidth: 'unset', size: size, menuItems: !!items.length ? (items.map((item, index) => ((0, jsx_runtime_1.jsx)(ListItem, Object.assign({ role: 'option', selected: item.selected !== undefined ? item.selected : multiple ? value.includes(item === null || item === void 0 ? void 0 : item.value) : value === (item === null || item === void 0 ? void 0 : item.value), preselected: item.preselected !== undefined ? item.preselected : !(multiple ? value.includes(item === null || item === void 0 ? void 0 : item.value) : value === (item === null || item === void 0 ? void 0 : item.value)), onMouseUp: onMouseUp, onMouseDown: onMouseDown, primary: getOptionName ? getOptionName(item.name, item, index) : ((0, jsx_runtime_1.jsx)(Type, Object.assign({ version: sizeListItem === 'large' ? 'b1' : sizeListItem === 'regular' ? 'b2' : 'b3' }, ListItemTypeProps, { children: item.name }))), value: item.value, size: (MenuProps === null || MenuProps === void 0 ? void 0 : MenuProps.size) || size, button: true }, ListItemProps, item.props, { onClick: (event) => {
|
368
368
|
var _a, _b;
|
369
369
|
if (multiple && value.includes(item === null || item === void 0 ? void 0 : item.value))
|
370
370
|
onUnselect(item === null || item === void 0 ? void 0 : item.value);
|
package/esm/Calendar/Calendar.js
CHANGED
@@ -135,7 +135,7 @@ const useStyle = style(theme => ({
|
|
135
135
|
}), {
|
136
136
|
name: 'onesy-Calendar'
|
137
137
|
});
|
138
|
-
// [l('millisecond'), l('milliseconds'), l('second'), l('minute'), l('minutes'), l('hour'), l('hours'), l('day'), l('days'), l('
|
138
|
+
// [l('millisecond'), l('milliseconds'), l('second'), l('minute'), l('minutes'), l('hour'), l('hours'), l('day'), l('days'), l('week'), l('weeks'), l('month'), l('months'), l('year')];
|
139
139
|
|
140
140
|
// [l('January'), l('February'), l('March'), l('April'), l('May'), l('June'), l('July'), l('August'), l('September'), l('October'), l('November'), l('December')];
|
141
141
|
// [l('Jan'), l('Feb'), l('Mar'), l('Apr'), l('May'), l('Jun'), l('Jul'), l('Aug'), l('Sep'), l('Oct'), l('Nov'), l('Dec')];
|
package/esm/Select/Select.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
|
-
const _excluded = ["tonal", "color", "size", "version", "value", "valueDefault", "onChange", "options", "name", "multiple", "prefix", "sufix", "start", "end", "autoWidth", "getLabel", "fullWidth", "chip", "clear", "readOnly", "noSelectText", "disabled", "renderValues", "renderChip", "IconClear", "IconDropdown", "inputProps", "InputWrapperProps", "WrapperProps", "ChipProps", "ChiProps", "ListProps", "MenuProps", "ListItemProps", "ListItemTypeProps", "IconButtonProps", "IconProps", "className", "style", "children"];
|
4
|
+
const _excluded = ["tonal", "color", "size", "version", "value", "valueDefault", "onChange", "options", "name", "multiple", "prefix", "sufix", "start", "end", "autoWidth", "getLabel", "getOptionName", "fullWidth", "chip", "clear", "readOnly", "noSelectText", "disabled", "renderValues", "renderChip", "IconClear", "IconDropdown", "inputProps", "InputWrapperProps", "WrapperProps", "ChipProps", "ChiProps", "ListProps", "MenuProps", "ListItemProps", "ListItemTypeProps", "IconButtonProps", "IconProps", "className", "style", "children"];
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
7
7
|
import React from 'react';
|
@@ -142,6 +142,7 @@ const Select = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
142
142
|
end,
|
143
143
|
autoWidth = true,
|
144
144
|
getLabel: getLabel_,
|
145
|
+
getOptionName,
|
145
146
|
fullWidth,
|
146
147
|
chip,
|
147
148
|
clear,
|
@@ -430,7 +431,7 @@ const Select = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
430
431
|
preselected: item.preselected !== undefined ? item.preselected : !(multiple ? value.includes(item?.value) : value === item?.value),
|
431
432
|
onMouseUp: onMouseUp,
|
432
433
|
onMouseDown: onMouseDown,
|
433
|
-
primary: /*#__PURE__*/React.createElement(Type, _extends({
|
434
|
+
primary: getOptionName ? getOptionName(item.name, item, index) : /*#__PURE__*/React.createElement(Type, _extends({
|
434
435
|
version: sizeListItem === 'large' ? 'b1' : sizeListItem === 'regular' ? 'b2' : 'b3'
|
435
436
|
}, ListItemTypeProps), item.name),
|
436
437
|
value: item.value,
|
package/esm/index.js
CHANGED