Skip to content

Commit

Permalink
📌 Overall style review & minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xizon committed Aug 9, 2024
1 parent 3183b48 commit ced6017
Show file tree
Hide file tree
Showing 78 changed files with 689 additions and 402 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "UIUX Lab",
"email": "[email protected]",
"name": "funda-ui",
"version": "4.2.015",
"version": "4.2.255",
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions packages/BackToTop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## General

Look at the button on the bottom right.

```js
import React from "react";
import BackToTop from 'funda-ui/BackToTop';
Expand Down
16 changes: 9 additions & 7 deletions packages/CascadingSelect/dist/cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4605,20 +4605,22 @@ var CascadingSelect = function CascadingSelect(props) {
windowScrollUpdate = _useWindowScroll2[1];
function popwinPosInit() {
var showAct = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
if (valRef.current === null) return;
if (rootRef.current === null || valRef.current === null) return;

// update modal position
var _modalRef = document.querySelector("#cas-select__items-wrapper-".concat(idRes));
var _triggerRef = valRef.current;
var _triggerXaxisRef = rootRef.current;

// console.log(getAbsolutePositionOfStage(_triggerRef));

if (_modalRef === null) return;
var _getAbsolutePositionO = (0,dist_cjs.getAbsolutePositionOfStage)(_triggerRef),
x = _getAbsolutePositionO.x,
y = _getAbsolutePositionO.y,
width = _getAbsolutePositionO.width,
height = _getAbsolutePositionO.height;
var _getAbsolutePositionO = (0,dist_cjs.getAbsolutePositionOfStage)(_triggerXaxisRef),
x = _getAbsolutePositionO.x;
var _getAbsolutePositionO2 = (0,dist_cjs.getAbsolutePositionOfStage)(_triggerRef),
y = _getAbsolutePositionO2.y,
width = _getAbsolutePositionO2.width,
height = _getAbsolutePositionO2.height;
var _triggerBox = _triggerRef.getBoundingClientRect();
var targetPos = '';

Expand Down Expand Up @@ -4660,7 +4662,7 @@ var CascadingSelect = function CascadingSelect(props) {
// Determine whether it exceeds the far right or left side of the screen
var _modalContent = _modalRef;
var _modalBox = _modalContent.getBoundingClientRect();
if (typeof _modalContent.dataset.offset === 'undefined') {
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {
// 10 pixels is used to account for some bias in mobile devices
if (_modalBox.right + 10 > window.innerWidth) {
var _modalOffsetPosition = _modalBox.right - window.innerWidth + EXCEEDED_SIDE_POS_OFFSET;
Expand Down
9 changes: 6 additions & 3 deletions packages/CascadingSelect/dist/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
font-weight: 400;
line-height: 1.5;
color: inherit;
/* required */
display: flex;
}
.cas-select__wrapper .cas-select__result div {
display: inline;
/* required */
display: flex;
}
.cas-select__wrapper .cas-select__result span {
padding: 3px;
Expand Down Expand Up @@ -57,8 +60,8 @@
}
.cas-select__wrapper .cas-select__val .arrow {
position: absolute;
top: 0;
margin-top: 0.3rem;
top: 50%;
transform: translateY(-50%);
right: 0.5rem;
}
.cas-select__wrapper .cas-select__val .arrow svg .arrow-fill-g {
Expand Down
10 changes: 7 additions & 3 deletions packages/CascadingSelect/dist/esm/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
line-height: 1.5;
color: inherit;

/* required */
display: flex;

div {
display: inline;
/* required */
display: flex;
}

span {
Expand Down Expand Up @@ -76,8 +80,8 @@

.arrow {
position: absolute;
top: 0;
margin-top: .3rem;
top: 50%;
transform: translateY(-50%);
right: .5rem;

svg {
Expand Down
9 changes: 5 additions & 4 deletions packages/CascadingSelect/dist/esm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,19 @@ const CascadingSelect = (props: CascadingSelectProps) => {


function popwinPosInit(showAct: boolean = true) {
if (valRef.current === null) return
if (rootRef.current === null || valRef.current === null) return

// update modal position
const _modalRef: any = document.querySelector(`#cas-select__items-wrapper-${idRes}`);
const _triggerRef: any = valRef.current;
const _triggerXaxisRef: any = rootRef.current;

// console.log(getAbsolutePositionOfStage(_triggerRef));

if (_modalRef === null) return;

const { x, y, width, height } = getAbsolutePositionOfStage(_triggerRef);
const { x } = getAbsolutePositionOfStage(_triggerXaxisRef);
const { y, width, height } = getAbsolutePositionOfStage(_triggerRef);
const _triggerBox = _triggerRef.getBoundingClientRect();
let targetPos = '';

Expand Down Expand Up @@ -255,7 +257,7 @@ const CascadingSelect = (props: CascadingSelectProps) => {
// Determine whether it exceeds the far right or left side of the screen
const _modalContent = _modalRef;
const _modalBox = _modalContent.getBoundingClientRect();
if (typeof _modalContent.dataset.offset === 'undefined') {
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {

// 10 pixels is used to account for some bias in mobile devices
if ((_modalBox.right + 10) > window.innerWidth) {
Expand All @@ -265,7 +267,6 @@ const CascadingSelect = (props: CascadingSelectProps) => {
// console.log('_modalPosition: ', _modalOffsetPosition)
}


if ((_modalBox.left - 10) < 0) {
const _modalOffsetPosition = Math.abs(_modalBox.left) + EXCEEDED_SIDE_POS_OFFSET;
_modalContent.dataset.offset = _modalOffsetPosition;
Expand Down
10 changes: 7 additions & 3 deletions packages/CascadingSelect/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
line-height: 1.5;
color: inherit;

/* required */
display: flex;

div {
display: inline;
/* required */
display: flex;
}

span {
Expand Down Expand Up @@ -76,8 +80,8 @@

.arrow {
position: absolute;
top: 0;
margin-top: .3rem;
top: 50%;
transform: translateY(-50%);
right: .5rem;

svg {
Expand Down
9 changes: 5 additions & 4 deletions packages/CascadingSelect/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,19 @@ const CascadingSelect = (props: CascadingSelectProps) => {


function popwinPosInit(showAct: boolean = true) {
if (valRef.current === null) return
if (rootRef.current === null || valRef.current === null) return

// update modal position
const _modalRef: any = document.querySelector(`#cas-select__items-wrapper-${idRes}`);
const _triggerRef: any = valRef.current;
const _triggerXaxisRef: any = rootRef.current;

// console.log(getAbsolutePositionOfStage(_triggerRef));

if (_modalRef === null) return;

const { x, y, width, height } = getAbsolutePositionOfStage(_triggerRef);
const { x } = getAbsolutePositionOfStage(_triggerXaxisRef);
const { y, width, height } = getAbsolutePositionOfStage(_triggerRef);
const _triggerBox = _triggerRef.getBoundingClientRect();
let targetPos = '';

Expand Down Expand Up @@ -255,7 +257,7 @@ const CascadingSelect = (props: CascadingSelectProps) => {
// Determine whether it exceeds the far right or left side of the screen
const _modalContent = _modalRef;
const _modalBox = _modalContent.getBoundingClientRect();
if (typeof _modalContent.dataset.offset === 'undefined') {
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {

// 10 pixels is used to account for some bias in mobile devices
if ((_modalBox.right + 10) > window.innerWidth) {
Expand All @@ -265,7 +267,6 @@ const CascadingSelect = (props: CascadingSelectProps) => {
// console.log('_modalPosition: ', _modalOffsetPosition)
}


if ((_modalBox.left - 10) < 0) {
const _modalOffsetPosition = Math.abs(_modalBox.left) + EXCEEDED_SIDE_POS_OFFSET;
_modalContent.dataset.offset = _modalOffsetPosition;
Expand Down
16 changes: 9 additions & 7 deletions packages/CascadingSelectE2E/dist/cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4630,20 +4630,22 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
windowScrollUpdate = _useWindowScroll2[1];
function popwinPosInit() {
var showAct = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
if (valRef.current === null) return;
if (rootRef.current === null || valRef.current === null) return;

// update modal position
var _modalRef = document.querySelector("#cas-select-e2e__items-wrapper-".concat(idRes));
var _triggerRef = valRef.current;
var _triggerXaxisRef = rootRef.current;

// console.log(getAbsolutePositionOfStage(_triggerRef));

if (_modalRef === null) return;
var _getAbsolutePositionO = (0,dist_cjs.getAbsolutePositionOfStage)(_triggerRef),
x = _getAbsolutePositionO.x,
y = _getAbsolutePositionO.y,
width = _getAbsolutePositionO.width,
height = _getAbsolutePositionO.height;
var _getAbsolutePositionO = (0,dist_cjs.getAbsolutePositionOfStage)(_triggerXaxisRef),
x = _getAbsolutePositionO.x;
var _getAbsolutePositionO2 = (0,dist_cjs.getAbsolutePositionOfStage)(_triggerRef),
y = _getAbsolutePositionO2.y,
width = _getAbsolutePositionO2.width,
height = _getAbsolutePositionO2.height;
var _triggerBox = _triggerRef.getBoundingClientRect();
var targetPos = '';

Expand Down Expand Up @@ -4685,7 +4687,7 @@ var CascadingSelectE2E = function CascadingSelectE2E(props) {
// Determine whether it exceeds the far right or left side of the screen
var _modalContent = _modalRef;
var _modalBox = _modalContent.getBoundingClientRect();
if (typeof _modalContent.dataset.offset === 'undefined') {
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {
// 10 pixels is used to account for some bias in mobile devices
if (_modalBox.right + 10 > window.innerWidth) {
var _modalOffsetPosition = _modalBox.right - window.innerWidth + EXCEEDED_SIDE_POS_OFFSET;
Expand Down
9 changes: 6 additions & 3 deletions packages/CascadingSelectE2E/dist/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
font-weight: 400;
line-height: 1.5;
color: inherit;
/* required */
display: flex;
}
.cas-select-e2e__wrapper .cas-select-e2e__result div {
display: inline;
/* required */
display: flex;
}
.cas-select-e2e__wrapper .cas-select-e2e__result span {
padding: 3px;
Expand Down Expand Up @@ -57,8 +60,8 @@
}
.cas-select-e2e__wrapper .cas-select-e2e__val .arrow {
position: absolute;
top: 0;
margin-top: 0.3rem;
top: 50%;
transform: translateY(-50%);
right: 0.5rem;
}
.cas-select-e2e__wrapper .cas-select-e2e__val .arrow svg .arrow-fill-g {
Expand Down
11 changes: 8 additions & 3 deletions packages/CascadingSelectE2E/dist/esm/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
line-height: 1.5;
color: inherit;

/* required */
display: flex;

div {
display: inline;
/* required */
display: flex;
}

span {
Expand Down Expand Up @@ -76,9 +80,10 @@

.arrow {
position: absolute;
top: 0;
margin-top: .3rem;
top: 50%;
transform: translateY(-50%);
right: .5rem;


svg {
.arrow-fill-g {
Expand Down
9 changes: 6 additions & 3 deletions packages/CascadingSelectE2E/dist/esm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,21 @@ const CascadingSelectE2E = (props: CascadingSelectE2EProps) => {


function popwinPosInit(showAct: boolean = true) {
if (valRef.current === null) return;
if (rootRef.current === null || valRef.current === null) return;


// update modal position
const _modalRef: any = document.querySelector(`#cas-select-e2e__items-wrapper-${idRes}`);
const _triggerRef: any = valRef.current;
const _triggerXaxisRef: any = rootRef.current;


// console.log(getAbsolutePositionOfStage(_triggerRef));

if (_modalRef === null) return;

const { x, y, width, height } = getAbsolutePositionOfStage(_triggerRef);
const { x } = getAbsolutePositionOfStage(_triggerXaxisRef);
const { y, width, height } = getAbsolutePositionOfStage(_triggerRef);
const _triggerBox = _triggerRef.getBoundingClientRect();
let targetPos = '';

Expand Down Expand Up @@ -289,7 +292,7 @@ const CascadingSelectE2E = (props: CascadingSelectE2EProps) => {
// Determine whether it exceeds the far right or left side of the screen
const _modalContent = _modalRef;
const _modalBox = _modalContent.getBoundingClientRect();
if (typeof _modalContent.dataset.offset === 'undefined') {
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {

// 10 pixels is used to account for some bias in mobile devices
if ((_modalBox.right + 10) > window.innerWidth) {
Expand Down
11 changes: 8 additions & 3 deletions packages/CascadingSelectE2E/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
line-height: 1.5;
color: inherit;

/* required */
display: flex;

div {
display: inline;
/* required */
display: flex;
}

span {
Expand Down Expand Up @@ -76,9 +80,10 @@

.arrow {
position: absolute;
top: 0;
margin-top: .3rem;
top: 50%;
transform: translateY(-50%);
right: .5rem;


svg {
.arrow-fill-g {
Expand Down
Loading

0 comments on commit ced6017

Please sign in to comment.