Skip to content

Commit

Permalink
Merge branch 'release/1.0.4' into 1.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Oct 31, 2023
2 parents ec93460 + 320a71b commit 85e8b5d
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 14 deletions.
2 changes: 1 addition & 1 deletion domino-ui-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-ui-parent</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion domino-ui-tools/mdi-icons-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-ui-tools</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domino-ui-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-ui-parent</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domino-ui-tools/theme-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-ui-tools</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domino-ui-webjar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>domino-ui-parent</artifactId>
<groupId>org.dominokit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion domino-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.dominokit</groupId>
<artifactId>domino-ui-parent</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>

<artifactId>domino-ui</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
*
* @param <T> the type of the data table records
*/
public class BodyScrollPlugin<T> implements DataTablePlugin<T> {
public class BodyScrollPlugin<T>
implements DataTablePlugin<T>, HasPluginConfig<T, BodyScrollPlugin<T>, BodyScrollPluginConfig> {

private BodyScrollPluginConfig config = new BodyScrollPluginConfig(0);

/** {@inheritDoc} */
@Override
Expand All @@ -41,14 +44,33 @@ public void onBodyAdded(DataTable<T> dataTable) {
}
int offsetHeight = new Double(scrollElement.offsetHeight).intValue();
int scrollHeight = new Double(scrollElement.scrollHeight).intValue();
int clientHeight = new Double(scrollElement.clientHeight).intValue();

if (JsMath.abs(offsetHeight) + JsMath.abs(scrollTop)
== new Double(scrollHeight).intValue()) {
>= new Double(scrollHeight + (offsetHeight - clientHeight)).intValue()
- config.getOffset()) {
dataTable.fireTableEvent(new BodyScrollEvent(ScrollPosition.BOTTOM));
}
});
}

/**
* Sets up the plugin configuration.
*
* @param config The plugin configuration.
*/
@Override
public BodyScrollPlugin<T> setConfig(BodyScrollPluginConfig config) {
this.config = config;
return this;
}

/** @return the plugin configuration */
@Override
public BodyScrollPluginConfig getConfig() {
return this.config;
}

/** An enum to specify the postion of the scroll */
public enum ScrollPosition {
/** The scroll reached the top */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright © 2019 Dominokit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dominokit.domino.ui.datatable.plugins;

/**
* Configuration class for {@link BodyScrollPlugin} Allow the user to define the offset of pixels
* the plugin will use to fire the event before it reach the bottom of the scroll.
*/
public class BodyScrollPluginConfig implements PluginConfig {

private int offset;

/**
* creates a new instance with the specified scroll offset.
*
* @param offset number of pixels to be used as scroll offset.
*/
public BodyScrollPluginConfig(int offset) {
this.offset = offset;
}

/** @return int number of pixels to use as an offset for reaching the scroll bottom. */
public int getOffset() {
return offset;
}

/**
* sets the number of pixels to use as an offset for reaching the scroll bottom.
*
* @return same configuration instance
*/
public BodyScrollPluginConfig setOffset(int offset) {
this.offset = offset;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.dominokit.domino.ui.utils.BaseDominoElement;
import org.dominokit.domino.ui.utils.DominoElement;

/** The component that contains the left pabel and right panel of the {@link Layout} */
/** The component that contains the left panel and right panel of the {@link Layout} */
public class Section extends BaseDominoElement<HTMLElement, Section> {

HTMLElement section;
Expand All @@ -38,7 +38,6 @@ public Section() {
.id("rightsidebar")
.css(LayoutStyles.RIGHT_SIDEBAR)
.css(LayoutStyles.OVERLAY_OPEN)
.style("height: calc(100vh - 70px); overflow-y: scroll;")
.element();

section = DominoElement.of(section()).add(leftSide).add(rightSide).element();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ table th[class*="col-"] {
.table-bordered {
}

.table-hover.table-striped > tbody > tr:hover:nth-child(odd):not([class*="details-tr"]):not([class*="bg-"]),
.table-hover.table-striped > tbody > tr:hover:nth-child(even):not([class*="details-tr"]):not([class*="bg-"]),
.table-hover > tbody > tr:hover:not([class*="details-tr"]):not([class*="bg-"]) {
background-color: #f5f5f5;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2658,6 +2658,7 @@ a {
-ms-box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
overflow: hidden;
overflow-y: scroll;
-moz-transition: 0.5s;
-o-transition: 0.5s;
-webkit-transition: 0.5s;
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.dominokit</groupId>
<artifactId>domino-ui-parent</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<packaging>pom</packaging>

<name>domino-ui-parent</name>
Expand Down Expand Up @@ -67,8 +67,8 @@
</modules>

<properties>
<snapshot.version>1.0.3-SNAPSHOT</snapshot.version>
<next.release.version>1.0.3</next.release.version>
<snapshot.version>1.0.4-SNAPSHOT</snapshot.version>
<next.release.version>1.0.4</next.release.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

Expand Down Expand Up @@ -146,7 +146,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.dominokit</groupId>
Expand Down

0 comments on commit 85e8b5d

Please sign in to comment.