nav-frontend-skjema
Advanced tools
Comparing version 0.1.26 to 0.1.27
@@ -105,3 +105,9 @@ 'use strict'; | ||
}); | ||
Object.defineProperty(exports, 'RadioPanel', { | ||
enumerable: true, | ||
get: function get() { | ||
return _radioPanelGruppe.RadioPanel; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -7,4 +7,4 @@ /// <reference types="react" /> | ||
value: string; | ||
id?: string; | ||
disabled?: boolean; | ||
inputProps?: React.InputHTMLAttributes<HTMLInputElement>; | ||
} | ||
@@ -26,3 +26,12 @@ export interface FeilProps { | ||
onChange: (event: React.SyntheticEvent<EventTarget>) => void; | ||
inputProps?: React.InputHTMLAttributes<HTMLInputElement>; | ||
} | ||
export interface RadioPanelState { | ||
hasFocus: boolean; | ||
} | ||
export declare class RadioPanel extends React.Component<RadioPanelProps, RadioPanelState> { | ||
constructor(props: RadioPanelProps); | ||
toggleOutline(): void; | ||
render(): JSX.Element; | ||
} | ||
declare class RadioPanelGruppe extends React.Component<RadioPanelGruppeProps> { | ||
@@ -29,0 +38,0 @@ render(): JSX.Element; |
@@ -44,4 +44,4 @@ "use strict"; | ||
name = _props.name, | ||
id = _props.id, | ||
_onChange = _props.onChange; | ||
_onChange = _props.onChange, | ||
inputProps = _props.inputProps; | ||
var hasFocus = this.state.hasFocus; | ||
@@ -54,3 +54,3 @@ | ||
}); | ||
return React.createElement("label", { className: cls }, React.createElement("input", { className: "radioPanel__radio", type: "radio", name: name, id: id, checked: checked, disabled: disabled, onFocus: function onFocus() { | ||
return React.createElement("label", { className: cls }, React.createElement("input", Object.assign({}, inputProps, { className: "radioPanel__radio", type: "radio", name: name, checked: checked, disabled: disabled, onFocus: function onFocus() { | ||
return _this2.toggleOutline(); | ||
@@ -61,3 +61,3 @@ }, onBlur: function onBlur() { | ||
return _onChange(event); | ||
} }), React.createElement("span", { className: "radioPanel__label" }, label)); | ||
} })), React.createElement("span", { className: "radioPanel__label" }, label)); | ||
} | ||
@@ -69,2 +69,4 @@ }]); | ||
exports.RadioPanel = RadioPanel; | ||
var RadioPanelGruppe = function (_React$Component2) { | ||
@@ -93,3 +95,3 @@ _inherits(RadioPanelGruppe, _React$Component2); | ||
return _onChange2(event, radio.value); | ||
}, id: radio.id }, radio)); | ||
} }, radio)); | ||
}))); | ||
@@ -103,2 +105,2 @@ } | ||
exports.default = RadioPanelGruppe; | ||
RadioPanelGruppe.__docgenInfo = {"description":"","displayName":"RadioPanelGruppe","props":{"radios":{"defaultValue":null,"description":"","name":"radios","required":true,"type":{"name":"RadioProps[]"}},"name":{"defaultValue":null,"description":"","name":"name","required":true,"type":{"name":"string"}},"legend":{"defaultValue":null,"description":"","name":"legend","required":true,"type":{"name":"string"}},"onChange":{"defaultValue":null,"description":"","name":"onChange","required":true,"type":{"name":"(event: SyntheticEvent<EventTarget>, value: string) => void"}},"checked":{"defaultValue":null,"description":"","name":"checked","required":false,"type":{"name":"string"}},"feil":{"defaultValue":null,"description":"","name":"feil","required":false,"type":{"name":"FeilProps"}}}} | ||
RadioPanel.__docgenInfo = {"description":"","displayName":"RadioPanel","props":{"checked":{"defaultValue":null,"description":"","name":"checked","required":true,"type":{"name":"boolean"}},"name":{"defaultValue":null,"description":"","name":"name","required":true,"type":{"name":"string"}},"onChange":{"defaultValue":null,"description":"","name":"onChange","required":true,"type":{"name":"(event: SyntheticEvent<EventTarget>) => void"}},"inputProps":{"defaultValue":null,"description":"","name":"inputProps","required":false,"type":{"name":"InputHTMLAttributes<HTMLInputElement>"}},"label":{"defaultValue":null,"description":"","name":"label","required":true,"type":{"name":"string"}},"value":{"defaultValue":null,"description":"","name":"value","required":true,"type":{"name":"string"}},"disabled":{"defaultValue":null,"description":"","name":"disabled","required":false,"type":{"name":"boolean"}}}} |
{ | ||
"name": "nav-frontend-skjema", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"main": "lib/index.js", | ||
@@ -18,3 +18,3 @@ "types": "lib/radio-panel-gruppe.d.ts", | ||
"nav-frontend-js-utils": "^1.0.3", | ||
"nav-frontend-skjema-style": "^0.3.12", | ||
"nav-frontend-skjema-style": "^0.3.13", | ||
"prop-types": "^15.5.10", | ||
@@ -26,3 +26,3 @@ "react": "^15.4.2 || ^16.0.0" | ||
"nav-frontend-js-utils": "^1.0.3", | ||
"nav-frontend-skjema-style": "^0.3.12", | ||
"nav-frontend-skjema-style": "^0.3.13", | ||
"prop-types": "^15.5.10", | ||
@@ -29,0 +29,0 @@ "react": "^15.4.2 || ^16.0.0" |
@@ -12,2 +12,2 @@ export { default as Input } from './input'; | ||
// eslint-disable-next-line import/no-unresolved | ||
export { default as RadioPanelGruppe } from './radio-panel-gruppe'; | ||
export { default as RadioPanelGruppe, RadioPanel } from './radio-panel-gruppe'; |
Sorry, the diff of this file is not supported yet
114646
2767