diff --git a/frontend/app_flowy/lib/plugin/plugin.dart b/frontend/app_flowy/lib/plugin/plugin.dart index d0effa0e6d..5007e92e18 100644 --- a/frontend/app_flowy/lib/plugin/plugin.dart +++ b/frontend/app_flowy/lib/plugin/plugin.dart @@ -13,6 +13,7 @@ enum DefaultPlugin { quillEditor, blank, trash, + grid, } extension FlowyDefaultPluginExt on DefaultPlugin { @@ -24,6 +25,8 @@ extension FlowyDefaultPluginExt on DefaultPlugin { return 1; case DefaultPlugin.trash: return 2; + case DefaultPlugin.grid: + return 3; } } } diff --git a/frontend/app_flowy/lib/startup/tasks/load_plugin.dart b/frontend/app_flowy/lib/startup/tasks/load_plugin.dart index 266c6d1c09..fd4bb7e2b9 100644 --- a/frontend/app_flowy/lib/startup/tasks/load_plugin.dart +++ b/frontend/app_flowy/lib/startup/tasks/load_plugin.dart @@ -2,6 +2,7 @@ import 'package:app_flowy/plugin/plugin.dart'; import 'package:app_flowy/startup/startup.dart'; import 'package:app_flowy/workspace/presentation/plugins/blank/blank.dart'; import 'package:app_flowy/workspace/presentation/plugins/doc/document.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/grid.dart'; import 'package:app_flowy/workspace/presentation/plugins/trash/trash.dart'; class PluginLoadTask extends LaunchTask { @@ -13,5 +14,6 @@ class PluginLoadTask extends LaunchTask { registerPlugin(builder: BlankPluginBuilder(), config: BlankPluginConfig()); registerPlugin(builder: TrashPluginBuilder(), config: TrashPluginConfig()); registerPlugin(builder: DocumentPluginBuilder()); + registerPlugin(builder: GridPluginBuilder(), config: GridPluginConfig()); } } diff --git a/frontend/app_flowy/lib/workspace/application/grid/grid_bloc.dart b/frontend/app_flowy/lib/workspace/application/grid/grid_bloc.dart index d8da9e9d65..40b145b8a4 100644 --- a/frontend/app_flowy/lib/workspace/application/grid/grid_bloc.dart +++ b/frontend/app_flowy/lib/workspace/application/grid/grid_bloc.dart @@ -74,7 +74,6 @@ class GridBloc extends Bloc { result.fold((repeatedRow) { final rows = repeatedRow.items; final gridInfo = GridInfo(rows: rows, fields: _fields!); - emit( state.copyWith(loadingState: GridLoadingState.finish(left(unit)), gridInfo: some(left(gridInfo))), ); @@ -116,7 +115,7 @@ class GridLoadingState with _$GridLoadingState { } class GridInfo { - List rows; + List rows; List fields; GridInfo({ @@ -139,7 +138,7 @@ class GridInfo { class RowInfo { List fields; - Map cellMap; + Map cellMap; RowInfo({ required this.fields, required this.cellMap, diff --git a/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart b/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart index 3344b2793a..8e249ab9c5 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/home_stack.dart @@ -170,7 +170,7 @@ class HomeStackManager { if (pluginType == notifier.plugin.ty) { return notifier.plugin.display.buildWidget(); } else { - return const BlankStackPage(); + return const BlankPage(); } }).toList(), ); diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/blank/blank.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/blank/blank.dart index 6be2a788fb..598f6971f2 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/blank/blank.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/blank/blank.dart @@ -45,20 +45,20 @@ class BlankPagePluginDisplay extends PluginDisplay { Widget get leftBarItem => FlowyText.medium(LocaleKeys.blankPageTitle.tr(), fontSize: 12); @override - Widget buildWidget() => const BlankStackPage(); + Widget buildWidget() => const BlankPage(); @override List get navigationItems => [this]; } -class BlankStackPage extends StatefulWidget { - const BlankStackPage({Key? key}) : super(key: key); +class BlankPage extends StatefulWidget { + const BlankPage({Key? key}) : super(key: key); @override - State createState() => _BlankStackPageState(); + State createState() => _BlankPageState(); } -class _BlankStackPageState extends State { +class _BlankPageState extends State { @override Widget build(BuildContext context) { return SizedBox.expand( diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid.dart new file mode 100644 index 0000000000..0fca5db0c7 --- /dev/null +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid.dart @@ -0,0 +1,63 @@ +import 'package:app_flowy/workspace/presentation/home/home_stack.dart'; +import 'package:flowy_infra_ui/style_widget/text.dart'; +import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart'; +import 'package:app_flowy/plugin/plugin.dart'; +import 'package:flutter/material.dart'; + +import 'src/grid_page.dart'; + +class GridPluginBuilder extends PluginBuilder { + @override + Plugin build(dynamic data) { + if (data is View) { + return GridPlugin(pluginType: pluginType, view: data); + } else { + throw FlowyPluginException.invalidData; + } + } + + @override + String get menuName => "Table"; + + @override + PluginType get pluginType => DefaultPlugin.grid.type(); +} + +class GridPluginConfig implements PluginConfig { + @override + bool get creatable => true; +} + +class GridPlugin extends Plugin { + final View _view; + final PluginType _pluginType; + + GridPlugin({ + required View view, + required PluginType pluginType, + }) : _pluginType = pluginType, + _view = view; + + @override + PluginDisplay get display => GridPluginDisplay(view: _view); + + @override + PluginId get id => _view.id; + + @override + PluginType get ty => _pluginType; +} + +class GridPluginDisplay extends PluginDisplay { + final View _view; + GridPluginDisplay({required View view, Key? key}) : _view = view; + + @override + Widget get leftBarItem => const FlowyText.medium("Grid demo", fontSize: 12); + + @override + Widget buildWidget() => GridPage(view: _view); + + @override + List get navigationItems => [this]; +} diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/controller/flowy_table_selection.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/controller/flowy_table_selection.dart similarity index 100% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/controller/flowy_table_selection.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/controller/flowy_table_selection.dart diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/controller/grid_scroll.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/controller/grid_scroll.dart similarity index 100% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/controller/grid_scroll.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/controller/grid_scroll.dart diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_page.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/grid_page.dart similarity index 93% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_page.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/grid_page.dart index 6b72af2aa5..33b8c94fa5 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_page.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/grid_page.dart @@ -8,14 +8,14 @@ import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter/material.dart'; -import 'package:app_flowy/workspace/presentation/plugins/grid/controller/grid_scroll.dart'; import 'package:styled_widget/styled_widget.dart'; -import 'grid_layout.dart'; -import 'grid_sizes.dart'; -import 'widgets/grid_content/grid_row.dart'; -import 'widgets/grid_footer/grid_footer.dart'; -import 'widgets/grid_header/header.dart'; +import 'controller/grid_scroll.dart'; +import 'layout/layout.dart'; +import 'layout/sizes.dart'; +import 'widgets/content/grid_row.dart'; +import 'widgets/footer/grid_footer.dart'; +import 'widgets/header/header.dart'; class GridPage extends StatefulWidget { final View view; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_layout.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/layout/layout.dart similarity index 93% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_layout.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/layout/layout.dart index 0daeacbb33..a44ad20d39 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_layout.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/layout/layout.dart @@ -1,6 +1,6 @@ import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; -import 'grid_sizes.dart'; +import 'sizes.dart'; class GridLayout { static double headerWidth(List fields) { diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_sizes.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/layout/sizes.dart similarity index 100% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid_sizes.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/layout/sizes.dart diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_builder.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_builder.dart similarity index 84% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_builder.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_builder.dart index 5ff1922835..1c02664c86 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_builder.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_builder.dart @@ -2,7 +2,7 @@ import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; import 'grid_cell.dart'; class GridCellBuilder { - static GridCellWidget buildCell(Field? field, GridCell? cell) { + static GridCellWidget buildCell(Field? field, Cell? cell) { if (field == null || cell == null) { return const BlankCell(); } diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_container.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_container.dart similarity index 92% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_container.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_container.dart index 1ba7c1f009..edd0de5076 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_container.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_container.dart @@ -1,4 +1,4 @@ -import 'package:app_flowy/workspace/presentation/plugins/grid/grid_sizes.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart'; import 'package:flowy_infra_ui/widget/mouse_hover_builder.dart'; import 'package:flutter/material.dart'; import 'cell_decoration.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_decoration.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_decoration.dart similarity index 100% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/cell_decoration.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/cell_decoration.dart diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/grid_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/grid_cell.dart similarity index 96% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/grid_cell.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/grid_cell.dart index 93701e1ded..00e6fad6af 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/grid_cell.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/grid_cell.dart @@ -1,4 +1,4 @@ -import 'package:app_flowy/workspace/presentation/plugins/grid/grid_sizes.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart'; import 'package:flowy_infra_ui/widget/mouse_hover_builder.dart'; import 'package:flutter/material.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/grid_row.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/grid_row.dart similarity index 91% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/grid_row.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/grid_row.dart index 247f9fc525..4d5da03423 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_content/grid_row.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/content/grid_row.dart @@ -1,6 +1,6 @@ import 'package:app_flowy/workspace/application/grid/grid_bloc.dart'; -import 'package:app_flowy/workspace/presentation/plugins/grid/grid_sizes.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart'; +import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' hide Row; import 'package:flutter/material.dart'; import 'cell_builder.dart'; import 'cell_container.dart'; @@ -9,7 +9,7 @@ import 'grid_cell.dart'; class GridRowContext { final RepeatedFieldOrder fieldOrders; final Map fieldById; - final Map cellByFieldId; + final Map cellByFieldId; GridRowContext(this.fieldOrders, this.fieldById, this.cellByFieldId); } diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_footer/grid_footer.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/footer/grid_footer.dart similarity index 86% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_footer/grid_footer.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/footer/grid_footer.dart index b5ccee4892..cdbb0d6e51 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_footer/grid_footer.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/footer/grid_footer.dart @@ -1,8 +1,9 @@ -import 'package:app_flowy/workspace/presentation/plugins/grid/grid_sizes.dart'; -import 'package:app_flowy/workspace/presentation/plugins/grid/widgets/grid_content/cell_decoration.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart'; import 'package:flowy_infra_ui/widget/mouse_hover_builder.dart'; import 'package:flutter/material.dart'; +import '../content/cell_decoration.dart'; + class GridFooter extends StatelessWidget { final VoidCallback? onAddRow; const GridFooter({Key? key, required this.onAddRow}) : super(key: key); diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/constants.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/constants.dart similarity index 100% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/constants.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/constants.dart diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/header.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/header.dart similarity index 93% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/header.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/header.dart index 51bceb239a..9f894f8ee5 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/header.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/header.dart @@ -1,5 +1,5 @@ -import 'package:app_flowy/workspace/presentation/plugins/grid/grid_sizes.dart'; -import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart'; +import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' hide Row; import 'package:flutter/material.dart'; import 'header_cell.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/header_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/header_cell.dart similarity index 94% rename from frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/header_cell.dart rename to frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/header_cell.dart index 8fbe34fa2b..4148f1e041 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_header/header_cell.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/header/header_cell.dart @@ -1,4 +1,4 @@ -import 'package:app_flowy/workspace/presentation/plugins/grid/grid_sizes.dart'; +import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart'; import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart'; import 'package:flutter/material.dart'; import 'constants.dart'; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_error_page.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_error_page.dart deleted file mode 100755 index 92973a05b3..0000000000 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/widgets/grid_error_page.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:flutter/material.dart'; - -class GridUnknownError extends StatelessWidget { - const GridUnknownError({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - child: Center( - child: CircularProgressIndicator(), - ), - ); - } -} diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/trash/trash.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/trash/trash.dart index 4f9ef4c911..e74289d982 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/trash/trash.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/trash/trash.dart @@ -65,20 +65,20 @@ class TrashPluginDisplay extends PluginDisplay { Widget? get rightBarItem => null; @override - Widget buildWidget() => const TrashStackPage(key: ValueKey('TrashStackPage')); + Widget buildWidget() => const TrashPage(key: ValueKey('TrashPage')); @override List get navigationItems => [this]; } -class TrashStackPage extends StatefulWidget { - const TrashStackPage({Key? key}) : super(key: key); +class TrashPage extends StatefulWidget { + const TrashPage({Key? key}) : super(key: key); @override - State createState() => _TrashStackPageState(); + State createState() => _TrashPageState(); } -class _TrashStackPageState extends State { +class _TrashPageState extends State { final ScrollController _scrollController = ScrollController(); @override Widget build(BuildContext context) { diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart index 2d8aeace2c..ba0b827df8 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pb.dart @@ -7,7 +7,6 @@ import 'dart:core' as $core; -import 'package:fixnum/fixnum.dart' as $fixnum; import 'package:protobuf/protobuf.dart' as $pb; import 'grid.pbenum.dart'; @@ -16,8 +15,8 @@ export 'grid.pbenum.dart'; class Grid extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Grid', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'filters', subBuilder: RepeatedGridFilter.create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'filters', subBuilder: RepeatedFilter.create) ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldOrders', subBuilder: RepeatedFieldOrder.create) ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rowOrders', subBuilder: RepeatedRowOrder.create) ..hasRequiredFields = false @@ -25,14 +24,14 @@ class Grid extends $pb.GeneratedMessage { Grid._() : super(); factory Grid({ - $core.String? gridId, - RepeatedGridFilter? filters, + $core.String? id, + RepeatedFilter? filters, RepeatedFieldOrder? fieldOrders, RepeatedRowOrder? rowOrders, }) { final _result = create(); - if (gridId != null) { - _result.gridId = gridId; + if (id != null) { + _result.id = id; } if (filters != null) { _result.filters = filters; @@ -67,24 +66,24 @@ class Grid extends $pb.GeneratedMessage { static Grid? _defaultInstance; @$pb.TagNumber(1) - $core.String get gridId => $_getSZ(0); + $core.String get id => $_getSZ(0); @$pb.TagNumber(1) - set gridId($core.String v) { $_setString(0, v); } + set id($core.String v) { $_setString(0, v); } @$pb.TagNumber(1) - $core.bool hasGridId() => $_has(0); + $core.bool hasId() => $_has(0); @$pb.TagNumber(1) - void clearGridId() => clearField(1); + void clearId() => clearField(1); @$pb.TagNumber(2) - RepeatedGridFilter get filters => $_getN(1); + RepeatedFilter get filters => $_getN(1); @$pb.TagNumber(2) - set filters(RepeatedGridFilter v) { setField(2, v); } + set filters(RepeatedFilter v) { setField(2, v); } @$pb.TagNumber(2) $core.bool hasFilters() => $_has(1); @$pb.TagNumber(2) void clearFilters() => clearField(2); @$pb.TagNumber(2) - RepeatedGridFilter ensureFilters() => $_ensure(1); + RepeatedFilter ensureFilters() => $_ensure(1); @$pb.TagNumber(3) RepeatedFieldOrder get fieldOrders => $_getN(2); @@ -109,122 +108,6 @@ class Grid extends $pb.GeneratedMessage { RepeatedRowOrder ensureRowOrders() => $_ensure(3); } -class GridFilter extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridFilter', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc') - ..hasRequiredFields = false - ; - - GridFilter._() : super(); - factory GridFilter({ - $core.String? id, - $core.String? name, - $core.String? desc, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (name != null) { - _result.name = name; - } - if (desc != null) { - _result.desc = desc; - } - return _result; - } - factory GridFilter.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GridFilter.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GridFilter clone() => GridFilter()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GridFilter copyWith(void Function(GridFilter) updates) => super.copyWith((message) => updates(message as GridFilter)) as GridFilter; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GridFilter create() => GridFilter._(); - GridFilter createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GridFilter getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GridFilter? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get id => $_getSZ(0); - @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get name => $_getSZ(1); - @$pb.TagNumber(2) - set name($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasName() => $_has(1); - @$pb.TagNumber(2) - void clearName() => clearField(2); - - @$pb.TagNumber(3) - $core.String get desc => $_getSZ(2); - @$pb.TagNumber(3) - set desc($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasDesc() => $_has(2); - @$pb.TagNumber(3) - void clearDesc() => clearField(3); -} - -class RepeatedGridFilter extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RepeatedGridFilter', createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'items', $pb.PbFieldType.PM, subBuilder: GridFilter.create) - ..hasRequiredFields = false - ; - - RepeatedGridFilter._() : super(); - factory RepeatedGridFilter({ - $core.Iterable? items, - }) { - final _result = create(); - if (items != null) { - _result.items.addAll(items); - } - return _result; - } - factory RepeatedGridFilter.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RepeatedGridFilter.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RepeatedGridFilter clone() => RepeatedGridFilter()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RepeatedGridFilter copyWith(void Function(RepeatedGridFilter) updates) => super.copyWith((message) => updates(message as RepeatedGridFilter)) as RepeatedGridFilter; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RepeatedGridFilter create() => RepeatedGridFilter._(); - RepeatedGridFilter createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RepeatedGridFilter getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RepeatedGridFilter? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get items => $_getList(0); -} - class FieldOrder extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FieldOrder', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') @@ -678,21 +561,19 @@ class RepeatedRowOrder extends $pb.GeneratedMessage { $core.List get items => $_getList(0); } -class GridRow extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridRow', createEmptyInstance: create) +class RawRow extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RawRow', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'gridId') - ..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'modifiedTime') - ..m<$core.String, GridCell>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cellByFieldId', entryClassName: 'GridRow.CellByFieldIdEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: GridCell.create) + ..m<$core.String, RawCell>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cellByFieldId', entryClassName: 'RawRow.CellByFieldIdEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: RawCell.create) ..hasRequiredFields = false ; - GridRow._() : super(); - factory GridRow({ + RawRow._() : super(); + factory RawRow({ $core.String? id, $core.String? gridId, - $fixnum.Int64? modifiedTime, - $core.Map<$core.String, GridCell>? cellByFieldId, + $core.Map<$core.String, RawCell>? cellByFieldId, }) { final _result = create(); if (id != null) { @@ -701,34 +582,31 @@ class GridRow extends $pb.GeneratedMessage { if (gridId != null) { _result.gridId = gridId; } - if (modifiedTime != null) { - _result.modifiedTime = modifiedTime; - } if (cellByFieldId != null) { _result.cellByFieldId.addAll(cellByFieldId); } return _result; } - factory GridRow.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GridRow.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RawRow.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RawRow.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - GridRow clone() => GridRow()..mergeFromMessage(this); + RawRow clone() => RawRow()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - GridRow copyWith(void Function(GridRow) updates) => super.copyWith((message) => updates(message as GridRow)) as GridRow; // ignore: deprecated_member_use + RawRow copyWith(void Function(RawRow) updates) => super.copyWith((message) => updates(message as RawRow)) as RawRow; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static GridRow create() => GridRow._(); - GridRow createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static RawRow create() => RawRow._(); + RawRow createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GridRow getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GridRow? _defaultInstance; + static RawRow getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RawRow? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @@ -749,74 +627,24 @@ class GridRow extends $pb.GeneratedMessage { void clearGridId() => clearField(2); @$pb.TagNumber(3) - $fixnum.Int64 get modifiedTime => $_getI64(2); - @$pb.TagNumber(3) - set modifiedTime($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(3) - $core.bool hasModifiedTime() => $_has(2); - @$pb.TagNumber(3) - void clearModifiedTime() => clearField(3); - - @$pb.TagNumber(4) - $core.Map<$core.String, GridCell> get cellByFieldId => $_getMap(3); + $core.Map<$core.String, RawCell> get cellByFieldId => $_getMap(2); } -class RepeatedRow extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RepeatedRow', createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'items', $pb.PbFieldType.PM, subBuilder: GridRow.create) - ..hasRequiredFields = false - ; - - RepeatedRow._() : super(); - factory RepeatedRow({ - $core.Iterable? items, - }) { - final _result = create(); - if (items != null) { - _result.items.addAll(items); - } - return _result; - } - factory RepeatedRow.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RepeatedRow.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RepeatedRow clone() => RepeatedRow()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RepeatedRow copyWith(void Function(RepeatedRow) updates) => super.copyWith((message) => updates(message as RepeatedRow)) as RepeatedRow; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RepeatedRow create() => RepeatedRow._(); - RepeatedRow createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RepeatedRow getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RepeatedRow? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get items => $_getList(0); -} - -class GridCell extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GridCell', createEmptyInstance: create) +class RawCell extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RawCell', createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rowId') ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'content') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data') ..hasRequiredFields = false ; - GridCell._() : super(); - factory GridCell({ + RawCell._() : super(); + factory RawCell({ $core.String? id, $core.String? rowId, $core.String? fieldId, - $core.String? content, + $core.String? data, }) { final _result = create(); if (id != null) { @@ -828,31 +656,31 @@ class GridCell extends $pb.GeneratedMessage { if (fieldId != null) { _result.fieldId = fieldId; } - if (content != null) { - _result.content = content; + if (data != null) { + _result.data = data; } return _result; } - factory GridCell.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory GridCell.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RawCell.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RawCell.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - GridCell clone() => GridCell()..mergeFromMessage(this); + RawCell clone() => RawCell()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - GridCell copyWith(void Function(GridCell) updates) => super.copyWith((message) => updates(message as GridCell)) as GridCell; // ignore: deprecated_member_use + RawCell copyWith(void Function(RawCell) updates) => super.copyWith((message) => updates(message as RawCell)) as RawCell; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static GridCell create() => GridCell._(); - GridCell createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static RawCell create() => RawCell._(); + RawCell createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static GridCell getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static GridCell? _defaultInstance; + static RawCell getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RawCell? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @@ -882,13 +710,184 @@ class GridCell extends $pb.GeneratedMessage { void clearFieldId() => clearField(3); @$pb.TagNumber(4) - $core.String get content => $_getSZ(3); + $core.String get data => $_getSZ(3); @$pb.TagNumber(4) - set content($core.String v) { $_setString(3, v); } + set data($core.String v) { $_setString(3, v); } @$pb.TagNumber(4) - $core.bool hasContent() => $_has(3); + $core.bool hasData() => $_has(3); @$pb.TagNumber(4) - void clearContent() => clearField(4); + void clearData() => clearField(4); +} + +class RepeatedRow extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RepeatedRow', createEmptyInstance: create) + ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'items', $pb.PbFieldType.PM, subBuilder: Row.create) + ..hasRequiredFields = false + ; + + RepeatedRow._() : super(); + factory RepeatedRow({ + $core.Iterable? items, + }) { + final _result = create(); + if (items != null) { + _result.items.addAll(items); + } + return _result; + } + factory RepeatedRow.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RepeatedRow.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + RepeatedRow clone() => RepeatedRow()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RepeatedRow copyWith(void Function(RepeatedRow) updates) => super.copyWith((message) => updates(message as RepeatedRow)) as RepeatedRow; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static RepeatedRow create() => RepeatedRow._(); + RepeatedRow createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static RepeatedRow getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RepeatedRow? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get items => $_getList(0); +} + +class Row extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Row', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..m<$core.String, Cell>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cellByFieldId', entryClassName: 'Row.CellByFieldIdEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OM, valueCreator: Cell.create) + ..hasRequiredFields = false + ; + + Row._() : super(); + factory Row({ + $core.String? id, + $core.Map<$core.String, Cell>? cellByFieldId, + }) { + final _result = create(); + if (id != null) { + _result.id = id; + } + if (cellByFieldId != null) { + _result.cellByFieldId.addAll(cellByFieldId); + } + return _result; + } + factory Row.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Row.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Row clone() => Row()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Row copyWith(void Function(Row) updates) => super.copyWith((message) => updates(message as Row)) as Row; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Row create() => Row._(); + Row createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Row getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Row? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get id => $_getSZ(0); + @$pb.TagNumber(1) + set id($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasId() => $_has(0); + @$pb.TagNumber(1) + void clearId() => clearField(1); + + @$pb.TagNumber(2) + $core.Map<$core.String, Cell> get cellByFieldId => $_getMap(1); +} + +class Cell extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Cell', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fieldId') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'content') + ..hasRequiredFields = false + ; + + Cell._() : super(); + factory Cell({ + $core.String? id, + $core.String? fieldId, + $core.String? content, + }) { + final _result = create(); + if (id != null) { + _result.id = id; + } + if (fieldId != null) { + _result.fieldId = fieldId; + } + if (content != null) { + _result.content = content; + } + return _result; + } + factory Cell.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Cell.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Cell clone() => Cell()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Cell copyWith(void Function(Cell) updates) => super.copyWith((message) => updates(message as Cell)) as Cell; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Cell create() => Cell._(); + Cell createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Cell getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Cell? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get id => $_getSZ(0); + @$pb.TagNumber(1) + set id($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasId() => $_has(0); + @$pb.TagNumber(1) + void clearId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get fieldId => $_getSZ(1); + @$pb.TagNumber(2) + set fieldId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasFieldId() => $_has(1); + @$pb.TagNumber(2) + void clearFieldId() => clearField(2); + + @$pb.TagNumber(3) + $core.String get content => $_getSZ(2); + @$pb.TagNumber(3) + set content($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasContent() => $_has(2); + @$pb.TagNumber(3) + void clearContent() => clearField(3); } class CreateGridPayload extends $pb.GeneratedMessage { @@ -985,3 +984,119 @@ class GridId extends $pb.GeneratedMessage { void clearValue() => clearField(1); } +class Filter extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Filter', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc') + ..hasRequiredFields = false + ; + + Filter._() : super(); + factory Filter({ + $core.String? id, + $core.String? name, + $core.String? desc, + }) { + final _result = create(); + if (id != null) { + _result.id = id; + } + if (name != null) { + _result.name = name; + } + if (desc != null) { + _result.desc = desc; + } + return _result; + } + factory Filter.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Filter.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Filter clone() => Filter()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Filter copyWith(void Function(Filter) updates) => super.copyWith((message) => updates(message as Filter)) as Filter; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Filter create() => Filter._(); + Filter createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Filter getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Filter? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get id => $_getSZ(0); + @$pb.TagNumber(1) + set id($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasId() => $_has(0); + @$pb.TagNumber(1) + void clearId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get name => $_getSZ(1); + @$pb.TagNumber(2) + set name($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasName() => $_has(1); + @$pb.TagNumber(2) + void clearName() => clearField(2); + + @$pb.TagNumber(3) + $core.String get desc => $_getSZ(2); + @$pb.TagNumber(3) + set desc($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasDesc() => $_has(2); + @$pb.TagNumber(3) + void clearDesc() => clearField(3); +} + +class RepeatedFilter extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RepeatedFilter', createEmptyInstance: create) + ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'items', $pb.PbFieldType.PM, subBuilder: Filter.create) + ..hasRequiredFields = false + ; + + RepeatedFilter._() : super(); + factory RepeatedFilter({ + $core.Iterable? items, + }) { + final _result = create(); + if (items != null) { + _result.items.addAll(items); + } + return _result; + } + factory RepeatedFilter.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory RepeatedFilter.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + RepeatedFilter clone() => RepeatedFilter()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RepeatedFilter copyWith(void Function(RepeatedFilter) updates) => super.copyWith((message) => updates(message as RepeatedFilter)) as RepeatedFilter; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static RepeatedFilter create() => RepeatedFilter._(); + RepeatedFilter createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static RepeatedFilter getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RepeatedFilter? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get items => $_getList(0); +} + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart index bfbd6266da..205acfd611 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-grid-data-model/grid.pbjson.dart @@ -27,37 +27,15 @@ final $typed_data.Uint8List fieldTypeDescriptor = $convert.base64Decode('CglGaWV const Grid$json = const { '1': 'Grid', '2': const [ - const {'1': 'grid_id', '3': 1, '4': 1, '5': 9, '10': 'gridId'}, - const {'1': 'filters', '3': 2, '4': 1, '5': 11, '6': '.RepeatedGridFilter', '10': 'filters'}, + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'filters', '3': 2, '4': 1, '5': 11, '6': '.RepeatedFilter', '10': 'filters'}, const {'1': 'field_orders', '3': 3, '4': 1, '5': 11, '6': '.RepeatedFieldOrder', '10': 'fieldOrders'}, const {'1': 'row_orders', '3': 4, '4': 1, '5': 11, '6': '.RepeatedRowOrder', '10': 'rowOrders'}, ], }; /// Descriptor for `Grid`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridDescriptor = $convert.base64Decode('CgRHcmlkEhcKB2dyaWRfaWQYASABKAlSBmdyaWRJZBItCgdmaWx0ZXJzGAIgASgLMhMuUmVwZWF0ZWRHcmlkRmlsdGVyUgdmaWx0ZXJzEjYKDGZpZWxkX29yZGVycxgDIAEoCzITLlJlcGVhdGVkRmllbGRPcmRlclILZmllbGRPcmRlcnMSMAoKcm93X29yZGVycxgEIAEoCzIRLlJlcGVhdGVkUm93T3JkZXJSCXJvd09yZGVycw=='); -@$core.Deprecated('Use gridFilterDescriptor instead') -const GridFilter$json = const { - '1': 'GridFilter', - '2': const [ - const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, - const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, - const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'}, - ], -}; - -/// Descriptor for `GridFilter`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridFilterDescriptor = $convert.base64Decode('CgpHcmlkRmlsdGVyEg4KAmlkGAEgASgJUgJpZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2M='); -@$core.Deprecated('Use repeatedGridFilterDescriptor instead') -const RepeatedGridFilter$json = const { - '1': 'RepeatedGridFilter', - '2': const [ - const {'1': 'items', '3': 1, '4': 3, '5': 11, '6': '.GridFilter', '10': 'items'}, - ], -}; - -/// Descriptor for `RepeatedGridFilter`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List repeatedGridFilterDescriptor = $convert.base64Decode('ChJSZXBlYXRlZEdyaWRGaWx0ZXISIQoFaXRlbXMYASADKAsyCy5HcmlkRmlsdGVyUgVpdGVtcw=='); +final $typed_data.Uint8List gridDescriptor = $convert.base64Decode('CgRHcmlkEg4KAmlkGAEgASgJUgJpZBIpCgdmaWx0ZXJzGAIgASgLMg8uUmVwZWF0ZWRGaWx0ZXJSB2ZpbHRlcnMSNgoMZmllbGRfb3JkZXJzGAMgASgLMhMuUmVwZWF0ZWRGaWVsZE9yZGVyUgtmaWVsZE9yZGVycxIwCgpyb3dfb3JkZXJzGAQgASgLMhEuUmVwZWF0ZWRSb3dPcmRlclIJcm93T3JkZXJz'); @$core.Deprecated('Use fieldOrderDescriptor instead') const FieldOrder$json = const { '1': 'FieldOrder', @@ -138,53 +116,86 @@ const RepeatedRowOrder$json = const { /// Descriptor for `RepeatedRowOrder`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List repeatedRowOrderDescriptor = $convert.base64Decode('ChBSZXBlYXRlZFJvd09yZGVyEh8KBWl0ZW1zGAEgAygLMgkuUm93T3JkZXJSBWl0ZW1z'); -@$core.Deprecated('Use gridRowDescriptor instead') -const GridRow$json = const { - '1': 'GridRow', +@$core.Deprecated('Use rawRowDescriptor instead') +const RawRow$json = const { + '1': 'RawRow', '2': const [ const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, const {'1': 'grid_id', '3': 2, '4': 1, '5': 9, '10': 'gridId'}, - const {'1': 'modified_time', '3': 3, '4': 1, '5': 3, '10': 'modifiedTime'}, - const {'1': 'cell_by_field_id', '3': 4, '4': 3, '5': 11, '6': '.GridRow.CellByFieldIdEntry', '10': 'cellByFieldId'}, + const {'1': 'cell_by_field_id', '3': 3, '4': 3, '5': 11, '6': '.RawRow.CellByFieldIdEntry', '10': 'cellByFieldId'}, ], - '3': const [GridRow_CellByFieldIdEntry$json], + '3': const [RawRow_CellByFieldIdEntry$json], }; -@$core.Deprecated('Use gridRowDescriptor instead') -const GridRow_CellByFieldIdEntry$json = const { +@$core.Deprecated('Use rawRowDescriptor instead') +const RawRow_CellByFieldIdEntry$json = const { '1': 'CellByFieldIdEntry', '2': const [ const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.GridCell', '10': 'value'}, + const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.RawCell', '10': 'value'}, ], '7': const {'7': true}, }; -/// Descriptor for `GridRow`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridRowDescriptor = $convert.base64Decode('CgdHcmlkUm93Eg4KAmlkGAEgASgJUgJpZBIXCgdncmlkX2lkGAIgASgJUgZncmlkSWQSIwoNbW9kaWZpZWRfdGltZRgDIAEoA1IMbW9kaWZpZWRUaW1lEkQKEGNlbGxfYnlfZmllbGRfaWQYBCADKAsyGy5HcmlkUm93LkNlbGxCeUZpZWxkSWRFbnRyeVINY2VsbEJ5RmllbGRJZBpLChJDZWxsQnlGaWVsZElkRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSHwoFdmFsdWUYAiABKAsyCS5HcmlkQ2VsbFIFdmFsdWU6AjgB'); -@$core.Deprecated('Use repeatedRowDescriptor instead') -const RepeatedRow$json = const { - '1': 'RepeatedRow', - '2': const [ - const {'1': 'items', '3': 1, '4': 3, '5': 11, '6': '.GridRow', '10': 'items'}, - ], -}; - -/// Descriptor for `RepeatedRow`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List repeatedRowDescriptor = $convert.base64Decode('CgtSZXBlYXRlZFJvdxIeCgVpdGVtcxgBIAMoCzIILkdyaWRSb3dSBWl0ZW1z'); -@$core.Deprecated('Use gridCellDescriptor instead') -const GridCell$json = const { - '1': 'GridCell', +/// Descriptor for `RawRow`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List rawRowDescriptor = $convert.base64Decode('CgZSYXdSb3cSDgoCaWQYASABKAlSAmlkEhcKB2dyaWRfaWQYAiABKAlSBmdyaWRJZBJDChBjZWxsX2J5X2ZpZWxkX2lkGAMgAygLMhouUmF3Um93LkNlbGxCeUZpZWxkSWRFbnRyeVINY2VsbEJ5RmllbGRJZBpKChJDZWxsQnlGaWVsZElkRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSHgoFdmFsdWUYAiABKAsyCC5SYXdDZWxsUgV2YWx1ZToCOAE='); +@$core.Deprecated('Use rawCellDescriptor instead') +const RawCell$json = const { + '1': 'RawCell', '2': const [ const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, const {'1': 'row_id', '3': 2, '4': 1, '5': 9, '10': 'rowId'}, const {'1': 'field_id', '3': 3, '4': 1, '5': 9, '10': 'fieldId'}, - const {'1': 'content', '3': 4, '4': 1, '5': 9, '10': 'content'}, + const {'1': 'data', '3': 4, '4': 1, '5': 9, '10': 'data'}, ], }; -/// Descriptor for `GridCell`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List gridCellDescriptor = $convert.base64Decode('CghHcmlkQ2VsbBIOCgJpZBgBIAEoCVICaWQSFQoGcm93X2lkGAIgASgJUgVyb3dJZBIZCghmaWVsZF9pZBgDIAEoCVIHZmllbGRJZBIYCgdjb250ZW50GAQgASgJUgdjb250ZW50'); +/// Descriptor for `RawCell`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List rawCellDescriptor = $convert.base64Decode('CgdSYXdDZWxsEg4KAmlkGAEgASgJUgJpZBIVCgZyb3dfaWQYAiABKAlSBXJvd0lkEhkKCGZpZWxkX2lkGAMgASgJUgdmaWVsZElkEhIKBGRhdGEYBCABKAlSBGRhdGE='); +@$core.Deprecated('Use repeatedRowDescriptor instead') +const RepeatedRow$json = const { + '1': 'RepeatedRow', + '2': const [ + const {'1': 'items', '3': 1, '4': 3, '5': 11, '6': '.Row', '10': 'items'}, + ], +}; + +/// Descriptor for `RepeatedRow`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List repeatedRowDescriptor = $convert.base64Decode('CgtSZXBlYXRlZFJvdxIaCgVpdGVtcxgBIAMoCzIELlJvd1IFaXRlbXM='); +@$core.Deprecated('Use rowDescriptor instead') +const Row$json = const { + '1': 'Row', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'cell_by_field_id', '3': 2, '4': 3, '5': 11, '6': '.Row.CellByFieldIdEntry', '10': 'cellByFieldId'}, + ], + '3': const [Row_CellByFieldIdEntry$json], +}; + +@$core.Deprecated('Use rowDescriptor instead') +const Row_CellByFieldIdEntry$json = const { + '1': 'CellByFieldIdEntry', + '2': const [ + const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.Cell', '10': 'value'}, + ], + '7': const {'7': true}, +}; + +/// Descriptor for `Row`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List rowDescriptor = $convert.base64Decode('CgNSb3cSDgoCaWQYASABKAlSAmlkEkAKEGNlbGxfYnlfZmllbGRfaWQYAiADKAsyFy5Sb3cuQ2VsbEJ5RmllbGRJZEVudHJ5Ug1jZWxsQnlGaWVsZElkGkcKEkNlbGxCeUZpZWxkSWRFbnRyeRIQCgNrZXkYASABKAlSA2tleRIbCgV2YWx1ZRgCIAEoCzIFLkNlbGxSBXZhbHVlOgI4AQ=='); +@$core.Deprecated('Use cellDescriptor instead') +const Cell$json = const { + '1': 'Cell', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'field_id', '3': 2, '4': 1, '5': 9, '10': 'fieldId'}, + const {'1': 'content', '3': 3, '4': 1, '5': 9, '10': 'content'}, + ], +}; + +/// Descriptor for `Cell`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List cellDescriptor = $convert.base64Decode('CgRDZWxsEg4KAmlkGAEgASgJUgJpZBIZCghmaWVsZF9pZBgCIAEoCVIHZmllbGRJZBIYCgdjb250ZW50GAMgASgJUgdjb250ZW50'); @$core.Deprecated('Use createGridPayloadDescriptor instead') const CreateGridPayload$json = const { '1': 'CreateGridPayload', @@ -205,3 +216,25 @@ const GridId$json = const { /// Descriptor for `GridId`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List gridIdDescriptor = $convert.base64Decode('CgZHcmlkSWQSFAoFdmFsdWUYASABKAlSBXZhbHVl'); +@$core.Deprecated('Use filterDescriptor instead') +const Filter$json = const { + '1': 'Filter', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, + const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'}, + ], +}; + +/// Descriptor for `Filter`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List filterDescriptor = $convert.base64Decode('CgZGaWx0ZXISDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSEgoEZGVzYxgDIAEoCVIEZGVzYw=='); +@$core.Deprecated('Use repeatedFilterDescriptor instead') +const RepeatedFilter$json = const { + '1': 'RepeatedFilter', + '2': const [ + const {'1': 'items', '3': 1, '4': 3, '5': 11, '6': '.Filter', '10': 'items'}, + ], +}; + +/// Descriptor for `RepeatedFilter`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List repeatedFilterDescriptor = $convert.base64Decode('Cg5SZXBlYXRlZEZpbHRlchIdCgVpdGVtcxgBIAMoCzIHLkZpbHRlclIFaXRlbXM='); diff --git a/frontend/rust-lib/flowy-grid/src/event_handler.rs b/frontend/rust-lib/flowy-grid/src/event_handler.rs index 765da724d5..600f55ab1a 100644 --- a/frontend/rust-lib/flowy-grid/src/event_handler.rs +++ b/frontend/rust-lib/flowy-grid/src/event_handler.rs @@ -1,7 +1,7 @@ use crate::controller::GridManager; use flowy_error::FlowyError; use flowy_grid_data_model::entities::{ - CreateGridPayload, Grid, GridId, RepeatedFieldOrder, RepeatedRow, RepeatedRowOrder, + CreateGridPayload, Grid, GridId, RepeatedField, RepeatedFieldOrder, RepeatedRow, RepeatedRowOrder, }; use lib_dispatch::prelude::{AppData, Data, DataResult}; use std::sync::Arc; @@ -28,7 +28,7 @@ pub(crate) async fn open_grid_handler( pub(crate) async fn get_rows_handler( data: Data, controller: AppData>, -) -> DataResult { +) -> DataResult { let row_orders: RepeatedRowOrder = data.into_inner(); todo!() @@ -38,7 +38,7 @@ pub(crate) async fn get_rows_handler( pub(crate) async fn get_fields_handler( data: Data, controller: AppData>, -) -> DataResult { +) -> DataResult { let field_orders: RepeatedFieldOrder = data.into_inner(); todo!() @@ -48,8 +48,8 @@ pub(crate) async fn get_fields_handler( pub(crate) async fn create_row_handler( data: Data, controller: AppData>, -) -> DataResult { +) -> Result<(), FlowyError> { let id: GridId = data.into_inner(); - todo!() + Ok(()) } diff --git a/shared-lib/flowy-grid-data-model/src/entities/grid.rs b/shared-lib/flowy-grid-data-model/src/entities/grid.rs index 03e738faee..034f823fd2 100644 --- a/shared-lib/flowy-grid-data-model/src/entities/grid.rs +++ b/shared-lib/flowy-grid-data-model/src/entities/grid.rs @@ -6,10 +6,10 @@ use strum_macros::{Display, EnumIter, EnumString}; #[derive(Debug, Default, ProtoBuf)] pub struct Grid { #[pb(index = 1)] - pub grid_id: String, + pub id: String, #[pb(index = 2)] - pub filters: RepeatedGridFilter, + pub filters: RepeatedFilter, #[pb(index = 3)] pub field_orders: RepeatedFieldOrder, @@ -18,24 +18,6 @@ pub struct Grid { pub row_orders: RepeatedRowOrder, } -#[derive(Debug, Default, ProtoBuf)] -pub struct GridFilter { - #[pb(index = 1)] - pub id: String, - - #[pb(index = 2)] - pub name: String, - - #[pb(index = 3)] - pub desc: String, -} - -#[derive(Debug, Default, ProtoBuf)] -pub struct RepeatedGridFilter { - #[pb(index = 1)] - pub items: Vec, -} - #[derive(Debug, Default, ProtoBuf)] pub struct FieldOrder { #[pb(index = 1)] @@ -167,7 +149,7 @@ pub struct RepeatedRowOrder { } #[derive(Debug, Default, ProtoBuf)] -pub struct GridRow { +pub struct RawRow { #[pb(index = 1)] pub id: String, @@ -175,20 +157,11 @@ pub struct GridRow { pub grid_id: String, #[pb(index = 3)] - pub modified_time: i64, - - #[pb(index = 4)] - pub cell_by_field_id: HashMap, + pub cell_by_field_id: HashMap, } #[derive(Debug, Default, ProtoBuf)] -pub struct RepeatedRow { - #[pb(index = 1)] - pub items: Vec, -} - -#[derive(Debug, Default, ProtoBuf)] -pub struct GridCell { +pub struct RawCell { #[pb(index = 1)] pub id: String, @@ -199,6 +172,33 @@ pub struct GridCell { pub field_id: String, #[pb(index = 4)] + pub data: String, +} + +#[derive(Debug, Default, ProtoBuf)] +pub struct RepeatedRow { + #[pb(index = 1)] + pub items: Vec, +} + +#[derive(Debug, Default, ProtoBuf)] +pub struct Row { + #[pb(index = 1)] + pub id: String, + + #[pb(index = 2)] + pub cell_by_field_id: HashMap, +} + +#[derive(Debug, Default, ProtoBuf)] +pub struct Cell { + #[pb(index = 1)] + pub id: String, + + #[pb(index = 2)] + pub field_id: String, + + #[pb(index = 3)] pub content: String, } @@ -213,3 +213,21 @@ pub struct GridId { #[pb(index = 1)] pub value: String, } + +#[derive(Debug, Default, ProtoBuf)] +pub struct Filter { + #[pb(index = 1)] + pub id: String, + + #[pb(index = 2)] + pub name: String, + + #[pb(index = 3)] + pub desc: String, +} + +#[derive(Debug, Default, ProtoBuf)] +pub struct RepeatedFilter { + #[pb(index = 1)] + pub items: Vec, +} diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs b/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs index 820ac7404c..b644b4fd87 100644 --- a/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs +++ b/shared-lib/flowy-grid-data-model/src/protobuf/model/grid.rs @@ -26,8 +26,8 @@ #[derive(PartialEq,Clone,Default)] pub struct Grid { // message fields - pub grid_id: ::std::string::String, - pub filters: ::protobuf::SingularPtrField, + pub id: ::std::string::String, + pub filters: ::protobuf::SingularPtrField, pub field_orders: ::protobuf::SingularPtrField, pub row_orders: ::protobuf::SingularPtrField, // special fields @@ -46,37 +46,37 @@ impl Grid { ::std::default::Default::default() } - // string grid_id = 1; + // string id = 1; - pub fn get_grid_id(&self) -> &str { - &self.grid_id + pub fn get_id(&self) -> &str { + &self.id } - pub fn clear_grid_id(&mut self) { - self.grid_id.clear(); + pub fn clear_id(&mut self) { + self.id.clear(); } // Param is passed by value, moved - pub fn set_grid_id(&mut self, v: ::std::string::String) { - self.grid_id = v; + pub fn set_id(&mut self, v: ::std::string::String) { + self.id = v; } // Mutable pointer to the field. // If field is not initialized, it is initialized with default value first. - pub fn mut_grid_id(&mut self) -> &mut ::std::string::String { - &mut self.grid_id + pub fn mut_id(&mut self) -> &mut ::std::string::String { + &mut self.id } // Take field - pub fn take_grid_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) + pub fn take_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.id, ::std::string::String::new()) } - // .RepeatedGridFilter filters = 2; + // .RepeatedFilter filters = 2; - pub fn get_filters(&self) -> &RepeatedGridFilter { - self.filters.as_ref().unwrap_or_else(|| ::default_instance()) + pub fn get_filters(&self) -> &RepeatedFilter { + self.filters.as_ref().unwrap_or_else(|| ::default_instance()) } pub fn clear_filters(&mut self) { self.filters.clear(); @@ -87,13 +87,13 @@ impl Grid { } // Param is passed by value, moved - pub fn set_filters(&mut self, v: RepeatedGridFilter) { + pub fn set_filters(&mut self, v: RepeatedFilter) { self.filters = ::protobuf::SingularPtrField::some(v); } // Mutable pointer to the field. // If field is not initialized, it is initialized with default value first. - pub fn mut_filters(&mut self) -> &mut RepeatedGridFilter { + pub fn mut_filters(&mut self) -> &mut RepeatedFilter { if self.filters.is_none() { self.filters.set_default(); } @@ -101,8 +101,8 @@ impl Grid { } // Take field - pub fn take_filters(&mut self) -> RepeatedGridFilter { - self.filters.take().unwrap_or_else(|| RepeatedGridFilter::new()) + pub fn take_filters(&mut self) -> RepeatedFilter { + self.filters.take().unwrap_or_else(|| RepeatedFilter::new()) } // .RepeatedFieldOrder field_orders = 3; @@ -197,7 +197,7 @@ impl ::protobuf::Message for Grid { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; }, 2 => { ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.filters)?; @@ -220,8 +220,8 @@ impl ::protobuf::Message for Grid { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - if !self.grid_id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.grid_id); + if !self.id.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.id); } if let Some(ref v) = self.filters.as_ref() { let len = v.compute_size(); @@ -241,8 +241,8 @@ impl ::protobuf::Message for Grid { } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.grid_id.is_empty() { - os.write_string(1, &self.grid_id)?; + if !self.id.is_empty() { + os.write_string(1, &self.id)?; } if let Some(ref v) = self.filters.as_ref() { os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; @@ -298,11 +298,11 @@ impl ::protobuf::Message for Grid { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "grid_id", - |m: &Grid| { &m.grid_id }, - |m: &mut Grid| { &mut m.grid_id }, + "id", + |m: &Grid| { &m.id }, + |m: &mut Grid| { &mut m.id }, )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "filters", |m: &Grid| { &m.filters }, |m: &mut Grid| { &mut m.filters }, @@ -333,7 +333,7 @@ impl ::protobuf::Message for Grid { impl ::protobuf::Clear for Grid { fn clear(&mut self) { - self.grid_id.clear(); + self.id.clear(); self.filters.clear(); self.field_orders.clear(); self.row_orders.clear(); @@ -353,415 +353,6 @@ impl ::protobuf::reflect::ProtobufValue for Grid { } } -#[derive(PartialEq,Clone,Default)] -pub struct GridFilter { - // message fields - pub id: ::std::string::String, - pub name: ::std::string::String, - pub desc: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a GridFilter { - fn default() -> &'a GridFilter { - ::default_instance() - } -} - -impl GridFilter { - pub fn new() -> GridFilter { - ::std::default::Default::default() - } - - // string id = 1; - - - pub fn get_id(&self) -> &str { - &self.id - } - pub fn clear_id(&mut self) { - self.id.clear(); - } - - // Param is passed by value, moved - pub fn set_id(&mut self, v: ::std::string::String) { - self.id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_id(&mut self) -> &mut ::std::string::String { - &mut self.id - } - - // Take field - pub fn take_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.id, ::std::string::String::new()) - } - - // string name = 2; - - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // string desc = 3; - - - pub fn get_desc(&self) -> &str { - &self.desc - } - pub fn clear_desc(&mut self) { - self.desc.clear(); - } - - // Param is passed by value, moved - pub fn set_desc(&mut self, v: ::std::string::String) { - self.desc = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_desc(&mut self) -> &mut ::std::string::String { - &mut self.desc - } - - // Take field - pub fn take_desc(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.desc, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for GridFilter { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?; - }, - 3 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.id); - } - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.name); - } - if !self.desc.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.desc); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.id.is_empty() { - os.write_string(1, &self.id)?; - } - if !self.name.is_empty() { - os.write_string(2, &self.name)?; - } - if !self.desc.is_empty() { - os.write_string(3, &self.desc)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> GridFilter { - GridFilter::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "id", - |m: &GridFilter| { &m.id }, - |m: &mut GridFilter| { &mut m.id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "name", - |m: &GridFilter| { &m.name }, - |m: &mut GridFilter| { &mut m.name }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "desc", - |m: &GridFilter| { &m.desc }, - |m: &mut GridFilter| { &mut m.desc }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GridFilter", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static GridFilter { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GridFilter::new) - } -} - -impl ::protobuf::Clear for GridFilter { - fn clear(&mut self) { - self.id.clear(); - self.name.clear(); - self.desc.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for GridFilter { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for GridFilter { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct RepeatedGridFilter { - // message fields - pub items: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a RepeatedGridFilter { - fn default() -> &'a RepeatedGridFilter { - ::default_instance() - } -} - -impl RepeatedGridFilter { - pub fn new() -> RepeatedGridFilter { - ::std::default::Default::default() - } - - // repeated .GridFilter items = 1; - - - pub fn get_items(&self) -> &[GridFilter] { - &self.items - } - pub fn clear_items(&mut self) { - self.items.clear(); - } - - // Param is passed by value, moved - pub fn set_items(&mut self, v: ::protobuf::RepeatedField) { - self.items = v; - } - - // Mutable pointer to the field. - pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.items - } - - // Take field - pub fn take_items(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for RepeatedGridFilter { - fn is_initialized(&self) -> bool { - for v in &self.items { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.items)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.items { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.items { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> RepeatedGridFilter { - RepeatedGridFilter::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "items", - |m: &RepeatedGridFilter| { &m.items }, - |m: &mut RepeatedGridFilter| { &mut m.items }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "RepeatedGridFilter", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static RepeatedGridFilter { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(RepeatedGridFilter::new) - } -} - -impl ::protobuf::Clear for RepeatedGridFilter { - fn clear(&mut self) { - self.items.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for RepeatedGridFilter { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for RepeatedGridFilter { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - #[derive(PartialEq,Clone,Default)] pub struct FieldOrder { // message fields @@ -2293,25 +1884,24 @@ impl ::protobuf::reflect::ProtobufValue for RepeatedRowOrder { } #[derive(PartialEq,Clone,Default)] -pub struct GridRow { +pub struct RawRow { // message fields pub id: ::std::string::String, pub grid_id: ::std::string::String, - pub modified_time: i64, - pub cell_by_field_id: ::std::collections::HashMap<::std::string::String, GridCell>, + pub cell_by_field_id: ::std::collections::HashMap<::std::string::String, RawCell>, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, } -impl<'a> ::std::default::Default for &'a GridRow { - fn default() -> &'a GridRow { - ::default_instance() +impl<'a> ::std::default::Default for &'a RawRow { + fn default() -> &'a RawRow { + ::default_instance() } } -impl GridRow { - pub fn new() -> GridRow { +impl RawRow { + pub fn new() -> RawRow { ::std::default::Default::default() } @@ -2367,25 +1957,10 @@ impl GridRow { ::std::mem::replace(&mut self.grid_id, ::std::string::String::new()) } - // int64 modified_time = 3; + // repeated .RawRow.CellByFieldIdEntry cell_by_field_id = 3; - pub fn get_modified_time(&self) -> i64 { - self.modified_time - } - pub fn clear_modified_time(&mut self) { - self.modified_time = 0; - } - - // Param is passed by value, moved - pub fn set_modified_time(&mut self, v: i64) { - self.modified_time = v; - } - - // repeated .GridRow.CellByFieldIdEntry cell_by_field_id = 4; - - - pub fn get_cell_by_field_id(&self) -> &::std::collections::HashMap<::std::string::String, GridCell> { + pub fn get_cell_by_field_id(&self) -> &::std::collections::HashMap<::std::string::String, RawCell> { &self.cell_by_field_id } pub fn clear_cell_by_field_id(&mut self) { @@ -2393,22 +1968,22 @@ impl GridRow { } // Param is passed by value, moved - pub fn set_cell_by_field_id(&mut self, v: ::std::collections::HashMap<::std::string::String, GridCell>) { + pub fn set_cell_by_field_id(&mut self, v: ::std::collections::HashMap<::std::string::String, RawCell>) { self.cell_by_field_id = v; } // Mutable pointer to the field. - pub fn mut_cell_by_field_id(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, GridCell> { + pub fn mut_cell_by_field_id(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, RawCell> { &mut self.cell_by_field_id } // Take field - pub fn take_cell_by_field_id(&mut self) -> ::std::collections::HashMap<::std::string::String, GridCell> { + pub fn take_cell_by_field_id(&mut self) -> ::std::collections::HashMap<::std::string::String, RawCell> { ::std::mem::replace(&mut self.cell_by_field_id, ::std::collections::HashMap::new()) } } -impl ::protobuf::Message for GridRow { +impl ::protobuf::Message for RawRow { fn is_initialized(&self) -> bool { true } @@ -2424,14 +1999,7 @@ impl ::protobuf::Message for GridRow { ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grid_id)?; }, 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int64()?; - self.modified_time = tmp; - }, - 4 => { - ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.cell_by_field_id)?; + ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.cell_by_field_id)?; }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; @@ -2451,10 +2019,7 @@ impl ::protobuf::Message for GridRow { if !self.grid_id.is_empty() { my_size += ::protobuf::rt::string_size(2, &self.grid_id); } - if self.modified_time != 0 { - my_size += ::protobuf::rt::value_size(3, self.modified_time, ::protobuf::wire_format::WireTypeVarint); - } - my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(4, &self.cell_by_field_id); + my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(3, &self.cell_by_field_id); my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); my_size @@ -2467,10 +2032,7 @@ impl ::protobuf::Message for GridRow { if !self.grid_id.is_empty() { os.write_string(2, &self.grid_id)?; } - if self.modified_time != 0 { - os.write_int64(3, self.modified_time)?; - } - ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(4, &self.cell_by_field_id, os)?; + ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(3, &self.cell_by_field_id, os)?; os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2501,8 +2063,8 @@ impl ::protobuf::Message for GridRow { Self::descriptor_static() } - fn new() -> GridRow { - GridRow::new() + fn new() -> RawRow { + RawRow::new() } fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { @@ -2511,55 +2073,334 @@ impl ::protobuf::Message for GridRow { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "id", - |m: &GridRow| { &m.id }, - |m: &mut GridRow| { &mut m.id }, + |m: &RawRow| { &m.id }, + |m: &mut RawRow| { &mut m.id }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "grid_id", - |m: &GridRow| { &m.grid_id }, - |m: &mut GridRow| { &mut m.grid_id }, + |m: &RawRow| { &m.grid_id }, + |m: &mut RawRow| { &mut m.grid_id }, )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( - "modified_time", - |m: &GridRow| { &m.modified_time }, - |m: &mut GridRow| { &mut m.modified_time }, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( "cell_by_field_id", - |m: &GridRow| { &m.cell_by_field_id }, - |m: &mut GridRow| { &mut m.cell_by_field_id }, + |m: &RawRow| { &m.cell_by_field_id }, + |m: &mut RawRow| { &mut m.cell_by_field_id }, )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GridRow", + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RawRow", fields, file_descriptor_proto() ) }) } - fn default_instance() -> &'static GridRow { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GridRow::new) + fn default_instance() -> &'static RawRow { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RawRow::new) } } -impl ::protobuf::Clear for GridRow { +impl ::protobuf::Clear for RawRow { fn clear(&mut self) { self.id.clear(); self.grid_id.clear(); - self.modified_time = 0; self.cell_by_field_id.clear(); self.unknown_fields.clear(); } } -impl ::std::fmt::Debug for GridRow { +impl ::std::fmt::Debug for RawRow { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -impl ::protobuf::reflect::ProtobufValue for GridRow { +impl ::protobuf::reflect::ProtobufValue for RawRow { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RawCell { + // message fields + pub id: ::std::string::String, + pub row_id: ::std::string::String, + pub field_id: ::std::string::String, + pub data: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RawCell { + fn default() -> &'a RawCell { + ::default_instance() + } +} + +impl RawCell { + pub fn new() -> RawCell { + ::std::default::Default::default() + } + + // string id = 1; + + + pub fn get_id(&self) -> &str { + &self.id + } + pub fn clear_id(&mut self) { + self.id.clear(); + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: ::std::string::String) { + self.id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_id(&mut self) -> &mut ::std::string::String { + &mut self.id + } + + // Take field + pub fn take_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.id, ::std::string::String::new()) + } + + // string row_id = 2; + + + pub fn get_row_id(&self) -> &str { + &self.row_id + } + pub fn clear_row_id(&mut self) { + self.row_id.clear(); + } + + // Param is passed by value, moved + pub fn set_row_id(&mut self, v: ::std::string::String) { + self.row_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_row_id(&mut self) -> &mut ::std::string::String { + &mut self.row_id + } + + // Take field + pub fn take_row_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.row_id, ::std::string::String::new()) + } + + // string field_id = 3; + + + pub fn get_field_id(&self) -> &str { + &self.field_id + } + pub fn clear_field_id(&mut self) { + self.field_id.clear(); + } + + // Param is passed by value, moved + pub fn set_field_id(&mut self, v: ::std::string::String) { + self.field_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_field_id(&mut self) -> &mut ::std::string::String { + &mut self.field_id + } + + // Take field + pub fn take_field_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.field_id, ::std::string::String::new()) + } + + // string data = 4; + + + pub fn get_data(&self) -> &str { + &self.data + } + pub fn clear_data(&mut self) { + self.data.clear(); + } + + // Param is passed by value, moved + pub fn set_data(&mut self, v: ::std::string::String) { + self.data = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_data(&mut self) -> &mut ::std::string::String { + &mut self.data + } + + // Take field + pub fn take_data(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.data, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for RawCell { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.row_id)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_id)?; + }, + 4 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.id.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.id); + } + if !self.row_id.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.row_id); + } + if !self.field_id.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.field_id); + } + if !self.data.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.data); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.id.is_empty() { + os.write_string(1, &self.id)?; + } + if !self.row_id.is_empty() { + os.write_string(2, &self.row_id)?; + } + if !self.field_id.is_empty() { + os.write_string(3, &self.field_id)?; + } + if !self.data.is_empty() { + os.write_string(4, &self.data)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RawCell { + RawCell::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "id", + |m: &RawCell| { &m.id }, + |m: &mut RawCell| { &mut m.id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "row_id", + |m: &RawCell| { &m.row_id }, + |m: &mut RawCell| { &mut m.row_id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "field_id", + |m: &RawCell| { &m.field_id }, + |m: &mut RawCell| { &mut m.field_id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "data", + |m: &RawCell| { &m.data }, + |m: &mut RawCell| { &mut m.data }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RawCell", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RawCell { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RawCell::new) + } +} + +impl ::protobuf::Clear for RawCell { + fn clear(&mut self) { + self.id.clear(); + self.row_id.clear(); + self.field_id.clear(); + self.data.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RawCell { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RawCell { fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { ::protobuf::reflect::ReflectValueRef::Message(self) } @@ -2568,7 +2409,7 @@ impl ::protobuf::reflect::ProtobufValue for GridRow { #[derive(PartialEq,Clone,Default)] pub struct RepeatedRow { // message fields - pub items: ::protobuf::RepeatedField, + pub items: ::protobuf::RepeatedField, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -2585,10 +2426,10 @@ impl RepeatedRow { ::std::default::Default::default() } - // repeated .GridRow items = 1; + // repeated .Row items = 1; - pub fn get_items(&self) -> &[GridRow] { + pub fn get_items(&self) -> &[Row] { &self.items } pub fn clear_items(&mut self) { @@ -2596,17 +2437,17 @@ impl RepeatedRow { } // Param is passed by value, moved - pub fn set_items(&mut self, v: ::protobuf::RepeatedField) { + pub fn set_items(&mut self, v: ::protobuf::RepeatedField) { self.items = v; } // Mutable pointer to the field. - pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField { + pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField { &mut self.items } // Take field - pub fn take_items(&mut self) -> ::protobuf::RepeatedField { + pub fn take_items(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new()) } } @@ -2693,7 +2534,7 @@ impl ::protobuf::Message for RepeatedRow { static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "items", |m: &RepeatedRow| { &m.items }, |m: &mut RepeatedRow| { &mut m.items }, @@ -2732,25 +2573,23 @@ impl ::protobuf::reflect::ProtobufValue for RepeatedRow { } #[derive(PartialEq,Clone,Default)] -pub struct GridCell { +pub struct Row { // message fields pub id: ::std::string::String, - pub row_id: ::std::string::String, - pub field_id: ::std::string::String, - pub content: ::std::string::String, + pub cell_by_field_id: ::std::collections::HashMap<::std::string::String, Cell>, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, } -impl<'a> ::std::default::Default for &'a GridCell { - fn default() -> &'a GridCell { - ::default_instance() +impl<'a> ::std::default::Default for &'a Row { + fn default() -> &'a Row { + ::default_instance() } } -impl GridCell { - pub fn new() -> GridCell { +impl Row { + pub fn new() -> Row { ::std::default::Default::default() } @@ -2780,33 +2619,204 @@ impl GridCell { ::std::mem::replace(&mut self.id, ::std::string::String::new()) } - // string row_id = 2; + // repeated .Row.CellByFieldIdEntry cell_by_field_id = 2; - pub fn get_row_id(&self) -> &str { - &self.row_id + pub fn get_cell_by_field_id(&self) -> &::std::collections::HashMap<::std::string::String, Cell> { + &self.cell_by_field_id } - pub fn clear_row_id(&mut self) { - self.row_id.clear(); + pub fn clear_cell_by_field_id(&mut self) { + self.cell_by_field_id.clear(); } // Param is passed by value, moved - pub fn set_row_id(&mut self, v: ::std::string::String) { - self.row_id = v; + pub fn set_cell_by_field_id(&mut self, v: ::std::collections::HashMap<::std::string::String, Cell>) { + self.cell_by_field_id = v; + } + + // Mutable pointer to the field. + pub fn mut_cell_by_field_id(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, Cell> { + &mut self.cell_by_field_id + } + + // Take field + pub fn take_cell_by_field_id(&mut self) -> ::std::collections::HashMap<::std::string::String, Cell> { + ::std::mem::replace(&mut self.cell_by_field_id, ::std::collections::HashMap::new()) + } +} + +impl ::protobuf::Message for Row { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; + }, + 2 => { + ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.cell_by_field_id)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.id.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.id); + } + my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(2, &self.cell_by_field_id); + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.id.is_empty() { + os.write_string(1, &self.id)?; + } + ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(2, &self.cell_by_field_id, os)?; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Row { + Row::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "id", + |m: &Row| { &m.id }, + |m: &mut Row| { &mut m.id }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( + "cell_by_field_id", + |m: &Row| { &m.cell_by_field_id }, + |m: &mut Row| { &mut m.cell_by_field_id }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Row", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Row { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Row::new) + } +} + +impl ::protobuf::Clear for Row { + fn clear(&mut self) { + self.id.clear(); + self.cell_by_field_id.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Row { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Row { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Cell { + // message fields + pub id: ::std::string::String, + pub field_id: ::std::string::String, + pub content: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Cell { + fn default() -> &'a Cell { + ::default_instance() + } +} + +impl Cell { + pub fn new() -> Cell { + ::std::default::Default::default() + } + + // string id = 1; + + + pub fn get_id(&self) -> &str { + &self.id + } + pub fn clear_id(&mut self) { + self.id.clear(); + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: ::std::string::String) { + self.id = v; } // Mutable pointer to the field. // If field is not initialized, it is initialized with default value first. - pub fn mut_row_id(&mut self) -> &mut ::std::string::String { - &mut self.row_id + pub fn mut_id(&mut self) -> &mut ::std::string::String { + &mut self.id } // Take field - pub fn take_row_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.row_id, ::std::string::String::new()) + pub fn take_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.id, ::std::string::String::new()) } - // string field_id = 3; + // string field_id = 2; pub fn get_field_id(&self) -> &str { @@ -2832,7 +2842,7 @@ impl GridCell { ::std::mem::replace(&mut self.field_id, ::std::string::String::new()) } - // string content = 4; + // string content = 3; pub fn get_content(&self) -> &str { @@ -2859,7 +2869,7 @@ impl GridCell { } } -impl ::protobuf::Message for GridCell { +impl ::protobuf::Message for Cell { fn is_initialized(&self) -> bool { true } @@ -2872,12 +2882,9 @@ impl ::protobuf::Message for GridCell { ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; }, 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.row_id)?; - }, - 3 => { ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_id)?; }, - 4 => { + 3 => { ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.content)?; }, _ => { @@ -2895,14 +2902,11 @@ impl ::protobuf::Message for GridCell { if !self.id.is_empty() { my_size += ::protobuf::rt::string_size(1, &self.id); } - if !self.row_id.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.row_id); - } if !self.field_id.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.field_id); + my_size += ::protobuf::rt::string_size(2, &self.field_id); } if !self.content.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.content); + my_size += ::protobuf::rt::string_size(3, &self.content); } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -2913,14 +2917,11 @@ impl ::protobuf::Message for GridCell { if !self.id.is_empty() { os.write_string(1, &self.id)?; } - if !self.row_id.is_empty() { - os.write_string(2, &self.row_id)?; - } if !self.field_id.is_empty() { - os.write_string(3, &self.field_id)?; + os.write_string(2, &self.field_id)?; } if !self.content.is_empty() { - os.write_string(4, &self.content)?; + os.write_string(3, &self.content)?; } os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) @@ -2952,8 +2953,8 @@ impl ::protobuf::Message for GridCell { Self::descriptor_static() } - fn new() -> GridCell { - GridCell::new() + fn new() -> Cell { + Cell::new() } fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { @@ -2962,55 +2963,49 @@ impl ::protobuf::Message for GridCell { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "id", - |m: &GridCell| { &m.id }, - |m: &mut GridCell| { &mut m.id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "row_id", - |m: &GridCell| { &m.row_id }, - |m: &mut GridCell| { &mut m.row_id }, + |m: &Cell| { &m.id }, + |m: &mut Cell| { &mut m.id }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "field_id", - |m: &GridCell| { &m.field_id }, - |m: &mut GridCell| { &mut m.field_id }, + |m: &Cell| { &m.field_id }, + |m: &mut Cell| { &mut m.field_id }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content", - |m: &GridCell| { &m.content }, - |m: &mut GridCell| { &mut m.content }, + |m: &Cell| { &m.content }, + |m: &mut Cell| { &mut m.content }, )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GridCell", + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Cell", fields, file_descriptor_proto() ) }) } - fn default_instance() -> &'static GridCell { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GridCell::new) + fn default_instance() -> &'static Cell { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Cell::new) } } -impl ::protobuf::Clear for GridCell { +impl ::protobuf::Clear for Cell { fn clear(&mut self) { self.id.clear(); - self.row_id.clear(); self.field_id.clear(); self.content.clear(); self.unknown_fields.clear(); } } -impl ::std::fmt::Debug for GridCell { +impl ::std::fmt::Debug for Cell { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -impl ::protobuf::reflect::ProtobufValue for GridCell { +impl ::protobuf::reflect::ProtobufValue for Cell { fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { ::protobuf::reflect::ReflectValueRef::Message(self) } @@ -3334,6 +3329,415 @@ impl ::protobuf::reflect::ProtobufValue for GridId { } } +#[derive(PartialEq,Clone,Default)] +pub struct Filter { + // message fields + pub id: ::std::string::String, + pub name: ::std::string::String, + pub desc: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Filter { + fn default() -> &'a Filter { + ::default_instance() + } +} + +impl Filter { + pub fn new() -> Filter { + ::std::default::Default::default() + } + + // string id = 1; + + + pub fn get_id(&self) -> &str { + &self.id + } + pub fn clear_id(&mut self) { + self.id.clear(); + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: ::std::string::String) { + self.id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_id(&mut self) -> &mut ::std::string::String { + &mut self.id + } + + // Take field + pub fn take_id(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.id, ::std::string::String::new()) + } + + // string name = 2; + + + pub fn get_name(&self) -> &str { + &self.name + } + pub fn clear_name(&mut self) { + self.name.clear(); + } + + // Param is passed by value, moved + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_name(&mut self) -> &mut ::std::string::String { + &mut self.name + } + + // Take field + pub fn take_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.name, ::std::string::String::new()) + } + + // string desc = 3; + + + pub fn get_desc(&self) -> &str { + &self.desc + } + pub fn clear_desc(&mut self) { + self.desc.clear(); + } + + // Param is passed by value, moved + pub fn set_desc(&mut self, v: ::std::string::String) { + self.desc = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_desc(&mut self) -> &mut ::std::string::String { + &mut self.desc + } + + // Take field + pub fn take_desc(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.desc, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for Filter { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.desc)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.id.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.id); + } + if !self.name.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.name); + } + if !self.desc.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.desc); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.id.is_empty() { + os.write_string(1, &self.id)?; + } + if !self.name.is_empty() { + os.write_string(2, &self.name)?; + } + if !self.desc.is_empty() { + os.write_string(3, &self.desc)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Filter { + Filter::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "id", + |m: &Filter| { &m.id }, + |m: &mut Filter| { &mut m.id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &Filter| { &m.name }, + |m: &mut Filter| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "desc", + |m: &Filter| { &m.desc }, + |m: &mut Filter| { &mut m.desc }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Filter", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Filter { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Filter::new) + } +} + +impl ::protobuf::Clear for Filter { + fn clear(&mut self) { + self.id.clear(); + self.name.clear(); + self.desc.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Filter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Filter { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RepeatedFilter { + // message fields + pub items: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RepeatedFilter { + fn default() -> &'a RepeatedFilter { + ::default_instance() + } +} + +impl RepeatedFilter { + pub fn new() -> RepeatedFilter { + ::std::default::Default::default() + } + + // repeated .Filter items = 1; + + + pub fn get_items(&self) -> &[Filter] { + &self.items + } + pub fn clear_items(&mut self) { + self.items.clear(); + } + + // Param is passed by value, moved + pub fn set_items(&mut self, v: ::protobuf::RepeatedField) { + self.items = v; + } + + // Mutable pointer to the field. + pub fn mut_items(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.items + } + + // Take field + pub fn take_items(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.items, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for RepeatedFilter { + fn is_initialized(&self) -> bool { + for v in &self.items { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.items)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.items { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.items { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RepeatedFilter { + RepeatedFilter::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "items", + |m: &RepeatedFilter| { &m.items }, + |m: &mut RepeatedFilter| { &mut m.items }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RepeatedFilter", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RepeatedFilter { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RepeatedFilter::new) + } +} + +impl ::protobuf::Clear for RepeatedFilter { + fn clear(&mut self) { + self.items.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RepeatedFilter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RepeatedFilter { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum FieldType { RichText = 0, @@ -3397,44 +3801,49 @@ impl ::protobuf::reflect::ProtobufValue for FieldType { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\ngrid.proto\"\xb8\x01\n\x04Grid\x12\x17\n\x07grid_id\x18\x01\x20\x01(\ - \tR\x06gridId\x12-\n\x07filters\x18\x02\x20\x01(\x0b2\x13.RepeatedGridFi\ - lterR\x07filters\x126\n\x0cfield_orders\x18\x03\x20\x01(\x0b2\x13.Repeat\ - edFieldOrderR\x0bfieldOrders\x120\n\nrow_orders\x18\x04\x20\x01(\x0b2\ - \x11.RepeatedRowOrderR\trowOrders\"D\n\nGridFilter\x12\x0e\n\x02id\x18\ - \x01\x20\x01(\tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\ - \x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\"7\n\x12RepeatedGridFilter\ - \x12!\n\x05items\x18\x01\x20\x03(\x0b2\x0b.GridFilterR\x05items\"G\n\nFi\ - eldOrder\x12\x19\n\x08field_id\x18\x01\x20\x01(\tR\x07fieldId\x12\x1e\n\ - \nvisibility\x18\x02\x20\x01(\x08R\nvisibility\"7\n\x12RepeatedFieldOrde\ - r\x12!\n\x05items\x18\x01\x20\x03(\x0b2\x0b.FieldOrderR\x05items\"\xc5\ - \x01\n\x05Field\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x12\n\x04n\ - ame\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\ - \x04desc\x12)\n\nfield_type\x18\x04\x20\x01(\x0e2\n.FieldTypeR\tfieldTyp\ - e\x12\x16\n\x06frozen\x18\x05\x20\x01(\x08R\x06frozen\x12\x14\n\x05width\ - \x18\x06\x20\x01(\x05R\x05width\x12+\n\x0ctype_options\x18\x07\x20\x01(\ - \x0b2\x08.AnyDataR\x0btypeOptions\"-\n\rRepeatedField\x12\x1c\n\x05items\ - \x18\x01\x20\x03(\x0b2\x06.FieldR\x05items\"8\n\x07AnyData\x12\x17\n\x07\ - type_id\x18\x01\x20\x01(\tR\x06typeId\x12\x14\n\x05value\x18\x02\x20\x01\ - (\x0cR\x05value\"Z\n\x08RowOrder\x12\x17\n\x07grid_id\x18\x01\x20\x01(\t\ - R\x06gridId\x12\x15\n\x06row_id\x18\x02\x20\x01(\tR\x05rowId\x12\x1e\n\n\ - visibility\x18\x03\x20\x01(\x08R\nvisibility\"3\n\x10RepeatedRowOrder\ - \x12\x1f\n\x05items\x18\x01\x20\x03(\x0b2\t.RowOrderR\x05items\"\xea\x01\ - \n\x07GridRow\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x17\n\x07gri\ - d_id\x18\x02\x20\x01(\tR\x06gridId\x12#\n\rmodified_time\x18\x03\x20\x01\ - (\x03R\x0cmodifiedTime\x12D\n\x10cell_by_field_id\x18\x04\x20\x03(\x0b2\ - \x1b.GridRow.CellByFieldIdEntryR\rcellByFieldId\x1aK\n\x12CellByFieldIdE\ - ntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x1f\n\x05value\x18\ - \x02\x20\x01(\x0b2\t.GridCellR\x05value:\x028\x01\"-\n\x0bRepeatedRow\ - \x12\x1e\n\x05items\x18\x01\x20\x03(\x0b2\x08.GridRowR\x05items\"f\n\x08\ - GridCell\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x15\n\x06row_id\ - \x18\x02\x20\x01(\tR\x05rowId\x12\x19\n\x08field_id\x18\x03\x20\x01(\tR\ - \x07fieldId\x12\x18\n\x07content\x18\x04\x20\x01(\tR\x07content\"'\n\x11\ - CreateGridPayload\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\"\x1e\n\ - \x06GridId\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05value*d\n\tFieldTyp\ - e\x12\x0c\n\x08RichText\x10\0\x12\n\n\x06Number\x10\x01\x12\x0c\n\x08Dat\ - eTime\x10\x02\x12\x10\n\x0cSingleSelect\x10\x03\x12\x0f\n\x0bMultiSelect\ - \x10\x04\x12\x0c\n\x08Checkbox\x10\x05b\x06proto3\ + \n\ngrid.proto\"\xab\x01\n\x04Grid\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\ + \x02id\x12)\n\x07filters\x18\x02\x20\x01(\x0b2\x0f.RepeatedFilterR\x07fi\ + lters\x126\n\x0cfield_orders\x18\x03\x20\x01(\x0b2\x13.RepeatedFieldOrde\ + rR\x0bfieldOrders\x120\n\nrow_orders\x18\x04\x20\x01(\x0b2\x11.RepeatedR\ + owOrderR\trowOrders\"G\n\nFieldOrder\x12\x19\n\x08field_id\x18\x01\x20\ + \x01(\tR\x07fieldId\x12\x1e\n\nvisibility\x18\x02\x20\x01(\x08R\nvisibil\ + ity\"7\n\x12RepeatedFieldOrder\x12!\n\x05items\x18\x01\x20\x03(\x0b2\x0b\ + .FieldOrderR\x05items\"\xc5\x01\n\x05Field\x12\x0e\n\x02id\x18\x01\x20\ + \x01(\tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\ + \x04desc\x18\x03\x20\x01(\tR\x04desc\x12)\n\nfield_type\x18\x04\x20\x01(\ + \x0e2\n.FieldTypeR\tfieldType\x12\x16\n\x06frozen\x18\x05\x20\x01(\x08R\ + \x06frozen\x12\x14\n\x05width\x18\x06\x20\x01(\x05R\x05width\x12+\n\x0ct\ + ype_options\x18\x07\x20\x01(\x0b2\x08.AnyDataR\x0btypeOptions\"-\n\rRepe\ + atedField\x12\x1c\n\x05items\x18\x01\x20\x03(\x0b2\x06.FieldR\x05items\"\ + 8\n\x07AnyData\x12\x17\n\x07type_id\x18\x01\x20\x01(\tR\x06typeId\x12\ + \x14\n\x05value\x18\x02\x20\x01(\x0cR\x05value\"Z\n\x08RowOrder\x12\x17\ + \n\x07grid_id\x18\x01\x20\x01(\tR\x06gridId\x12\x15\n\x06row_id\x18\x02\ + \x20\x01(\tR\x05rowId\x12\x1e\n\nvisibility\x18\x03\x20\x01(\x08R\nvisib\ + ility\"3\n\x10RepeatedRowOrder\x12\x1f\n\x05items\x18\x01\x20\x03(\x0b2\ + \t.RowOrderR\x05items\"\xc2\x01\n\x06RawRow\x12\x0e\n\x02id\x18\x01\x20\ + \x01(\tR\x02id\x12\x17\n\x07grid_id\x18\x02\x20\x01(\tR\x06gridId\x12C\n\ + \x10cell_by_field_id\x18\x03\x20\x03(\x0b2\x1a.RawRow.CellByFieldIdEntry\ + R\rcellByFieldId\x1aJ\n\x12CellByFieldIdEntry\x12\x10\n\x03key\x18\x01\ + \x20\x01(\tR\x03key\x12\x1e\n\x05value\x18\x02\x20\x01(\x0b2\x08.RawCell\ + R\x05value:\x028\x01\"_\n\x07RawCell\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\ + \x02id\x12\x15\n\x06row_id\x18\x02\x20\x01(\tR\x05rowId\x12\x19\n\x08fie\ + ld_id\x18\x03\x20\x01(\tR\x07fieldId\x12\x12\n\x04data\x18\x04\x20\x01(\ + \tR\x04data\")\n\x0bRepeatedRow\x12\x1a\n\x05items\x18\x01\x20\x03(\x0b2\ + \x04.RowR\x05items\"\xa0\x01\n\x03Row\x12\x0e\n\x02id\x18\x01\x20\x01(\t\ + R\x02id\x12@\n\x10cell_by_field_id\x18\x02\x20\x03(\x0b2\x17.Row.CellByF\ + ieldIdEntryR\rcellByFieldId\x1aG\n\x12CellByFieldIdEntry\x12\x10\n\x03ke\ + y\x18\x01\x20\x01(\tR\x03key\x12\x1b\n\x05value\x18\x02\x20\x01(\x0b2\ + \x05.CellR\x05value:\x028\x01\"K\n\x04Cell\x12\x0e\n\x02id\x18\x01\x20\ + \x01(\tR\x02id\x12\x19\n\x08field_id\x18\x02\x20\x01(\tR\x07fieldId\x12\ + \x18\n\x07content\x18\x03\x20\x01(\tR\x07content\"'\n\x11CreateGridPaylo\ + ad\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\"\x1e\n\x06GridId\x12\ + \x14\n\x05value\x18\x01\x20\x01(\tR\x05value\"@\n\x06Filter\x12\x0e\n\ + \x02id\x18\x01\x20\x01(\tR\x02id\x12\x12\n\x04name\x18\x02\x20\x01(\tR\ + \x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\"/\n\x0eRepeatedF\ + ilter\x12\x1d\n\x05items\x18\x01\x20\x03(\x0b2\x07.FilterR\x05items*d\n\ + \tFieldType\x12\x0c\n\x08RichText\x10\0\x12\n\n\x06Number\x10\x01\x12\ + \x0c\n\x08DateTime\x10\x02\x12\x10\n\x0cSingleSelect\x10\x03\x12\x0f\n\ + \x0bMultiSelect\x10\x04\x12\x0c\n\x08Checkbox\x10\x05b\x06proto3\ "; static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; diff --git a/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto b/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto index 352a54c5c8..16b14f76c9 100644 --- a/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto +++ b/shared-lib/flowy-grid-data-model/src/protobuf/proto/grid.proto @@ -1,19 +1,11 @@ syntax = "proto3"; message Grid { - string grid_id = 1; - RepeatedGridFilter filters = 2; + string id = 1; + RepeatedFilter filters = 2; RepeatedFieldOrder field_orders = 3; RepeatedRowOrder row_orders = 4; } -message GridFilter { - string id = 1; - string name = 2; - string desc = 3; -} -message RepeatedGridFilter { - repeated GridFilter items = 1; -} message FieldOrder { string field_id = 1; bool visibility = 2; @@ -45,20 +37,28 @@ message RowOrder { message RepeatedRowOrder { repeated RowOrder items = 1; } -message GridRow { +message RawRow { string id = 1; string grid_id = 2; - int64 modified_time = 3; - map cell_by_field_id = 4; + map cell_by_field_id = 3; } -message RepeatedRow { - repeated GridRow items = 1; -} -message GridCell { +message RawCell { string id = 1; string row_id = 2; string field_id = 3; - string content = 4; + string data = 4; +} +message RepeatedRow { + repeated Row items = 1; +} +message Row { + string id = 1; + map cell_by_field_id = 2; +} +message Cell { + string id = 1; + string field_id = 2; + string content = 3; } message CreateGridPayload { string name = 1; @@ -66,6 +66,14 @@ message CreateGridPayload { message GridId { string value = 1; } +message Filter { + string id = 1; + string name = 2; + string desc = 3; +} +message RepeatedFilter { + repeated Filter items = 1; +} enum FieldType { RichText = 0; Number = 1;