Skip to content

Commit

Permalink
Merge pull request #539 from instedd/wizard
Browse files Browse the repository at this point in the history
[WIP] Wizard
  • Loading branch information
Hugo David Farji authored May 20, 2019
2 parents 11e5909 + 86973d4 commit a031b97
Show file tree
Hide file tree
Showing 14 changed files with 448 additions and 92 deletions.
134 changes: 130 additions & 4 deletions resources/sass/site2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ form.vertical, .fields-vertical {
margin-bottom: 0;
}
}
.step-info {
line-height: 1.9rem;
margin: 1.2rem 0 3rem;
}

.mdc-select {
margin-top: 16px;
Expand All @@ -526,6 +530,14 @@ form.vertical, .fields-vertical {
color: rgba(0, 0, 0, 0.6);
margin: 25px 0 0;
}

button {
display: inline-flex;
align-items: center;
.material-icons {
margin-right: 10px;
}
}
}

.project-settings-actions {
Expand All @@ -536,6 +548,10 @@ form.vertical, .fields-vertical {

button {
margin-left: 25px;
&:first-child {
float: left;
margin: 0;
}
}
}

Expand Down Expand Up @@ -577,12 +593,56 @@ form.vertical, .fields-vertical {
margin-right: 15px;
}

.project-setting{
width: 554px;
.project-setting {
max-width: 554px;
}
.project-setting-title {
p {
display: inline-flex;
align-items: flex-start;
.material-icons {
margin-right: 10px;
}
}
}

.action-input{
width: 110px;
.action-input {
max-width: 100px;
}
.percentage-input {
display: inline-flex;
align-items: end;
div {
margin-right: 0.8rem;
> input {
max-width: 50px;
}
}
}

.prefix {
color: #999999;
font-style: normal;
position: absolute;
padding-bottom: 8px;

+ input {
padding-left: 15px;
}
+ .suffix {
+ input {
padding-left: 1rem;
}
}
}
.suffix {
@extend .prefix;
left: auto;
right: 0;
+ input {
padding-right: 1rem;
padding-left: 0;
}
}

//empty projects
Expand Down Expand Up @@ -770,6 +830,72 @@ form.vertical, .fields-vertical {
animation: spin 2s linear infinite;
}

.wizard {
.steps {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
border-bottom: 1px solid rgba(0,0,0,0.1);
margin-left: -25px;
margin-right: -25px;
padding: 5px 20px 0;
height: 56px;

> a {
text-decoration: none;
text-transform: capitalize;
display: flex;
align-items: center;
i {
background-color: #999999;
color: #ffffff;
font-style: normal;
padding: 5px 11px;
margin-right: 10px;
border-radius: 50%;
}
div {
color: #999999;
display: inline-block;
&:after {
content: "";
position: absolute;
height: 12px;
min-width: 85px;
margin-left: 10px;
border-bottom: 1px solid rgba(0,0,0,0.1);
}
}
&:last-child div:after {
border: none;
}
}

.complete {
i {
background-color: $mdc-theme-primary;
}
div {
color: #000000;
}
}
.active {
@extend .complete;
font-weight: 500;
}
.material-icons {
font-size: 19px;
display: inline;
padding: 6px;
}
}
.map {
min-height: 500px;
height: 100%;
}
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
Expand Down
17 changes: 11 additions & 6 deletions src/planwise/client/components/common2.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@

(defn mdc-input-field
[props component-props]
(let [{:keys [id focus focus-extra-class label]} component-props]

(let [{:keys [id focus focus-extra-class label]} component-props
{:keys [prefix suffix]} props]
[:div.mdc-text-field.mdc-text-field--upgraded {:class (cond
(:read-only props) focus-extra-class
@focus (str "mdc-text-field--focused" focus-extra-class))}
[:input.mdc-text-field__input (merge props {:id id
:on-focus #(reset! focus true)
:on-blur #(reset! focus false)}
(when @focus
{:placeholder nil}))]
(when-not (empty? prefix) [:i.prefix prefix])
(when-not (empty? suffix) [:i.suffix suffix])
[:input.mdc-text-field__input (apply dissoc (merge props {:id id
:on-focus #(reset! focus true)
:on-blur #(reset! focus false)})
[:prefix :suffix])]
[:label.mdc-floating-label {:for id
:class (when (or (not (blank? (str (:value props))))
@focus) "mdc-floating-label--float-above")}
Expand All @@ -60,6 +63,7 @@
(fn [props]
(let [component-props (assoc (select-keys props extra-keys)
:id id
:type "text"
:focus focus)
props (apply dissoc props extra-keys)]
[mdc-input-field props component-props]))))
Expand All @@ -85,6 +89,7 @@
(select-keys props extra-keys)
{:id (str (random-uuid))
:focus focus
:type "number"
:focus-extra-class (when wrong-input " invalid-input")})
on-change-fn (:on-change props)
global-value (str (:value props))
Expand Down
Loading

0 comments on commit a031b97

Please sign in to comment.