Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes made to master #645

Merged
merged 21 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
76aeca1
fix(dropdown): adding property to position the dropdown manually
lucasMurtaVI Jul 13, 2023
189c33d
fix(autocomplete): adding property to position the autocomplete manually
lucasMurtaVI Jul 14, 2023
32e1930
fix(selects): adding property to position the selects manually
lucasMurtaVI Jul 14, 2023
aceca8f
fix(pagination): adding property to position the pagination manually
lucasMurtaVI Jul 14, 2023
d076182
Merge pull request #633 from takenet/bugfix/position-pagination
lucasMurtaVI Jul 17, 2023
b4cae78
Merge pull request #632 from takenet/bugfix/position-selects
lucasMurtaVI Jul 17, 2023
74fa8d6
Merge pull request #631 from takenet/bugfix/position-autocomplete
lucasMurtaVI Jul 17, 2023
4ed09f8
Merge pull request #630 from takenet/bugfix/position-dropdown
lucasMurtaVI Jul 17, 2023
2f02264
fix(button): fixind fixing button loading position
lucasMurtaVI Jul 18, 2023
a432beb
fix(input-chips): fixind maxlenght on component
lucasMurtaVI Jul 18, 2023
59bd112
fix(accordion): fixing open and close method
lucasMurtaVI Jul 18, 2023
8272cd2
Merge pull request #637 from takenet/bugfix/fixing-input-chips
lucasMurtaVI Jul 21, 2023
d51defc
Merge pull request #636 from takenet/bugfix/fixing-load-buttom
lucasMurtaVI Jul 21, 2023
4810cee
Merge pull request #638 from takenet/bugfix/fixing-accordion
lucasMurtaVI Jul 21, 2023
3e917c1
Merge pull request #641 from takenet/developer
lucasMurtaVI Jul 21, 2023
65bae2b
fix(input-chips): fixing input error
lucasMurtaVI Jul 21, 2023
5ba495b
Merge pull request #642 from takenet/bugfix/fixing-input-chips
lucasMurtaVI Jul 21, 2023
c6703d3
fix(sidebar): fixing prop name
lucasMurtaVI Jul 21, 2023
197a8e7
Merge pull request #643 from takenet/bugfix/fixing-sidebar-prop
lucasMurtaVI Jul 21, 2023
00a7a99
Update sidebar
lucasMurtaVI Jul 21, 2023
b02d898
Merge pull request #644 from takenet/lucasMurtaVI-patch-1
lucasMurtaVI Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { typeDate } from "./components/datepicker/datepicker";
import { languages } from "./utils/languages";
import { DaysList } from "./components/datepicker/datepicker-interface";
import { stateSelect } from "./components/datepicker/datepicker-period/datepicker-period";
import { activeMode } from "./components/dropdown/dropdown";
import { activeMode, DropdownPostionType } from "./components/dropdown/dropdown";
import { alignItems, breakpoint, direction, flexWrap, gap, justifyContent, margin, padding } from "./components/grid/grid-interface";
import { IconSize, IconTheme, IconType as IconType1 } from "./components/icon/icon-interface";
import { IllustrationType } from "./components/illustration/illustration-interface";
Expand All @@ -41,6 +41,7 @@ import { colorsVariants as colorsVariants1, loadingSize, LoadingSpinnerVariant a
import { menuPosition } from "./components/menu/menu";
import { avatarSize as avatarSize2 } from "./components/menu/menu-exibition/menu-exibition";
import { sizes } from "./components/modal/modal";
import { PaginationOptionsPositionType } from "./components/pagination/pagination";
import { PaperElevation } from "./components/paper/paper-interface";
import { progressBarColor, progressBarSize } from "./components/progress-bar/progress-bar";
import { sidebarBackground, sidebarPosition, sidebarType } from "./components/sidebar/sidebar";
Expand Down Expand Up @@ -579,6 +580,10 @@ export namespace Components {
* Open. Used to open/close the dropdown.
*/
"open"?: boolean;
/**
* Used to set tooltip position
*/
"position"?: DropdownPostionType;
"toggle": () => Promise<void>;
}
interface BdsExpansionPanel {
Expand Down Expand Up @@ -843,6 +848,10 @@ export namespace Components {
* Clear all chips
*/
"clear": () => Promise<void>;
/**
* Passing true to display a counter of available size, it is necessary to pass another maxlength property.
*/
"counterLength"?: boolean;
/**
* Add state danger on input, use for use feedback.
*/
Expand Down Expand Up @@ -895,6 +904,10 @@ export namespace Components {
* label in input, with he the input size increases.
*/
"label"?: string;
/**
* Set maximum length value for chips
*/
"maxChipsLength"?: number;
/**
* Set maximum length value for the chip content
*/
Expand Down Expand Up @@ -1355,6 +1368,10 @@ export namespace Components {
"active"?: boolean;
}
interface BdsPagination {
/**
* Set the placement of the options menu. Can be 'bottom' or 'top'.
*/
"optionsPosition"?: PaginationOptionsPositionType;
/**
* Prop to recive the number of pages.
*/
Expand Down Expand Up @@ -1648,7 +1665,7 @@ export namespace Components {
/**
* Width, number to define sidebar width.
*/
"backgournd"?: sidebarBackground;
"background"?: sidebarBackground;
/**
* ; isOpen. Used to open sidebar.
*/
Expand Down Expand Up @@ -3284,6 +3301,10 @@ declare namespace LocalJSX {
* Open. Used to open/close the dropdown.
*/
"open"?: boolean;
/**
* Used to set tooltip position
*/
"position"?: DropdownPostionType;
}
interface BdsExpansionPanel {
}
Expand Down Expand Up @@ -3553,6 +3574,10 @@ declare namespace LocalJSX {
* The chips on the component Should be passed this way: chips='["chip1", "chip2"]'
*/
"chips"?: string[] | string;
/**
* Passing true to display a counter of available size, it is necessary to pass another maxlength property.
*/
"counterLength"?: boolean;
/**
* Add state danger on input, use for use feedback.
*/
Expand Down Expand Up @@ -3597,6 +3622,10 @@ declare namespace LocalJSX {
* label in input, with he the input size increases.
*/
"label"?: string;
/**
* Set maximum length value for chips
*/
"maxChipsLength"?: number;
/**
* Set maximum length value for the chip content
*/
Expand Down Expand Up @@ -4176,6 +4205,10 @@ declare namespace LocalJSX {
* When de value of component change, the event are dispache.
*/
"onBdsPaginationChange"?: (event: BdsPaginationCustomEvent<any>) => void;
/**
* Set the placement of the options menu. Can be 'bottom' or 'top'.
*/
"optionsPosition"?: PaginationOptionsPositionType;
/**
* Prop to recive the number of pages.
*/
Expand Down Expand Up @@ -4509,7 +4542,7 @@ declare namespace LocalJSX {
/**
* Width, number to define sidebar width.
*/
"backgournd"?: sidebarBackground;
"background"?: sidebarBackground;
/**
* ; isOpen. Used to open sidebar.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/components/accordion/accordion.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import 'resets';
@import 'mixins';

.accordion_header {
display: grid;
grid-auto-flow: column;
Expand Down Expand Up @@ -76,9 +79,10 @@
-webkit-transition: height 0.5s;
-moz-transition: height 0.5s;
transition: height 0.5s;
@include custom-scroll;

&_isOpen {
overflow: visible;
overflow: overlay;
}

& .container {
Expand Down
1 change: 1 addition & 0 deletions src/components/accordion/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class AccordionGroup {
async close() {
this.accheaders?.close();
this.accBodies?.close();
this.isOpen = false;
}

// Método interno
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export interface AutocompleteSelectedChangeEventDetail {

export type AutocompleteSelectType = 'text' | 'icon';

export type AutocompleteOptionsPositionType = 'top' | 'bottom';
export type AutocompleteOptionsPositionType = 'auto' | 'top' | 'bottom';
25 changes: 22 additions & 3 deletions src/components/autocomplete/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class BdsAutocomplete {
/**
* Set the placement of the options menu. Can be 'bottom' or 'top'.
*/
@Prop() optionsPosition?: AutocompleteOptionsPositionType = 'bottom';
@Prop() optionsPosition?: AutocompleteOptionsPositionType = 'auto';

/**
* If true, the X icon will appear only when component is focused.
Expand Down Expand Up @@ -136,7 +136,12 @@ export class BdsAutocomplete {
} else {
this.iconDropElement.name = this.isOpen ? 'arrow-down' : 'arrow-up';
}
if (isOpen) this.validatePositionDrop();
if (isOpen)
if (this.optionsPosition != 'auto') {
this.setDefaultPlacement(this.optionsPosition);
} else {
this.validatePositionDrop();
}
}

@Watch('selected')
Expand Down Expand Up @@ -187,7 +192,21 @@ export class BdsAutocomplete {
}

this.text = this.getText();
this.validatePositionDrop();
if (this.optionsPosition != 'auto') {
this.setDefaultPlacement(this.optionsPosition);
} else {
this.validatePositionDrop();
}
}

private setDefaultPlacement(value: AutocompleteOptionsPositionType) {
if (value == 'bottom') {
this.dropElement.classList.add('select__options--position-bottom');
this.iconDropElement.name = 'arrow-down';
} else {
this.dropElement.classList.add('select__options--position-top');
this.iconDropElement.name = 'arrow-up';
}
}

private validatePositionDrop() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/autocomplete/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| `icon` | `icon` | used for add icon in input left. Uses the bds-icon component. | `string` | `''` |
| `label` | `label` | label in input, with he the input size increases. | `string` | `''` |
| `options` | `options` | The options of the select Should be passed this way: options='[{"value": "Cat", "label": "Meow"}, {"value": "Dog", "label": "Woof"}]' Options can also be passed as child by using bds-select-option component, but passing as a child you may have some compatibility problems with Angular. | `AutocompleteOption[] \| string` | `undefined` |
| `optionsPosition` | `options-position` | Set the placement of the options menu. Can be 'bottom' or 'top'. | `"bottom" \| "top"` | `'bottom'` |
| `optionsPosition` | `options-position` | Set the placement of the options menu. Can be 'bottom' or 'top'. | `"auto" \| "bottom" \| "top"` | `'auto'` |
| `placeholder` | `placeholder` | Placeholder for native input element. | `string` | `''` |
| `searchOnlyTitle` | `search-only-title` | Search only the title property | `boolean` | `true` |
| `selected` | -- | the item selected. | `HTMLBdsSelectOptionElement` | `undefined` |
Expand Down
23 changes: 17 additions & 6 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ $button-padding-left-right: 16px;
-moz-transition: all 0.5s;
transition: all 0.5s;


bds-loading-spinner {
max-height: 100%;
position: absolute;
}

& * {
pointer-events: none;
}
Expand All @@ -84,6 +90,12 @@ $button-padding-left-right: 16px;
&--size-standard {
@include padding-button-top-bottom($button-size-standard, $height-standard);

bds-loading-spinner {
width: 32px;
height: 32px;
top: calc(50% - 16px);
}

&--icon {
@include padding-button-top-bottom($button-size-standard-icon, $height-standard);
}
Expand All @@ -92,6 +104,11 @@ $button-padding-left-right: 16px;
&--size-short {
@include padding-button-top-bottom($button-size-short, $height-short);

bds-loading-spinner {
width: 16px;
height: 16px;
top: calc(50% - 8px);
}
&--icon {
@include padding-button-top-bottom($button-size-short-icon, $height-short);
}
Expand Down Expand Up @@ -287,12 +304,6 @@ $button-padding-left-right: 16px;
}
}

bds-loading-spinner {
width: auto;
max-height: 100%;
position: absolute;
}

.hide {
cursor: not-allowed;
opacity: 0;
Expand Down
7 changes: 4 additions & 3 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Button {
/**
* If not empty, Sets the color of the spinner, can be 'primary','secondary' or 'ghost'
*/
@Prop() bdsLoadingColor?: colorsVariants = 'light';
@Prop() bdsLoadingColor?: colorsVariants = 'main';

/**
* Data test is the prop to specifically test the component action object.
Expand Down Expand Up @@ -132,10 +132,11 @@ export class Button {
}

renderLoadingSpinner(): HTMLBdsLoadingSpinnerElement {
const loadingColor = this.variant == 'primary' || this.variant == 'delete' ? 'light' : 'main';
if (this.size === 'short') {
return <bds-loading-spinner size="extra-small" color={this.bdsLoadingColor}></bds-loading-spinner>;
return <bds-loading-spinner size="extra-small" color={loadingColor}></bds-loading-spinner>;
} else {
return <bds-loading-spinner size="small" color={this.bdsLoadingColor}></bds-loading-spinner>;
return <bds-loading-spinner size="small" color={loadingColor}></bds-loading-spinner>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| ------------------- | --------------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------ |
| `arrow` | `arrow` | The arrow button | `boolean` | `false` |
| `bdsLoading` | `bds-loading` | If true, shows the loading spinner | `boolean` | `false` |
| `bdsLoadingColor` | `bds-loading-color` | If not empty, Sets the color of the spinner, can be 'primary','secondary' or 'ghost' | `"light" \| "main"` | `'light'` |
| `bdsLoadingColor` | `bds-loading-color` | If not empty, Sets the color of the spinner, can be 'primary','secondary' or 'ghost' | `"light" \| "main"` | `'main'` |
| `bdsLoadingVariant` | `bds-loading-variant` | If not empty, Sets the color of the spinner, can be 'primary','secondary' or 'ghost' | `"delete" \| "ghost" \| "primary" \| "secondary" \| "tertiary"` | `'primary'` |
| `dataTest` | `data-test` | Data test is the prop to specifically test the component action object. | `string` | `null` |
| `disabled` | `disabled` | If true, the base button will be disabled. | `boolean` | `false` |
Expand Down
2 changes: 2 additions & 0 deletions src/components/counter-text/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
### Used by

- [bds-input](../input)
- [bds-input-chips](../input-chips)

### Depends on

Expand All @@ -31,6 +32,7 @@
graph TD;
bds-counter-text --> bds-typo
bds-input --> bds-counter-text
bds-input-chips --> bds-counter-text
style bds-counter-text fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
4 changes: 4 additions & 0 deletions src/components/dropdown/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
left: 0;
}

&__center {
left: calc(50% - 122px);
}

&__right {
right: 0;
}
Expand Down
36 changes: 33 additions & 3 deletions src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@ import {
import { getScrollParent, positionAbsoluteElement } from '../../utils/position-element';

export type activeMode = 'hover' | 'click';
export type dropdownPosition = 'bottom' | 'right';
export type dropVerticalPosition = 'bottom' | 'top';
export type dropHorizontalPosition = 'left' | 'center' | 'right';
export type subMenuState = 'close' | 'pending' | 'open';

export type DropdownPostionType =
| 'auto'
| 'top-center'
| 'top-left'
| 'top-right'
| 'bottom-center'
| 'bottom-right'
| 'bottom-left';

@Component({
tag: 'bds-dropdown',
styleUrl: 'dropdown.scss',
Expand Down Expand Up @@ -46,6 +56,11 @@ export class BdsDropdown implements ComponentInterface {
*/
@Prop({ mutable: true, reflect: true }) public open?: boolean = false;

/**
* Used to set tooltip position
*/
@Prop() position?: DropdownPostionType = 'auto';

/**
* bdsToggle. Event to return selected date value.
*/
Expand All @@ -65,7 +80,17 @@ export class BdsDropdown implements ComponentInterface {
}

componentDidLoad() {
this.validatePositionDrop();
if (this.position != 'auto') {
this.setDefaultPlacement(this.position);
} else {
this.validatePositionDrop();
}
}

private setDefaultPlacement(value: DropdownPostionType) {
const arrayPosition = value.split('-');
this.dropElement.classList.add(`dropdown__basic__${arrayPosition[0]}`);
this.dropElement.classList.add(`dropdown__basic__${arrayPosition[1]}`);
}

private validatePositionDrop() {
Expand All @@ -85,7 +110,12 @@ export class BdsDropdown implements ComponentInterface {

@Watch('open')
protected isOpenChanged(open: boolean): void {
if (open) this.validatePositionDrop();
if (open)
if (this.position != 'auto') {
this.setDefaultPlacement(this.position);
} else {
this.validatePositionDrop();
}
}

@Method()
Expand Down
Loading
Loading