@planningcenter/doxy-web
Advanced tools
Comparing version 2.4.0-rc.0 to 2.4.0-rc.1
import React, { ReactElement } from "react"; | ||
interface OptionProps { | ||
disabled?: boolean; | ||
hidden?: boolean; | ||
label: string; | ||
value: string; | ||
} | ||
declare const Option: ({ disabled, label, value }: OptionProps) => React.JSX.Element; | ||
declare const Option: ({ disabled, hidden, label, value, }: OptionProps) => React.JSX.Element; | ||
interface OptGroupProps { | ||
@@ -23,3 +24,2 @@ children: ReactElement<typeof Option> | ReactElement<typeof Option>[]; | ||
onChange: (e: React.ChangeEvent<HTMLSelectElement>) => void; | ||
placeholder?: string; | ||
required?: boolean; | ||
@@ -30,6 +30,6 @@ size?: "md" | "sm"; | ||
declare const Select: { | ||
({ ariaLabel, children, disabled, id, label, name, onBlur, onChange, placeholder, required, size, value, }: SelectProps): React.JSX.Element; | ||
Option: ({ disabled, label, value }: OptionProps) => React.JSX.Element; | ||
({ ariaLabel, children, disabled, id, label, name, onBlur, onChange, required, size, value, }: SelectProps): React.JSX.Element; | ||
Option: ({ disabled, hidden, label, value, }: OptionProps) => React.JSX.Element; | ||
OptGroup: ({ children, disabled, label }: OptGroupProps) => React.JSX.Element; | ||
}; | ||
export { Select }; |
@@ -369,2 +369,3 @@ import React, { useRef, useEffect, useState, forwardRef } from 'react'; | ||
disabled = false, | ||
hidden = false, | ||
label, | ||
@@ -375,4 +376,5 @@ value | ||
key: label, | ||
value: value, | ||
disabled: disabled | ||
disabled: disabled, | ||
hidden: hidden, | ||
value: value | ||
}, label); | ||
@@ -401,3 +403,2 @@ }; | ||
onChange, | ||
placeholder = "", | ||
required = false, | ||
@@ -407,3 +408,2 @@ size = "md", | ||
} = _ref3; | ||
const [selectedValue, setSelectedValue] = useState(value); | ||
return /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement("label", { | ||
@@ -420,13 +420,6 @@ htmlFor: id | ||
onBlur: e => onBlur && onBlur(e), | ||
onChange: e => { | ||
onChange(e); | ||
setSelectedValue(e.target.value); | ||
}, | ||
onChange: e => onChange(e), | ||
required: required, | ||
value: selectedValue || "" | ||
}, placeholder && /*#__PURE__*/React.createElement("option", { | ||
value: "", | ||
disabled: true, | ||
hidden: true | ||
}, placeholder), children)); | ||
value: value | ||
}, children)); | ||
}; | ||
@@ -433,0 +426,0 @@ Select.Option = Option; |
@@ -378,2 +378,3 @@ 'use strict'; | ||
disabled = false, | ||
hidden = false, | ||
label, | ||
@@ -384,4 +385,5 @@ value | ||
key: label, | ||
value: value, | ||
disabled: disabled | ||
disabled: disabled, | ||
hidden: hidden, | ||
value: value | ||
}, label); | ||
@@ -410,3 +412,2 @@ }; | ||
onChange, | ||
placeholder = "", | ||
required = false, | ||
@@ -416,3 +417,2 @@ size = "md", | ||
} = _ref3; | ||
const [selectedValue, setSelectedValue] = React.useState(value); | ||
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label && /*#__PURE__*/React__default["default"].createElement("label", { | ||
@@ -429,13 +429,6 @@ htmlFor: id | ||
onBlur: e => onBlur && onBlur(e), | ||
onChange: e => { | ||
onChange(e); | ||
setSelectedValue(e.target.value); | ||
}, | ||
onChange: e => onChange(e), | ||
required: required, | ||
value: selectedValue || "" | ||
}, placeholder && /*#__PURE__*/React__default["default"].createElement("option", { | ||
value: "", | ||
disabled: true, | ||
hidden: true | ||
}, placeholder), children)); | ||
value: value | ||
}, children)); | ||
}; | ||
@@ -442,0 +435,0 @@ Select.Option = Option; |
{ | ||
"name": "@planningcenter/doxy-web", | ||
"version": "2.4.0-rc.0", | ||
"version": "2.4.0-rc.1", | ||
"description": "Doxy for Church Center Web", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
606498
11859