auto-views
Advanced tools
Comparing version 0.0.20 to 0.0.21
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
import { SchemaRepository } from "./schema-repo"; | ||
import { DisplayMode } from "./form-entry"; | ||
import { SchemaProperty } from "./schema-property"; | ||
@@ -12,6 +13,2 @@ export interface AutoFormProps extends React.HTMLAttributes<HTMLFormElement> { | ||
} | ||
export declare enum DisplayMode { | ||
View = 0, | ||
Edit = 1, | ||
} | ||
export declare function newSchemaRepository(): SchemaRepository; | ||
@@ -18,0 +15,0 @@ export declare function fieldValueSelector(key: string): string; |
@@ -25,7 +25,2 @@ "use strict"; | ||
var jsonschema_1 = require("jsonschema"); | ||
var DisplayMode; | ||
(function (DisplayMode) { | ||
DisplayMode[DisplayMode["View"] = 0] = "View"; | ||
DisplayMode[DisplayMode["Edit"] = 1] = "Edit"; | ||
})(DisplayMode = exports.DisplayMode || (exports.DisplayMode = {})); | ||
function newSchemaRepository() { | ||
@@ -32,0 +27,0 @@ return new schema_repo_1.SchemaRepository(); |
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
import { DisplayMode } from "./auto-form"; | ||
export declare enum DisplayMode { | ||
View = 0, | ||
Edit = 1, | ||
} | ||
export interface EntryEventTarget extends EventTarget { | ||
@@ -14,3 +17,3 @@ value: any; | ||
title: string; | ||
displayMode: DisplayMode; | ||
displayMode?: DisplayMode; | ||
type: string; | ||
@@ -22,4 +25,7 @@ value?: any; | ||
export declare class Entry extends React.Component<EntryProps, {}> { | ||
static defaultProps: { | ||
displayMode: DisplayMode; | ||
}; | ||
private onChange; | ||
render(): JSX.Element; | ||
} |
@@ -23,2 +23,7 @@ "use strict"; | ||
var auto_form_1 = require("./auto-form"); | ||
var DisplayMode; | ||
(function (DisplayMode) { | ||
DisplayMode[DisplayMode["View"] = 0] = "View"; | ||
DisplayMode[DisplayMode["Edit"] = 1] = "Edit"; | ||
})(DisplayMode = exports.DisplayMode || (exports.DisplayMode = {})); | ||
function entrySelector(key) { | ||
@@ -55,3 +60,3 @@ return "entry_value_" + key; | ||
var comp; | ||
if (this.props.displayMode == auto_form_1.DisplayMode.Edit) { | ||
if (this.props.displayMode == DisplayMode.Edit) { | ||
comp = React.createElement("input", __assign({}, childProps, { type: this.props.type, onChange: this.onChange })); | ||
@@ -67,2 +72,5 @@ } | ||
}; | ||
Entry.defaultProps = { | ||
displayMode: DisplayMode.View, | ||
}; | ||
return Entry; | ||
@@ -69,0 +77,0 @@ }(React.Component)); |
{ | ||
"name": "auto-views", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53473
694