magic-select
Advanced tools
+3
-2
@@ -0,1 +1,2 @@ | ||
| import React from 'react'; | ||
| export declare type OptionType = { | ||
@@ -5,7 +6,7 @@ label: string; | ||
| }; | ||
| declare type Props = { | ||
| declare type SelectProps = { | ||
| optionsToDisplay: OptionType[]; | ||
| triggerCurrentOption: (value: string) => void; | ||
| }; | ||
| export declare const SelectComponent: ({ optionsToDisplay, triggerCurrentOption }: Props) => void; | ||
| export declare function SelectComponent({ optionsToDisplay, triggerCurrentOption }: SelectProps): React.JSX.Element; | ||
| export {}; |
+19
-4
@@ -1,8 +0,23 @@ | ||
| require('react'); | ||
| function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
| var SelectComponent = function SelectComponent(_ref) { | ||
| return; | ||
| }; | ||
| var React = _interopDefault(require('react')); | ||
| function SelectComponent(_ref) { | ||
| var optionsToDisplay = _ref.optionsToDisplay, | ||
| triggerCurrentOption = _ref.triggerCurrentOption; | ||
| return React.createElement("select", null, optionsToDisplay === null || optionsToDisplay === void 0 ? void 0 : optionsToDisplay.map(function (option) { | ||
| return React.createElement("option", { | ||
| key: option.value, | ||
| value: option.value, | ||
| onClick: function onClick() { | ||
| return triggerCurrentOption(option.value); | ||
| }, | ||
| onKeyUp: function onKeyUp() { | ||
| return triggerCurrentOption(option.value); | ||
| } | ||
| }, option.label); | ||
| })); | ||
| } | ||
| exports.SelectComponent = SelectComponent; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React from 'react'\nimport styles from './styles.module.css'\n\nexport type OptionType = {\n label: string\n value: string\n}\n\ntype Props = {\n optionsToDisplay: OptionType[]\n triggerCurrentOption: (value: string) => void\n}\n\nexport const SelectComponent = ({ optionsToDisplay, triggerCurrentOption }: Props) => {\n return\n (<select className={styles.test}>\n {optionsToDisplay?.map((option) => (\n <option key={option.value} value={option.value} onClick={() => triggerCurrentOption(option.value)}>\n {option.label}\n </option>\n ))}\n </select>)\n}\n"],"names":["SelectComponent","_ref"],"mappings":";;IAaaA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA;EAC1B;AAQF;;;;"} | ||
| {"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport type OptionType = {\n label: string\n value: string\n}\n\ntype SelectProps = {\n optionsToDisplay: OptionType[]\n triggerCurrentOption: (value: string) => void\n}\n\nexport function SelectComponent({ optionsToDisplay, triggerCurrentOption }: SelectProps) {\n return (\n <select>\n {optionsToDisplay?.map((option) => (\n <option key={option.value} value={option.value} onClick={() => triggerCurrentOption(option.value)} onKeyUp={() => triggerCurrentOption(option.value)}>\n {option.label}\n </option>\n ))}\n </select>\n )\n}\n\n"],"names":["SelectComponent","_ref","optionsToDisplay","triggerCurrentOption","React","map","option","key","value","onClick","onKeyUp","label"],"mappings":";;;;SAYgBA,eAAeA,CAAAC,IAAA;MAAGC,gBAAgB,GAAAD,IAAA,CAAhBC,gBAAgB;IAAEC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;EACtE,OACEC,oCACGF,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAEG,GAAG,CAAC,UAACC,MAAM;IAAA,OAC5BF;MAAQG,GAAG,EAAED,MAAM,CAACE,KAAK;MAAEA,KAAK,EAAEF,MAAM,CAACE,KAAK;MAAEC,OAAO,EAAE,SAAAA;QAAA,OAAMN,oBAAoB,CAACG,MAAM,CAACE,KAAK,CAAC;;MAAEE,OAAO,EAAE,SAAAA;QAAA,OAAMP,oBAAoB,CAACG,MAAM,CAACE,KAAK,CAAC;;OACjJF,MAAM,CAACK,KAAK,CACN;GACV,CAAC,CACK;AAEb;;;;"} |
+17
-4
@@ -1,8 +0,21 @@ | ||
| import 'react'; | ||
| import React from 'react'; | ||
| var SelectComponent = function SelectComponent(_ref) { | ||
| return; | ||
| }; | ||
| function SelectComponent(_ref) { | ||
| var optionsToDisplay = _ref.optionsToDisplay, | ||
| triggerCurrentOption = _ref.triggerCurrentOption; | ||
| return React.createElement("select", null, optionsToDisplay === null || optionsToDisplay === void 0 ? void 0 : optionsToDisplay.map(function (option) { | ||
| return React.createElement("option", { | ||
| key: option.value, | ||
| value: option.value, | ||
| onClick: function onClick() { | ||
| return triggerCurrentOption(option.value); | ||
| }, | ||
| onKeyUp: function onKeyUp() { | ||
| return triggerCurrentOption(option.value); | ||
| } | ||
| }, option.label); | ||
| })); | ||
| } | ||
| export { SelectComponent }; | ||
| //# sourceMappingURL=index.modern.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.modern.js","sources":["../src/index.tsx"],"sourcesContent":["import React from 'react'\nimport styles from './styles.module.css'\n\nexport type OptionType = {\n label: string\n value: string\n}\n\ntype Props = {\n optionsToDisplay: OptionType[]\n triggerCurrentOption: (value: string) => void\n}\n\nexport const SelectComponent = ({ optionsToDisplay, triggerCurrentOption }: Props) => {\n return\n (<select className={styles.test}>\n {optionsToDisplay?.map((option) => (\n <option key={option.value} value={option.value} onClick={() => triggerCurrentOption(option.value)}>\n {option.label}\n </option>\n ))}\n </select>)\n}\n"],"names":["SelectComponent","_ref"],"mappings":";;IAaaA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA;EAC1B;AAQF;;;;"} | ||
| {"version":3,"file":"index.modern.js","sources":["../src/index.tsx"],"sourcesContent":["import React from 'react'\n\nexport type OptionType = {\n label: string\n value: string\n}\n\ntype SelectProps = {\n optionsToDisplay: OptionType[]\n triggerCurrentOption: (value: string) => void\n}\n\nexport function SelectComponent({ optionsToDisplay, triggerCurrentOption }: SelectProps) {\n return (\n <select>\n {optionsToDisplay?.map((option) => (\n <option key={option.value} value={option.value} onClick={() => triggerCurrentOption(option.value)} onKeyUp={() => triggerCurrentOption(option.value)}>\n {option.label}\n </option>\n ))}\n </select>\n )\n}\n\n"],"names":["SelectComponent","_ref","optionsToDisplay","triggerCurrentOption","React","map","option","key","value","onClick","onKeyUp","label"],"mappings":";;SAYgBA,eAAeA,CAAAC,IAAA;MAAGC,gBAAgB,GAAAD,IAAA,CAAhBC,gBAAgB;IAAEC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;EACtE,OACEC,oCACGF,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAEG,GAAG,CAAC,UAACC,MAAM;IAAA,OAC5BF;MAAQG,GAAG,EAAED,MAAM,CAACE,KAAK;MAAEA,KAAK,EAAEF,MAAM,CAACE,KAAK;MAAEC,OAAO,EAAE,SAAAA;QAAA,OAAMN,oBAAoB,CAACG,MAAM,CAACE,KAAK,CAAC;;MAAEE,OAAO,EAAE,SAAAA;QAAA,OAAMP,oBAAoB,CAACG,MAAM,CAACE,KAAK,CAAC;;OACjJF,MAAM,CAACK,KAAK,CACN;GACV,CAAC,CACK;AAEb;;;;"} |
+1
-1
| { | ||
| "name": "magic-select", | ||
| "version": "1.0.3", | ||
| "version": "1.0.4", | ||
| "description": "Its not a simple select. Its your magic select component", | ||
@@ -5,0 +5,0 @@ "author": "DGouron", |
| /* add css module styles here (optional) */ | ||
| ._3ybTi { | ||
| margin: 2em; | ||
| padding: 0.5em; | ||
| border: 2px solid #000; | ||
| font-size: 2em; | ||
| text-align: center; | ||
| } |
7058
44.1%51
64.52%8
-11.11%