Socket
Socket
Sign inDemoInstall

@wfp/ui

Package Overview
Dependencies
Maintainers
7
Versions
349
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wfp/ui - npm Package Compare versions

Comparing version 0.17.87 to 0.17.88

30

es/components/Unit/YearMonthCalc.js

@@ -0,4 +1,6 @@

import React from 'react';
import SvgUnit from './SvgUnit';
import StringUnit from './StringUnit';
var MonthYearCalc = function MonthYearCalc(props) {
var YearMonthGen = function YearMonthGen(props) {
var children = props.children;

@@ -44,15 +46,17 @@ var value = children;

export var YearMonthCalc = function YearMonthCalc(props) {
var svg = props.svg;
var value = MonthYearCalc(props);
if (svg) {
return SvgUnit({
value: value.monthName + ' ' + value.year
}, props);
}
return React.createElement("span", {
className: props.className
}, value.monthName, " ", value.year);
var className = props.className,
string = props.string,
svg = props.svg,
calcOnly = props.calcOnly;
var YearMonthgenerated = YearMonthGen(props);
var calcObject = {
value: YearMonthgenerated.monthName + ' ' + YearMonthgenerated.year,
before: '',
after: '',
output: undefined
};
if (calcOnly) return calcObject;else if (svg) return SvgUnit(calcObject, props);else if (string) return StringUnit(calcObject, props);else if (calcObject !== false) return React.createElement("span", {
className: className
}, calcObject.value);
};
export default YearMonthCalc;

@@ -8,7 +8,11 @@ "use strict";

var _react = _interopRequireDefault(require("react"));
var _SvgUnit = _interopRequireDefault(require("./SvgUnit"));
var _StringUnit = _interopRequireDefault(require("./StringUnit"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var MonthYearCalc = function MonthYearCalc(props) {
var YearMonthGen = function YearMonthGen(props) {
var children = props.children;

@@ -54,14 +58,16 @@ var value = children;

var YearMonthCalc = function YearMonthCalc(props) {
var svg = props.svg;
var value = MonthYearCalc(props);
if (svg) {
return (0, _SvgUnit.default)({
value: value.monthName + ' ' + value.year
}, props);
}
return React.createElement("span", {
className: props.className
}, value.monthName, " ", value.year);
var className = props.className,
string = props.string,
svg = props.svg,
calcOnly = props.calcOnly;
var YearMonthgenerated = YearMonthGen(props);
var calcObject = {
value: YearMonthgenerated.monthName + ' ' + YearMonthgenerated.year,
before: '',
after: '',
output: undefined
};
if (calcOnly) return calcObject;else if (svg) return (0, _SvgUnit.default)(calcObject, props);else if (string) return (0, _StringUnit.default)(calcObject, props);else if (calcObject !== false) return _react.default.createElement("span", {
className: className
}, calcObject.value);
};

@@ -68,0 +74,0 @@

{
"name": "@wfp/ui",
"version": "0.17.87",
"version": "0.17.88",
"description": "WFP UI Kit Next",

@@ -5,0 +5,0 @@ "license": "Apache-2",

@@ -0,4 +1,6 @@

import React from 'react';
import SvgUnit from './SvgUnit';
import StringUnit from './StringUnit';
const MonthYearCalc = props => {
const YearMonthGen = props => {
const { children } = props;

@@ -40,16 +42,23 @@

export const YearMonthCalc = props => {
const { svg } = props;
const value = MonthYearCalc(props);
const { className, string, svg, calcOnly } = props;
const YearMonthgenerated = YearMonthGen(props);
if (svg) {
return SvgUnit({ value: value.monthName + ' ' + value.year }, props);
}
return (
<span className={props.className}>
{value.monthName} {value.year}
</span>
);
const calcObject = {
value: YearMonthgenerated.monthName + ' ' + YearMonthgenerated.year,
before: '',
after: '',
output: undefined,
};
if (calcOnly) return calcObject;
else if (svg)
return SvgUnit(calcObject,
props
);
else if (string) return StringUnit(calcObject, props);
else if (calcObject !== false) return <span className={className}>{calcObject.value}</span>;
};
export default YearMonthCalc;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc