react-bootstrap-front 3.7.3 → 3.7.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.
Files changed (32) hide show
  1. package/CHANGELOG +22 -0
  2. package/dist/react-bootstrap-front.js +16 -26
  3. package/package.json +4 -12
  4. package/src/features/advanced/DefaultQuickSearch.js +17 -3
  5. package/src/features/advanced/DropdownWrapper.js +5 -8
  6. package/src/features/advanced/ResponsiveModalInner.js +38 -15
  7. package/src/features/advanced/ResponsiveModalInner.scss +7 -1
  8. package/src/features/basic/CalmButton.js +3 -3
  9. package/src/features/basic/InputJson.js +1 -0
  10. package/src/features/basic/ResponsiveButton.js +3 -3
  11. package/src/features/basic/index.js +1 -3
  12. package/src/features/basic/style.scss +0 -3
  13. package/src/features/draft/ColorPicker.js +50 -0
  14. package/src/features/draft/ColorPicker.scss +0 -0
  15. package/src/features/draft/FontSize.js +71 -0
  16. package/src/features/draft/FontSize.scss +0 -0
  17. package/src/features/draft/Inline.js +43 -0
  18. package/src/features/draft/Inline.scss +0 -0
  19. package/src/features/{basic/InputTextarea.js → draft/InputHtml.js} +25 -53
  20. package/src/features/draft/InputHtml.scss +8 -0
  21. package/src/features/draft/index.js +4 -0
  22. package/src/features/draft/style.scss +4 -0
  23. package/src/features/helpers/index.js +13 -3
  24. package/src/features/list/DefaultLine.jsx +17 -2
  25. package/src/features/list/DefaultList.jsx +1 -1
  26. package/src/features/list/MobileLine.jsx +45 -37
  27. package/src/index.js +7 -2
  28. package/src/styles/index.scss +1 -0
  29. package/src/styles/look2.scss +62 -13
  30. package/src/features/basic/InputTextarea.scss +0 -3
  31. package/src/features/basic/InputTextareaHtml.js +0 -175
  32. package/src/features/basic/InputTextareaHtml.scss +0 -6
@@ -0,0 +1,4 @@
1
+ export { default as ColorPicker } from "./ColorPicker";
2
+ export { default as FontSize } from "./FontSize";
3
+ export { default as Inline } from "./Inline";
4
+ export { default as InputHtml } from "./InputHtml";
@@ -0,0 +1,4 @@
1
+ @import './ColorPicker';
2
+ @import './FontSize';
3
+ @import './Inline';
4
+ @import './InputHtml';
@@ -132,16 +132,26 @@ export const ensureDatetimeTZ = date => {
132
132
  export const getBreakpointAsSize = p_size => {
133
133
  const size = p_size || 'xxs';
134
134
  switch (size.toLowerCase()) {
135
+ case 'xxl':
136
+ return 1800;
135
137
  case 'xl':
136
138
  return 1600;
139
+ case 'xlg':
140
+ return 1400;
137
141
  case 'lg':
138
142
  return 1200;
143
+ case 'xmd':
144
+ return 1100;
139
145
  case 'md':
140
- return 1024;
146
+ return 1000;
147
+ case 'xsm':
148
+ return 900;
141
149
  case 'sm':
142
- return 768;
150
+ return 800;
143
151
  case 'xs':
144
- return 540;
152
+ return 600;
153
+ case 'xxs':
154
+ return 500;
145
155
  default:
146
156
  return 360;
147
157
  }
@@ -49,10 +49,12 @@ export default class DesktopListLine extends Component {
49
49
  super(props);
50
50
  this.state = {
51
51
  flipped: false,
52
+ clicked: false,
52
53
  };
53
54
  this.mouseLeave = this.mouseLeave.bind(this);
54
55
  this.mouseEnter = this.mouseEnter.bind(this);
55
56
  this.handleDoubleClick = this.handleDoubleClick.bind(this);
57
+ this.handleClick = this.handleClick.bind(this);
56
58
  }
57
59
 
58
60
  mouseLeave() {
@@ -78,6 +80,17 @@ export default class DesktopListLine extends Component {
78
80
  return false;
79
81
  }
80
82
 
83
+ handleClick(ev) {
84
+ if (ev) {
85
+ ev.preventDefault();
86
+ }
87
+ if (!this.state.clicked) {
88
+ this.setState({clicked: true});
89
+ setTimeout(() => { this.setState({clicked: false}); }, 500);
90
+ this.props.onClick(this.props.item);
91
+ }
92
+ }
93
+
81
94
  render() {
82
95
  const { item } = this.props;
83
96
  let rowOddEven = 'row-no-odd-even';
@@ -88,9 +101,11 @@ export default class DesktopListLine extends Component {
88
101
  <div className={this.props.className}>
89
102
  <HoverObserver onMouseEnter={this.mouseEnter} onMouseLeave={this.mouseLeave}>
90
103
  <div
91
- onDoubleClick={this.handleDoubleClick}
104
+ onDoubleClick={ev => {
105
+ this.handleDoubleClick(ev);
106
+ }}
92
107
  onClick={ev => {
93
- this.props.onClick(item);
108
+ this.handleClick(ev);
94
109
  }}
95
110
  style={mystyle}
96
111
  className={classnames(
@@ -516,7 +516,7 @@ export default class DefaultList extends Component {
516
516
  >
517
517
  <div className="row">
518
518
  <div className="col-xxs-w36">
519
- <div className="p-2">{this.props.inlineComponent}</div>
519
+ {this.props.inlineComponent}
520
520
  </div>
521
521
  </div>
522
522
  </TouchHandler>
@@ -60,12 +60,14 @@ export class MobileLine extends Component {
60
60
  super(props);
61
61
  this.state = {
62
62
  flipped: false,
63
+ clicked: false,
63
64
  };
64
65
  this.mouseLeave = this.mouseLeave.bind(this);
65
66
  this.mouseEnter = this.mouseEnter.bind(this);
66
67
  this.openMenu = this.openMenu.bind(this);
67
68
  this.closeMenu = this.closeMenu.bind(this);
68
69
  this.handleDoubleClick = this.handleDoubleClick.bind(this);
70
+ this.handleClick = this.handleClick.bind(this);
69
71
  }
70
72
 
71
73
  mouseLeave() {
@@ -92,6 +94,40 @@ export class MobileLine extends Component {
92
94
  this.setState({ flipped: false });
93
95
  }
94
96
 
97
+ handleClick(ev) {
98
+ if (ev) {
99
+ ev.preventDefault();
100
+ }
101
+ if (!this.state.clicked) {
102
+ this.setState({clicked: true});
103
+ setTimeout(() => { this.setState({clicked: false}); }, 500);
104
+ if (this.props.forSelectOne) {
105
+ this.props.onSelect(this.props.item);
106
+ } else {
107
+ if (isMobileDevice()) {
108
+ if (!this.props.mobile) {
109
+ this.closeMenu();
110
+ this.props.onClick(this.props.item);
111
+ } else {
112
+ if (this.props.item.id === this.props.currentFlipped) {
113
+ this.closeMenu();
114
+ this.handleDoubleClick(ev);
115
+ } else {
116
+ this.closeMenu();
117
+ this.props.onClick(this.props.item);
118
+ }
119
+ }
120
+ } else {
121
+ this.props.onClick(this.props.item);
122
+ }
123
+ }
124
+ } else {
125
+ if (ev) {
126
+ ev.stopPropagation();
127
+ }
128
+ }
129
+ }
130
+
95
131
  handleDoubleClick(ev) {
96
132
  if (ev) {
97
133
  ev.preventDefault();
@@ -99,16 +135,11 @@ export class MobileLine extends Component {
99
135
  if (window.getSelection) {
100
136
  window.getSelection().removeAllRanges();
101
137
  }
102
- if (this.props.forSelectOne) {
103
- this.props.onSelect(this.props.item);
104
- } else {
105
- this.props.inlineActions.forEach(action => {
106
- if (action.role === 'MODIFY') {
107
- action.onClick(this.props.id);
108
- }
109
- });
110
- }
111
- return false;
138
+ this.props.inlineActions.forEach(action => {
139
+ if (action.role === 'MODIFY') {
140
+ action.onClick(this.props.id);
141
+ }
142
+ });
112
143
  }
113
144
 
114
145
  render() {
@@ -132,27 +163,11 @@ export class MobileLine extends Component {
132
163
  <div className="col-xxs-w36">
133
164
  <div
134
165
  className="card card-mobile-line"
166
+ onDoubleClick={ev => {
167
+ this.handleDoubleClick(ev);
168
+ }}
135
169
  onClick={ev => {
136
- if (this.props.forSelectOne) {
137
- this.props.onSelect(this.props.item);
138
- } else {
139
- if (isMobileDevice()) {
140
- if (!this.props.mobile) {
141
- this.closeMenu();
142
- this.props.onClick(this.props.item);
143
- } else {
144
- if (this.props.item.id === this.props.currentFlipped) {
145
- this.closeMenu();
146
- this.handleDoubleClick(ev);
147
- } else {
148
- this.closeMenu();
149
- this.props.onClick(this.props.item);
150
- }
151
- }
152
- } else {
153
- this.props.onClick(this.props.item);
154
- }
155
- }
170
+ this.handleClick(ev);
156
171
  }}
157
172
  >
158
173
  <HoverObserver onMouseEnter={this.mouseEnter} onMouseLeave={this.mouseLeave}>
@@ -173,13 +188,6 @@ export class MobileLine extends Component {
173
188
  'select-line border border-secondary mr-2 white',
174
189
  this.props.selected.find(elem => elem === this.props.id) && 'selected'
175
190
  )}
176
- onClick={ev => {
177
- if (ev) {
178
- ev.preventDefault();
179
- ev.stopPropagation();
180
- }
181
- this.props.onSelect(this.props.id);
182
- }}
183
191
  >
184
192
  <div className="select-line-inner bg-secondary" />
185
193
  </div>
package/src/index.js CHANGED
@@ -37,8 +37,6 @@ export { default as InputSelect } from "./features/basic/InputSelect";
37
37
  export { default as InputSpin } from "./features/basic/InputSpin";
38
38
  export { default as InputStringarray } from "./features/basic/InputStringarray";
39
39
  export * from "./features/basic/InputText";
40
- export { default as InputTextarea } from "./features/basic/InputTextarea";
41
- export { default as InputTextareaHtml } from "./features/basic/InputTextareaHtml";
42
40
  export { default as InputCheckList } from "./features/basic/InputCheckList";
43
41
  export { default as InputCheckLists } from "./features/basic/InputCheckLists";
44
42
  export { default as InputKeywords } from "./features/basic/InputKeywords";
@@ -73,6 +71,13 @@ export { default as SvgNext } from "./features/advanced/SvgNext";
73
71
  export { default as SvgToday } from "./features/advanced/SvgToday";
74
72
  export { default as WidthObserver } from "./features/advanced/WidthObserver";
75
73
 
74
+ /**
75
+ *******************************************************************************
76
+ * Draft
77
+ *******************************************************************************
78
+ */
79
+ export * from "./features/draft/index.js";
80
+
76
81
  /**
77
82
  *******************************************************************************
78
83
  * Page
@@ -3,6 +3,7 @@
3
3
 
4
4
  @import '../features/advanced/style';
5
5
  @import '../features/basic/style';
6
+ @import '../features/draft/style';
6
7
  @import '../features/filter/style';
7
8
  @import '../features/grid/style';
8
9
  @import '../features/inline-list/style';
@@ -206,21 +206,70 @@ svg.text-warning.inline-action:hover {
206
206
  }
207
207
  }
208
208
 
209
- .modal-xl {
210
- .modal-body {
211
- min-height: 550px;
209
+ .modal-dialog {
210
+ &.modal-w-xxl {
211
+ width: 1800px;
212
+ max-width: 1800px;
213
+ .modal-body {
214
+ min-height: 550px;
215
+ max-height: 650px;
216
+ }
212
217
  }
213
- }
214
-
215
- .modal-lg {
216
- .modal-body {
217
- min-height: 450px;
218
+ &.modal-w-xl {
219
+ width: 1600px;
220
+ max-width: 1600px;
221
+ .modal-body {
222
+ min-height: 550px;
223
+ max-height: 650px;
224
+ }
218
225
  }
219
- }
220
-
221
- .modal-md {
222
- .modal-body {
223
- min-height: 350px;
226
+ &.modal-w-xlg {
227
+ width: 1400px;
228
+ max-width: 1400px;
229
+ .modal-body {
230
+ min-height: 450px;
231
+ max-height: 550px;
232
+ }
233
+ }
234
+ &.modal-w-lg {
235
+ width: 1200px;
236
+ max-width: 1200px;
237
+ .modal-body {
238
+ min-height: 450px;
239
+ max-height: 550px;
240
+ }
241
+ }
242
+ &.modal-w-xmd {
243
+ width: 1100px;
244
+ max-width: 1100px;
245
+ .modal-body {
246
+ min-height: 350px;
247
+ max-height: 450px;
248
+ }
249
+ }
250
+ &.modal-w-md {
251
+ width: 1000px;
252
+ max-width: 1000px;
253
+ .modal-body {
254
+ min-height: 350px;
255
+ max-height: 450px;
256
+ }
257
+ }
258
+ &.modal-w-xsm {
259
+ width: 900px;
260
+ max-width: 900px;
261
+ }
262
+ &.modal-w-sm {
263
+ width: 800px;
264
+ max-width: 800px;
265
+ }
266
+ &.modal-w-xs {
267
+ width: 600px;
268
+ max-width: 600px;
269
+ }
270
+ &.modal-w-xxs {
271
+ width: 500px;
272
+ max-width: 500px;
224
273
  }
225
274
  }
226
275
 
@@ -1,3 +0,0 @@
1
- .public-DraftStyleDefault-block {
2
- margin: 0;
3
- }
@@ -1,175 +0,0 @@
1
- import React, { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import classnames from 'classnames';
4
- import { HtmlEditor, Toolbar, Editor } from '@aeaton/react-prosemirror'
5
- import { plugins, schema, toolbar } from '@aeaton/react-prosemirror-config-default'
6
-
7
- const myStyle = {
8
- height: 'auto',
9
- };
10
- const appenStyle = {
11
- maxHeight: '40px',
12
- };
13
-
14
- export default class InputTextareaHtml extends Component {
15
- static propTypes = {
16
- id: PropTypes.string,
17
- name: PropTypes.string.isRequired,
18
- label: PropTypes.string,
19
- value: PropTypes.string,
20
- size: PropTypes.string,
21
- labelTop: PropTypes.bool,
22
- onChange: PropTypes.func,
23
- required: PropTypes.bool,
24
- disabled: PropTypes.bool,
25
- clearIcon: PropTypes.element,
26
- toolbarIcon: PropTypes.element,
27
- presetTextIcon: PropTypes.element,
28
- onPresetText: PropTypes.func,
29
- };
30
-
31
- static defaultProps = {
32
- labelTop: true,
33
- value: '',
34
- label: '',
35
- id: '',
36
- size: '',
37
- onChange: () => {},
38
- disabled: false,
39
- required: false,
40
- clearIcon: null,
41
- toolbarIcon: null,
42
- presetTextIcon: null,
43
- onPresetText: null,
44
- };
45
-
46
-
47
- constructor(props) {
48
- super(props);
49
- this.state = {
50
- toolbar: false,
51
- myRef: React.createRef(),
52
- presetText: false,
53
- };
54
- this.onToolbar = this.onToolbar.bind(this);
55
- this.onClear = this.onClear.bind(this);
56
- this.onChange = this.onChange.bind(this);
57
- }
58
-
59
- onToolbar() {
60
- this.setState({ toolbar: !this.state.toolbar });
61
- }
62
-
63
- onClear() {
64
- const event = {
65
- target: {
66
- name: this.props.name,
67
- value: null,
68
- },
69
- };
70
- this.props.onChange(event);
71
- }
72
-
73
- onChange(content) {
74
- const event = {
75
- target: {
76
- name: this.props.name,
77
- value: content,
78
- },
79
- };
80
- this.props.onChange(event);
81
- }
82
-
83
- render() {
84
- let content = '';
85
- if (this.props.value) {
86
- content = this.props.value;
87
- } else {
88
- content = '<p/>';
89
- }
90
- return (
91
- <div className={classnames('form-group', !this.props.labelTop && 'row')}>
92
- {this.props.label !== '' && (
93
- <label htmlFor={this.props.id} className={classnames(!this.props.labelTop && 'col-xxs-w6 col-form-label')}>
94
- {this.props.label}
95
- {this.props.required && <span>&nbsp;*</span>}
96
- </label>
97
- )}
98
- <div className={classnames(!this.props.labelTop && 'col-xxs-w30')}>
99
- <div
100
- className={classnames('input-group', (this.props.error || this.props.warning) && 'is-invalid')}
101
- style={myStyle}
102
- >
103
- <div className="form-control border-rbf h-auto">
104
- <HtmlEditor
105
- schema={schema}
106
- plugins={plugins}
107
- value={content}
108
- handleChange={this.onChange}
109
- debounce={250}
110
- >
111
- {this.state.toolbar && <Toolbar toolbar={toolbar} />}
112
- <Editor autoFocus />
113
- </HtmlEditor>
114
- </div>
115
- <div className="input-group-append" style={appenStyle}>
116
- {this.props.presetTextIcon && (
117
- <>
118
- <button
119
- type="button"
120
- className={classnames(
121
- 'btn btn-input btn-outline-rbf bg-light',
122
- this.props.size === 'sm' && `btn-${this.props.size}`
123
- )}
124
- onClick={this.onPresetText}
125
- ref={this.state.myRef}
126
- >
127
- {this.props.presetTextIcon}
128
- </button>
129
- {this.props.presetTexts && this.props.presetTexts.length > 0 && this.state.presetText && (
130
- <Dropdown
131
- align="bottom-right"
132
- myRef={this.state.myRef}
133
- maxHeight="250px"
134
- onClose={this.onPresetTextClose}
135
- >
136
- <DropdownMenu>
137
- {Array.isArray(this.props.presetTexts) &&
138
- this.props.presetTexts.map(text => {
139
- return (
140
- <DropdownMenuOption
141
- key={`text-${text.id}`}
142
- label={text.text_code}
143
- onClick={() => {
144
- this.onAddPresetText(text.text_content);
145
- }}
146
- />
147
- );
148
- })}
149
- </DropdownMenu>
150
- </Dropdown>
151
- )}
152
- </>
153
- )}
154
- <button
155
- type="button"
156
- className={classnames(
157
- 'btn btn-input btn-outline-rbf bg-light',
158
- this.props.size === 'sm' && `btn-${this.props.size}`
159
- )}
160
- onClick={this.onToolbar}
161
- >
162
- {this.props.toolbarIcon}
163
- </button>
164
- </div>
165
- </div>
166
- {this.props.help && this.props.help !== '' && (
167
- <small className="form-text text-muted">{this.props.help}</small>
168
- )}
169
- {this.props.error && <div className="invalid-feedback">{this.props.error}</div>}
170
- {this.props.warning && <div className="invalid-feedback">{this.props.warning}</div>}
171
- </div>
172
- </div>
173
- );
174
- }
175
- }
@@ -1,6 +0,0 @@
1
- .rbf-input-textarea-light {
2
- margin: 0;
3
- }
4
- .rbf-quill {
5
- height: fit-content;
6
- }