@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/prod.js CHANGED
@@ -46291,6 +46291,168 @@ ActiveAutoComplete.defaultProps = {
46291
46291
  usedItemIds: []
46292
46292
  };
46293
46293
 
46294
+ var styles$1a = {
46295
+ labelRoot: {
46296
+ pointerEvents: 'auto',
46297
+ display: 'flex',
46298
+ alignItems: 'center'
46299
+ }
46300
+ };
46301
+
46302
+ var useStyles$A = makeStyles$1(function (theme) {
46303
+ return {
46304
+ textField: {
46305
+ marginTop: theme.spacing(0.25),
46306
+ marginBottom: theme.spacing(0.25)
46307
+ },
46308
+ notchedOutline: {
46309
+ borderRadius: 2,
46310
+ borderColor: 'transparent'
46311
+ },
46312
+ inputPaddingWithoutLabel: function inputPaddingWithoutLabel(props) {
46313
+ return {
46314
+ padding: props.inputPadding ? props.inputPadding : '2px 2px 2px 2px',
46315
+ height: 'auto'
46316
+ };
46317
+ },
46318
+ inputPaddingWithLabel: function inputPaddingWithLabel(props) {
46319
+ return {
46320
+ padding: props.inputPadding ? props.inputPadding : '18.5px 14px',
46321
+ height: 'auto'
46322
+ };
46323
+ },
46324
+ input: function input(props) {
46325
+ return _extends$1({}, theme.typography[props.typographyVariant]);
46326
+ },
46327
+ inputHover: {
46328
+ '&:hover $notchedOutline': {
46329
+ borderColor: 'transparent'
46330
+ }
46331
+ },
46332
+ icon: {
46333
+ display: 'none'
46334
+ },
46335
+ showIcon: {
46336
+ display: 'block'
46337
+ }
46338
+ };
46339
+ });
46340
+
46341
+ /**
46342
+ * ActiveKeyboardDateTimePicker is a customized [Material Ui KeyboardDateTimePicker]('https://material-ui-pickers.dev/api/KeyboardDateTimePicker') for more details
46343
+ */
46344
+ function ActiveKeyboardDateTimePicker(props) {
46345
+ var classes = useStyles$A(props);
46346
+ var autoOk = props.autoOk,
46347
+ variant = props.variant,
46348
+ inputVariant = props.inputVariant,
46349
+ readOnly = props.readOnly,
46350
+ interactiveMode = props.interactiveMode,
46351
+ InputLabelProps = props.InputLabelProps,
46352
+ className = props.className,
46353
+ inputProps = props.inputProps,
46354
+ InputProps = props.InputProps,
46355
+ placeholder = props.placeholder,
46356
+ showLabelHelp = props.showLabelHelp,
46357
+ InputLabelHelpProps = props.InputLabelHelpProps,
46358
+ label = props.label,
46359
+ others = objectWithoutProperties(props, ['autoOk', 'variant', 'inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label']);
46360
+
46361
+ var _React$useState = React__default.useState(classes.icon),
46362
+ _React$useState2 = slicedToArray(_React$useState, 2),
46363
+ hideIcon = _React$useState2[0],
46364
+ setHideIcon = _React$useState2[1];
46365
+
46366
+ var inputPaddingClass = props.label ? classes.inputPaddingWithLabel : classes.inputPaddingWithoutLabel;
46367
+ var finalPlaceholder = readOnly ? null : placeholder;
46368
+
46369
+ var onMouseOver = function onMouseOver() {
46370
+ if (!readOnly) {
46371
+ setHideIcon(classes.showIcon);
46372
+ }
46373
+ return props.onMouseOver && props.onMouseOver;
46374
+ };
46375
+
46376
+ var handleBlur = function handleBlur(event) {
46377
+ event.preventDefault();
46378
+ setHideIcon(classes.icon);
46379
+ return props.onBlur && props.onBlur;
46380
+ };
46381
+
46382
+ return React__default.createElement(
46383
+ MuiPickersUtilsProvider,
46384
+ { utils: DateFnsUtils },
46385
+ React__default.createElement(KeyboardDateTimePicker, _extends$1({
46386
+ autoOk: autoOk,
46387
+ variant: variant,
46388
+ inputVariant: inputVariant,
46389
+ placeholder: finalPlaceholder,
46390
+ className: classes.textField + ' ' + (className && className),
46391
+ InputLabelProps: _extends$1({
46392
+ shrink: true,
46393
+ style: _extends$1({}, styles$1a.labelRoot)
46394
+ }, InputLabelProps),
46395
+ inputProps: _extends$1({
46396
+ readOnly: Boolean(readOnly),
46397
+ disabled: Boolean(readOnly)
46398
+ }, inputProps),
46399
+ readOnly: readOnly,
46400
+ KeyboardButtonProps: {
46401
+ classes: {
46402
+ root: '' + (!interactiveMode && !readOnly ? '' : hideIcon)
46403
+ }
46404
+ },
46405
+ InputProps: _extends$1({
46406
+ classes: {
46407
+ root: classes.input + ' ' + (readOnly && classes.inputHover),
46408
+ notchedOutline: '' + (!interactiveMode && !readOnly ? '' : classes.notchedOutline),
46409
+ input: inputPaddingClass
46410
+ }
46411
+ }, InputProps),
46412
+ label: showLabelHelp ? React__default.createElement(InputLabelHelp, _extends$1({ inputLabel: label }, InputLabelHelpProps)) : label,
46413
+ onMouseOver: onMouseOver,
46414
+ onMouseLeave: handleBlur,
46415
+ onBlur: handleBlur
46416
+ }, others))
46417
+ );
46418
+ }
46419
+
46420
+ ActiveKeyboardDateTimePicker.propTypes = {
46421
+ /** AutoOk on date select */
46422
+ autoOk: PropTypes__default.bool,
46423
+ /** Picker container option variant : 'dialog' | 'inline' | 'static' */
46424
+ variant: PropTypes__default.string,
46425
+ /** Material ui textfield variant */
46426
+ inputVariant: PropTypes__default.string,
46427
+ /** Date format */
46428
+ format: PropTypes__default.string,
46429
+ /** To make the content readOnly */
46430
+ readOnly: PropTypes__default.bool,
46431
+ /** Change to write mode by hiding text field border and displays border on hover*/
46432
+ interactiveMode: PropTypes__default.bool,
46433
+ /** Props applied to the InputLabel element.*/
46434
+ InputLabelProps: PropTypes__default.object,
46435
+ /** Attributes applied to the input element. */
46436
+ inputProps: PropTypes__default.object,
46437
+ /** Props applied to the Input element. */
46438
+ InputProps: PropTypes__default.object,
46439
+ /** Placeholder text*/
46440
+ placeholder: PropTypes__default.string,
46441
+ /** Label text */
46442
+ label: PropTypes__default.string,
46443
+ /** Show label help */
46444
+ showLabelHelp: PropTypes__default.bool,
46445
+ /** 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}} */
46446
+ InputLabelHelpProps: PropTypes__default.object
46447
+ };
46448
+
46449
+ ActiveKeyboardDateTimePicker.defaultProps = {
46450
+ inputVariant: 'outlined',
46451
+ autoOk: true,
46452
+ variant: 'inline',
46453
+ format: 'dd/MM/yyyy hh:mm a'
46454
+ };
46455
+
46294
46456
  exports.ActiveAutoComplete = ActiveAutoComplete;
46295
46457
  exports.ActiveCurrencyField = ActiveCurrencyField;
46296
46458
  exports.ActiveDatePicker = ActiveDatePicker;
@@ -46299,6 +46461,7 @@ exports.ActiveFormPositiveInteger = ActiveFormPositiveInteger;
46299
46461
  exports.ActiveFormSelect = ActiveFormSelect;
46300
46462
  exports.ActiveFormTextField = ActiveFormTextField;
46301
46463
  exports.ActiveKeyboardDatePicker = ActiveKeyboardDatePicker;
46464
+ exports.ActiveKeyboardDateTimePicker = ActiveKeyboardDateTimePicker;
46302
46465
  exports.ActiveKeyboardTimePicker = ActiveKeyboardTimePicker;
46303
46466
  exports.ActiveTimePicker = ActiveTimePicker;
46304
46467
  exports.UAsyncBadge = UAsyncBadge;