react-jsonschema-form-extras 0.9.73 → 0.9.75

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.
@@ -50,8 +50,8 @@ var DateTimePicker = function (_Component) {
50
50
  var onChange = this.props.onChange;
51
51
 
52
52
  if (value !== "") {
53
- this.setState({ dateTimeValue: value }); //2019-02-07T14:02
54
- onChange((0, _moment2.default)(value).format("YYYY-MM-DDTHH:mm"));
53
+ this.setState({ dateTimeValue: value });
54
+ onChange((0, _moment2.default)(value).format("MM/DD/YYYY, h:mm A"));
55
55
  }
56
56
  }
57
57
  }, {
package/lib/DraftRte.js CHANGED
@@ -74,15 +74,15 @@ function mapFromObject(data, mapping, defVal) {
74
74
  return agg;
75
75
  }, defVal);
76
76
  }
77
- /**
78
- *
79
- * @param {*} data
80
- * @param {*} mapping
81
- * Mapped object is converted to the object mapping takes
77
+ /**
78
+ *
79
+ * @param {*} data
80
+ * @param {*} mapping
81
+ * Mapped object is converted to the object mapping takes
82
82
  */
83
83
  function mapFromSchema(data, mapping) {
84
- /* if (isEmpty(data)) {
85
- return;
84
+ /* if (isEmpty(data)) {
85
+ return;
86
86
  } */
87
87
  if (!mapping || mapping === null) {
88
88
  return data;
@@ -95,11 +95,11 @@ function mapFromSchema(data, mapping) {
95
95
  }
96
96
  }
97
97
 
98
- /**
99
- *
100
- * @param {*} data
101
- * @param {*} mapping
102
- * prepare the String to display
98
+ /**
99
+ *
100
+ * @param {*} data
101
+ * @param {*} mapping
102
+ * prepare the String to display
103
103
  */
104
104
  function optionToString(fields, separator) {
105
105
  return function (option) {
@@ -119,11 +119,11 @@ function optionToString(fields, separator) {
119
119
  }, "");
120
120
  };
121
121
  }
122
- /**
123
- *
124
- * @param {*} data
125
- * @param {*} mapping
126
- * maping the label
122
+ /**
123
+ *
124
+ * @param {*} data
125
+ * @param {*} mapping
126
+ * maping the label
127
127
  */
128
128
  function mapLabelKey(labelKey) {
129
129
  if (Array.isArray(labelKey)) {
@@ -140,10 +140,10 @@ function mapLabelKey(labelKey) {
140
140
  var DraftRTE = function (_Component) {
141
141
  _inherits(DraftRTE, _Component);
142
142
 
143
- /**
144
- *
145
- * @param {*} props
146
- * Currently only supports HTML
143
+ /**
144
+ *
145
+ * @param {*} props
146
+ * Currently only supports HTML
147
147
  */
148
148
  function DraftRTE(props) {
149
149
  _classCallCheck(this, DraftRTE);
@@ -183,24 +183,24 @@ var DraftRTE = function (_Component) {
183
183
  };
184
184
  return _this;
185
185
  }
186
- /**
187
- * updates formData by calling parent's onChange function with current html content
186
+ /**
187
+ * updates formData by calling parent's onChange function with current html content
188
188
  */
189
189
 
190
190
 
191
- /**
192
- * handles editor's onChange
193
- * handles logic to update form data based on props supplied to the component
191
+ /**
192
+ * handles editor's onChange
193
+ * handles logic to update form data based on props supplied to the component
194
194
  */
195
195
  //will only be executed if debounce is present
196
196
 
197
- /**
198
- * handles the logic to update formData on blur
197
+ /**
198
+ * handles the logic to update formData on blur
199
199
  */
200
200
 
201
201
 
202
- /**
203
- * handles the logic to load the suggestions on the time of focus
202
+ /**
203
+ * handles the logic to load the suggestions on the time of focus
204
204
  */
205
205
 
206
206
 
@@ -208,8 +208,8 @@ var DraftRTE = function (_Component) {
208
208
  key: "render",
209
209
 
210
210
 
211
- /**
212
- * react render function
211
+ /**
212
+ * react render function
213
213
  */
214
214
  value: function render() {
215
215
  var _this2 = this;
@@ -154,11 +154,11 @@ function mapFromObject(data, mapping, defVal) {
154
154
  return agg;
155
155
  }, defVal);
156
156
  }
157
- /**
158
- *
159
- * @param {*} data
160
- * @param {*} mapping
161
- * Mapped object is converted to the object mapping takes
157
+ /**
158
+ *
159
+ * @param {*} data
160
+ * @param {*} mapping
161
+ * Mapped object is converted to the object mapping takes
162
162
  */
163
163
  function mapFromSchema(data, mapping) {
164
164
  if (isEmpty(data)) {
@@ -223,9 +223,9 @@ function isFunction(functionToCheck) {
223
223
  return functionToCheck instanceof Function;
224
224
  }
225
225
 
226
- /*
227
- this is done to prevent an edge case with a typeahead wrapped inside a table that has an item selected & uses a function as a labelKey
228
- TODO: Need to find a better solution for this
226
+ /*
227
+ this is done to prevent an edge case with a typeahead wrapped inside a table that has an item selected & uses a function as a labelKey
228
+ TODO: Need to find a better solution for this
229
229
  */
230
230
  function transformLabelKey(labelKey, schema, selected) {
231
231
  if (isFunction(labelKey) && selected && selected.length > 0 && schema.type === "string" && selected.every(function (x) {
@@ -1,10 +1,10 @@
1
- /*Collapsible header items*/
2
- .header-elements-wrapper {
3
- align-items: center;
4
- color: #fff;
5
- display: inline-flex;
6
- flex-direction: row;
7
- justify-content: flex-start;
8
- padding-left: 20px;
9
- white-space: nowrap;
1
+ /*Collapsible header items*/
2
+ .header-elements-wrapper {
3
+ align-items: center;
4
+ color: #fff;
5
+ display: inline-flex;
6
+ flex-direction: row;
7
+ justify-content: flex-start;
8
+ padding-left: 20px;
9
+ white-space: nowrap;
10
10
  }
@@ -411,10 +411,12 @@ var TableField = function (_Component) {
411
411
  var _tableListData = _tableList.map(function (fieldName, i) {
412
412
  if (fieldData[fieldName] !== undefined && Object.keys(fieldData[fieldName]).length > 0) {
413
413
  isComponentDataAvailable = true;
414
+ var listElementLeftHand = fieldData[fieldName].code || fieldData[fieldName].question;
415
+ var listElementRightHand = fieldData[fieldName].description || fieldData[fieldName].answer;
414
416
  return _react2.default.createElement(
415
417
  "li",
416
418
  { className: "customTable-item" },
417
- fieldData[fieldName].code + " - " + fieldData[fieldName].description
419
+ listElementLeftHand + " - " + listElementRightHand
418
420
  );
419
421
  }
420
422
  return;
package/package.json CHANGED
@@ -1,138 +1,139 @@
1
- {
2
- "name": "react-jsonschema-form-extras",
3
- "description": "Extra widgets for Mozilla's react-jsonschema-form",
4
- "private": false,
5
- "author": "mavarazy@gmail.com",
6
- "version": "0.9.73",
7
- "scripts": {
8
- "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files",
9
- "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js --optimize-minimize",
10
- "build:playground": "rimraf build && cross-env NODE_ENV=production webpack --config webpack.config.prod.js --optimize-minimize && cp playground/index.prod.html build/index.html",
11
- "cs-check": "prettier -l $npm_package_prettierOptions '{playground,src,test}/**/*.js'",
12
- "cs-format": "prettier $npm_package_prettierOptions '{playground,src,test}/**/*.js' --write",
13
- "dist": "npm run build:lib && npm run build:dist",
14
- "lint": "eslint src test playground --fix",
15
- "precommit": "lint-staged",
16
- "publish-to-gh-pages": "npm run build:playground && gh-pages --dist build/",
17
- "publish-to-npm": "npm run dist && npm publish && npm version patch",
18
- "start": "webpack-dev-server",
19
- "tdd": "jest --watchAll",
20
- "test": "jest"
21
- },
22
- "jest": {
23
- "verbose": true,
24
- "collectCoverage": true
25
- },
26
- "prettierOptions": "--jsx-bracket-same-line --trailing-comma es5 --semi",
27
- "lint-staged": {
28
- "{playground,src,test}/**/*.js": [
29
- "npm run lint",
30
- "npm run cs-format",
31
- "git add"
32
- ]
33
- },
34
- "main": "lib/index.js",
35
- "files": [
36
- "lib",
37
- "dist"
38
- ],
39
- "engineStrict": false,
40
- "engines": {
41
- "npm": "^5.0.4",
42
- "node": ">=8.0.0"
43
- },
44
- "peerDependencies": {
45
- "moment": "^2.20.0",
46
- "prop-types": "^15.x",
47
- "react": "^16.x",
48
- "react-bootstrap-table": "^4.x",
49
- "react-bootstrap-typeahead": "^3.3.2",
50
- "react-day-picker": "^7.x",
51
- "react-rte": "^0.15.0"
52
- },
53
- "dependencies": {
54
- "classnames": "^2.2.6",
55
- "draftjs-to-html": "^0.8.4",
56
- "es6-shim": "^0.35.5",
57
- "html-to-draftjs": "^1.4.0",
58
- "lodash.debounce": "^4.0.8",
59
- "react-draft-wysiwyg": "^1.12.13",
60
- "react-render-html": "^0.6.0",
61
- "selectn": "^1.1.2"
62
- },
63
- "devDependencies": {
64
- "atob": "^2.1.1",
65
- "babel-cli": "^6.0.0",
66
- "babel-core": "^6.26.3",
67
- "babel-eslint": "^8.0.1",
68
- "babel-jest": "^21.2.0",
69
- "babel-loader": "^7.1.2",
70
- "babel-plugin-add-module-exports": "^0.2.1",
71
- "babel-plugin-transform-class-properties": "^6.24.1",
72
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
73
- "babel-polyfill": "^6.26.0",
74
- "babel-preset-env": "^1.7.0",
75
- "babel-preset-es2015": "^6.24.1",
76
- "babel-preset-react": "^6.24.1",
77
- "babel-preset-stage-2": "^6.24.1",
78
- "babel-register": "^6.26.0",
79
- "bootstrap": "^3.3.7",
80
- "coveralls": "^3.0.0",
81
- "cross-env": "^5.1.0",
82
- "css-loader": "^0.28.7",
83
- "eslint": "^4.9.0",
84
- "eslint-plugin-jest": "^21.2.0",
85
- "eslint-plugin-react": "^7.4.0",
86
- "eslint-plugin-standard": "^3.0.1",
87
- "exit-hook": "^1.1.1",
88
- "express": "^4.16.2",
89
- "extract-text-webpack-plugin": "^3.0.1",
90
- "gh-pages": "^1.2.0",
91
- "has-flag": "^2.0.0",
92
- "html": "1.0.0",
93
- "husky": "^0.14.3",
94
- "istanbul-api": "1.2.2",
95
- "istanbul-reports": "1.1.4",
96
- "jest": "^23.6.0",
97
- "jsdom": "^11.12.0",
98
- "json-rules-engine-simplified": "^0.1.17",
99
- "lint-staged": "^6.0.0",
100
- "moment": "^2.20.1",
101
- "prettier": "^1.7.4",
102
- "react": "^16.0.0",
103
- "react-bootstrap-table": "^4.3.0",
104
- "react-bootstrap-typeahead": "^3.2.4",
105
- "react-day-picker": "^7.0.5",
106
- "react-dom": "^16.0.0",
107
- "react-jsonschema-form": "^1.0.0",
108
- "react-jsonschema-form-conditionals": "^0.3.15",
109
- "react-rte": "^0.15.0",
110
- "react-test-renderer": "^16.0.0",
111
- "react-transform-catch-errors": "^1.0.2",
112
- "react-transform-hmr": "^1.0.4",
113
- "regenerator-runtime": "^0.11.0",
114
- "rimraf": "^2.6.2",
115
- "selectn": "^1.1.2",
116
- "sinon": "^4.1.1",
117
- "style-loader": "^0.19.0",
118
- "webpack": "^3.9.1",
119
- "webpack-dev-server": "^2.9.3",
120
- "webpack-hot-middleware": "^2.20.0"
121
- },
122
- "directories": {
123
- "test": "test"
124
- },
125
- "repository": {
126
- "type": "git",
127
- "url": "git+https://github.com/RxNT/react-jsonschema-form-extras.git"
128
- },
129
- "keywords": [
130
- "react",
131
- "form",
132
- "json-schema",
133
- "conditional",
134
- "predicate"
135
- ],
136
- "license": "Apache-2.0",
137
- "homepage": "https://github.com/RxNT/react-jsonschema-form-extras#readme"
138
- }
1
+ {
2
+ "name": "react-jsonschema-form-extras",
3
+ "description": "Extra widgets for Mozilla's react-jsonschema-form",
4
+ "private": false,
5
+ "author": "mavarazy@gmail.com",
6
+ "version": "0.9.75",
7
+ "scripts": {
8
+ "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files",
9
+ "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js --optimize-minimize",
10
+ "build:playground": "rimraf build && cross-env NODE_ENV=production webpack --config webpack.config.prod.js --optimize-minimize && cp playground/index.prod.html build/index.html",
11
+ "cs-check": "prettier -l $npm_package_prettierOptions '{playground,src,test}/**/*.js'",
12
+ "cs-format": "prettier $npm_package_prettierOptions '{playground,src,test}/**/*.js' --write",
13
+ "dist": "npm run build:lib && npm run build:dist",
14
+ "lint": "eslint src test playground --fix",
15
+ "precommit": "lint-staged",
16
+ "publish-to-gh-pages": "npm run build:playground && gh-pages --dist build/",
17
+ "publish-to-npm": "npm run dist && npm publish && npm version patch",
18
+ "start": "webpack-dev-server",
19
+ "tdd": "jest --watchAll",
20
+ "test": "jest"
21
+ },
22
+ "jest": {
23
+ "verbose": true,
24
+ "collectCoverage": true
25
+ },
26
+ "prettierOptions": "--jsx-bracket-same-line --trailing-comma es5 --semi",
27
+ "lint-staged": {
28
+ "{playground,src,test}/**/*.js": [
29
+ "npm run lint",
30
+ "npm run cs-format",
31
+ "git add"
32
+ ]
33
+ },
34
+ "main": "lib/index.js",
35
+ "files": [
36
+ "lib",
37
+ "dist"
38
+ ],
39
+ "engineStrict": false,
40
+ "engines": {
41
+ "npm": "^5.0.4",
42
+ "node": ">=8.0.0"
43
+ },
44
+ "peerDependencies": {
45
+ "moment": "^2.20.0",
46
+ "prop-types": "^15.x",
47
+ "react": "^16.x",
48
+ "react-bootstrap-table": "^4.x",
49
+ "react-bootstrap-typeahead": "^3.3.2",
50
+ "react-day-picker": "^7.x",
51
+ "react-rte": "^0.15.0"
52
+ },
53
+ "dependencies": {
54
+ "classnames": "^2.2.6",
55
+ "draftjs-to-html": "^0.8.4",
56
+ "es6-shim": "^0.35.5",
57
+ "html-to-draftjs": "^1.4.0",
58
+ "lodash.debounce": "^4.0.8",
59
+ "react-draft-wysiwyg": "^1.12.13",
60
+ "react-render-html": "^0.6.0",
61
+ "selectn": "^1.1.2",
62
+ "use-debounce": "^10.0.4"
63
+ },
64
+ "devDependencies": {
65
+ "atob": "^2.1.1",
66
+ "babel-cli": "^6.0.0",
67
+ "babel-core": "^6.26.3",
68
+ "babel-eslint": "^8.0.1",
69
+ "babel-jest": "^21.2.0",
70
+ "babel-loader": "^7.1.2",
71
+ "babel-plugin-add-module-exports": "^0.2.1",
72
+ "babel-plugin-transform-class-properties": "^6.24.1",
73
+ "babel-plugin-transform-object-rest-spread": "^6.26.0",
74
+ "babel-polyfill": "^6.26.0",
75
+ "babel-preset-env": "^1.7.0",
76
+ "babel-preset-es2015": "^6.24.1",
77
+ "babel-preset-react": "^6.24.1",
78
+ "babel-preset-stage-2": "^6.24.1",
79
+ "babel-register": "^6.26.0",
80
+ "bootstrap": "^3.3.7",
81
+ "coveralls": "^3.0.0",
82
+ "cross-env": "^5.1.0",
83
+ "css-loader": "^0.28.7",
84
+ "eslint": "^4.9.0",
85
+ "eslint-plugin-jest": "^21.2.0",
86
+ "eslint-plugin-react": "^7.4.0",
87
+ "eslint-plugin-standard": "^3.0.1",
88
+ "exit-hook": "^1.1.1",
89
+ "express": "^4.16.2",
90
+ "extract-text-webpack-plugin": "^3.0.1",
91
+ "gh-pages": "^1.2.0",
92
+ "has-flag": "^2.0.0",
93
+ "html": "1.0.0",
94
+ "husky": "^0.14.3",
95
+ "istanbul-api": "1.2.2",
96
+ "istanbul-reports": "1.1.4",
97
+ "jest": "^23.6.0",
98
+ "jsdom": "^11.12.0",
99
+ "json-rules-engine-simplified": "^0.1.17",
100
+ "lint-staged": "^6.0.0",
101
+ "moment": "^2.20.1",
102
+ "prettier": "^1.7.4",
103
+ "react": "^16.0.0",
104
+ "react-bootstrap-table": "^4.3.0",
105
+ "react-bootstrap-typeahead": "^3.2.4",
106
+ "react-day-picker": "^7.0.5",
107
+ "react-dom": "^16.0.0",
108
+ "react-jsonschema-form": "^1.0.0",
109
+ "react-jsonschema-form-conditionals": "^0.3.15",
110
+ "react-rte": "^0.15.0",
111
+ "react-test-renderer": "^16.0.0",
112
+ "react-transform-catch-errors": "^1.0.2",
113
+ "react-transform-hmr": "^1.0.4",
114
+ "regenerator-runtime": "^0.11.0",
115
+ "rimraf": "^2.6.2",
116
+ "selectn": "^1.1.2",
117
+ "sinon": "^4.1.1",
118
+ "style-loader": "^0.19.0",
119
+ "webpack": "^3.9.1",
120
+ "webpack-dev-server": "^2.9.3",
121
+ "webpack-hot-middleware": "^2.20.0"
122
+ },
123
+ "directories": {
124
+ "test": "test"
125
+ },
126
+ "repository": {
127
+ "type": "git",
128
+ "url": "git+https://github.com/RxNT/react-jsonschema-form-extras.git"
129
+ },
130
+ "keywords": [
131
+ "react",
132
+ "form",
133
+ "json-schema",
134
+ "conditional",
135
+ "predicate"
136
+ ],
137
+ "license": "Apache-2.0",
138
+ "homepage": "https://github.com/RxNT/react-jsonschema-form-extras#readme"
139
+ }