@unicef/material-ui 0.12.0 → 0.12.1

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/lib/dev.js CHANGED
@@ -53983,6 +53983,168 @@ ActiveAutoComplete.defaultProps = {
53983
53983
  usedItemIds: []
53984
53984
  };
53985
53985
 
53986
+ var styles$1a = {
53987
+ labelRoot: {
53988
+ pointerEvents: 'auto',
53989
+ display: 'flex',
53990
+ alignItems: 'center'
53991
+ }
53992
+ };
53993
+
53994
+ var useStyles$A = makeStyles$1(function (theme) {
53995
+ return {
53996
+ textField: {
53997
+ marginTop: theme.spacing(0.25),
53998
+ marginBottom: theme.spacing(0.25)
53999
+ },
54000
+ notchedOutline: {
54001
+ borderRadius: 2,
54002
+ borderColor: 'transparent'
54003
+ },
54004
+ inputPaddingWithoutLabel: function inputPaddingWithoutLabel(props) {
54005
+ return {
54006
+ padding: props.inputPadding ? props.inputPadding : '2px 2px 2px 2px',
54007
+ height: 'auto'
54008
+ };
54009
+ },
54010
+ inputPaddingWithLabel: function inputPaddingWithLabel(props) {
54011
+ return {
54012
+ padding: props.inputPadding ? props.inputPadding : '18.5px 14px',
54013
+ height: 'auto'
54014
+ };
54015
+ },
54016
+ input: function input(props) {
54017
+ return _extends$1({}, theme.typography[props.typographyVariant]);
54018
+ },
54019
+ inputHover: {
54020
+ '&:hover $notchedOutline': {
54021
+ borderColor: 'transparent'
54022
+ }
54023
+ },
54024
+ icon: {
54025
+ display: 'none'
54026
+ },
54027
+ showIcon: {
54028
+ display: 'block'
54029
+ }
54030
+ };
54031
+ });
54032
+
54033
+ /**
54034
+ * ActiveKeyboardDateTimePicker is a customized [Material Ui KeyboardDateTimePicker]('https://material-ui-pickers.dev/api/KeyboardDateTimePicker') for more details
54035
+ */
54036
+ function ActiveKeyboardDateTimePicker(props) {
54037
+ var classes = useStyles$A(props);
54038
+ var autoOk = props.autoOk,
54039
+ variant = props.variant,
54040
+ inputVariant = props.inputVariant,
54041
+ readOnly = props.readOnly,
54042
+ interactiveMode = props.interactiveMode,
54043
+ InputLabelProps = props.InputLabelProps,
54044
+ className = props.className,
54045
+ inputProps = props.inputProps,
54046
+ InputProps = props.InputProps,
54047
+ placeholder = props.placeholder,
54048
+ showLabelHelp = props.showLabelHelp,
54049
+ InputLabelHelpProps = props.InputLabelHelpProps,
54050
+ label = props.label,
54051
+ others = objectWithoutProperties(props, ['autoOk', 'variant', 'inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label']);
54052
+
54053
+ var _React$useState = React__default.useState(classes.icon),
54054
+ _React$useState2 = slicedToArray(_React$useState, 2),
54055
+ hideIcon = _React$useState2[0],
54056
+ setHideIcon = _React$useState2[1];
54057
+
54058
+ var inputPaddingClass = props.label ? classes.inputPaddingWithLabel : classes.inputPaddingWithoutLabel;
54059
+ var finalPlaceholder = readOnly ? null : placeholder;
54060
+
54061
+ var onMouseOver = function onMouseOver() {
54062
+ if (!readOnly) {
54063
+ setHideIcon(classes.showIcon);
54064
+ }
54065
+ return props.onMouseOver && props.onMouseOver;
54066
+ };
54067
+
54068
+ var handleBlur = function handleBlur(event) {
54069
+ event.preventDefault();
54070
+ setHideIcon(classes.icon);
54071
+ return props.onBlur && props.onBlur;
54072
+ };
54073
+
54074
+ return React__default.createElement(
54075
+ MuiPickersUtilsProvider,
54076
+ { utils: DateFnsUtils },
54077
+ React__default.createElement(KeyboardDateTimePicker, _extends$1({
54078
+ autoOk: autoOk,
54079
+ variant: variant,
54080
+ inputVariant: inputVariant,
54081
+ placeholder: finalPlaceholder,
54082
+ className: classes.textField + ' ' + (className && className),
54083
+ InputLabelProps: _extends$1({
54084
+ shrink: true,
54085
+ style: _extends$1({}, styles$1a.labelRoot)
54086
+ }, InputLabelProps),
54087
+ inputProps: _extends$1({
54088
+ readOnly: Boolean(readOnly),
54089
+ disabled: Boolean(readOnly)
54090
+ }, inputProps),
54091
+ readOnly: readOnly,
54092
+ KeyboardButtonProps: {
54093
+ classes: {
54094
+ root: '' + (!interactiveMode && !readOnly ? '' : hideIcon)
54095
+ }
54096
+ },
54097
+ InputProps: _extends$1({
54098
+ classes: {
54099
+ root: classes.input + ' ' + (readOnly && classes.inputHover),
54100
+ notchedOutline: '' + (!interactiveMode && !readOnly ? '' : classes.notchedOutline),
54101
+ input: inputPaddingClass
54102
+ }
54103
+ }, InputProps),
54104
+ label: showLabelHelp ? React__default.createElement(InputLabelHelp, _extends$1({ inputLabel: label }, InputLabelHelpProps)) : label,
54105
+ onMouseOver: onMouseOver,
54106
+ onMouseLeave: handleBlur,
54107
+ onBlur: handleBlur
54108
+ }, others))
54109
+ );
54110
+ }
54111
+
54112
+ ActiveKeyboardDateTimePicker.propTypes = {
54113
+ /** AutoOk on date select */
54114
+ autoOk: PropTypes__default.bool,
54115
+ /** Picker container option variant : 'dialog' | 'inline' | 'static' */
54116
+ variant: PropTypes__default.string,
54117
+ /** Material ui textfield variant */
54118
+ inputVariant: PropTypes__default.string,
54119
+ /** Date format */
54120
+ format: PropTypes__default.string,
54121
+ /** To make the content readOnly */
54122
+ readOnly: PropTypes__default.bool,
54123
+ /** Change to write mode by hiding text field border and displays border on hover*/
54124
+ interactiveMode: PropTypes__default.bool,
54125
+ /** Props applied to the InputLabel element.*/
54126
+ InputLabelProps: PropTypes__default.object,
54127
+ /** Attributes applied to the input element. */
54128
+ inputProps: PropTypes__default.object,
54129
+ /** Props applied to the Input element. */
54130
+ InputProps: PropTypes__default.object,
54131
+ /** Placeholder text*/
54132
+ placeholder: PropTypes__default.string,
54133
+ /** Label text */
54134
+ label: PropTypes__default.string,
54135
+ /** Show label help */
54136
+ showLabelHelp: PropTypes__default.bool,
54137
+ /** Props applied to the input label help element. E.g InputLabelHelpProps={{type:'link', label:'Help', link:'unicef.github.io', icon, tooltipTitle: 'Tooltip title', tooltipPlacement: 'bottom}} */
54138
+ InputLabelHelpProps: PropTypes__default.object
54139
+ };
54140
+
54141
+ ActiveKeyboardDateTimePicker.defaultProps = {
54142
+ inputVariant: 'outlined',
54143
+ autoOk: true,
54144
+ variant: 'inline',
54145
+ format: 'dd/MM/yyyy hh:mm a'
54146
+ };
54147
+
53986
54148
  exports.ActiveAutoComplete = ActiveAutoComplete;
53987
54149
  exports.ActiveCurrencyField = ActiveCurrencyField;
53988
54150
  exports.ActiveDatePicker = ActiveDatePicker;
@@ -53991,6 +54153,7 @@ exports.ActiveFormPositiveInteger = ActiveFormPositiveInteger;
53991
54153
  exports.ActiveFormSelect = ActiveFormSelect;
53992
54154
  exports.ActiveFormTextField = ActiveFormTextField;
53993
54155
  exports.ActiveKeyboardDatePicker = ActiveKeyboardDatePicker;
54156
+ exports.ActiveKeyboardDateTimePicker = ActiveKeyboardDateTimePicker;
53994
54157
  exports.ActiveKeyboardTimePicker = ActiveKeyboardTimePicker;
53995
54158
  exports.ActiveTimePicker = ActiveTimePicker;
53996
54159
  exports.UAsyncBadge = UAsyncBadge;