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

auto-views

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-views - npm Package Compare versions

Comparing version 0.0.21 to 0.0.22

3

lib/components/auto-form/form-entry.d.ts

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

title: string;
displayMode?: DisplayMode;
displayMode: DisplayMode;
type: string;

@@ -30,2 +30,3 @@ value?: any;

render(): JSX.Element;
private renderInternalComponent();
}

@@ -54,18 +54,36 @@ "use strict";

Entry.prototype.render = function () {
var childProps = (_a = {},
_a['data-automation-id'] = auto_form_1.fieldValueSelector(this.props.entryKey),
_a);
childProps = Object.assign(childProps, this.props.value != undefined ? { value: this.props.value } : {}, (this.props.valid) ? {} : { style: { borderColor: 'red' } });
var comp;
if (this.props.displayMode == DisplayMode.Edit) {
comp = React.createElement("input", __assign({}, childProps, { type: this.props.type, onChange: this.onChange }));
}
else {
comp = React.createElement("label", __assign({}, childProps));
}
var comp = this.renderInternalComponent();
return React.createElement("div", __assign({}, this.props),
React.createElement("label", { "data-automation-id": auto_form_1.fieldLabelSelector(this.props.entryKey) }, this.props.title),
comp);
var _a;
};
Entry.prototype.renderInternalComponent = function () {
var _this = this;
var childProps = Object.assign((_a = {}, _a['data-automation-id'] = auto_form_1.fieldValueSelector(this.props.entryKey), _a), this.props.value != undefined ? { value: this.props.value } : {}, (this.props.valid) ? {} : { style: { borderColor: 'red' } });
var renderForView = function () {
if (_this.props.type != 'boolean') {
return React.createElement("label", __assign({}, childProps));
}
else {
childProps = Object.assign(childProps, {
onChange: _this.onChange,
type: _this.props.type == "boolean" ? "checkbox" : _this.props.type
});
return React.createElement("input", __assign({}, childProps));
}
};
var renderForEdit = function () {
childProps = Object.assign(childProps, {
onChange: _this.onChange,
type: _this.props.type == "boolean" ? "checkbox" : _this.props.type
});
return React.createElement("input", __assign({}, childProps));
};
var myMap = (_b = {},
_b[DisplayMode.Edit] = renderForEdit,
_b[DisplayMode.View] = renderForView,
_b);
return myMap[this.props.displayMode]();
var _a, _b;
};
Entry.defaultProps = {

@@ -72,0 +90,0 @@ displayMode: DisplayMode.View,

{
"name": "auto-views",
"version": "0.0.21",
"version": "0.0.22",
"description": "Common, fully-tested, strictly-typed, Wix-styled, auto views library",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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