diff --git a/apps/common/mobile/lib/view/Search.jsx b/apps/common/mobile/lib/view/Search.jsx index 17e4cfb4d..64f8ef7d4 100644 --- a/apps/common/mobile/lib/view/Search.jsx +++ b/apps/common/mobile/lib/view/Search.jsx @@ -1,5 +1,5 @@ -import React, { Component } from 'react'; +import React, { Component, Fragment } from 'react'; import { Searchbar, Popover, Popup, View, Page, List, ListItem, Navbar, NavRight, Link } from 'framework7-react'; import { Toggle } from 'framework7-react'; import { f7 } from 'framework7-react'; @@ -9,7 +9,8 @@ import { observable, runInAction } from "mobx"; import { observer } from "mobx-react"; const searchOptions = observable({ - usereplace: false + usereplace: false, + isReplaceAll: false }); const popoverStyle = { @@ -31,7 +32,8 @@ class SearchSettingsView extends Component { searchBy: 1, lookIn: 1, isMatchCase: false, - isMatchCell: false + isMatchCell: false, + isReplaceAll: false }; } @@ -39,12 +41,20 @@ class SearchSettingsView extends Component { runInAction(() => searchOptions.usereplace = action == 'replace'); this.setState({ - useReplace: searchOptions.usereplace + useReplace: searchOptions.usereplace, }); if (this.onReplaceChecked) {} } + onSwitchReplaceMode(value) { + runInAction(() => searchOptions.isReplaceAll = value === true); + + this.setState({ + isReplaceAll: searchOptions.isReplaceAll + }); + } + extraSearchOptions() { } @@ -265,12 +275,7 @@ class SearchView extends Component {
{isIos ?
: null}
-
- - - -
-
+
{this.changeSearchQuery(e.target.value)}} /> @@ -285,6 +290,49 @@ class SearchView extends Component {
+ + +
+ {/*
+
+ {this.changeSearchQuery(e.target.value)}} /> + {isIos ? : null} + +
+
+ {this.changeReplaceQuery(e.target.value)}} /> + {isIos ? : null} + +
+
*/} + {/*
this.onReplaceClick()}>{_t.textReplace} this.onReplaceAllClick()}>{_t.textReplaceAll} @@ -298,6 +346,11 @@ class SearchView extends Component {
+
+ + + +
*/}
) diff --git a/apps/common/mobile/resources/less/common-ios.less b/apps/common/mobile/resources/less/common-ios.less index 2dc225ede..0549eba14 100644 --- a/apps/common/mobile/resources/less/common-ios.less +++ b/apps/common/mobile/resources/less/common-ios.less @@ -438,6 +438,7 @@ .searchbar-input-wrap { margin-right: 10px; height: 28px; + margin: 8px 0; } .buttons-row-replace a { color: @themeColor; @@ -462,42 +463,49 @@ } .searchbar-inner { - &__right { - .buttons-row a.next { - margin-left: 15px; - } - } + // &__right { + // .buttons-row a.next { + // margin-left: 15px; + // } + // } } - @media(max-width: 550px) - { - .searchbar-expandable.searchbar-enabled { - top: 0; - .searchbar-inner { - &__left { - margin-right: 15px; - } - &__center { - flex-direction: column; - } - &__right { - flex-direction: column-reverse; - margin-left: 10px; - } - } - &.replace { - height: 88px; - .searchbar-inner { - height: 100%; - &__center { - .searchbar-input-wrap { - margin: 8px 0; - } - } - } - } - } - } + .searchbar-expandable.searchbar-enabled { + &.replace { + height: 88px; + } + } + + // @media(max-width: 550px) + // { + // .searchbar-expandable.searchbar-enabled { + // top: 0; + // .searchbar-inner { + // // &__left { + // // margin-right: 15px; + // // } + // // &__center { + // // flex-direction: column; + // // } + // // &__right { + // // flex-direction: column-reverse; + // // margin-left: 10px; + // // } + // } + // &.replace { + // height: 88px; + // margin-top: 5px; + // .searchbar-inner { + // height: 100%; + // &__center { + // .searchbar-input-wrap { + // margin: 8px 0; + // } + // } + // } + // } + // } + // } .actions-button { background: rgba(255,255,255,.95); diff --git a/apps/common/mobile/resources/less/common-material.less b/apps/common/mobile/resources/less/common-material.less index a1a938939..27ac89bed 100644 --- a/apps/common/mobile/resources/less/common-material.less +++ b/apps/common/mobile/resources/less/common-material.less @@ -396,38 +396,38 @@ // height: 100%; .searchbar-inner { height: 100%; - &__center { - flex-direction: column; - } - &__right { - flex-direction: column-reverse; - } + // &__center { + // flex-direction: column; + // } + // &__right { + // flex-direction: column-reverse; + // } } &.replace { height: 96px; } } - a.link { - padding: 0 16px; - } - a.icon-only { - width: auto; - height: 48px; - } + // a.link { + // padding: 0 16px; + // } + // a.icon-only { + // width: auto; + // height: 48px; + // } .buttons-row-replace a { color: @white; } - .searchbar .buttons-row { - align-self: flex-start; - } + // .searchbar .buttons-row { + // align-self: flex-start; + // } } @media(max-width: 550px) { .searchbar-expandable.searchbar-enabled { .searchbar-inner { - &__left { - margin-right: 33px; - } + // &__left { + // margin-right: 33px; + // } } } } diff --git a/apps/common/mobile/resources/less/search.less b/apps/common/mobile/resources/less/search.less index caf870f49..19059b326 100644 --- a/apps/common/mobile/resources/less/search.less +++ b/apps/common/mobile/resources/less/search.less @@ -1,28 +1,74 @@ @statusBarBorderColor: #cbcbcb; .navbar { - .searchbar { - background-color: var(--f7-navbar-bg-color); + .subnavbar { + .searchbar { + background-color: var(--f7-navbar-bg-color); - .buttons-row { - align-self: center; - display: flex; - } + .buttons-row { + align-self: center; + display: flex; + } - .searchbar-bg { - .hairline(bottom, @statusBarBorderColor); + .searchbar-bg { + .hairline(bottom, @statusBarBorderColor); + } + + .searchbar-inner { + &__right { + display: block; + } + } } } .searchbar-inner { - &__center { - display: flex; - align-items: center; - width: 100%; + flex-wrap: wrap; + padding-left: 25px; + padding-right: 18px; + justify-content: space-between; + height: 100%; + // &__center { + // display: flex; + // align-items: center; + // width: 100%; + // } + // &__right { + // display: flex; + // align-items: center; + // } + &__left { + height: 100%; + width: 65%; } &__right { - display: flex; - align-items: center; + height: 100%; + .buttons-row { + justify-content: flex-end; + } + .link-settings { + max-width: 24px; + min-width: 24px; + margin-left: 20px; + } + } + } + + .buttons-row-replace { + display: flex; + flex-direction: row; + align-items: center; + width: 100%; + justify-content: center; + margin-top: 5px; + a { + font-size: 15px; + height: auto; + display: block; + line-height: normal; + } + a:nth-child(2) { + margin-left: 20px; } } @@ -30,43 +76,34 @@ transition-duration: 0s; } - .buttons-row-replace { - display: flex; - flex-direction: column; - align-items: center; - width: max-content; - a { - font-size: 15px; - height: auto; - display: block; - line-height: normal; - } - } + .searchbar-expandable.searchbar-enabled { + top: 0; + } - @media(max-width: 550px) - { - .searchbar-expandable.searchbar-enabled { - .searchbar-inner { - &__left { - min-width: 22px; - max-width: 22px; - } - &__center { - flex-direction: column; - } - &__right { - flex-direction: column-reverse; - } - } - &.replace { - top: 0; - .searchbar-inner { - height: 100%; - &__left { - align-self: flex-start; - } - } - } - } - } + // @media(max-width: 550px) + // { + // .searchbar-expandable.searchbar-enabled { + // .searchbar-inner { + // // &__left { + // // min-width: 22px; + // // max-width: 22px; + // // } + // // &__center { + // // flex-direction: column; + // // } + // // &__right { + // // flex-direction: column-reverse; + // // } + // } + // &.replace { + // top: 0; + // .searchbar-inner { + // height: 100%; + // &__left { + // align-self: flex-start; + // } + // } + // } + // } + // } } diff --git a/apps/documenteditor/mobile/src/controller/Search.jsx b/apps/documenteditor/mobile/src/controller/Search.jsx index 4184133cc..5a6b7c210 100644 --- a/apps/documenteditor/mobile/src/controller/Search.jsx +++ b/apps/documenteditor/mobile/src/controller/Search.jsx @@ -36,6 +36,12 @@ class SearchSettings extends SearchSettingsView { this.onFindReplaceClick('find')} /> this.onFindReplaceClick('replace')} /> + {Device.isPhone ? ( + + this.onSwitchReplaceMode(!this.state.isReplaceAll)}> + + ) : null} diff --git a/apps/presentationeditor/mobile/src/controller/Search.jsx b/apps/presentationeditor/mobile/src/controller/Search.jsx index d99567a2d..7af4a597c 100644 --- a/apps/presentationeditor/mobile/src/controller/Search.jsx +++ b/apps/presentationeditor/mobile/src/controller/Search.jsx @@ -29,6 +29,12 @@ class SearchSettings extends SearchSettingsView { this.onFindReplaceClick('find')} /> this.onFindReplaceClick('replace')} /> + {Device.isPhone ? ( + + this.onSwitchReplaceMode(!this.state.isReplaceAll)}> + + ) : null} diff --git a/apps/spreadsheeteditor/mobile/src/controller/Search.jsx b/apps/spreadsheeteditor/mobile/src/controller/Search.jsx index c5da9a6b1..afe5a5305 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Search.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Search.jsx @@ -37,6 +37,12 @@ class SearchSettings extends SearchSettingsView { this.onFindReplaceClick('find')} /> this.onFindReplaceClick('replace')} /> + {Device.isPhone ? ( + + this.onSwitchReplaceMode(!this.state.isReplaceAll)}> + + ) : null} {_t.textSearchIn} this.setState({