Skip to content

Commit edeccfb

Browse files
authored
Merge pull request #93 from webdev-dev/master
FormFields: Added preview class name instead of styling on disabled.
2 parents a0866bb + dfd94ce commit edeccfb

34 files changed

Lines changed: 269 additions & 42 deletions

dist/_wfui-react.scss

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,59 +2187,59 @@ div.ReactTags__suggestions ul li.ReactTags__activeSuggestion {
21872187
cursor: pointer; }
21882188

21892189
/* Styles for disabled fields */
2190-
.wfui-form-disabled .wfui-form-description {
2190+
.wfui-form-preview .wfui-form-description {
21912191
display: none; }
21922192

2193-
.wfui-form-disabled .wfui-form-photo input,
2194-
.wfui-form-disabled .wfui-form-input input,
2195-
.wfui-form-disabled .wfui-form-textarea textarea {
2193+
.wfui-form-preview .wfui-form-photo input,
2194+
.wfui-form-preview .wfui-form-input input,
2195+
.wfui-form-preview .wfui-form-textarea textarea {
21962196
background: none;
21972197
border: none;
21982198
box-shadow: none;
21992199
padding: 0; }
22002200

2201-
.wfui-form-disabled.wfui-form-singlecheckbox .active.checkbox {
2201+
.wfui-form-preview.wfui-form-singlecheckbox .active.checkbox {
22022202
display: block; }
2203-
.wfui-form-disabled.wfui-form-singlecheckbox .active.checkbox > label {
2203+
.wfui-form-preview.wfui-form-singlecheckbox .active.checkbox > label {
22042204
background: none;
22052205
border: none;
22062206
padding: 0; }
2207-
.wfui-form-disabled.wfui-form-singlecheckbox .active.checkbox input[type='checkbox'] {
2207+
.wfui-form-preview.wfui-form-singlecheckbox .active.checkbox input[type='checkbox'] {
22082208
display: none; }
22092209

2210-
.wfui-form-disabled .wfui-checkboxes-hybrid .checkbox,
2211-
.wfui-form-disabled .wfui-form-checkboxes .checkbox {
2210+
.wfui-form-preview .wfui-checkboxes-hybrid .checkbox,
2211+
.wfui-form-preview .wfui-form-checkboxes .checkbox {
22122212
display: none; }
22132213

2214-
.wfui-form-disabled .wfui-checkboxes-hybrid .active.checkbox,
2215-
.wfui-form-disabled .wfui-form-checkboxes .active.checkbox {
2214+
.wfui-form-preview .wfui-checkboxes-hybrid .active.checkbox,
2215+
.wfui-form-preview .wfui-form-checkboxes .active.checkbox {
22162216
display: block; }
2217-
.wfui-form-disabled .wfui-checkboxes-hybrid .active.checkbox > label,
2218-
.wfui-form-disabled .wfui-form-checkboxes .active.checkbox > label {
2217+
.wfui-form-preview .wfui-checkboxes-hybrid .active.checkbox > label,
2218+
.wfui-form-preview .wfui-form-checkboxes .active.checkbox > label {
22192219
background: none;
22202220
border: none;
22212221
padding: 0; }
2222-
.wfui-form-disabled .wfui-checkboxes-hybrid .active.checkbox input[type='checkbox'],
2223-
.wfui-form-disabled .wfui-form-checkboxes .active.checkbox input[type='checkbox'] {
2222+
.wfui-form-preview .wfui-checkboxes-hybrid .active.checkbox input[type='checkbox'],
2223+
.wfui-form-preview .wfui-form-checkboxes .active.checkbox input[type='checkbox'] {
22242224
display: none; }
22252225

2226-
.wfui-form-disabled .wfui-radios-hybrid .radio,
2227-
.wfui-form-disabled .wfui-form-radios .radio {
2226+
.wfui-form-preview .wfui-radios-hybrid .radio,
2227+
.wfui-form-preview .wfui-form-radios .radio {
22282228
display: none; }
22292229

2230-
.wfui-form-disabled .wfui-radios-hybrid .active.radio,
2231-
.wfui-form-disabled .wfui-form-radios .active.radio {
2230+
.wfui-form-preview .wfui-radios-hybrid .active.radio,
2231+
.wfui-form-preview .wfui-form-radios .active.radio {
22322232
display: block; }
2233-
.wfui-form-disabled .wfui-radios-hybrid .active.radio > label,
2234-
.wfui-form-disabled .wfui-form-radios .active.radio > label {
2233+
.wfui-form-preview .wfui-radios-hybrid .active.radio > label,
2234+
.wfui-form-preview .wfui-form-radios .active.radio > label {
22352235
background: none;
22362236
border: none;
22372237
padding: 0; }
2238-
.wfui-form-disabled .wfui-radios-hybrid .active.radio input[type='radio'],
2239-
.wfui-form-disabled .wfui-form-radios .active.radio input[type='radio'] {
2238+
.wfui-form-preview .wfui-radios-hybrid .active.radio input[type='radio'],
2239+
.wfui-form-preview .wfui-form-radios .active.radio input[type='radio'] {
22402240
display: none; }
22412241

2242-
.wfui-form-disabled .wfui-form-select select.form-control {
2242+
.wfui-form-preview .wfui-form-select select.form-control {
22432243
padding: 0;
22442244
border: none;
22452245
background: none;

lib/FormFields/renderAddAnother.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ var renderAddAnother = function (_React$Component) {
5858
help = _props.help,
5959
required = _props.required,
6060
disabled = _props.disabled,
61+
preview = _props.preview,
6162
withContext = _props.withContext,
6263
error = _props.meta.error;
6364

@@ -69,7 +70,7 @@ var renderAddAnother = function (_React$Component) {
6970
{
7071
className: (0, _classnames2.default)(className, 'wfui-form-item', {
7172
'wfui-form-item-error': error
72-
}, { 'wfui-form-disabled': disabled })
73+
}, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview })
7374
},
7475
_react2.default.createElement(
7576
_index.ControlLabel,
@@ -185,6 +186,7 @@ renderAddAnother.propTypes = {
185186
labelAddAnother: _propTypes2.default.string,
186187
required: _propTypes2.default.bool,
187188
disabled: _propTypes2.default.bool,
189+
preview: _propTypes2.default.bool,
188190
draggable: _propTypes2.default.bool,
189191
withContext: _propTypes2.default.bool
190192
};

lib/FormFields/renderAutocomplete.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ var renderAutocomplete = function (_React$Component) {
194194
onHandleChange = _props.onHandleChange,
195195
required = _props.required,
196196
disabled = _props.disabled,
197+
preview = _props.preview,
197198
globalError = _props.globalError,
198199
itemDisplay = _props.itemDisplay,
199200
textNoResult = _props.textNoResult,
@@ -210,7 +211,7 @@ var renderAutocomplete = function (_React$Component) {
210211
return _react2.default.createElement(
211212
'div',
212213
{
213-
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error || globalError }, { 'wfui-form-inline': inline }, { 'wfui-form-disabled': disabled }, { answered: input.value })
214+
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error || globalError }, { 'wfui-form-inline': inline }, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview }, { answered: input.value })
214215
},
215216
_react2.default.createElement(
216217
_.ControlLabel,

lib/FormFields/renderCheckboxes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var renderCheckboxes = function renderCheckboxes(_ref) {
3030
help = _ref.help,
3131
required = _ref.required,
3232
disabled = _ref.disabled,
33+
preview = _ref.preview,
3334
globalError = _ref.globalError,
3435
_ref$meta = _ref.meta,
3536
touched = _ref$meta.touched,
@@ -39,7 +40,7 @@ var renderCheckboxes = function renderCheckboxes(_ref) {
3940
{
4041
className: (0, _classnames2.default)(className, 'wfui-form-item', {
4142
'wfui-form-item-error': error || globalError
42-
}, { 'wfui-form-disabled': disabled })
43+
}, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview })
4344
},
4445
_react2.default.createElement(
4546
_index.ControlLabel,

lib/FormFields/renderField.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ var renderField = function renderField(_ref) {
4242
onHandleChange = _ref.onHandleChange,
4343
required = _ref.required,
4444
disabled = _ref.disabled,
45+
preview = _ref.preview,
4546
globalError = _ref.globalError,
4647
_ref$meta = _ref.meta,
4748
touched = _ref$meta.touched,
4849
error = _ref$meta.error;
4950
return _react2.default.createElement(
5051
'div',
5152
{
52-
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error || globalError }, { 'wfui-form-inline': inline }, { 'wfui-form-disabled': disabled }, { answered: input.value })
53+
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error || globalError }, { 'wfui-form-inline': inline }, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview }, { answered: input.value })
5354
},
5455
_react2.default.createElement(
5556
_index.ControlLabel,

lib/FormFields/renderFileUpload.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ var renderFileUpload = function (_React$Component) {
9595
touched = _props$meta.touched,
9696
error = _props$meta.error,
9797
review = _props.review,
98+
preview = _props.preview,
9899
fileTypes = _props.fileTypes,
99100
txtRemove = _props.txtRemove,
100101
txtUpload = _props.txtUpload,
@@ -108,7 +109,7 @@ var renderFileUpload = function (_React$Component) {
108109
return _react2.default.createElement(
109110
'div',
110111
{
111-
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': globalError }, { 'wfui-form-disabled': disabled })
112+
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': globalError }, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview })
112113
},
113114
_react2.default.createElement(
114115
_index.ControlLabel,

lib/FormFields/renderFilterTable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ var renderFilterTable = function (_React$Component) {
510510
help = _props4.help,
511511
required = _props4.required,
512512
disabled = _props4.disabled,
513+
preview = _props4.preview,
513514
error = _props4.meta.error;
514515
var _state3 = this.state,
515516
showAddModal = _state3.showAddModal,
@@ -523,7 +524,7 @@ var renderFilterTable = function (_React$Component) {
523524
return _react2.default.createElement(
524525
'div',
525526
{
526-
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error }, { 'wfui-form-disabled': disabled }, { inactive: fields.length >= 0 })
527+
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error }, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview }, { inactive: fields.length >= 0 })
527528
},
528529
_react2.default.createElement(
529530
_index.ControlLabel,

lib/FormFields/renderPhoto.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ var renderPhoto = function (_React$Component) {
6464
maxlength = _props.maxlength,
6565
onStateChange = _props.onStateChange,
6666
disabled = _props.disabled,
67+
preview = _props.preview,
6768
_props$meta = _props.meta,
6869
touched = _props$meta.touched,
6970
error = _props$meta.error;
@@ -75,7 +76,7 @@ var renderPhoto = function (_React$Component) {
7576
{
7677
className: (0, _classnames2.default)(className, 'wfui-form-item', {
7778
'wfui-form-item-error': error
78-
}, { 'wfui-form-disabled': disabled })
79+
}, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview })
7980
},
8081
_react2.default.createElement(
8182
_index.ControlLabel,

lib/FormFields/renderRadios.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var renderRadios = function renderRadios(_ref) {
2828
help = _ref.help,
2929
required = _ref.required,
3030
disabled = _ref.disabled,
31+
preview = _ref.preview,
3132
globalError = _ref.globalError,
3233
_ref$meta = _ref.meta,
3334
touched = _ref$meta.touched,
@@ -37,7 +38,7 @@ var renderRadios = function renderRadios(_ref) {
3738
{
3839
className: (0, _classnames2.default)(className, 'wfui-form-item', {
3940
'wfui-form-item-error': error || globalError
40-
}, { 'wfui-form-disabled': disabled })
41+
}, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview })
4142
},
4243
_react2.default.createElement(
4344
_index.ControlLabel,

lib/FormFields/renderSelect.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ var renderSelect = function renderSelect(_ref) {
3232
help = _ref.help,
3333
required = _ref.required,
3434
disabled = _ref.disabled,
35+
preview = _ref.preview,
3536
globalError = _ref.globalError,
3637
_ref$meta = _ref.meta,
3738
touched = _ref$meta.touched,
3839
error = _ref$meta.error;
3940
return _react2.default.createElement(
4041
'div',
4142
{
42-
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error || globalError }, { 'wfui-form-disabled': disabled }, { answered: input.value })
43+
className: (0, _classnames2.default)(className, 'wfui-form-item', { 'wfui-form-item-error': error || globalError }, { 'wfui-form-disabled': disabled }, { 'wfui-form-preview': preview }, { answered: input.value })
4344
},
4445
_react2.default.createElement(
4546
_index.ControlLabel,

0 commit comments

Comments
 (0)