jrs-react 1.2.16 → 1.2.17

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.
package/build/index.es.js CHANGED
@@ -6198,6 +6198,37 @@ const StyledPick = styled.div`
6198
6198
  padding-right: 12px;
6199
6199
  }
6200
6200
  `;
6201
+ class JRRadio extends JROptions {
6202
+ renderer() {
6203
+ const {
6204
+ valueName = 'value',
6205
+ labelName = 'label',
6206
+ onChange,
6207
+ ...props
6208
+ } = this.props;
6209
+ const options = this.getOptions();
6210
+ return /*#__PURE__*/React__default.createElement(StyledPick, {
6211
+ className: 'jr-radio'
6212
+ }, options?.map((record, key) => {
6213
+ const recordValue = record[valueName];
6214
+ return /*#__PURE__*/React__default.createElement("label", {
6215
+ key: key
6216
+ }, /*#__PURE__*/React__default.createElement("input", {
6217
+ type: 'radio',
6218
+ name: 'radio',
6219
+ checked: this.getValue() == recordValue,
6220
+ onClick: e => {
6221
+ if (this.getValue() == recordValue) {
6222
+ this.setValue(null);
6223
+ e.target.checked = false;
6224
+ } else {
6225
+ this.setValue(recordValue);
6226
+ }
6227
+ }
6228
+ }), record[labelName]);
6229
+ }));
6230
+ }
6231
+ }
6201
6232
 
6202
6233
  class JRCheckbox extends JROptions {
6203
6234
  renderer() {
@@ -6239,4 +6270,19 @@ class JRCheckbox extends JROptions {
6239
6270
  }
6240
6271
  }
6241
6272
 
6242
- export { JRAlert, JRButton, JRCheckbox, JRFields, JRFrame, JRSelect, JRSubmit, JRTable, JRTestReact, JRWindow };
6273
+ class JRText extends JRInput {
6274
+ input() {
6275
+ return /*#__PURE__*/React__default.createElement("input", {
6276
+ value: this.props.value ?? '',
6277
+ style: {
6278
+ height: '24px',
6279
+ width: '100%'
6280
+ },
6281
+ onChange: e => {
6282
+ this.setValue(e.target.value);
6283
+ }
6284
+ });
6285
+ }
6286
+ }
6287
+
6288
+ export { JRAlert, JRButton, JRCheckbox, JRFields, JRFrame, JRRadio, JRSelect, JRSubmit, JRTable, JRTestReact, JRText, JRWindow };
package/build/index.js CHANGED
@@ -6225,6 +6225,37 @@ const StyledPick = styled__default["default"].div`
6225
6225
  padding-right: 12px;
6226
6226
  }
6227
6227
  `;
6228
+ class JRRadio extends JROptions {
6229
+ renderer() {
6230
+ const {
6231
+ valueName = 'value',
6232
+ labelName = 'label',
6233
+ onChange,
6234
+ ...props
6235
+ } = this.props;
6236
+ const options = this.getOptions();
6237
+ return /*#__PURE__*/React__default["default"].createElement(StyledPick, {
6238
+ className: 'jr-radio'
6239
+ }, options?.map((record, key) => {
6240
+ const recordValue = record[valueName];
6241
+ return /*#__PURE__*/React__default["default"].createElement("label", {
6242
+ key: key
6243
+ }, /*#__PURE__*/React__default["default"].createElement("input", {
6244
+ type: 'radio',
6245
+ name: 'radio',
6246
+ checked: this.getValue() == recordValue,
6247
+ onClick: e => {
6248
+ if (this.getValue() == recordValue) {
6249
+ this.setValue(null);
6250
+ e.target.checked = false;
6251
+ } else {
6252
+ this.setValue(recordValue);
6253
+ }
6254
+ }
6255
+ }), record[labelName]);
6256
+ }));
6257
+ }
6258
+ }
6228
6259
 
6229
6260
  class JRCheckbox extends JROptions {
6230
6261
  renderer() {
@@ -6266,13 +6297,30 @@ class JRCheckbox extends JROptions {
6266
6297
  }
6267
6298
  }
6268
6299
 
6300
+ class JRText extends JRInput {
6301
+ input() {
6302
+ return /*#__PURE__*/React__default["default"].createElement("input", {
6303
+ value: this.props.value ?? '',
6304
+ style: {
6305
+ height: '24px',
6306
+ width: '100%'
6307
+ },
6308
+ onChange: e => {
6309
+ this.setValue(e.target.value);
6310
+ }
6311
+ });
6312
+ }
6313
+ }
6314
+
6269
6315
  exports.JRAlert = JRAlert;
6270
6316
  exports.JRButton = JRButton;
6271
6317
  exports.JRCheckbox = JRCheckbox;
6272
6318
  exports.JRFields = JRFields;
6273
6319
  exports.JRFrame = JRFrame;
6320
+ exports.JRRadio = JRRadio;
6274
6321
  exports.JRSelect = JRSelect;
6275
6322
  exports.JRSubmit = JRSubmit;
6276
6323
  exports.JRTable = JRTable;
6277
6324
  exports.JRTestReact = JRTestReact;
6325
+ exports.JRText = JRText;
6278
6326
  exports.JRWindow = JRWindow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jrs-react",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
@@ -12,7 +12,7 @@ export const StyledPick=styled.div`
12
12
  padding-right: 12px;
13
13
  }
14
14
  `
15
- export class JRRadio extends JROptions{
15
+ export default class JRRadio extends JROptions{
16
16
  renderer(){
17
17
  const {valueName='value',labelName='label',onChange,...props}=this.props
18
18
  const options=this.getOptions()
package/src/index.js CHANGED
@@ -8,11 +8,13 @@ import JRButton from './components/JRInput/JRButton'
8
8
  import JRAlert from './components/JRAlert'
9
9
  import JRSelect from './components/JRInput/JRSelect'
10
10
  import JRCheckbox from './components/JRInput/JRCheckbox'
11
+ import JRRadio from './components/JRInput/JRRadio'
12
+ import JRText from './components/JRInput/JRText'
11
13
 
12
14
  export {
13
15
  JRTestReact
14
16
  ,JRSubmit,JRFrame,JRWindow,JRTable,JRFields,JRAlert
15
17
  ,JRButton
16
- ,JRSelect,JRCheckbox
18
+ ,JRText,JRSelect,JRCheckbox,JRRadio
17
19
 
18
20
  }