@dktunited-techoff/techoff-suite-ui 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { cloneElement } from 'react';
2
3
  import './Select.css';
3
4
  export const Select = ({ label, value, options, onChange }) => {
4
5
  // ########
@@ -8,9 +9,6 @@ export const Select = ({ label, value, options, onChange }) => {
8
9
  // Rendering
9
10
  return (React.createElement("div", { className: "select-container" },
10
11
  label && React.createElement("label", null, label),
11
- React.createElement("select", { value: value, onChange: handleChange },
12
- React.createElement(React.Fragment, null,
13
- React.createElement("option", null, "-"),
14
- options))));
12
+ React.createElement("select", { value: value, onChange: handleChange }, options.map((option, index) => cloneElement(option, { key: index, ...option.props })))));
15
13
  };
16
14
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,EAAE,EAAE;IACzE,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,CAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC9B,KAAK,IAAI,mCAAQ,KAAK,CAAS;QAChC,gCAAQ,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY;YAC1C;gBACE,wCAAkB;gBACjB,OAAO,CACP,CACI,CACL,CACP,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,YAAY,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,EAAE,EAAE;IACzE,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,CAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC9B,KAAK,IAAI,mCAAQ,KAAK,CAAS;QAChC,gCAAQ,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,IACzC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAC/E,CACL,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Select = void 0;
4
4
  const React = require("react");
5
+ const react_1 = require("react");
5
6
  require("./Select.css");
6
7
  const Select = ({ label, value, options, onChange }) => {
7
8
  // ########
@@ -11,10 +12,7 @@ const Select = ({ label, value, options, onChange }) => {
11
12
  // Rendering
12
13
  return (React.createElement("div", { className: "select-container" },
13
14
  label && React.createElement("label", null, label),
14
- React.createElement("select", { value: value, onChange: handleChange },
15
- React.createElement(React.Fragment, null,
16
- React.createElement("option", null, "-"),
17
- options))));
15
+ React.createElement("select", { value: value, onChange: handleChange }, options.map((option, index) => (0, react_1.cloneElement)(option, { key: index, ...option.props })))));
18
16
  };
19
17
  exports.Select = Select;
20
18
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAG/B,wBAAsB;AAEf,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,EAAE,EAAE;IACzE,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,CAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC9B,KAAK,IAAI,mCAAQ,KAAK,CAAS;QAChC,gCAAQ,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY;YAC1C;gBACE,wCAAkB;gBACjB,OAAO,CACP,CACI,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,MAAM,UAkBjB"}
1
+ {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAkD;AAElD,wBAAsB;AAEf,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe,EAAE,EAAE;IACzE,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,CAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC9B,KAAK,IAAI,mCAAQ,KAAK,CAAS;QAChC,gCAAQ,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,IACzC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,IAAA,oBAAY,EAAC,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAC/E,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,MAAM,UAejB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dktunited-techoff/techoff-suite-ui",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib",
6
6
  "module": "esm/index.js",
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ChangeEvent } from 'react';
2
+ import { ChangeEvent, cloneElement } from 'react';
3
3
  import { SelectProps } from './Select.types';
4
4
  import './Select.css';
5
5
 
@@ -14,10 +14,7 @@ export const Select = ({ label, value, options, onChange }: SelectProps) => {
14
14
  <div className="select-container">
15
15
  {label && <label>{label}</label>}
16
16
  <select value={value} onChange={handleChange}>
17
- <>
18
- <option>-</option>
19
- {options}
20
- </>
17
+ {options.map((option, index) => cloneElement(option, { key: index, ...option.props }))}
21
18
  </select>
22
19
  </div>
23
20
  );