@pie-lib/config-ui 12.0.0-next.0 → 12.1.0-next.2

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +5 -13
  3. package/src/choice-configuration/__tests__/index.test.jsx +1 -1
  4. package/src/choice-configuration/index.jsx +68 -75
  5. package/src/feedback-config/__tests__/feedback-selector.test.jsx +3 -13
  6. package/src/feedback-config/feedback-selector.jsx +3 -7
  7. package/src/layout/config-layout.jsx +11 -4
  8. package/lib/alert-dialog.js +0 -68
  9. package/lib/alert-dialog.js.map +0 -1
  10. package/lib/checkbox.js +0 -84
  11. package/lib/checkbox.js.map +0 -1
  12. package/lib/choice-configuration/feedback-menu.js +0 -129
  13. package/lib/choice-configuration/feedback-menu.js.map +0 -1
  14. package/lib/choice-configuration/index.js +0 -385
  15. package/lib/choice-configuration/index.js.map +0 -1
  16. package/lib/choice-utils.js +0 -42
  17. package/lib/choice-utils.js.map +0 -1
  18. package/lib/feedback-config/feedback-selector.js +0 -159
  19. package/lib/feedback-config/feedback-selector.js.map +0 -1
  20. package/lib/feedback-config/group.js +0 -61
  21. package/lib/feedback-config/group.js.map +0 -1
  22. package/lib/feedback-config/index.js +0 -146
  23. package/lib/feedback-config/index.js.map +0 -1
  24. package/lib/form-section.js +0 -44
  25. package/lib/form-section.js.map +0 -1
  26. package/lib/help.js +0 -106
  27. package/lib/help.js.map +0 -1
  28. package/lib/index.js +0 -186
  29. package/lib/index.js.map +0 -1
  30. package/lib/input.js +0 -106
  31. package/lib/input.js.map +0 -1
  32. package/lib/inputs.js +0 -105
  33. package/lib/inputs.js.map +0 -1
  34. package/lib/langs.js +0 -136
  35. package/lib/langs.js.map +0 -1
  36. package/lib/layout/config-layout.js +0 -129
  37. package/lib/layout/config-layout.js.map +0 -1
  38. package/lib/layout/index.js +0 -21
  39. package/lib/layout/index.js.map +0 -1
  40. package/lib/layout/layout-contents.js +0 -160
  41. package/lib/layout/layout-contents.js.map +0 -1
  42. package/lib/layout/settings-box.js +0 -57
  43. package/lib/layout/settings-box.js.map +0 -1
  44. package/lib/mui-box/index.js +0 -63
  45. package/lib/mui-box/index.js.map +0 -1
  46. package/lib/number-text-field-custom.js +0 -376
  47. package/lib/number-text-field-custom.js.map +0 -1
  48. package/lib/number-text-field.js +0 -233
  49. package/lib/number-text-field.js.map +0 -1
  50. package/lib/radio-with-label.js +0 -48
  51. package/lib/radio-with-label.js.map +0 -1
  52. package/lib/settings/display-size.js +0 -61
  53. package/lib/settings/display-size.js.map +0 -1
  54. package/lib/settings/index.js +0 -110
  55. package/lib/settings/index.js.map +0 -1
  56. package/lib/settings/panel.js +0 -393
  57. package/lib/settings/panel.js.map +0 -1
  58. package/lib/settings/settings-radio-label.js +0 -51
  59. package/lib/settings/settings-radio-label.js.map +0 -1
  60. package/lib/settings/toggle.js +0 -63
  61. package/lib/settings/toggle.js.map +0 -1
  62. package/lib/tabs/index.js +0 -75
  63. package/lib/tabs/index.js.map +0 -1
  64. package/lib/tags-input/index.js +0 -149
  65. package/lib/tags-input/index.js.map +0 -1
  66. package/lib/two-choice.js +0 -136
  67. package/lib/two-choice.js.map +0 -1
  68. package/lib/with-stateful-model.js +0 -61
  69. package/lib/with-stateful-model.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,49 @@
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
+ # [12.1.0-next.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@12.1.0-next.1...@pie-lib/config-ui@12.1.0-next.2) (2026-01-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * removed slate-html-serializer from markup, and fixed extracss rules functionality ([1ac30a3](https://github.com/pie-framework/pie-lib/commit/1ac30a362202b9c063920642382cce8234b9de85))
12
+
13
+
14
+
15
+
16
+
17
+ # [12.1.0-next.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@11.30.2...@pie-lib/config-ui@12.1.0-next.1) (2026-01-26)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * fix feedback menu, adjust choiceconfig style ([f5ea380](https://github.com/pie-framework/pie-lib/commit/f5ea380a108c0da9358c4e9028baa7068f4c5e91))
23
+ * fix some popper components, fix some math toolbar color ([ed1df55](https://github.com/pie-framework/pie-lib/commit/ed1df558e272686a712767e347df49434790f334))
24
+ * label positioning in input render-ui ([8012817](https://github.com/pie-framework/pie-lib/commit/80128173dc596181de296633e9413bba8b79db81))
25
+ * number fields in settings panel ([babde84](https://github.com/pie-framework/pie-lib/commit/babde844bffe8efdc4a2622bbfc0e372a0d33806))
26
+ * remove carets from [@pie-lib](https://github.com/pie-lib) dependencies and configure lerna to use exact versions ([c9cd800](https://github.com/pie-framework/pie-lib/commit/c9cd800844abca09e7acf1fd35b2ddf51a6d86df))
27
+ * remove carret, point to specific libs version ([09939a5](https://github.com/pie-framework/pie-lib/commit/09939a5aca19d7dda03d62c93d4d524f98dd69da))
28
+ * remove exports and publish ([#2068](https://github.com/pie-framework/pie-lib/issues/2068)) ([60a96cd](https://github.com/pie-framework/pie-lib/commit/60a96cde0ec65f6b1cac0ae329aa33a0abc50d05))
29
+ * remove parantheses ([07c8d13](https://github.com/pie-framework/pie-lib/commit/07c8d1366d768b1e22e31fb930a7d41a2a31d5ca))
30
+ * select in settings panel ([89d3f93](https://github.com/pie-framework/pie-lib/commit/89d3f935ebf9e13c6d1f538e6b3d76ff5612b5f6))
31
+ * settings panel label size ([c3606b9](https://github.com/pie-framework/pie-lib/commit/c3606b9319e771284415177bee48ffa49fb72fc6))
32
+ * updated tip-tap with mui instead of material-ui [PD-5141] ([880d3ab](https://github.com/pie-framework/pie-lib/commit/880d3ab1d63aa12c7e975c882f50624200565737))
33
+ * use fixed lib deps ([de7c64d](https://github.com/pie-framework/pie-lib/commit/de7c64d14f13259fe44d47405e4421baef21e24e))
34
+ * **config-ui:** use the styled components for both tabs case as for the others ([81b8c23](https://github.com/pie-framework/pie-lib/commit/81b8c231c3e469e7a07a3e9d9321093dba8d0bcb))
35
+ * **config-ui, mask-markup:** replace deprecated props, externd AlerDialog with new props ([6e7a163](https://github.com/pie-framework/pie-lib/commit/6e7a16314944745154801010aa4973a03aa15dcc))
36
+
37
+
38
+ ### Features
39
+
40
+ * add MuiButton style overrides for consistent theming ([8fc184e](https://github.com/pie-framework/pie-lib/commit/8fc184e0eca3425cc76f1f76d8f1f24eb56c0779))
41
+ * bump react and react-dom ([01dc19e](https://github.com/pie-framework/pie-lib/commit/01dc19e88bbc8d372c561d1511df1a82937d45af))
42
+ * sync latest changes from dev ([c936e9c](https://github.com/pie-framework/pie-lib/commit/c936e9c7f9e095e7d9b9805ac2bf72bd271e05f1))
43
+ * **config-ui:** migrate to material v5 PD-5258 ([3ea0799](https://github.com/pie-framework/pie-lib/commit/3ea0799ce78ca20c938c7765b7af5a47194c39d1))
44
+
45
+
46
+
47
+
48
+
6
49
  # [12.0.0-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/config-ui@11.30.3-next.0...@pie-lib/config-ui@12.0.0-next.0) (2026-01-19)
7
50
 
8
51
  **Note:** Version bump only for package @pie-lib/config-ui
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/config-ui",
3
- "version": "12.0.0-next.0",
3
+ "version": "12.1.0-next.2",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "publishConfig": {
@@ -12,9 +12,9 @@
12
12
  "@emotion/style": "^0.8.0",
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
- "@pie-lib/editable-html": "11.21.3-next.15",
16
- "@pie-lib/icons": "2.24.2-next.16",
17
- "@pie-lib/render-ui": "4.35.3-next.15",
15
+ "@pie-lib/editable-html-tip-tap": "1.1.0-next.2",
16
+ "@pie-lib/icons": "3.1.0-next.1",
17
+ "@pie-lib/render-ui": "5.1.0-next.2",
18
18
  "assert": "^1.4.1",
19
19
  "debug": "^4.1.1",
20
20
  "lodash": "^4.17.11",
@@ -29,13 +29,5 @@
29
29
  "peerDependencies": {
30
30
  "react": "^18.2.0"
31
31
  },
32
- "gitHead": "a6ae07ad459bbae1039b5a1a8b9c40e3c1f3af73",
33
- "exports": {
34
- ".": {
35
- "require": "./lib/index.js",
36
- "import": "./src/index.js",
37
- "default": "./lib/index.js"
38
- },
39
- "./esm": "./esm/index.js"
40
- }
32
+ "gitHead": "04c639af6e49d1881bf3244ebb3940171c26bd3e"
41
33
  }
@@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import { ChoiceConfiguration } from '../index';
5
5
 
6
- jest.mock('@pie-lib/editable-html', () => ({
6
+ jest.mock('@pie-lib/editable-html-tip-tap', () => ({
7
7
  __esModule: true,
8
8
  default: ({ markup, onChange, disabled }) => (
9
9
  <textarea
@@ -6,14 +6,14 @@ import ActionDelete from '@mui/icons-material/Delete';
6
6
  import ArrowRight from '@mui/icons-material/SubdirectoryArrowRight';
7
7
  import IconButton from '@mui/material/IconButton';
8
8
  import { InputContainer } from '@pie-lib/render-ui';
9
- // import EditableHtml from '@pie-lib/editable-html';
9
+ // import EditableHtml from '@pie-lib/editable-html-tip-tap';
10
10
  import { InputCheckbox, InputRadio } from '../inputs';
11
11
  import FeedbackMenu from './feedback-menu';
12
12
 
13
13
  // - mathquill error window not defined
14
14
  let EditableHtml;
15
15
  if (typeof window !== 'undefined') {
16
- EditableHtml = require('@pie-lib/editable-html')['default'];
16
+ EditableHtml = require('@pie-lib/editable-html-tip-tap')['default'];
17
17
  }
18
18
 
19
19
  const StyledEditorHolder = styled('div')(({ theme }) => ({
@@ -38,7 +38,6 @@ const EditableHtmlContainer = ({
38
38
  uploadSoundSupport,
39
39
  mathMlOptions = {},
40
40
  }) => {
41
-
42
41
  return (
43
42
  <InputContainer label={label} className={className}>
44
43
  <StyledEditorHolder>
@@ -288,81 +287,75 @@ export class ChoiceConfiguration extends React.Component {
288
287
  const InputToggle = mode === 'checkbox' ? InputCheckbox : InputRadio;
289
288
 
290
289
  return (
291
- <StyledTopRow>
292
- {index > 0 && (
293
- <StyledIndex type="title">
294
- {useLetterOrdering ? String.fromCharCode(96 + index).toUpperCase() : index}
295
- </StyledIndex>
296
- )}
297
-
298
- <StyledToggle>
299
- <InputToggle
300
- onChange={this.onCheckedChange}
301
- label={!noLabels ? 'Correct' : ''}
302
- checked={!!data.correct}
303
- error={noCorrectAnswerError}
304
- />
305
- </StyledToggle>
306
-
307
- <StyledMiddleColumn>
308
- <EditableHtmlContainer
309
- label={!noLabels ? 'Label' : ''}
310
- value={data.label}
311
- onChange={this.onLabelChange}
312
- imageSupport={imageSupport}
313
- disableImageAlignmentButtons={disableImageAlignmentButtons}
314
- disabled={disabled}
315
- spellCheck={spellCheck}
316
- nonEmpty={nonEmpty}
317
- pluginOpts={pluginOpts}
318
- toolbarOpts={toolbarOpts}
319
- error={error}
320
- uploadSoundSupport={uploadSoundSupport}
321
- mathMlOptions={mathMlOptions}
322
- maxImageWidth={maxImageWidth}
323
- maxImageHeight={maxImageHeight}
324
- />
325
- {error && <StyledErrorText>{error}</StyledErrorText>}
326
-
327
- {allowFeedBack && (
328
- <Feedback
329
- {...data.feedback}
330
- correct={data.correct}
331
- defaults={defaultFeedback}
332
- onChange={this.onFeedbackValueChange}
333
- toolbarOpts={toolbarOpts}
334
- />
335
- )}
336
- </StyledMiddleColumn>
290
+ <StyledTopRow>
291
+ {index > 0 && (
292
+ <StyledIndex type="title">
293
+ {useLetterOrdering ? String.fromCharCode(96 + index).toUpperCase() : index}
294
+ </StyledIndex>
295
+ )}
296
+
297
+ <StyledToggle>
298
+ <InputToggle
299
+ onChange={this.onCheckedChange}
300
+ label={!noLabels ? 'Correct' : ''}
301
+ checked={!!data.correct}
302
+ error={noCorrectAnswerError}
303
+ />
304
+ </StyledToggle>
305
+
306
+ <StyledMiddleColumn>
307
+ <EditableHtmlContainer
308
+ label={!noLabels ? 'Label' : ''}
309
+ value={data.label}
310
+ onChange={this.onLabelChange}
311
+ imageSupport={imageSupport}
312
+ disableImageAlignmentButtons={disableImageAlignmentButtons}
313
+ disabled={disabled}
314
+ spellCheck={spellCheck}
315
+ nonEmpty={nonEmpty}
316
+ pluginOpts={pluginOpts}
317
+ toolbarOpts={toolbarOpts}
318
+ error={error}
319
+ uploadSoundSupport={uploadSoundSupport}
320
+ mathMlOptions={mathMlOptions}
321
+ maxImageWidth={maxImageWidth}
322
+ maxImageHeight={maxImageHeight}
323
+ />
324
+ {error && <StyledErrorText>{error}</StyledErrorText>}
337
325
 
338
326
  {allowFeedBack && (
339
- <StyledFeedback>
340
- <InputContainer label={!noLabels ? 'Feedback' : ''}>
341
- <StyledFeedbackIcon>
342
- <FeedbackMenu
343
- onChange={this.onFeedbackTypeChange}
344
- value={data.feedback}
345
- />
346
- </StyledFeedbackIcon>
347
- </InputContainer>
348
- </StyledFeedback>
349
- )}
350
-
351
- {allowDelete && (
352
- <StyledDelete>
353
- <InputContainer label={!noLabels ? 'Delete' : ''}>
354
- <StyledDeleteIcon>
355
- <IconButton
356
- aria-label="delete"
357
- onClick={onDelete}
358
- size="large">
359
- <ActionDelete />
360
- </IconButton>
361
- </StyledDeleteIcon>
362
- </InputContainer>
363
- </StyledDelete>
327
+ <Feedback
328
+ {...data.feedback}
329
+ correct={data.correct}
330
+ defaults={defaultFeedback}
331
+ onChange={this.onFeedbackValueChange}
332
+ toolbarOpts={toolbarOpts}
333
+ />
364
334
  )}
365
- </StyledTopRow>
335
+ </StyledMiddleColumn>
336
+
337
+ {allowFeedBack && (
338
+ <StyledFeedback>
339
+ <InputContainer label={!noLabels ? 'Feedback' : ''}>
340
+ <StyledFeedbackIcon>
341
+ <FeedbackMenu onChange={this.onFeedbackTypeChange} value={data.feedback} />
342
+ </StyledFeedbackIcon>
343
+ </InputContainer>
344
+ </StyledFeedback>
345
+ )}
346
+
347
+ {allowDelete && (
348
+ <StyledDelete>
349
+ <InputContainer label={!noLabels ? 'Delete' : ''}>
350
+ <StyledDeleteIcon>
351
+ <IconButton aria-label="delete" onClick={onDelete} size="large">
352
+ <ActionDelete />
353
+ </IconButton>
354
+ </StyledDeleteIcon>
355
+ </InputContainer>
356
+ </StyledDelete>
357
+ )}
358
+ </StyledTopRow>
366
359
  );
367
360
  }
368
361
  }
@@ -4,15 +4,11 @@ import React from 'react';
4
4
  import { FeedbackSelector } from '../feedback-selector';
5
5
 
6
6
  // Mock the editable-html component to avoid window dependencies in tests
7
- jest.mock('@pie-lib/editable-html', () => {
7
+ jest.mock('@pie-lib/editable-html-tip-tap', () => {
8
8
  return {
9
9
  __esModule: true,
10
10
  default: ({ markup, onChange }) => (
11
- <textarea
12
- data-testid="editable-html"
13
- defaultValue={markup || ''}
14
- onChange={(e) => onChange(e.target.value)}
15
- />
11
+ <textarea data-testid="editable-html" defaultValue={markup || ''} onChange={(e) => onChange(e.target.value)} />
16
12
  ),
17
13
  };
18
14
  });
@@ -21,13 +17,7 @@ describe('feedback-selector', () => {
21
17
  let onChange;
22
18
 
23
19
  const renderComponent = (feedback = { type: 'default', default: 'hi' }) => {
24
- return render(
25
- <FeedbackSelector
26
- label={'Feedback'}
27
- onChange={onChange}
28
- feedback={feedback}
29
- />
30
- );
20
+ return render(<FeedbackSelector label={'Feedback'} onChange={onChange} feedback={feedback} />);
31
21
  };
32
22
 
33
23
  beforeEach(() => {
@@ -1,16 +1,15 @@
1
- //import EditableHTML from '@pie-lib/editable-html';
1
+ //import EditableHTML from '@pie-lib/editable-html-tip-tap';
2
2
  import { InputContainer } from '@pie-lib/render-ui';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
  import { styled } from '@mui/material/styles';
6
6
  import Group from './group';
7
7
 
8
-
9
8
  // - mathquill error window not defined
10
9
  let EditableHtml;
11
10
  let StyledEditableHTML;
12
11
  if (typeof window !== 'undefined') {
13
- EditableHtml = require('@pie-lib/editable-html')['default'];
12
+ EditableHtml = require('@pie-lib/editable-html-tip-tap')['default'];
14
13
  StyledEditableHTML = styled(EditableHtml)(({ theme }) => ({
15
14
  fontFamily: theme.typography.fontFamily,
16
15
  }));
@@ -87,10 +86,7 @@ export class FeedbackSelector extends React.Component {
87
86
 
88
87
  return (
89
88
  <StyledFeedbackSelector>
90
- <StyledInputContainer
91
- label={label}
92
- extraClasses={{ label: { transform: 'translateY(-20%)' } }}
93
- >
89
+ <StyledInputContainer label={label} extraClasses={{ label: { transform: 'translateY(-20%)' } }}>
94
90
  <StyledGroup
95
91
  keys={feedbackKeys}
96
92
  label={label}
@@ -5,7 +5,6 @@ import { withContentRect } from 'react-measure';
5
5
  import PropTypes from 'prop-types';
6
6
  import LayoutContents from './layout-contents';
7
7
  import SettingsBox from './settings-box';
8
- import { AppendCSSRules } from '@pie-lib/render-ui';
9
8
 
10
9
  const theme = createTheme({
11
10
  typography: {
@@ -26,7 +25,7 @@ const theme = createTheme({
26
25
  },
27
26
  });
28
27
 
29
- class MeasuredConfigLayout extends AppendCSSRules {
28
+ class MeasuredConfigLayout extends React.Component {
30
29
  static propTypes = {
31
30
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
32
31
  className: PropTypes.string,
@@ -34,6 +33,10 @@ class MeasuredConfigLayout extends AppendCSSRules {
34
33
  settings: PropTypes.element,
35
34
  sidePanelMinWidth: PropTypes.number,
36
35
  hideSettings: PropTypes.bool,
36
+ extraCSSRules: PropTypes.shape({
37
+ names: PropTypes.arrayOf(PropTypes.string),
38
+ rules: PropTypes.string,
39
+ }),
37
40
  };
38
41
 
39
42
  static defaultProps = {
@@ -69,16 +72,20 @@ class MeasuredConfigLayout extends AppendCSSRules {
69
72
  <ThemeProvider theme={theme}>
70
73
  <Measure bounds onResize={this.onResize}>
71
74
  {({ measureRef }) => {
72
- const { children, settings, hideSettings, dimensions } = this.props;
75
+ const { children, settings, hideSettings, dimensions, extraCSSRules } = this.props;
73
76
  const { layoutMode } = this.state;
74
77
 
75
78
  const settingsPanel =
76
79
  layoutMode === 'inline' ? <SettingsBox className="settings-box">{settings}</SettingsBox> : settings;
77
80
  const secondaryContent = hideSettings ? null : settingsPanel;
78
- const finalClass = 'main-container';
81
+ const finalClass = 'main-container extraCSSRules';
79
82
 
80
83
  return (
81
84
  <div ref={measureRef} className={finalClass}>
85
+ {extraCSSRules?.rules ? (
86
+ <style dangerouslySetInnerHTML={{ __html: `.extraCSSRules { ${extraCSSRules.rules} }` }} />
87
+ ) : null}
88
+
82
89
  <LayoutContents mode={layoutMode} secondary={secondaryContent} dimensions={dimensions}>
83
90
  {children}
84
91
  </LayoutContents>
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _propTypes = _interopRequireDefault(require("prop-types"));
10
- var _material = require("@mui/material");
11
- var _styles = require("@mui/material/styles");
12
- var StyledDialogTitle = (0, _styles.styled)(_material.DialogTitle)(function () {
13
- return {
14
- fontSize: 'max(1.25rem, 18px)'
15
- };
16
- });
17
- var StyledDialogContentText = (0, _styles.styled)(_material.DialogContentText)(function () {
18
- return {
19
- fontSize: 'max(1rem, 14px)'
20
- };
21
- });
22
- var AlertDialog = function AlertDialog(_ref) {
23
- var text = _ref.text,
24
- title = _ref.title,
25
- onClose = _ref.onClose,
26
- onConfirm = _ref.onConfirm,
27
- open = _ref.open,
28
- onCloseText = _ref.onCloseText,
29
- onConfirmText = _ref.onConfirmText,
30
- disableAutoFocus = _ref.disableAutoFocus,
31
- disableEnforceFocus = _ref.disableEnforceFocus,
32
- disableRestoreFocus = _ref.disableRestoreFocus;
33
- return /*#__PURE__*/_react["default"].createElement(_material.Dialog, {
34
- open: open,
35
- disableAutoFocus: disableAutoFocus,
36
- disableEnforceFocus: disableEnforceFocus,
37
- disableRestoreFocus: disableRestoreFocus,
38
- onClose: onClose
39
- }, title && /*#__PURE__*/_react["default"].createElement(StyledDialogTitle, null, title), text && /*#__PURE__*/_react["default"].createElement(_material.DialogContent, null, /*#__PURE__*/_react["default"].createElement(StyledDialogContentText, null, text)), /*#__PURE__*/_react["default"].createElement(_material.DialogActions, null, onClose && /*#__PURE__*/_react["default"].createElement(_material.Button, {
40
- onClick: onClose,
41
- color: "primary"
42
- }, onCloseText), onConfirm && /*#__PURE__*/_react["default"].createElement(_material.Button, {
43
- autoFocus: true,
44
- onClick: onConfirm,
45
- color: "primary"
46
- }, onConfirmText)));
47
- };
48
- AlertDialog.defaultProps = {
49
- onCloseText: 'CANCEL',
50
- onConfirmText: 'OK',
51
- disableAutoFocus: false,
52
- disableEnforceFocus: false,
53
- disableRestoreFocus: false
54
- };
55
- AlertDialog.propTypes = {
56
- text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
57
- title: _propTypes["default"].string,
58
- onClose: _propTypes["default"].func,
59
- onConfirm: _propTypes["default"].func,
60
- open: _propTypes["default"].bool,
61
- onConfirmText: _propTypes["default"].string,
62
- onCloseText: _propTypes["default"].string,
63
- disableAutoFocus: _propTypes["default"].bool,
64
- disableEnforceFocus: _propTypes["default"].bool,
65
- disableRestoreFocus: _propTypes["default"].bool
66
- };
67
- var _default = exports["default"] = AlertDialog;
68
- //# sourceMappingURL=alert-dialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert-dialog.js","names":["_react","_interopRequireDefault","require","_propTypes","_material","_styles","StyledDialogTitle","styled","DialogTitle","fontSize","StyledDialogContentText","DialogContentText","AlertDialog","_ref","text","title","onClose","onConfirm","open","onCloseText","onConfirmText","disableAutoFocus","disableEnforceFocus","disableRestoreFocus","createElement","Dialog","DialogContent","DialogActions","Button","onClick","color","autoFocus","defaultProps","propTypes","PropTypes","oneOfType","string","object","func","bool","_default","exports"],"sources":["../src/alert-dialog.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';\nimport { styled } from '@mui/material/styles';\n\nconst StyledDialogTitle = styled(DialogTitle)(() => ({\n fontSize: 'max(1.25rem, 18px)',\n}));\n\nconst StyledDialogContentText = styled(DialogContentText)(() => ({\n fontSize: 'max(1rem, 14px)',\n}));\n\nconst AlertDialog = ({ text, title, onClose, onConfirm, open, onCloseText, onConfirmText, disableAutoFocus, disableEnforceFocus, disableRestoreFocus }) => (\n <Dialog open={open} disableAutoFocus={disableAutoFocus} disableEnforceFocus={disableEnforceFocus} disableRestoreFocus={disableRestoreFocus} onClose={onClose}>\n {title && <StyledDialogTitle>{title}</StyledDialogTitle>}\n {text && (\n <DialogContent>\n <StyledDialogContentText>{text}</StyledDialogContentText>\n </DialogContent>\n )}\n <DialogActions>\n {onClose && (\n <Button onClick={onClose} color=\"primary\">\n {onCloseText}\n </Button>\n )}\n {onConfirm && (\n <Button autoFocus onClick={onConfirm} color=\"primary\">\n {onConfirmText}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n);\n\nAlertDialog.defaultProps = {\n onCloseText: 'CANCEL',\n onConfirmText: 'OK',\n disableAutoFocus: false,\n disableEnforceFocus: false,\n disableRestoreFocus: false,\n};\n\nAlertDialog.propTypes = {\n text: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n title: PropTypes.string,\n onClose: PropTypes.func,\n onConfirm: PropTypes.func,\n open: PropTypes.bool,\n onConfirmText: PropTypes.string,\n onCloseText: PropTypes.string,\n disableAutoFocus: PropTypes.bool,\n disableEnforceFocus: PropTypes.bool,\n disableRestoreFocus: PropTypes.bool,\n};\n\nexport default AlertDialog;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GA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AO,iBACNhB,MAAA,YAAAwB,aAAA,CAACpB,SAAA,CAAAwB,MAAM;IAACC,OAAO,EAAEb,OAAQ;IAACc,KAAK,EAAC;EAAS,GACtCX,WACK,CACT,EACAF,SAAS,iBACRjB,MAAA,YAAAwB,aAAA,CAACpB,SAAA,CAAAwB,MAAM;IAACG,SAAS;IAACF,OAAO,EAAEZ,SAAU;IAACa,KAAK,EAAC;EAAS,GAClDV,aACK,CAEG,CACT,CAAC;AAAA,CACV;AAEDR,WAAW,CAACoB,YAAY,GAAG;EACzBb,WAAW,EAAE,QAAQ;EACrBC,aAAa,EAAE,IAAI;EACnBC,gBAAgB,EAAE,KAAK;EACvBC,mBAAmB,EAAE,KAAK;EAC1BC,mBAAmB,EAAE;AACvB,CAAC;AAEDX,WAAW,CAACqB,SAAS,GAAG;EACtBnB,IAAI,EAAEoB,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,MAAM,CAAC,CAAC;EAC/DtB,KAAK,EAAEmB,qBAAS,CAACE,MAAM;EACvBpB,OAAO,EAAEkB,qBAAS,CAACI,IAAI;EACvBrB,SAAS,EAAEiB,qBAAS,CAACI,IAAI;EACzBpB,IAAI,EAAEgB,qBAAS,CAACK,IAAI;EACpBnB,aAAa,EAAEc,qBAAS,CAACE,MAAM;EAC/BjB,WAAW,EAAEe,qBAAS,CAACE,MAAM;EAC7Bf,gBAAgB,EAAEa,qBAAS,CAACK,IAAI;EAChCjB,mBAAmB,EAAEY,qBAAS,CAACK,IAAI;EACnChB,mBAAmB,EAAEW,qBAAS,CAACK;AACjC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEa7B,WAAW","ignoreList":[]}
package/lib/checkbox.js DELETED
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
10
- var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
11
- var _propTypes = _interopRequireDefault(require("prop-types"));
12
- var _react = _interopRequireDefault(require("react"));
13
- var _styles = require("@mui/material/styles");
14
- var _renderUi = require("@pie-lib/render-ui");
15
- var _colors = require("@mui/material/colors");
16
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
- var StyledFormControlLabel = (0, _styles.styled)(_FormControlLabel["default"])(function (_ref) {
19
- var theme = _ref.theme,
20
- mini = _ref.mini;
21
- return {
22
- margin: 0,
23
- marginLeft: 0,
24
- padding: 0,
25
- '& .MuiFormControlLabel-label': _objectSpread({
26
- fontSize: theme.typography.fontSize - 1,
27
- transform: 'translate(-4%, 2%)',
28
- color: 'rgba(0,0,0,1.0)'
29
- }, mini && {
30
- marginLeft: theme.spacing(1),
31
- color: _colors.grey[700],
32
- fontSize: theme.typography.fontSize - 3
33
- })
34
- };
35
- });
36
- var StyledCheckbox = (0, _styles.styled)(_Checkbox["default"])(function (_ref2) {
37
- var theme = _ref2.theme,
38
- mini = _ref2.mini,
39
- error = _ref2.error;
40
- return _objectSpread(_objectSpread({
41
- color: "".concat(_renderUi.color.tertiary(), " !important")
42
- }, mini && {
43
- margin: 0,
44
- padding: 0,
45
- width: theme.spacing(3),
46
- height: theme.spacing(3)
47
- }), error && {
48
- color: "".concat(theme.palette.error.main, " !important")
49
- });
50
- });
51
- var Checkbox = function Checkbox(_ref3) {
52
- var mini = _ref3.mini,
53
- checked = _ref3.checked,
54
- onChange = _ref3.onChange,
55
- value = _ref3.value,
56
- label = _ref3.label,
57
- error = _ref3.error;
58
- return /*#__PURE__*/_react["default"].createElement(StyledFormControlLabel, {
59
- mini: mini,
60
- control: /*#__PURE__*/_react["default"].createElement(StyledCheckbox, {
61
- checked: checked,
62
- onChange: onChange,
63
- value: value,
64
- mini: mini,
65
- error: error
66
- }),
67
- label: label
68
- });
69
- };
70
- Checkbox.propTypes = {
71
- mini: _propTypes["default"].bool,
72
- checked: _propTypes["default"].bool.isRequired,
73
- onChange: _propTypes["default"].func.isRequired,
74
- value: _propTypes["default"].string,
75
- label: _propTypes["default"].string.isRequired,
76
- error: _propTypes["default"].bool
77
- };
78
- Checkbox.defaultProps = {
79
- value: '',
80
- mini: false,
81
- error: false
82
- };
83
- var _default = exports["default"] = Checkbox;
84
- //# sourceMappingURL=checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.js","names":["_FormControlLabel","_interopRequireDefault","require","_Checkbox","_propTypes","_react","_styles","_renderUi","_colors","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","StyledFormControlLabel","styled","FormControlLabel","_ref","theme","mini","margin","marginLeft","padding","fontSize","typography","transform","color","spacing","grey","StyledCheckbox","MuiCheckbox","_ref2","error","concat","tertiary","width","height","palette","main","Checkbox","_ref3","checked","onChange","value","label","createElement","control","propTypes","PropTypes","bool","isRequired","func","string","defaultProps","_default","exports"],"sources":["../src/checkbox.jsx"],"sourcesContent":["import FormControlLabel from '@mui/material/FormControlLabel';\nimport MuiCheckbox from '@mui/material/Checkbox';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\nimport { grey } from '@mui/material/colors';\n\nconst StyledFormControlLabel = styled(FormControlLabel)(({ theme, mini }) => ({\n margin: 0,\n marginLeft: 0,\n padding: 0,\n '& .MuiFormControlLabel-label': {\n fontSize: theme.typography.fontSize - 1,\n transform: 'translate(-4%, 2%)',\n color: 'rgba(0,0,0,1.0)',\n ...(mini && {\n marginLeft: theme.spacing(1),\n color: grey[700],\n fontSize: theme.typography.fontSize - 3,\n }),\n },\n}));\n\nconst StyledCheckbox = styled(MuiCheckbox)(({ theme, mini, error }) => ({\n color: `${color.tertiary()} !important`,\n ...(mini && {\n margin: 0,\n padding: 0,\n width: theme.spacing(3),\n height: theme.spacing(3),\n }),\n ...(error && {\n color: `${theme.palette.error.main} !important`,\n }),\n}));\n\nconst Checkbox = ({ mini, checked, onChange, value, label, error }) => (\n <StyledFormControlLabel\n mini={mini}\n control={\n <StyledCheckbox\n checked={checked}\n onChange={onChange}\n value={value}\n mini={mini}\n error={error}\n />\n }\n label={label}\n />\n);\n\nCheckbox.propTypes = {\n mini: PropTypes.bool,\n checked: PropTypes.bool.isRequired,\n onChange: PropTypes.func.isRequired,\n value: PropTypes.string,\n label: PropTypes.string.isRequired,\n error: PropTypes.bool,\n};\n\nCheckbox.defaultProps = {\n value: '',\n mini: false,\n error: false,\n};\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAA4C,SAAAO,QAAAC,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