lanes 0.1.9.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Rakefile +1 -1
- data/client/lanes/Boot.cjsx +3 -3
- data/client/lanes/Config.coffee +38 -3
- data/client/lanes/access/Extension.coffee +1 -1
- data/client/lanes/access/LoginDialog.cjsx +57 -47
- data/client/lanes/access/Roles.coffee +2 -2
- data/client/lanes/access/User.coffee +4 -3
- data/client/lanes/access/screens/user-management/UserManagement.cjsx +12 -11
- data/client/lanes/components/calendar/Calendar.cjsx +16 -0
- data/client/lanes/components/calendar/index.js +3 -0
- data/client/lanes/components/calendar/styles.scss +3 -0
- data/client/lanes/components/grid/Body.cjsx +86 -0
- data/client/lanes/components/grid/CellStyles.coffee +20 -0
- data/client/lanes/components/grid/EditingMixin.cjsx +84 -24
- data/client/lanes/components/grid/Editor.cjsx +45 -0
- data/client/lanes/components/grid/Grid.cjsx +62 -104
- data/client/lanes/components/grid/Header.cjsx +35 -0
- data/client/lanes/components/grid/PopOverMixin.cjsx +19 -9
- data/client/lanes/components/grid/PopoverEditor.cjsx +7 -1
- data/client/lanes/components/grid/RowEditor.cjsx +1 -1
- data/client/lanes/components/grid/Selections.cjsx +39 -0
- data/client/lanes/components/grid/Toolbar.cjsx +24 -5
- data/client/lanes/components/grid/editors.scss +22 -50
- data/client/lanes/components/grid/index.js +0 -1
- data/client/lanes/components/grid/row-editor.scss +68 -0
- data/client/lanes/components/grid/styles.scss +79 -3
- data/client/lanes/components/modal/Modal.cjsx +64 -24
- data/client/lanes/components/modal/styles.scss +12 -0
- data/client/lanes/components/record-finder/Clause.cjsx +11 -4
- data/client/lanes/components/record-finder/Dialog.cjsx +23 -24
- data/client/lanes/components/record-finder/RecordFinder.cjsx +45 -14
- data/client/lanes/components/record-finder/styles.scss +9 -6
- data/client/lanes/components/select-field/SelectField.cjsx +108 -53
- data/client/lanes/components/select-field/styles.scss +19 -0
- data/client/lanes/components/shared/ControlLabel.cjsx +45 -0
- data/client/lanes/components/shared/DateTime.cjsx +48 -0
- data/client/lanes/components/shared/DisplayValue.cjsx +16 -0
- data/client/lanes/components/shared/FieldMixin.cjsx +54 -23
- data/client/lanes/components/shared/FieldSet.cjsx +12 -35
- data/client/lanes/components/shared/FieldWrapper.cjsx +13 -0
- data/client/lanes/components/shared/FormGroup.cjsx +37 -0
- data/client/lanes/components/shared/Icon.cjsx +20 -0
- data/client/lanes/components/shared/ImageSaver.cjsx +33 -0
- data/client/lanes/components/shared/Input.cjsx +19 -0
- data/client/lanes/components/shared/InputFieldMixin.cjsx +48 -0
- data/client/lanes/components/shared/JobProgress.cjsx +27 -0
- data/client/lanes/components/shared/NetworkActivityOverlay.cjsx +58 -0
- data/client/lanes/components/shared/NumberInput.cjsx +29 -0
- data/client/lanes/components/shared/ResizeSensor.cjsx +11 -0
- data/client/lanes/components/shared/ScreenWrapper.cjsx +13 -0
- data/client/lanes/components/shared/Throbber.cjsx +3 -0
- data/client/lanes/components/shared/ToggleField.cjsx +33 -0
- data/client/lanes/components/shared/Tooltip.cjsx +2 -2
- data/client/lanes/components/shared/fields.scss +75 -13
- data/client/lanes/components/shared/fieldset.scss +3 -5
- data/client/lanes/components/shared/image-saver.scss +38 -0
- data/client/lanes/components/shared/index.js +2 -0
- data/client/lanes/{styles/plugins → components/shared}/overlay.scss +17 -4
- data/client/lanes/components/shared/resize-sensor.scss +30 -0
- data/client/lanes/components/shared/styles.scss +13 -0
- data/client/lanes/components/shared/throbber.scss +53 -0
- data/client/lanes/components/toolbar/RemoteChangeSets.cjsx +21 -48
- data/client/lanes/components/toolbar/SaveButton.cjsx +24 -0
- data/client/lanes/components/toolbar/Toolbar.cjsx +24 -37
- data/client/lanes/components/toolbar/changes-notification.scss +10 -6
- data/client/lanes/components/toolbar/styles.scss +29 -9
- data/client/lanes/extension/Base.coffee +4 -5
- data/client/lanes/index.js +0 -1
- data/client/lanes/index.scss.erb +10 -1
- data/client/lanes/lib/HotReload.coffee +13 -15
- data/client/lanes/lib/MakeBaseClass.coffee +6 -1
- data/client/lanes/lib/development.coffee +2 -0
- data/client/lanes/lib/dom-polyfills.coffee +5 -0
- data/client/lanes/lib/dom.coffee +38 -9
- data/client/lanes/lib/format.coffee +11 -0
- data/client/lanes/lib/index.js.erb +2 -0
- data/client/lanes/lib/production.coffee +6 -0
- data/client/lanes/lib/utilFunctions.coffee +50 -15
- data/client/lanes/models/AssociationMap.coffee +122 -46
- data/client/lanes/models/AssociationProxy.coffee +147 -0
- data/client/lanes/models/Base.coffee +97 -85
- data/client/lanes/models/ChangeMonitor.coffee +7 -3
- data/client/lanes/models/ChangeSet.coffee +2 -2
- data/client/lanes/models/Collection.coffee +49 -6
- data/client/lanes/models/JobStatus.coffee +32 -0
- data/client/lanes/models/PubSub.coffee +7 -5
- data/client/lanes/models/Query.coffee +115 -34
- data/client/lanes/models/ServerCache.coffee +67 -52
- data/client/lanes/models/State.coffee +97 -0
- data/client/lanes/models/Sync.coffee +18 -13
- data/client/lanes/models/SystemSettings.coffee +0 -0
- data/client/lanes/models/index.js +1 -0
- data/client/lanes/models/mixins/FileSupport.coffee +60 -0
- data/client/lanes/models/mixins/HasCodeField.coffee +13 -6
- data/client/lanes/models/query/ArrayResult.coffee +188 -0
- data/client/lanes/models/query/CollectionResult.coffee +71 -0
- data/client/lanes/models/query/Result.coffee +9 -0
- data/client/lanes/react/Component.coffee +7 -3
- data/client/lanes/react/PubSub.coffee +7 -7
- data/client/lanes/react/Root.cjsx +1 -4
- data/client/lanes/react/Screen.coffee +1 -0
- data/client/lanes/react/TypeValidators.coffee +3 -3
- data/client/lanes/react/Viewport.coffee +41 -7
- data/client/lanes/react/index.js +0 -1
- data/client/lanes/react/mixins/Access.coffee +4 -1
- data/client/lanes/react/mixins/Data.coffee +40 -25
- data/client/lanes/react/mixins/FieldErrors.coffee +27 -0
- data/client/lanes/react/mixins/RelayEditingState.coffee +4 -0
- data/client/lanes/react/mixins/Screen.coffee +14 -0
- data/client/lanes/react/mixins/Viewport.coffee +9 -3
- data/client/lanes/screens/ChangeListener.coffee +3 -3
- data/client/lanes/screens/Commands.coffee +14 -7
- data/client/lanes/screens/CommonComponents.cjsx +20 -0
- data/client/lanes/screens/Definitions.coffee +64 -20
- data/client/lanes/screens/SystemSettings.cjsx +56 -0
- data/client/lanes/screens/UserPreferences.cjsx +38 -0
- data/client/lanes/screens/index.js +3 -0
- data/client/lanes/screens/styles.scss +2 -1
- data/client/lanes/styles/fonts.scss +1 -0
- data/client/lanes/styles/global.scss +2 -1
- data/client/lanes/styles/global/flexbox.scss +16 -0
- data/client/lanes/styles/global/styles.scss +1 -0
- data/client/lanes/styles/mixins/_dropdown.scss +21 -0
- data/client/lanes/styles/mixins/_flexbox.scss +394 -0
- data/client/lanes/styles/mixins/all.scss +2 -0
- data/client/lanes/styles/variables.scss +28 -0
- data/client/lanes/testing/BeforeEach.coffee +15 -14
- data/client/lanes/testing/Helpers.coffee +14 -5
- data/client/lanes/testing/TestObjects.coffee +10 -2
- data/client/lanes/testing/index.js +1 -0
- data/client/lanes/testing/jasmine-react.js +125 -0
- data/client/lanes/vendor/base.js +56049 -74987
- data/client/lanes/vendor/calendar.js +17301 -0
- data/client/lanes/vendor/calendar.scss +303 -0
- data/client/lanes/vendor/commons.js +14990 -15847
- data/client/lanes/vendor/development.js +4912 -1952
- data/client/lanes/vendor/grid.js +14246 -5551
- data/client/lanes/vendor/grid.scss +876 -335
- data/client/lanes/vendor/index.js +1 -0
- data/client/lanes/vendor/message-bus-ajax.js +44 -0
- data/client/lanes/vendor/message-bus.js +414 -0
- data/client/lanes/vendor/rw-widgets.eot +0 -0
- data/client/lanes/vendor/rw-widgets.svg +18 -0
- data/client/lanes/vendor/rw-widgets.ttf +0 -0
- data/client/lanes/vendor/rw-widgets.woff +0 -0
- data/client/lanes/vendor/toggle.js +345 -0
- data/client/lanes/vendor/toggle.scss +138 -0
- data/client/lanes/vendor/widgets.js +21245 -6839
- data/client/lanes/vendor/widgets.scss +83 -67
- data/client/lanes/workspace/Layout.cjsx +18 -8
- data/client/lanes/workspace/Modal.cjsx +47 -0
- data/client/lanes/workspace/Navbar.cjsx +16 -2
- data/client/lanes/workspace/ScreenView.cjsx +10 -3
- data/client/lanes/workspace/ScreensMenu.cjsx +23 -7
- data/client/lanes/workspace/Tabs.cjsx +55 -0
- data/client/lanes/workspace/UIState.coffee +7 -8
- data/client/lanes/workspace/index.js +2 -1
- data/client/lanes/workspace/mixin.coffee +11 -0
- data/client/lanes/workspace/mixins/UIState.coffee +8 -0
- data/client/lanes/workspace/mixins/index.js +3 -0
- data/client/lanes/workspace/styles.scss +2 -1
- data/client/lanes/workspace/styles/header.scss +23 -1
- data/client/lanes/workspace/styles/layout.scss +26 -24
- data/client/lanes/workspace/styles/screens.scss +0 -4
- data/client/lanes/workspace/styles/tabs.scss +3 -10
- data/config/routes.rb +10 -4
- data/config/screens.rb +25 -0
- data/db/migrate/01_create_system_settings.rb +10 -0
- data/docs/todo-example-part-1.md +18 -20
- data/lanes.gemspec +15 -6
- data/lib/lanes.rb +4 -2
- data/lib/lanes/access/config/routes.rb +5 -3
- data/lib/lanes/access/config/screens.rb +1 -0
- data/lib/lanes/access/db/migrate/20140615031600_create_lanes_users.rb +1 -1
- data/lib/lanes/access/user.rb +1 -1
- data/lib/lanes/api.rb +2 -1
- data/lib/lanes/api/controller.rb +32 -71
- data/lib/lanes/api/default_routes.rb +10 -8
- data/lib/lanes/api/formatted_reply.rb +53 -0
- data/lib/lanes/api/handlers/file.rb +26 -0
- data/lib/lanes/api/helper_methods.rb +29 -5
- data/lib/lanes/api/javascript_processor.rb +36 -17
- data/lib/lanes/api/pub_sub.rb +6 -9
- data/lib/lanes/api/request_wrapper.rb +1 -2
- data/lib/lanes/api/root.rb +11 -43
- data/lib/lanes/api/routing.rb +63 -0
- data/lib/lanes/api/sprockets_extension.rb +15 -7
- data/lib/lanes/api/updates.rb +1 -2
- data/lib/lanes/command.rb +0 -1
- data/lib/lanes/command/app.rb +6 -5
- data/lib/lanes/command/console.rb +1 -0
- data/lib/lanes/command/generate.rb +3 -0
- data/lib/lanes/command/generate_migration.rb +33 -0
- data/lib/lanes/command/generate_model.rb +4 -26
- data/lib/lanes/command/migration_support.rb +29 -0
- data/lib/lanes/command/update_model.rb +14 -5
- data/lib/lanes/concerns/all.rb +2 -0
- data/lib/lanes/concerns/api_path.rb +4 -2
- data/lib/lanes/concerns/association_extensions.rb +1 -1
- data/lib/lanes/concerns/attr_accessor_with_default.rb +3 -1
- data/lib/lanes/concerns/code_identifier.rb +1 -1
- data/lib/lanes/concerns/image_uploader.rb +42 -0
- data/lib/lanes/concerns/pub_sub.rb +0 -1
- data/lib/lanes/concerns/queries.rb +2 -2
- data/lib/lanes/concerns/set_attribute_data.rb +4 -13
- data/lib/lanes/concerns/sorting_expressions.rb +34 -0
- data/lib/lanes/configuration.rb +48 -9
- data/lib/lanes/extension.rb +16 -7
- data/lib/lanes/extension/definition.rb +8 -2
- data/lib/lanes/job.rb +78 -0
- data/lib/lanes/job/failure_logger.rb +33 -0
- data/lib/lanes/model.rb +4 -0
- data/lib/lanes/rake_tasks.rb +6 -0
- data/lib/lanes/redis.rb +13 -0
- data/lib/lanes/screen.rb +34 -18
- data/lib/lanes/system_settings.rb +66 -0
- data/lib/lanes/version.rb +1 -1
- data/lib/lanes/workspace/extension.rb +1 -1
- data/npm-build/base.js +10 -3
- data/npm-build/calendar.js +6 -0
- data/npm-build/development.js +4 -5
- data/npm-build/grid.js +3 -5
- data/npm-build/package.json +40 -29
- data/npm-build/react-toggle.js +5 -0
- data/npm-build/react-widgets.js +6 -0
- data/npm-build/update-dayz +14 -0
- data/npm-build/webpack.config.js +5 -2
- data/spec/command-reference-files/initial/Gemfile +1 -1
- data/spec/command-reference-files/initial/config/routes.rb +2 -0
- data/spec/command-reference-files/initial/lib/appy-app.rb +4 -0
- data/spec/command-reference-files/initial/lib/appy-app/extension.rb +2 -0
- data/spec/command-reference-files/initial/spec/server/{spec_helpers.rb → spec_helper.rb} +0 -0
- data/spec/command-reference-files/model/config/routes.rb +2 -0
- data/spec/command-reference-files/model/spec/server/test_test_spec.rb +1 -1
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/ReadySetGo.cjsx +6 -4
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/index.scss +4 -3
- data/spec/command-reference-files/screen/config/screens.rb +4 -2
- data/spec/command-reference-files/screen/spec/appy-app/screens/ready-set-go/ReadySetGoSpec.coffee +1 -1
- data/spec/fixtures/system_settings.yml +1 -0
- data/spec/lanes/components/grid/GridSpec.coffee +56 -31
- data/spec/lanes/components/grid/RowEditorSpec.coffee +96 -0
- data/spec/lanes/components/select-field/SelectFieldSpec.coffee +99 -0
- data/spec/lanes/components/shared/NetworkActivityOverlaySpec.coffee +34 -0
- data/spec/lanes/models/AssociationMapSpec.coffee +36 -2
- data/spec/lanes/models/AssociationProxySpec.coffee +77 -0
- data/spec/lanes/models/BaseSpec.coffee +37 -4
- data/spec/lanes/models/CollectionSpec.coffee +11 -17
- data/spec/lanes/models/PubSubSpec.coffee +1 -1
- data/spec/lanes/models/ServerCacheSpec.coffee +65 -0
- data/spec/server/api/coffeescript_processor_spec.rb +1 -1
- data/spec/server/concerns/pub_sub_spec.rb +9 -10
- data/spec/server/concerns/sorting_expressions_spec.rb +34 -0
- data/spec/server/configuration_spec.rb +3 -3
- data/spec/server/job_spec.rb +54 -0
- data/spec/server/spec_helper.rb +0 -5
- data/spec/server/system_settings_spec.rb +23 -0
- data/templates/client/screens/Screen.cjsx +6 -4
- data/templates/client/screens/styles.scss +4 -3
- data/templates/config/routes.rb +2 -0
- data/templates/config/screen.rb +4 -2
- data/templates/lib/namespace.rb +4 -0
- data/templates/lib/namespace/extension.rb +2 -0
- data/templates/spec/client/Screen.coffee +1 -1
- data/templates/spec/server/model_spec.rb +1 -1
- data/templates/spec/server/{spec_helpers.rb → spec_helper.rb} +0 -0
- data/views/lanes_root_view.erb +70 -0
- data/views/specs.erb +2 -2
- metadata +207 -68
- data/client/images/lanes/dataTables/Sorting icons.psd +0 -0
- data/client/images/lanes/dataTables/back_disabled.png +0 -0
- data/client/images/lanes/dataTables/back_enabled.png +0 -0
- data/client/images/lanes/dataTables/back_enabled_hover.png +0 -0
- data/client/images/lanes/dataTables/favicon.ico +0 -0
- data/client/images/lanes/dataTables/forward_disabled.png +0 -0
- data/client/images/lanes/dataTables/forward_enabled.png +0 -0
- data/client/images/lanes/dataTables/forward_enabled_hover.png +0 -0
- data/client/images/lanes/dataTables/loading-background.png +0 -0
- data/client/images/lanes/dataTables/sort_asc.png +0 -0
- data/client/images/lanes/dataTables/sort_asc_disabled.png +0 -0
- data/client/images/lanes/dataTables/sort_both.png +0 -0
- data/client/images/lanes/dataTables/sort_desc.png +0 -0
- data/client/images/lanes/dataTables/sort_desc_disabled.png +0 -0
- data/client/lanes/components/shared/Resize.cjsx +0 -152
- data/client/lanes/components/shared/TextArea.cjsx +0 -19
- data/client/lanes/components/shared/TextField.cjsx +0 -25
- data/client/lanes/models/Bootstrap.coffee +0 -5
- data/client/lanes/models/QueryResults.coffee +0 -93
- data/client/lanes/react/FormBindings.coffee +0 -103
- data/client/lanes/react/Router.cjsx +0 -18
- data/client/lanes/styles/dataTables.scss +0 -4
- data/client/lanes/styles/plugins/all.scss +0 -2
- data/client/lanes/styles/plugins/resize-sensor.scss +0 -24
- data/client/lanes/vendor/jquery-2.js +0 -9190
- data/client/lanes/vendor/jquery.tap.js +0 -401
- data/client/lanes/vendor/magicsuggest.js +0 -1565
- data/client/lanes/vendor/message-bus.coffee +0 -264
- data/client/lanes/workspace/ActiveScreenSwitcher.cjsx +0 -38
- data/client/lanes/workspace/styles/toolbar.scss +0 -4
- data/lib/lanes/api/eco.js +0 -516
- data/lib/lanes/api/sprockets_compressor.rb +0 -39
- data/spec/command-reference-files/model/lib/appy-app.rb +0 -11
- data/views/index.erb +0 -19
@@ -6,20 +6,30 @@ Lanes.Components.Grid.PopoverMixin = {
|
|
6
6
|
Lanes.Components.Grid.EditingMixin
|
7
7
|
]
|
8
8
|
|
9
|
+
propTypes:
|
10
|
+
width: React.PropTypes.number.isRequired
|
11
|
+
height: React.PropTypes.number.isRequired
|
12
|
+
|
13
|
+
getDefaultProps: ->
|
14
|
+
width: 280, height: 350
|
15
|
+
|
9
16
|
renderPopover: (child) ->
|
10
|
-
props =
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
{ placement: 'right', positionLeft: @props.editingEl.offsetLeft + (this.props.editingEl.offsetWidth / 2) }
|
17
|
+
props = _.extend({}, @props)
|
18
|
+
{position} = @props
|
19
|
+
if position.left > ((position.container.width / 2) - 150)
|
20
|
+
props.placement = 'left'
|
21
|
+
props.positionLeft = position.left - @props.width
|
16
22
|
else
|
17
|
-
|
23
|
+
props.placement = 'right'
|
24
|
+
props.positionLeft = position.left
|
25
|
+
props.arrowOffsetTop = Math.min(position.top, (@props.height - 75))
|
26
|
+
props.positionTop = Math.max(5, position.top - props.arrowOffsetTop + (position.rowHeight / 2))
|
27
|
+
|
18
28
|
<div className="editor po">
|
19
29
|
<BS.Popover
|
30
|
+
id="editing-form"
|
20
31
|
{...props}
|
21
|
-
|
22
|
-
arrowOffsetTop={100 + @props.rowHeight / 2}
|
32
|
+
style={height: @props.height, width: @props.width}
|
23
33
|
title = "Edit #{@model.name || 'Record'}"
|
24
34
|
>
|
25
35
|
{@renderEditingBody()}
|
@@ -1,8 +1,14 @@
|
|
1
1
|
class Lanes.Components.Grid.PopoverEditor extends Lanes.React.Component
|
2
2
|
|
3
3
|
mixins: [
|
4
|
-
Lanes.Components.Grid.
|
4
|
+
Lanes.Components.Grid.PopoverMixin
|
5
5
|
]
|
6
6
|
|
7
|
+
renderBody: ->
|
8
|
+
<form>
|
9
|
+
{@renderFields()}
|
10
|
+
{@renderControls()}
|
11
|
+
</form>
|
12
|
+
|
7
13
|
render: ->
|
8
14
|
@renderPopover()
|
@@ -5,6 +5,6 @@ class Lanes.Components.Grid.RowEditor extends Lanes.React.Component
|
|
5
5
|
mixins: [Lanes.Components.Grid.EditingMixin]
|
6
6
|
|
7
7
|
render: ->
|
8
|
-
<div className="editor row" style={top: @
|
8
|
+
<div className="editor row" style={top: @props.position.top}>
|
9
9
|
{@renderEditingBody()}
|
10
10
|
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class CheckBox extends Lanes.React.BaseComponent
|
2
|
+
d: -> @props.query.results.xtraData(@props.row)
|
3
|
+
|
4
|
+
onChange: (ev) -> #, me, results, index) ->
|
5
|
+
@d().selected = ev.target.checked
|
6
|
+
@props.selections.onChange?(@props)
|
7
|
+
@forceUpdate()
|
8
|
+
|
9
|
+
render: ->
|
10
|
+
selected = @d().selected
|
11
|
+
selected = @props.selections.selectionDefault unless selected?
|
12
|
+
<input type="checkbox" checked={selected} onChange={@onChange} />
|
13
|
+
|
14
|
+
|
15
|
+
class Lanes.Components.Grid.Selections
|
16
|
+
id: 'selected'
|
17
|
+
query: false
|
18
|
+
textAlign: 'center'
|
19
|
+
fixedWidth: 90
|
20
|
+
selectionDefault: true
|
21
|
+
sortBy: (row, indx, all) ->
|
22
|
+
false == this.xtraData(indx)?.selected
|
23
|
+
|
24
|
+
constructor: (options) ->
|
25
|
+
@onChange = options.onChange
|
26
|
+
@choices = {}
|
27
|
+
_.bindAll(@, 'onColumnClick')
|
28
|
+
@component = _.partial(@component, _, @)
|
29
|
+
|
30
|
+
onColumnClick: (ev, props) ->
|
31
|
+
unless ev.target.tagName is 'INPUT'
|
32
|
+
input = ev.target.querySelector('input')
|
33
|
+
xd = props.query.results.xtraData(props.rowNum)
|
34
|
+
xd.selected = input.checked = !input.checked
|
35
|
+
@onChange?(props)
|
36
|
+
ev.stopPropagation()
|
37
|
+
|
38
|
+
component: (props, me) ->
|
39
|
+
<CheckBox {...props} selections={me} />
|
@@ -1,14 +1,33 @@
|
|
1
|
-
class Lanes.Components.Grid.Toolbar extends Lanes.React.
|
1
|
+
class Lanes.Components.Grid.Toolbar extends Lanes.React.BaseComponent
|
2
2
|
|
3
3
|
propTypes:
|
4
4
|
addRecord: React.PropTypes.func
|
5
|
+
startEdit: React.PropTypes.func
|
6
|
+
toolbarChildren: React.PropTypes.oneOfType([
|
7
|
+
React.PropTypes.element,
|
8
|
+
React.PropTypes.arrayOf(React.PropTypes.element)
|
9
|
+
])
|
5
10
|
|
6
|
-
|
7
|
-
|
8
|
-
|
11
|
+
onAddRecord: ->
|
12
|
+
model = @props.query.results.addBlankRow(0)
|
13
|
+
@props.startEdit(0)
|
14
|
+
|
15
|
+
AddButton: ->
|
16
|
+
return null unless @props.allowCreate
|
17
|
+
<BS.Button className="navbar-btn add-row pull-right"
|
18
|
+
onClick={@onAddRecord} bsSize='small'
|
19
|
+
>
|
20
|
+
<LC.Icon type="plus" />Add Row
|
9
21
|
</BS.Button>
|
10
22
|
|
11
23
|
render: ->
|
24
|
+
if ( ( false == @props.commands?.isEditing() or not @props.allowCreate ) and not @props.toolbarChildren )
|
25
|
+
return null
|
26
|
+
|
27
|
+
props = _.extend {}, @props,
|
28
|
+
<Lanes.Components.Grid.Toolbar key="toolbar" {...props} />
|
29
|
+
|
12
30
|
<BS.Navbar className="toolbar">
|
13
|
-
{@
|
31
|
+
{@props.toolbarChildren}
|
32
|
+
<@AddButton />
|
14
33
|
</BS.Navbar>
|
@@ -3,6 +3,11 @@
|
|
3
3
|
$editor-background: #e6e6e6;
|
4
4
|
$editor-border-color: #a8a8a8;
|
5
5
|
$editor-border: 1px solid $editor-border-color;
|
6
|
+
|
7
|
+
.toolbar {
|
8
|
+
.add-row { margin-right: 10px; }
|
9
|
+
}
|
10
|
+
|
6
11
|
.editor {
|
7
12
|
|
8
13
|
.controls {
|
@@ -10,10 +15,10 @@ $editor-border: 1px solid $editor-border-color;
|
|
10
15
|
position: relative;
|
11
16
|
overflow: visible;
|
12
17
|
.buttons {
|
13
|
-
|
18
|
+
display: inline-block;
|
14
19
|
margin: 0 auto;
|
15
|
-
display: flex;
|
16
|
-
justify-content: space-between;
|
20
|
+
//display: flex;
|
21
|
+
//justify-content: space-between;
|
17
22
|
}
|
18
23
|
}
|
19
24
|
// common styles shared between row, popover and other editors
|
@@ -32,61 +37,20 @@ $editor-border: 1px solid $editor-border-color;
|
|
32
37
|
height: 35px;
|
33
38
|
border-radius: 5px;
|
34
39
|
}
|
40
|
+
&.center { justify-content: center; }
|
41
|
+
&.right { justify-content: flex-end; }
|
35
42
|
}
|
36
43
|
input {
|
37
44
|
padding: 0 5px;
|
38
45
|
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
// The row editor
|
43
|
-
&.row {
|
44
|
-
position: absolute;
|
45
|
-
width: 100%;
|
46
|
-
right: 25px;
|
47
|
-
left: 5px;
|
48
|
-
z-index:11;
|
49
|
-
min-height: 10px;
|
50
|
-
|
51
|
-
label { display: none; }
|
52
|
-
|
53
|
-
.fields {
|
54
|
-
flex-direction: row;
|
55
|
-
background: $editor-background;
|
56
|
-
}
|
57
|
-
.controls .buttons {
|
58
|
-
background: $editor-background;
|
59
|
-
padding: 2px 8px 8px;
|
60
|
-
position: relative;
|
61
|
-
border-bottom-left-radius: 7px;
|
62
|
-
border-bottom-right-radius: 7px;
|
63
|
-
|
64
|
-
// http://css-tricks.com/better-tabs-with-round-out-borders/
|
65
|
-
&:before,
|
66
|
-
&:after {
|
67
|
-
position: absolute;
|
68
|
-
top: -1px;
|
69
|
-
width: 7px;
|
70
|
-
height: 6px;
|
71
|
-
content: " ";
|
72
|
-
}
|
73
|
-
&:before {
|
74
|
-
left: -7px;
|
75
|
-
border-top-right-radius: 6px;
|
76
|
-
border-width: 1px 1px 0px 0px;
|
77
|
-
box-shadow: 3px 0px 0px $editor-background;
|
78
|
-
}
|
79
|
-
&:after {
|
80
|
-
right: -7px;
|
81
|
-
border-top-left-radius: 6px;
|
82
|
-
border-width: 1px 0px 0px 1px;
|
83
|
-
box-shadow: -3px 0px 0px $editor-background;
|
84
|
-
}
|
46
|
+
input[type=checkbox] {
|
47
|
+
width: inherit;
|
85
48
|
}
|
86
49
|
}
|
50
|
+
|
87
51
|
//Popover editor
|
88
52
|
.popover {
|
89
|
-
|
53
|
+
min-width: 250px;
|
90
54
|
.fields {
|
91
55
|
flex-direction: column;
|
92
56
|
}
|
@@ -101,6 +65,14 @@ $editor-border: 1px solid $editor-border-color;
|
|
101
65
|
border-top: 1px solid darken($editor-background, 15%);
|
102
66
|
padding-top: 8px;
|
103
67
|
margin-top: 8px;
|
68
|
+
.buttons {
|
69
|
+
display: flex;
|
70
|
+
flex-direction: row;
|
71
|
+
justify-content: space-around;
|
72
|
+
flex: 1;
|
73
|
+
}
|
104
74
|
}
|
105
75
|
}
|
106
76
|
}
|
77
|
+
|
78
|
+
@import "./row-editor";
|
@@ -0,0 +1,68 @@
|
|
1
|
+
// The row editor
|
2
|
+
.editor.row {
|
3
|
+
position: absolute;
|
4
|
+
width: 100%;
|
5
|
+
right: 25px;
|
6
|
+
left: 5px;
|
7
|
+
z-index:11;
|
8
|
+
min-height: 10px;
|
9
|
+
|
10
|
+
pointer-events: none;
|
11
|
+
.editing-body { pointer-events: none; }
|
12
|
+
.fields { pointer-events: all; }
|
13
|
+
.controls { pointer-events: none; }
|
14
|
+
.buttons { pointer-events: all; }
|
15
|
+
|
16
|
+
label { display: none; }
|
17
|
+
|
18
|
+
.fields {
|
19
|
+
flex-direction: row;
|
20
|
+
background: $editor-background;
|
21
|
+
.value {
|
22
|
+
width: 100%;
|
23
|
+
height: 35px;
|
24
|
+
border-radius: 5px;
|
25
|
+
flex: 1;
|
26
|
+
.rw-input { height: 35px; }
|
27
|
+
}
|
28
|
+
.field {
|
29
|
+
&.center input { text-align: center; }
|
30
|
+
&.right input { text-align: right; }
|
31
|
+
}
|
32
|
+
}
|
33
|
+
.controls .buttons {
|
34
|
+
background: $editor-background;
|
35
|
+
padding: 2px 8px 8px 8px;
|
36
|
+
position: relative;
|
37
|
+
border-bottom-left-radius: 7px;
|
38
|
+
border-bottom-right-radius: 7px;
|
39
|
+
|
40
|
+
button {
|
41
|
+
margin-left: 20px;
|
42
|
+
&:first-child {
|
43
|
+
margin-left: 0;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
// http://css-tricks.com/better-tabs-with-round-out-borders/
|
47
|
+
&:before,
|
48
|
+
&:after {
|
49
|
+
position: absolute;
|
50
|
+
top: -1px;
|
51
|
+
width: 7px;
|
52
|
+
height: 6px;
|
53
|
+
content: " ";
|
54
|
+
}
|
55
|
+
&:before {
|
56
|
+
left: -7px;
|
57
|
+
border-top-right-radius: 6px;
|
58
|
+
border-width: 1px 1px 0px 0px;
|
59
|
+
box-shadow: 3px 0px 0px $editor-background;
|
60
|
+
}
|
61
|
+
&:after {
|
62
|
+
right: -7px;
|
63
|
+
border-top-left-radius: 6px;
|
64
|
+
border-width: 1px 0px 0px 1px;
|
65
|
+
box-shadow: -3px 0px 0px $editor-background;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
@@ -1,8 +1,85 @@
|
|
1
|
-
@import "lanes/vendor/grid";
|
2
|
-
|
3
1
|
.grid-component {
|
2
|
+
|
3
|
+
min-height: 250px;
|
4
|
+
width: 100%;
|
5
|
+
border: 1px solid $table-border-color;
|
4
6
|
position: relative;
|
5
7
|
|
8
|
+
display: flex;
|
9
|
+
flex-direction: column;
|
10
|
+
flex: 1;
|
11
|
+
|
12
|
+
|
13
|
+
// styles shared between header and row
|
14
|
+
.header, .r {
|
15
|
+
display: flex;
|
16
|
+
flex-direction: row;
|
17
|
+
|
18
|
+
display: flex;
|
19
|
+
flex-direction: row;
|
20
|
+
.c {
|
21
|
+
padding: $table-cell-padding;
|
22
|
+
line-height: $line-height-base;
|
23
|
+
|
24
|
+
display: flex;
|
25
|
+
flex-direction: row;
|
26
|
+
|
27
|
+
&.center { justify-content: center; }
|
28
|
+
&.right { justify-content: flex-end; }
|
29
|
+
|
30
|
+
}
|
31
|
+
&:first-child {
|
32
|
+
border-top: 0;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
.header {
|
37
|
+
min-height: 40px;
|
38
|
+
.c {
|
39
|
+
border: 1px solid $table-border-color;
|
40
|
+
align-items: flex-end;
|
41
|
+
display: inline-block;
|
42
|
+
cursor: pointer;
|
43
|
+
|
44
|
+
display: flex;
|
45
|
+
flex-direction: row;
|
46
|
+
align-items: center;
|
47
|
+
justify-content: space-between;
|
48
|
+
|
49
|
+
&.sort {
|
50
|
+
&:after {
|
51
|
+
content: $fa-var-sort;
|
52
|
+
font-family: FontAwesome;
|
53
|
+
position: relative;
|
54
|
+
right: -5px;
|
55
|
+
color: lightgray;
|
56
|
+
}
|
57
|
+
&.asc:after {
|
58
|
+
color: gray;
|
59
|
+
content: $fa-var-sort-asc;
|
60
|
+
}
|
61
|
+
&.desc:after {
|
62
|
+
color: gray;
|
63
|
+
content: $fa-var-sort-desc;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
.grid-body {
|
70
|
+
border-top: 1px solid $table-border-color;
|
71
|
+
overflow: auto;
|
72
|
+
position: relative; // for absolutely positioned row editor
|
73
|
+
flex-grow: 1;
|
74
|
+
height: 1px;
|
75
|
+
.r:nth-child(odd) {
|
76
|
+
background-color: $table-bg-accent;
|
77
|
+
}
|
78
|
+
.c {
|
79
|
+
align-items: center;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
6
83
|
.toolbar {
|
7
84
|
margin-bottom: 0;
|
8
85
|
border-bottom-left-radius: 0;
|
@@ -11,5 +88,4 @@
|
|
11
88
|
|
12
89
|
@import "./editors";
|
13
90
|
|
14
|
-
|
15
91
|
}
|
@@ -1,36 +1,76 @@
|
|
1
1
|
class Lanes.Components.Modal extends Lanes.React.Component
|
2
2
|
|
3
|
+
propTypes:
|
4
|
+
title: React.PropTypes.string
|
5
|
+
onOk: React.PropTypes.func
|
6
|
+
onCancel: React.PropTypes.func
|
7
|
+
body: React.PropTypes.func
|
8
|
+
show: React.PropTypes.bool
|
9
|
+
buttons: React.PropTypes.array
|
10
|
+
autoHide: React.PropTypes.bool
|
11
|
+
className: React.PropTypes.string
|
12
|
+
size: React.PropTypes.string
|
13
|
+
|
3
14
|
contextTypes:
|
4
|
-
|
15
|
+
viewport: Lanes.PropTypes.State
|
16
|
+
uistate: Lanes.PropTypes.State
|
5
17
|
|
6
|
-
|
7
|
-
|
8
|
-
|
18
|
+
getDefaultProps: ->
|
19
|
+
size: 'large', autoHide: false
|
20
|
+
buttons: [
|
21
|
+
{ title: 'Cancel' }
|
22
|
+
{ title: 'OK', style: 'primary' }
|
23
|
+
]
|
9
24
|
|
10
|
-
|
11
|
-
|
25
|
+
getInitialState: ->
|
26
|
+
show: false
|
12
27
|
|
13
|
-
|
14
|
-
|
28
|
+
onOkButton: -> @state.onOk?(this)
|
29
|
+
onCancelButton: -> @state.onCancel?(this)
|
30
|
+
onButton: (btn) ->
|
31
|
+
@selected = btn
|
32
|
+
@_hide() if @state.autoHide
|
33
|
+
if btn.eventKey is 'ok'
|
34
|
+
@onOkButton()
|
35
|
+
else
|
36
|
+
@onCancelButton()
|
15
37
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
onRequestHide: React.PropTypes.func
|
38
|
+
componentWillReceiveProps: (nextProps) ->
|
39
|
+
@replaceState(nextProps)
|
40
|
+
|
41
|
+
_hide: ->
|
42
|
+
@context.viewport.modalProps.show = false
|
43
|
+
@setState(show: false)
|
23
44
|
|
24
|
-
|
25
|
-
@context.
|
45
|
+
show: ->
|
46
|
+
@context.viewport.modalProps.show = true
|
47
|
+
@setState(show: true)
|
48
|
+
|
49
|
+
hide: ->
|
50
|
+
@_hide()
|
51
|
+
@state.onCancel?()
|
26
52
|
|
27
53
|
render: ->
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
54
|
+
return null unless @state.show
|
55
|
+
|
56
|
+
buttons = for button in @state.buttons
|
57
|
+
if _.isString(button) then button = {title: button}
|
58
|
+
button.eventKey ||= (button.key or button.title).toLowerCase()
|
59
|
+
<BS.Button key={button.title}
|
60
|
+
bsStyle={button.style || 'default'} className={name}
|
61
|
+
onClick={_.partial(@onButton, button)}>{button.title}</BS.Button>
|
62
|
+
|
63
|
+
cls = _.classnames('lanes-modal', @state.className, @context.uistate?.layout_size)
|
64
|
+
Body = @state.body
|
65
|
+
<BS.Modal.Dialog className={cls} bsSize={@state.size} onHide={@_hide}>
|
66
|
+
<BS.Modal.Header>
|
67
|
+
<BS.Modal.Title>{@state.title}</BS.Modal.Title>
|
68
|
+
</BS.Modal.Header>
|
69
|
+
|
70
|
+
<BS.Modal.Body style={maxHeight: @context.viewport.height - 250}>
|
71
|
+
<Body modal={@} />
|
72
|
+
</BS.Modal.Body>
|
33
73
|
|
34
|
-
{
|
74
|
+
<BS.Modal.Footer>{buttons}</BS.Modal.Footer>
|
35
75
|
|
36
|
-
</BS.Modal>
|
76
|
+
</BS.Modal.Dialog>
|