Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vap

Package Overview
Dependencies
Maintainers
1
Versions
568
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vap - npm Package Compare versions

Comparing version 1.2.8 to 1.2.9

layouts/screen/Comments/EchartContent.d.ts

25

layouts/screen/Comments/interface.d.ts

@@ -36,1 +36,26 @@ /// <reference types="react" />

}
/**
* 大屏Echarts组件属性
*/
export interface EchartCommentProps {
/**
* class 属性
*/
className?: string;
/**
* 组件样式
*/
style?: React.CSSProperties;
/**
* 组件宽度
*/
width?: number | string;
/**
* 组件高度
*/
height?: number | string;
/**
* Echart数据
*/
data: any;
}

1

layouts/screen/index.d.ts
export { default as Page } from './Page';
export { default as Comment } from './Comments/Comment';
export { default as EchartContent } from './Comments/EchartContent';
export { default as ScrollList } from './ScrollList';
export { default as CountUp } from './CountUp';

@@ -7,2 +7,4 @@ "use strict";

exports.Comment = Comment_1.default;
var EchartContent_1 = require("./Comments/EchartContent");
exports.EchartContent = EchartContent_1.default;
var ScrollList_1 = require("./ScrollList");

@@ -9,0 +11,0 @@ exports.ScrollList = ScrollList_1.default;

@@ -10,2 +10,3 @@ /// <reference types="react" />

speed?: number;
className?: string;
}> {

@@ -12,0 +13,0 @@ id: string;

5

layouts/screen/ScrollList/index.js

@@ -44,2 +44,3 @@ "use strict";

var container = $('#' + this.id).parent();
container.css({ overflow: 'hidden' });
var root = $('#' + this.id);

@@ -57,3 +58,3 @@ var interval = null;

}
var speed = this.props.speed || 40;
var speed = this.props.speed || 50;
interval = window.setInterval(function () {

@@ -78,3 +79,3 @@ _this.marquee(root, sh);

var _this = this;
return React.createElement("ul", { id: this.id, style: { width: '100%', height: '100%', overflow: 'hidden' } }, this.props.list.map(function (item) { return React.createElement("li", null, _this.props.render(item)); }));
return React.createElement("ul", { id: this.id, className: this.props.className, style: { width: '100%', height: '100%', overflow: 'hidden' } }, this.props.list.map(function (item) { return React.createElement("li", null, _this.props.render(item)); }));
};

@@ -81,0 +82,0 @@ return default_1;

{
"name": "vap",
"version": "1.2.8",
"version": "1.2.9",
"description": "vap",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,1 +1,2 @@

/// <reference types="react" />
/**

@@ -44,5 +45,6 @@ * 用于列表,字典等 Render 的 Value,由 name(显示) 和 value(实际取值) 两个字段组成

listRender: (arr?: any[], value?: string, name?: string, def?: string) => Render;
momentRender: (time?: boolean, nearly?: number, format?: string) => Render;
momentRender: (time?: boolean, nearly?: number) => Render;
dateRender: (format?: string) => Render;
htmlRender: (className?: string) => (val: any) => JSX.Element;
};
export default _default;

@@ -112,16 +112,15 @@ "use strict";

/**
* 时间 Render 构造器
* Monment 时间 Render 构造器,可以在近一段时间内显示 (x小时前)之类的字串
* @param time 是否显示时分秒,默认为 true 即 `YYYY-MM-DD HH:mm:ss`, 设置为 `false` 则显示为'YYYY-MM-DD'
* @param nearly 最近 {x} 天 时,转换为 moment 方式显示,比如 5秒前,15小时前,2天前等等。 默认为 3
* @param format 时间参数的格式,默认为空,如果是特别格式,请指定此参数,否则不好解析
*
*/
function momentRender(time, nearly, format) {
function momentRender(time, nearly) {
if (time === void 0) { time = true; }
if (nearly === void 0) { nearly = 3; }
if (format === void 0) { format = null; }
var now = moment();
var from = now.unix();
var fn = function (val) {
var time = format ? moment(val, format) : moment(new Date(val));
// let time = format ? moment(val, format) : moment(new Date(val));
var time = moment(new Date(val));
var to = time.unix();

@@ -148,2 +147,14 @@ var diff = from - to;

/**
*
* 时间 Render 构造器
* @param 时间
*/
function dateRender(format) {
if (format === void 0) { format = 'YYYY-MM-DD HH:mm:ss'; }
var fn = function (val) {
return React.createElement("span", null, moment(new Date(val)).format(format));
};
return fn;
}
/**
* 返回一个 htmlRender,用于显示自定义的html,会用div包住

@@ -158,2 +169,2 @@ * @param className 包住自定义html的 className 默认为空

}
exports.default = { statusRender: statusRender, strRender: strRender, listRender: listRender, momentRender: momentRender, htmlRender: htmlRender };
exports.default = { statusRender: statusRender, strRender: strRender, listRender: listRender, momentRender: momentRender, dateRender: dateRender, htmlRender: htmlRender };
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