@pie-lib/config-ui 10.11.0 → 10.12.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.12.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@10.12.0...@pie-lib/config-ui@10.12.1) (2022-05-03)
7
+
8
+ **Note:** Version bump only for package @pie-lib/config-ui
9
+
10
+
11
+
12
+
13
+
14
+ # [10.12.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@10.11.1...@pie-lib/config-ui@10.12.0) (2022-05-03)
15
+
16
+
17
+ ### Features
18
+
19
+ * **config-ui:** tweak form-section component for placement-ordering ui/ux PD-1744 ([2e7bc9e](https://github.com/pie-framework/pie-lib/commit/2e7bc9e2d133d90096f0651a302925b9595b1173))
20
+ * implemented an alert dialog ([7a82e03](https://github.com/pie-framework/pie-lib/commit/7a82e0351b5f3124fb78fbfce6eee406f0b9d030))
21
+
22
+
23
+
24
+
25
+
26
+ ## [10.11.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@10.11.0...@pie-lib/config-ui@10.11.1) (2022-04-28)
27
+
28
+ **Note:** Version bump only for package @pie-lib/config-ui
29
+
30
+
31
+
32
+
33
+
6
34
  # [10.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@10.10.24...@pie-lib/config-ui@10.11.0) (2022-04-12)
7
35
 
8
36
 
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _core = require("@material-ui/core");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+
16
+ var AlertDialog = function AlertDialog(_ref) {
17
+ var text = _ref.text,
18
+ title = _ref.title,
19
+ onClose = _ref.onClose,
20
+ onConfirm = _ref.onConfirm,
21
+ open = _ref.open;
22
+ return /*#__PURE__*/_react["default"].createElement(_core.Dialog, {
23
+ open: open,
24
+ onClose: onClose
25
+ }, title && /*#__PURE__*/_react["default"].createElement(_core.DialogTitle, null, title), text && /*#__PURE__*/_react["default"].createElement(_core.DialogContent, null, /*#__PURE__*/_react["default"].createElement(_core.DialogContentText, null, text)), /*#__PURE__*/_react["default"].createElement(_core.DialogActions, null, onClose && /*#__PURE__*/_react["default"].createElement(_core.Button, {
26
+ onClick: onClose,
27
+ color: "primary"
28
+ }, "CANCEL"), onConfirm && /*#__PURE__*/_react["default"].createElement(_core.Button, {
29
+ autoFocus: true,
30
+ onClick: onConfirm,
31
+ color: "primary"
32
+ }, "OK")));
33
+ };
34
+
35
+ AlertDialog.propTypes = {
36
+ text: _propTypes["default"].string,
37
+ title: _propTypes["default"].string,
38
+ onClose: _propTypes["default"].func,
39
+ onConfirm: _propTypes["default"].func,
40
+ open: _propTypes["default"].bool
41
+ };
42
+ var _default = AlertDialog;
43
+ exports["default"] = _default;
44
+ //# sourceMappingURL=alert-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/alert-dialog.jsx"],"names":["AlertDialog","text","title","onClose","onConfirm","open","propTypes","PropTypes","string","func","bool"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AASA,IAAMA,WAAW,GAAG,SAAdA,WAAc;AAAA,MAAGC,IAAH,QAAGA,IAAH;AAAA,MAASC,KAAT,QAASA,KAAT;AAAA,MAAgBC,OAAhB,QAAgBA,OAAhB;AAAA,MAAyBC,SAAzB,QAAyBA,SAAzB;AAAA,MAAoCC,IAApC,QAAoCA,IAApC;AAAA,sBAClB,gCAAC,YAAD;AAAQ,IAAA,IAAI,EAAEA,IAAd;AAAoB,IAAA,OAAO,EAAEF;AAA7B,KACGD,KAAK,iBAAI,gCAAC,iBAAD,QAAcA,KAAd,CADZ,EAEGD,IAAI,iBACH,gCAAC,mBAAD,qBACE,gCAAC,uBAAD,QAAoBA,IAApB,CADF,CAHJ,eAOE,gCAAC,mBAAD,QACGE,OAAO,iBACN,gCAAC,YAAD;AAAQ,IAAA,OAAO,EAAEA,OAAjB;AAA0B,IAAA,KAAK,EAAC;AAAhC,cAFJ,EAMGC,SAAS,iBACR,gCAAC,YAAD;AAAQ,IAAA,SAAS,MAAjB;AAAkB,IAAA,OAAO,EAAEA,SAA3B;AAAsC,IAAA,KAAK,EAAC;AAA5C,UAPJ,CAPF,CADkB;AAAA,CAApB;;AAuBAJ,WAAW,CAACM,SAAZ,GAAwB;AACtBL,EAAAA,IAAI,EAAEM,sBAAUC,MADM;AAEtBN,EAAAA,KAAK,EAAEK,sBAAUC,MAFK;AAGtBL,EAAAA,OAAO,EAAEI,sBAAUE,IAHG;AAItBL,EAAAA,SAAS,EAAEG,sBAAUE,IAJC;AAKtBJ,EAAAA,IAAI,EAAEE,sBAAUG;AALM,CAAxB;eAQeV,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle\n} from '@material-ui/core';\n\nconst AlertDialog = ({ text, title, onClose, onConfirm, open }) => (\n <Dialog open={open} onClose={onClose}>\n {title && <DialogTitle>{title}</DialogTitle>}\n {text && (\n <DialogContent>\n <DialogContentText>{text}</DialogContentText>\n </DialogContent>\n )}\n <DialogActions>\n {onClose && (\n <Button onClick={onClose} color=\"primary\">\n CANCEL\n </Button>\n )}\n {onConfirm && (\n <Button autoFocus onClick={onConfirm} color=\"primary\">\n OK\n </Button>\n )}\n </DialogActions>\n </Dialog>\n);\n\nAlertDialog.propTypes = {\n text: PropTypes.string,\n title: PropTypes.string,\n onClose: PropTypes.func,\n onConfirm: PropTypes.func,\n open: PropTypes.bool\n};\n\nexport default AlertDialog;\n"],"file":"alert-dialog.js"}
@@ -31,12 +31,14 @@ var _default = (0, _styles.withStyles)(styles)(function (_ref) {
31
31
  var className = _ref.className,
32
32
  classes = _ref.classes,
33
33
  label = _ref.label,
34
- children = _ref.children;
34
+ children = _ref.children,
35
+ labelExtraStyle = _ref.labelExtraStyle;
35
36
  return /*#__PURE__*/_react["default"].createElement("div", {
36
37
  className: (0, _classnames["default"])(classes.formSection, className)
37
38
  }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
38
39
  className: classes.label,
39
- type: "subheading"
40
+ type: "subheading",
41
+ style: labelExtraStyle
40
42
  }, label), children);
41
43
  });
42
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/form-section.jsx"],"names":["styles","theme","formSection","marginTop","spacing","unit","marginBottom","label","className","classes","children"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,WAAW,EAAE;AACXC,MAAAA,SAAS,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CADrB;AAEXC,MAAAA,YAAY,EAAEL,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAFxB,KADU;AAKvBE,IAAAA,KAAK,EAAE;AACLD,MAAAA,YAAY,EAAEL,KAAK,CAACG,OAAN,CAAcC;AADvB;AALgB,GAAL;AAAA,CAApB;;eAUe,wBAAWL,MAAX,EAAmB;AAAA,MAAGQ,SAAH,QAAGA,SAAH;AAAA,MAAcC,OAAd,QAAcA,OAAd;AAAA,MAAuBF,KAAvB,QAAuBA,KAAvB;AAAA,MAA8BG,QAA9B,QAA8BA,QAA9B;AAAA,sBAChC;AAAK,IAAA,SAAS,EAAE,4BAAWD,OAAO,CAACP,WAAnB,EAAgCM,SAAhC;AAAhB,kBACE,gCAAC,sBAAD;AAAY,IAAA,SAAS,EAAEC,OAAO,CAACF,KAA/B;AAAsC,IAAA,IAAI,EAAC;AAA3C,KACGA,KADH,CADF,EAIGG,QAJH,CADgC;AAAA,CAAnB,C","sourcesContent":["import React from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst styles = theme => ({\n formSection: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2\n },\n label: {\n marginBottom: theme.spacing.unit\n }\n});\n\nexport default withStyles(styles)(({ className, classes, label, children }) => (\n <div className={classNames(classes.formSection, className)}>\n <Typography className={classes.label} type=\"subheading\">\n {label}\n </Typography>\n {children}\n </div>\n));\n"],"file":"form-section.js"}
1
+ {"version":3,"sources":["../src/form-section.jsx"],"names":["styles","theme","formSection","marginTop","spacing","unit","marginBottom","label","className","classes","children","labelExtraStyle"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,WAAW,EAAE;AACXC,MAAAA,SAAS,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CADrB;AAEXC,MAAAA,YAAY,EAAEL,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAFxB,KADU;AAKvBE,IAAAA,KAAK,EAAE;AACLD,MAAAA,YAAY,EAAEL,KAAK,CAACG,OAAN,CAAcC;AADvB;AALgB,GAAL;AAAA,CAApB;;eAUe,wBAAWL,MAAX,EAAmB;AAAA,MAAGQ,SAAH,QAAGA,SAAH;AAAA,MAAcC,OAAd,QAAcA,OAAd;AAAA,MAAuBF,KAAvB,QAAuBA,KAAvB;AAAA,MAA8BG,QAA9B,QAA8BA,QAA9B;AAAA,MAAwCC,eAAxC,QAAwCA,eAAxC;AAAA,sBAChC;AAAK,IAAA,SAAS,EAAE,4BAAWF,OAAO,CAACP,WAAnB,EAAgCM,SAAhC;AAAhB,kBACE,gCAAC,sBAAD;AAAY,IAAA,SAAS,EAAEC,OAAO,CAACF,KAA/B;AAAsC,IAAA,IAAI,EAAC,YAA3C;AAAwD,IAAA,KAAK,EAAEI;AAA/D,KACGJ,KADH,CADF,EAIGG,QAJH,CADgC;AAAA,CAAnB,C","sourcesContent":["import React from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst styles = theme => ({\n formSection: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2\n },\n label: {\n marginBottom: theme.spacing.unit\n }\n});\n\nexport default withStyles(styles)(({ className, classes, label, children, labelExtraStyle }) => (\n <div className={classNames(classes.formSection, className)}>\n <Typography className={classes.label} type=\"subheading\" style={labelExtraStyle}>\n {label}\n </Typography>\n {children}\n </div>\n));\n"],"file":"form-section.js"}
package/lib/index.js CHANGED
@@ -5,6 +5,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ Object.defineProperty(exports, "AlertDialog", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _alertDialog["default"];
12
+ }
13
+ });
8
14
  Object.defineProperty(exports, "Checkbox", {
9
15
  enumerable: true,
10
16
  get: function get() {
@@ -146,6 +152,8 @@ Object.defineProperty(exports, "withStatefulModel", {
146
152
  }
147
153
  });
148
154
 
155
+ var _alertDialog = _interopRequireDefault(require("./alert-dialog"));
156
+
149
157
  var _feedbackConfig = _interopRequireWildcard(require("./feedback-config"));
150
158
 
151
159
  var _inputs = require("./inputs");
@@ -192,9 +200,9 @@ var settings = _interopRequireWildcard(require("./settings"));
192
200
 
193
201
  exports.settings = settings;
194
202
 
195
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
196
-
197
203
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
198
204
 
199
205
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
206
+
207
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
200
208
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;;;;AACA;;AACA;;AACA;;AAEA","sourcesContent":["import FeedbackConfig, {\n FeedbackSelector,\n buildDefaults as feedbackConfigDefaults\n} from './feedback-config';\nimport { InputCheckbox, InputSwitch, InputRadio } from './inputs';\nimport Langs, { LanguageControls } from './langs';\nimport Tabs from './tabs';\nimport Checkbox from './checkbox';\nimport FormSection from './form-section';\nimport Help from './help';\nimport Input from './input';\nimport { InputContainer } from '@pie-lib/render-ui';\nimport NumberTextField from './number-text-field';\nimport TwoChoice, { NChoice } from './two-choice';\nimport TagsInput from './tags-input';\nimport MuiBox from './mui-box';\nimport ChoiceConfiguration from './choice-configuration';\nimport * as layout from './layout';\n\nimport * as choiceUtils from './choice-utils';\nimport withStatefulModel from './with-stateful-model';\nimport Toggle from './settings/toggle';\nimport DisplaySize from './settings/display-size';\n\nimport * as settings from './settings';\n\nexport {\n FeedbackConfig,\n FeedbackSelector,\n feedbackConfigDefaults,\n InputCheckbox,\n InputSwitch,\n InputRadio,\n Langs,\n LanguageControls,\n Tabs,\n Checkbox,\n FormSection,\n Help,\n Input,\n InputContainer,\n NumberTextField,\n TwoChoice,\n NChoice,\n TagsInput,\n MuiBox,\n ChoiceConfiguration,\n layout,\n choiceUtils,\n withStatefulModel,\n Toggle,\n DisplaySize,\n settings\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;;;;AACA;;AACA;;AACA;;AAEA","sourcesContent":["import AlertDialog from './alert-dialog';\nimport FeedbackConfig, {\n FeedbackSelector,\n buildDefaults as feedbackConfigDefaults\n} from './feedback-config';\nimport { InputCheckbox, InputSwitch, InputRadio } from './inputs';\nimport Langs, { LanguageControls } from './langs';\nimport Tabs from './tabs';\nimport Checkbox from './checkbox';\nimport FormSection from './form-section';\nimport Help from './help';\nimport Input from './input';\nimport { InputContainer } from '@pie-lib/render-ui';\nimport NumberTextField from './number-text-field';\nimport TwoChoice, { NChoice } from './two-choice';\nimport TagsInput from './tags-input';\nimport MuiBox from './mui-box';\nimport ChoiceConfiguration from './choice-configuration';\nimport * as layout from './layout';\n\nimport * as choiceUtils from './choice-utils';\nimport withStatefulModel from './with-stateful-model';\nimport Toggle from './settings/toggle';\nimport DisplaySize from './settings/display-size';\n\nimport * as settings from './settings';\n\nexport {\n AlertDialog,\n FeedbackConfig,\n FeedbackSelector,\n feedbackConfigDefaults,\n InputCheckbox,\n InputSwitch,\n InputRadio,\n Langs,\n LanguageControls,\n Tabs,\n Checkbox,\n FormSection,\n Help,\n Input,\n InputContainer,\n NumberTextField,\n TwoChoice,\n NChoice,\n TagsInput,\n MuiBox,\n ChoiceConfiguration,\n layout,\n choiceUtils,\n withStatefulModel,\n Toggle,\n DisplaySize,\n settings\n};\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/config-ui",
3
- "version": "10.11.0",
3
+ "version": "10.12.1",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "publishConfig": {
@@ -10,9 +10,9 @@
10
10
  "dependencies": {
11
11
  "@material-ui/core": "^3.8.3",
12
12
  "@material-ui/icons": "^3.0.2",
13
- "@pie-lib/editable-html": "^7.20.0",
13
+ "@pie-lib/editable-html": "^7.22.1",
14
14
  "@pie-lib/icons": "^2.4.25",
15
- "@pie-lib/render-ui": "^4.12.5",
15
+ "@pie-lib/render-ui": "^4.12.6",
16
16
  "classnames": "^2.2.6",
17
17
  "debug": "^4.1.1",
18
18
  "lodash": "^4.17.11",
@@ -26,5 +26,5 @@
26
26
  "peerDependencies": {
27
27
  "react": "^16.8.1"
28
28
  },
29
- "gitHead": "c37429328de4f87b6a7095de6e671c2cc53dd7f5"
29
+ "gitHead": "7af4bd333e7b4ae5720a863ee443377274cc6181"
30
30
  }
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import {
4
+ Button,
5
+ Dialog,
6
+ DialogActions,
7
+ DialogContent,
8
+ DialogContentText,
9
+ DialogTitle
10
+ } from '@material-ui/core';
11
+
12
+ const AlertDialog = ({ text, title, onClose, onConfirm, open }) => (
13
+ <Dialog open={open} onClose={onClose}>
14
+ {title && <DialogTitle>{title}</DialogTitle>}
15
+ {text && (
16
+ <DialogContent>
17
+ <DialogContentText>{text}</DialogContentText>
18
+ </DialogContent>
19
+ )}
20
+ <DialogActions>
21
+ {onClose && (
22
+ <Button onClick={onClose} color="primary">
23
+ CANCEL
24
+ </Button>
25
+ )}
26
+ {onConfirm && (
27
+ <Button autoFocus onClick={onConfirm} color="primary">
28
+ OK
29
+ </Button>
30
+ )}
31
+ </DialogActions>
32
+ </Dialog>
33
+ );
34
+
35
+ AlertDialog.propTypes = {
36
+ text: PropTypes.string,
37
+ title: PropTypes.string,
38
+ onClose: PropTypes.func,
39
+ onConfirm: PropTypes.func,
40
+ open: PropTypes.bool
41
+ };
42
+
43
+ export default AlertDialog;
@@ -13,9 +13,9 @@ const styles = theme => ({
13
13
  }
14
14
  });
15
15
 
16
- export default withStyles(styles)(({ className, classes, label, children }) => (
16
+ export default withStyles(styles)(({ className, classes, label, children, labelExtraStyle }) => (
17
17
  <div className={classNames(classes.formSection, className)}>
18
- <Typography className={classes.label} type="subheading">
18
+ <Typography className={classes.label} type="subheading" style={labelExtraStyle}>
19
19
  {label}
20
20
  </Typography>
21
21
  {children}
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import AlertDialog from './alert-dialog';
1
2
  import FeedbackConfig, {
2
3
  FeedbackSelector,
3
4
  buildDefaults as feedbackConfigDefaults
@@ -25,6 +26,7 @@ import DisplaySize from './settings/display-size';
25
26
  import * as settings from './settings';
26
27
 
27
28
  export {
29
+ AlertDialog,
28
30
  FeedbackConfig,
29
31
  FeedbackSelector,
30
32
  feedbackConfigDefaults,