hippo-fw 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +0 -3
  3. data/.nvmrc +1 -2
  4. data/.ruby-version +1 -1
  5. data/Rakefile +1 -1
  6. data/client/hippo/access/login-dialog.jsx +2 -0
  7. data/client/hippo/boot.jsx +12 -0
  8. data/client/hippo/components/asset.jsx +5 -1
  9. data/client/hippo/components/asset.scss +1 -0
  10. data/client/hippo/components/data-list.jsx +6 -4
  11. data/client/hippo/components/data-table.jsx +7 -6
  12. data/client/hippo/components/data-table/header-cell.jsx +2 -0
  13. data/client/hippo/components/date-time.jsx +12 -2
  14. data/client/hippo/components/form/api.js +12 -0
  15. data/client/hippo/components/form/fields.jsx +8 -1
  16. data/client/hippo/components/form/fields/checkbox-wrapper.jsx +2 -0
  17. data/client/hippo/components/form/fields/date-wrapper.jsx +2 -0
  18. data/client/hippo/components/form/fields/form-field.scss +2 -0
  19. data/client/hippo/components/form/fields/label.jsx +2 -0
  20. data/client/hippo/components/form/fields/react-tags.scss +170 -0
  21. data/client/hippo/components/form/fields/select-wrapper.jsx +2 -0
  22. data/client/hippo/components/form/fields/tags-wrapper.jsx +46 -0
  23. data/client/hippo/components/form/fields/text-wrapper.jsx +9 -1
  24. data/client/hippo/components/form/fields/textarea-wrapper.jsx +15 -0
  25. data/client/hippo/components/form/wrapper.jsx +21 -1
  26. data/client/hippo/components/help.jsx +21 -0
  27. data/client/hippo/components/master-detail.jsx +2 -0
  28. data/client/hippo/components/network-activity-overlay.jsx +3 -1
  29. data/client/hippo/components/popout-window.jsx +126 -0
  30. data/client/hippo/components/query-builder.jsx +9 -117
  31. data/client/hippo/components/query-builder/boolean-picker.jsx +28 -0
  32. data/client/hippo/components/query-builder/clause-filter.jsx +58 -0
  33. data/client/hippo/components/query-builder/clause.jsx +98 -0
  34. data/client/hippo/components/query-builder/date-picker.jsx +23 -0
  35. data/client/hippo/components/query-builder/query-builder.scss +7 -0
  36. data/client/hippo/components/record-finder.jsx +2 -0
  37. data/client/hippo/components/record-finder/query-layer.jsx +5 -1
  38. data/client/hippo/components/save-button.jsx +7 -1
  39. data/client/hippo/components/screen.jsx +2 -0
  40. data/client/hippo/components/text-editor.jsx +4 -5
  41. data/client/hippo/components/text-editor/display-modes/Button.jsx +5 -2
  42. data/client/hippo/components/text-editor/display-modes/ToggleEdit.jsx +2 -1
  43. data/client/hippo/components/text-editor/display-modes/ToggleInsert.jsx +2 -1
  44. data/client/hippo/components/text-editor/display-modes/ToggleLayout.jsx +2 -1
  45. data/client/hippo/components/text-editor/display-modes/TogglePreview.jsx +2 -1
  46. data/client/hippo/components/text-editor/display-modes/ToggleResize.jsx +2 -1
  47. data/client/hippo/components/text-editor/display-modes/index.js +7 -7
  48. data/client/hippo/components/text-editor/image-plugin/Component/Display/index.js +4 -2
  49. data/client/hippo/components/text-editor/image-plugin/Component/Form/index.js +2 -0
  50. data/client/hippo/components/text-editor/renderer.jsx +2 -0
  51. data/client/hippo/components/text-editor/text-editor.scss +13 -4
  52. data/client/hippo/components/time-zone-select.jsx +2 -0
  53. data/client/hippo/components/tool-tip.jsx +2 -0
  54. data/client/hippo/extensions/base.js +2 -0
  55. data/client/hippo/extensions/hippo.js +2 -0
  56. data/client/hippo/lib/__mocks__/request-assets.js +1 -2
  57. data/client/hippo/lib/bootstrap.js +2 -0
  58. data/client/hippo/lib/computed-properties.js +24 -0
  59. data/client/hippo/lib/date-range.js +13 -2
  60. data/client/hippo/lib/request-assets.js +3 -2
  61. data/client/hippo/lib/smooth-scroll.js +2 -0
  62. data/client/hippo/lib/util.js +1 -2
  63. data/client/hippo/models/asset.js +2 -0
  64. data/client/hippo/models/base.js +5 -2
  65. data/client/hippo/models/collection.js +2 -0
  66. data/client/hippo/models/config.js +3 -1
  67. data/client/hippo/models/pub_sub.js +2 -0
  68. data/client/hippo/models/pub_sub/channel.js +2 -0
  69. data/client/hippo/models/pub_sub/map.js +2 -0
  70. data/client/hippo/models/query.js +21 -12
  71. data/client/hippo/models/query/array-result.js +52 -16
  72. data/client/hippo/models/query/clause.js +11 -4
  73. data/client/hippo/models/query/field.js +2 -1
  74. data/client/hippo/models/query/info.js +7 -1
  75. data/client/hippo/models/query/operator.js +2 -0
  76. data/client/hippo/models/query/result.js +2 -0
  77. data/client/hippo/models/query/types.js +4 -0
  78. data/client/hippo/models/sync.js +2 -0
  79. data/client/hippo/models/system-setting.js +1 -15
  80. data/client/hippo/models/tenant.js +23 -7
  81. data/client/hippo/react/Root.jsx +2 -0
  82. data/client/hippo/react/component-not-found.jsx +2 -0
  83. data/client/hippo/screens/definition.js +2 -0
  84. data/client/hippo/screens/group.js +2 -0
  85. data/client/hippo/screens/instance.js +5 -1
  86. data/client/hippo/screens/system-settings.jsx +19 -5
  87. data/client/hippo/screens/system-settings/mailer-config.jsx +4 -2
  88. data/client/hippo/screens/system-settings/system-settings.scss +1 -1
  89. data/client/hippo/screens/system-settings/tenant.jsx +4 -2
  90. data/client/hippo/screens/user-management.jsx +2 -0
  91. data/client/hippo/screens/user-management/edit-form.jsx +2 -0
  92. data/client/hippo/testing/screens.js +10 -2
  93. data/client/hippo/user.js +4 -0
  94. data/client/hippo/workspace/index.jsx +3 -1
  95. data/client/hippo/workspace/menu-group.jsx +2 -0
  96. data/client/hippo/workspace/menu-option.jsx +2 -0
  97. data/client/hippo/workspace/menu.jsx +6 -3
  98. data/client/hippo/workspace/navbar.jsx +2 -0
  99. data/client/hippo/workspace/screen.jsx +2 -0
  100. data/client/hippo/workspace/styles.scss +5 -1
  101. data/command-reference-files/initial/.eslintrc.js +0 -3
  102. data/command-reference-files/initial/Gemfile +1 -1
  103. data/config/routes.rb +3 -1
  104. data/db/seed.rb +1 -1
  105. data/hippo-fw.gemspec +2 -2
  106. data/lib/hippo/api/controller_base.rb +2 -1
  107. data/lib/hippo/api/handlers/asset.rb +3 -2
  108. data/lib/hippo/api/handlers/tenant.rb +4 -6
  109. data/lib/hippo/api/helper_methods.rb +5 -7
  110. data/lib/hippo/api/route_set.rb +3 -2
  111. data/lib/hippo/asset.rb +4 -0
  112. data/lib/hippo/command/console.rb +1 -1
  113. data/lib/hippo/concerns/asset_uploader.rb +9 -4
  114. data/lib/hippo/concerns/queries.rb +3 -3
  115. data/lib/hippo/extension.rb +14 -4
  116. data/lib/hippo/extension/definition.rb +5 -1
  117. data/lib/hippo/logger.rb +26 -27
  118. data/lib/hippo/mailer.rb +19 -7
  119. data/lib/hippo/system_settings.rb +10 -4
  120. data/lib/hippo/templates/liquid.rb +1 -0
  121. data/lib/hippo/templates/liquid/pluralize.rb +16 -0
  122. data/lib/hippo/tenant.rb +17 -1
  123. data/lib/hippo/user.rb +10 -9
  124. data/lib/hippo/version.rb +1 -1
  125. data/lib/hippo/webpack.rb +22 -2
  126. data/package-lock.json +5462 -883
  127. data/package.json +9 -11
  128. data/spec/client/access/login-dialog.spec.jsx +2 -2
  129. data/spec/client/components/__snapshots__/query-builder.spec.jsx.snap +1 -1
  130. data/spec/client/components/__snapshots__/record-finder.spec.jsx.snap +1 -1
  131. data/spec/client/components/master-detail.spec.jsx +2 -1
  132. data/spec/client/components/query-builder.spec.jsx +3 -3
  133. data/spec/client/extension/base.spec.js +2 -0
  134. data/spec/client/models/base.spec.js +5 -3
  135. data/spec/client/models/query.spec.js +18 -6
  136. data/spec/client/models/sync.spec.js +2 -1
  137. data/spec/client/models/system-setting.spec.js +0 -12
  138. data/spec/client/screens/user-management.spec.jsx +1 -2
  139. data/spec/client/test-models.js +10 -0
  140. data/spec/server/api/tenant_change_spec.rb +1 -2
  141. data/spec/server/asset_spec.rb +2 -2
  142. data/templates/js/config-data.js +1 -1
  143. data/templates/spec/factories/model.rb +1 -1
  144. data/views/hippo_root_view.erb +1 -3
  145. metadata +17 -6
  146. data/client/hippo/components/text-editor/display-modes/SaveState.jsx +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf25cc10af49e41c6a3b48817f8bc1b50853484e
4
- data.tar.gz: 7afc125a95df6077aa39e6f6acec0d42c3d926a5
3
+ metadata.gz: e97da3fa2dce1988dbd6c99f57b23fa97c107804
4
+ data.tar.gz: 6ddec0b54d142580acde726ad71285a0bd418a60
5
5
  SHA512:
6
- metadata.gz: 98ee0dc3e62a19bf1d3aa0503781a0b374061a0490c06a73039cb8f3040b455cfb9a18b157ae54c1940ecb27f9cb19f054656e9bd185a5276058809deaf6edad
7
- data.tar.gz: 3217e075db4cac207c3b5cad67a8cb269114ca7f59a8396b8112472ce2acef5e347d808ee888baa4f61257d3e5ceaa5d61ba029689ec0505cbef6b6aa1d9aacf
6
+ metadata.gz: bb9884ee011d186fb0465284b8e537507d64d806b60be2ee687a6c52f16555168640734dd1f87b727f61e7dccf5ea1df349e95c904c8b39e1c388ba87de013d8
7
+ data.tar.gz: 65bad2b85ca2f0d47ec885120dbf7dd73324f3f75fd3d67177ba7da1207684f39d3b65f51750c175900678059d1415f3b6112f75d41a0f23adc5cb8b943479d3
@@ -1,7 +1,4 @@
1
1
  module.exports = {
2
2
  "extends": "argosity",
3
3
  "parser": "babel-eslint",
4
- rules: {
5
- 'no-underscore-dangle': 0,
6
- },
7
4
  };
data/.nvmrc CHANGED
@@ -1,2 +1 @@
1
- v8
2
-
1
+ stable
@@ -1 +1 @@
1
- 2.4.1
1
+ 2.4.2
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ YARD::Rake::YardocTask.new do |t|
19
19
  end
20
20
 
21
21
  task :npmrelease do
22
- sh "npm-release"
22
+ sh "npm publish"
23
23
  end
24
24
 
25
25
  task :release => :npmrelease
@@ -9,6 +9,7 @@ import User from '../user';
9
9
 
10
10
  @observer
11
11
  export default class LoginDialog extends React.Component {
12
+
12
13
  constructor() {
13
14
  super();
14
15
  bindAll(this, 'attemptLogin');
@@ -33,4 +34,5 @@ export default class LoginDialog extends React.Component {
33
34
  </Layer>
34
35
  );
35
36
  }
37
+
36
38
  }
@@ -2,9 +2,11 @@ import React from 'react'; // eslint-disable-line no-unused-vars
2
2
  import ReactDOM from 'react-dom';
3
3
  import whenDomReady from 'when-dom-ready';
4
4
  import { delay } from 'lodash';
5
+ import { unresolvedAssociations } from 'mobx-decorated-models';
5
6
  import { AppContainer } from 'react-hot-loader';
6
7
  import { onBoot } from './models/pub_sub';
7
8
  import './extensions/hippo';
9
+ import Tenant from './models/tenant';
8
10
 
9
11
  // react-tap-event-plugin is required for material-ui which is used by ory-editor-ui
10
12
  require('react-tap-event-plugin')();
@@ -27,8 +29,18 @@ whenDomReady().then(() => {
27
29
  if (Root) return;
28
30
  /* global document: true */
29
31
  Root = document.getElementById('hippo-root');
32
+
33
+ Tenant.bootstrap(
34
+ JSON.parse(document.getElementById('bootstrap-data').innerHTML),
35
+ );
30
36
  /* global document: false */
31
37
  renderer(Workspace);
38
+
39
+ unresolvedAssociations().forEach(({ model, property }) => {
40
+ // eslint-disable-next-line no-console
41
+ console.warn(`The model for ${model.identifiedBy}(${property}) cannot be found`);
42
+ });
43
+
32
44
  const loading = document.querySelector('.loading');
33
45
  if (loading) {
34
46
  loading.classList.add('complete');
@@ -15,6 +15,7 @@ import './asset.scss';
15
15
 
16
16
  @observer
17
17
  export default class Asset extends React.PureComponent {
18
+
18
19
  static defaultProps = {
19
20
  label: '',
20
21
  className: '',
@@ -72,7 +73,9 @@ export default class Asset extends React.PureComponent {
72
73
 
73
74
 
74
75
  render() {
75
- const { model: _, label: __, name: ___, className, tabIndex, ...col } = this.props;
76
+ const {
77
+ model: _, label: __, name: ___, className, tabIndex, ...col
78
+ } = this.props;
76
79
 
77
80
  return (
78
81
  <Col
@@ -97,4 +100,5 @@ export default class Asset extends React.PureComponent {
97
100
  </Col>
98
101
  );
99
102
  }
103
+
100
104
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  #hippo-root {
4
4
  .asset {
5
+ > .grommetux-form-field { height: 100%; }
5
6
  .drop-zone {
6
7
  height: 200px;
7
8
  padding: 0.5rem;
@@ -6,17 +6,18 @@ import { observer } from 'mobx-react';
6
6
  import { autobind } from 'core-decorators';
7
7
  import cn from 'classnames';
8
8
  import Box from 'grommet/components/Box';
9
-
10
9
  import {
11
10
  List, AutoSizer, InfiniteLoader,
12
11
  } from 'react-virtualized';
13
12
  import 'react-virtualized/styles.css';
14
13
 
14
+ import ActivityOverlay from './network-activity-overlay';
15
15
  import Query from '../models/query';
16
16
  import './data-list/data-list.scss';
17
17
 
18
18
  @observer
19
19
  export default class DataList extends React.Component {
20
+
20
21
  static defaultProps = {
21
22
  rowHeight: 40,
22
23
  }
@@ -75,12 +76,11 @@ export default class DataList extends React.Component {
75
76
  className={cn('data-list', { selectable: this.props.onRowClick })}
76
77
  align='stretch' flex
77
78
  >
78
-
79
79
  {this.props.header}
80
-
80
+ <ActivityOverlay model={query.results} message="Loading…" />
81
81
  <Box className="body" align="stretch" flex>
82
82
  <InfiniteLoader
83
- keyChange={query.results.updateKey}
83
+ keyChange={query.results.fingerprint}
84
84
  minimumBatchSize={query.pageSize}
85
85
  isRowLoaded={this.isRowLoaded}
86
86
  loadMoreRows={this.loadMoreRows}
@@ -95,6 +95,7 @@ export default class DataList extends React.Component {
95
95
  {({ height, width }) =>
96
96
  <List
97
97
  {...listProps}
98
+ keyChange={query.results.fingerprint}
98
99
  height={height}
99
100
  width={width}
100
101
  ref={(list) => {
@@ -114,4 +115,5 @@ export default class DataList extends React.Component {
114
115
  </Box>
115
116
  );
116
117
  }
118
+
117
119
  }
@@ -26,6 +26,7 @@ function renderEditTriangle({ rowIndex, columnData: { onEdit } }) {
26
26
 
27
27
  @observer
28
28
  export default class DataTable extends React.Component {
29
+
29
30
  static defaultProps = {
30
31
  canCreate: false,
31
32
  editRowIndex: null,
@@ -53,8 +54,7 @@ export default class DataTable extends React.Component {
53
54
  'calculateRowHeight',
54
55
  'isRowLoaded',
55
56
  'loadMoreRows',
56
- 'headerRenderer',
57
- );
57
+ 'headerRenderer');
58
58
  this.editIndex = props.editRowIndex;
59
59
  autorun(() => {
60
60
  if (isNumber(this.editIndex) && this.tableRef) {
@@ -130,9 +130,7 @@ export default class DataTable extends React.Component {
130
130
  dataKey: f.dataIndex || f.id,
131
131
  headerRenderer: this.headerRenderer,
132
132
  }, pick(f, 'width', 'label', 'flexGrow', 'flexShrink',
133
- 'cellRenderer', 'className', 'headerClassName'),
134
- ),
135
- );
133
+ 'cellRenderer', 'className', 'headerClassName')));
136
134
  if (this.props.editor) {
137
135
  definitions.unshift({
138
136
  key: 'edit-toggle',
@@ -162,7 +160,9 @@ export default class DataTable extends React.Component {
162
160
  }
163
161
 
164
162
  rowRenderer(props) {
165
- const { index, className, key, style } = props;
163
+ const {
164
+ index, className, key, style,
165
+ } = props;
166
166
  extend(props, this.rowProps);
167
167
  if (this.editIndex === index) {
168
168
  const { editor: Editor } = this.props;
@@ -242,4 +242,5 @@ export default class DataTable extends React.Component {
242
242
  </div>
243
243
  );
244
244
  }
245
+
245
246
  }
@@ -14,6 +14,7 @@ import Field from '../../models/query/field';
14
14
 
15
15
  @observer
16
16
  export default class SortingHeaderCell extends React.Component {
17
+
17
18
  static defaultProps = {
18
19
  onAdd: null,
19
20
  }
@@ -90,4 +91,5 @@ export default class SortingHeaderCell extends React.Component {
90
91
  }
91
92
  return label;
92
93
  }
94
+
93
95
  }
@@ -25,6 +25,7 @@ const defaultOptions = {
25
25
 
26
26
  @observer
27
27
  export default class DateTimePicker extends React.PureComponent {
28
+
28
29
  static propTypes = {
29
30
  defaultValue: PropTypes.string,
30
31
  options: PropTypes.object,
@@ -91,7 +92,13 @@ export default class DateTimePicker extends React.PureComponent {
91
92
  }
92
93
 
93
94
  @autobind onChange(dates) {
94
- this.props.onChange({ target: { value: dates[0] } });
95
+ if ('range' === this.props.options.mode) {
96
+ if (2 === dates.length) {
97
+ this.props.onChange({ target: { value: dates } });
98
+ }
99
+ } else {
100
+ this.props.onChange({ target: { value: dates[0] } });
101
+ }
95
102
  }
96
103
 
97
104
  getOptions(props) {
@@ -119,7 +126,9 @@ export default class DateTimePicker extends React.PureComponent {
119
126
 
120
127
  render() {
121
128
  // eslint-disable-next-line no-unused-vars
122
- const { options, defaultValue, value, children, ...props } = omit(this.props, hooks);
129
+ const {
130
+ options: _, defaultValue, value: __, children: ___, ...props
131
+ } = omit(this.props, hooks);
123
132
 
124
133
  return (
125
134
  <input
@@ -129,4 +138,5 @@ export default class DateTimePicker extends React.PureComponent {
129
138
  />
130
139
  );
131
140
  }
141
+
132
142
  }
@@ -7,6 +7,7 @@ import {
7
7
  } from 'lodash';
8
8
 
9
9
  export class FormField {
10
+
10
11
  name: '';
11
12
  @observable isTouched = false
12
13
  @observable isChanged = false;
@@ -72,10 +73,12 @@ export class FormField {
72
73
  this.isTouched = false;
73
74
  this.isChanged = false;
74
75
  }
76
+
75
77
  }
76
78
 
77
79
 
78
80
  export class FormState {
81
+
79
82
  fields = observable.map();
80
83
 
81
84
  @action
@@ -138,6 +141,14 @@ export class FormState {
138
141
  });
139
142
  }
140
143
 
144
+ @action
145
+ update(values) {
146
+ each(values, (v, k) => {
147
+ const field = this.fields.get(k);
148
+ if (field) { field.value = v; }
149
+ });
150
+ }
151
+
141
152
  @action
142
153
  setFromModel(model) {
143
154
  if (get(model, 'syncInProgress.isFetch')) {
@@ -154,4 +165,5 @@ export class FormState {
154
165
  this.fields.forEach((field, name) => (set(model, name, field.value)));
155
166
  return Promise.resolve(model);
156
167
  }
168
+
157
169
  }
@@ -12,24 +12,30 @@ import DateWrapper from './fields/date-wrapper';
12
12
  import SelectWrapper from './fields/select-wrapper';
13
13
  import TextWrapper from './fields/text-wrapper';
14
14
  import CheckBoxWrapper from './fields/checkbox-wrapper';
15
+ import TagsWrapper from './fields/tags-wrapper';
16
+ import TextAreaWrapper from './fields/textarea-wrapper';
15
17
  import Label from './fields/label';
16
18
  import TimeZoneSelect from '../../components/time-zone-select';
17
19
 
20
+
18
21
  import './fields/form-field.scss';
19
22
 
20
23
  const TypesMapping = {
21
24
  text: TextWrapper,
22
25
  date: DateWrapper,
26
+ tags: TagsWrapper,
23
27
  label: Label,
24
28
  select: SelectWrapper,
25
29
  number: NumberInput,
26
30
  timezone: TimeZoneSelect,
27
31
  checkbox: CheckBoxWrapper,
32
+ textarea: TextAreaWrapper,
28
33
  };
29
34
 
30
35
  @inject('formState')
31
36
  @observer
32
37
  export default class FormField extends React.PureComponent {
38
+
33
39
  static propTypes = Object.assign({
34
40
  label: PropTypes.string,
35
41
  name: PropTypes.string.isRequired,
@@ -73,7 +79,7 @@ export default class FormField extends React.PureComponent {
73
79
  const InputTag = TypesMapping[type] || TypesMapping.text;
74
80
 
75
81
  return (
76
- <div className={classnames('form-field', className)}>
82
+ <div className={classnames('form-field', type, className)}>
77
83
  <Field
78
84
  label={label || titleize(name)}
79
85
  error={this.field.invalidMessage}
@@ -94,4 +100,5 @@ export default class FormField extends React.PureComponent {
94
100
  </div>
95
101
  );
96
102
  }
103
+
97
104
  }
@@ -5,6 +5,7 @@ import CheckBox from 'grommet/components/CheckBox';
5
5
 
6
6
  @observer
7
7
  export default class CheckBoxWrapper extends React.PureComponent {
8
+
8
9
  @action.bound onBlur(ev) {
9
10
  this.props.onBlur({ target: { value: ev.target.checked } });
10
11
  }
@@ -18,4 +19,5 @@ export default class CheckBoxWrapper extends React.PureComponent {
18
19
  onBlur={this.onBlur} checked={!!this.props.value} />
19
20
  );
20
21
  }
22
+
21
23
  }
@@ -7,6 +7,7 @@ import DateTime from '../../date-time';
7
7
 
8
8
  @observer
9
9
  export default class DateWrapper extends React.PureComponent {
10
+
10
11
  static defaultProps = {
11
12
  format: 'M/d/Y h:iK',
12
13
  }
@@ -47,4 +48,5 @@ export default class DateWrapper extends React.PureComponent {
47
48
  />
48
49
  );
49
50
  }
51
+
50
52
  }
@@ -10,3 +10,5 @@
10
10
  }
11
11
  }
12
12
  }
13
+
14
+ @import './react-tags';
@@ -4,6 +4,7 @@ import Value from 'grommet/components/Value';
4
4
 
5
5
  @observer
6
6
  export default class LabelWrapper extends React.PureComponent {
7
+
7
8
  render() {
8
9
  const { value } = this.props;
9
10
 
@@ -11,4 +12,5 @@ export default class LabelWrapper extends React.PureComponent {
11
12
  <Value value={value} />
12
13
  );
13
14
  }
15
+
14
16
  }
@@ -0,0 +1,170 @@
1
+ .form-field.tags {
2
+ .grommetux-form-field.grommetux-form-field--focus {
3
+ overflow: visible;
4
+ }
5
+ }
6
+
7
+ .react-tags {
8
+ position: relative;
9
+ // padding: 6px 0 0 6px;
10
+ // border: 1px solid #D1D1D1;
11
+ border-radius: 1px;
12
+
13
+ /* shared font styles */
14
+ font-size: 1em;
15
+ line-height: 1.2;
16
+ display: flex;
17
+ /* clicking anywhere will focus the input */
18
+ cursor: text;
19
+ flex-wrap: wrap;
20
+
21
+ button:not(.grommetux-button):not(.grommetux-button--box) {
22
+ margin: 0;
23
+ height: 100%;
24
+ font-weight: 300;
25
+ padding: 0 0.4rem;
26
+ min-width: inherit;
27
+ border: 1px solid lightgray;
28
+ height: 28px;
29
+ }
30
+
31
+ .react-tags.is-focused {
32
+ border-color: #B1B1B1;
33
+ }
34
+
35
+ .react-tags__selected {
36
+ flex: 0;
37
+ display: flex;
38
+ flex-wrap: wrap;
39
+ align-items: center;
40
+ margin-left: 22px;
41
+ margin-right: 0.5rem;
42
+ }
43
+
44
+ .react-tags__selected-tag {
45
+ display: inline-block;
46
+ box-sizing: border-box;
47
+ margin: 0 6px 6px 0;
48
+ padding: 6px 8px;
49
+ border: 1px solid #D1D1D1;
50
+ border-radius: 2px;
51
+ background: #F1F1F1;
52
+
53
+ /* match the font styles */
54
+ font-size: inherit;
55
+ line-height: inherit;
56
+ }
57
+
58
+ .react-tags__selected-tag:after {
59
+ content: '\2715';
60
+ color: #AAA;
61
+ margin-left: 8px;
62
+ }
63
+
64
+ .react-tags__selected-tag:hover,
65
+ .react-tags__selected-tag:focus {
66
+ border-color: #B1B1B1;
67
+ }
68
+
69
+ .react-tags__search {
70
+
71
+ display: flex;
72
+ align-items: center;
73
+
74
+
75
+ /* match tag layout */
76
+ // padding: 7px 2px;
77
+ // margin-bottom: 6px;
78
+
79
+ /* prevent autoresize overflowing the container */
80
+ max-width: 100%;
81
+ }
82
+
83
+ @media screen and (min-width: 30em) {
84
+
85
+ .react-tags__search {
86
+ /* this will become the offsetParent for suggestions */
87
+ position: relative;
88
+ }
89
+
90
+ }
91
+
92
+ .react-tags__search input:not(.grommetux-input) {
93
+
94
+
95
+ /* prevent autoresize overflowing the container */
96
+ // max-width: 100%;
97
+
98
+ /* remove styles and layout from this element */
99
+ margin: 0;
100
+ // padding: 0;
101
+ border: 0;
102
+ outline: none;
103
+ flex: 1;
104
+ width: inherit !important;
105
+ padding: 10px 0;
106
+ &:focus {
107
+ padding: 10px 0;
108
+ }
109
+ /* match the font styles */
110
+ font-size: inherit;
111
+ line-height: inherit;
112
+ }
113
+
114
+ .react-tags__search input::-ms-clear {
115
+ display: none;
116
+ }
117
+
118
+ .react-tags__suggestions {
119
+ position: absolute;
120
+ top: 100%;
121
+ left: 0;
122
+ width: 100%;
123
+ background-color: white;
124
+ z-index: 3;
125
+ }
126
+
127
+ @media screen and (min-width: 30em) {
128
+
129
+ .react-tags__suggestions {
130
+
131
+ width: 240px;
132
+ }
133
+
134
+ }
135
+
136
+ .react-tags__suggestions ul {
137
+ margin: 4px -1px;
138
+ padding: 0;
139
+ list-style: none;
140
+ background: white;
141
+ // border: 1px solid #D1D1D1;
142
+ border-radius: 2px;
143
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
144
+ }
145
+
146
+ .react-tags__suggestions li {
147
+ border-bottom: 1px solid #ddd;
148
+ padding: 6px 8px;
149
+ }
150
+
151
+ .react-tags__suggestions li mark {
152
+ text-decoration: underline;
153
+ background: none;
154
+ font-weight: 600;
155
+ }
156
+
157
+ .react-tags__suggestions li:hover {
158
+ cursor: pointer;
159
+ background: #eee;
160
+ }
161
+
162
+ .react-tags__suggestions li.is-active {
163
+ background: #b7cfe0;
164
+ }
165
+
166
+ .react-tags__suggestions li.is-disabled {
167
+ opacity: 0.5;
168
+ cursor: auto;
169
+ }
170
+ }