Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

feat(table component): columns resizing, reordering, sorting and rows selecting #7

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3cd5495
feat(table component): wip: columns sort and ordering implementation
dmitryueno Sep 9, 2020
7b82c08
feat(table component): columns ordering and sorting features implemen…
dmitryueno Sep 9, 2020
f1cdeba
feat(table component): wip: change columns width feature
dmitryueno Sep 10, 2020
a95c7a4
chore(release): 1.3.1
Sep 14, 2020
f9193a1
fix(gux-table): resizeObserver not present in spec tests
daragh-king-genesys Sep 15, 2020
524d98d
feat(gux-pagination): added expanded layout
daragh-king-genesys Sep 7, 2020
626fa49
feat(table component): resizable columns functionality implementation
dmitryueno Sep 15, 2020
875e58b
Merge pull request #34 from MyPureCloud/NO-JIRA_broken-table-test
daragh-king-genesys Sep 15, 2020
4c562f9
chore(release): 1.3.2
Sep 15, 2020
b307b0f
chore(translations): translation updates
ININ-TransifexAutomation Sep 16, 2020
cd1f8bd
Merge pull request #39 from MyPureCloud/TPA_20200916_101535
daragh-king-genesys Sep 16, 2020
beb40aa
Merge pull request #24 from MyPureCloud/COMUI-245-pagination-expanded
daragh-king-genesys Sep 16, 2020
5e99a60
feat(table component): rows selection funtionality implementatio
dmitryueno Sep 16, 2020
7f44705
feat(table component): row selection event implementation
dmitryueno Sep 16, 2020
0159220
Merge branch 'master' of https://github.com/MyPureCloud/genesys-webco…
dmitryueno Sep 16, 2020
0f6cf24
feat(table component): new tests for table component
dmitryueno Sep 16, 2020
dcc1c13
fix(gux-dropdown): better handle asynchronously loaded options
MattCheely Sep 16, 2020
eec3866
feat(color-styles): exporting common color variables
daragh-king-genesys Sep 9, 2020
3a74630
chore(release): 1.4.0
Sep 16, 2020
945a959
fix(table component): test code removed
dmitryueno Sep 17, 2020
e91d870
fix(table component): fix typo
dmitryueno Sep 17, 2020
ca2b392
Merge pull request #29 from MyPureCloud/COMUI-194_color-styles
MattCheely Sep 17, 2020
40fcb0c
fix(doc-site): fix the sort order of components
MattCheely Sep 17, 2020
acfddc9
Merge pull request #40 from MyPureCloud/comui-255-async-options
MattCheely Sep 17, 2020
236861e
chore(release): 1.5.0
Sep 17, 2020
914f104
Merge pull request #45 from MyPureCloud/fix-menu-sorting
MattCheely Sep 18, 2020
417e424
chore(release): 1.5.1
Sep 18, 2020
0e82f1a
refactor(table component): refactor logic for column resizing and sor…
dmitryueno Sep 21, 2020
a8094f9
fix(table component): tests fixed to use new tag name
dmitryueno Sep 21, 2020
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
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.5.1](http://inindca///compare/v1.5.0...v1.5.1) (2020-09-18)


### Bug Fixes

* **doc-site:** fix the sort order of components ([40fcb0c](http://inindca///commit/40fcb0c0beac68670ce87a225439089d951b4a4b))

## [1.5.0](http://inindca///compare/v1.4.0...v1.5.0) (2020-09-17)


### Features

* **color-styles:** exporting common color variables ([eec3866](http://inindca///commit/eec3866d0734339b9fa3beace3102178c5f50303))


### Bug Fixes

* **gux-dropdown:** better handle asynchronously loaded options ([dcc1c13](http://inindca///commit/dcc1c13033025e723e4a3cf90967f95373f55d8f))

## [1.4.0](http://inindca///compare/v1.3.2...v1.4.0) (2020-09-16)


### Features

* **gux-pagination:** added expanded layout ([524d98d](http://inindca///commit/524d98d09d0a21029151c0b5fc74b1f8914f3820))

### [1.3.2](http://inindca///compare/v1.3.1...v1.3.2) (2020-09-15)


### Bug Fixes

* **gux-table:** resizeObserver not present in spec tests ([f9193a1](http://inindca///commit/f9193a1e542c87b06b8f64ca2ad83b3784fd9d43))

### [1.3.1](http://inindca///compare/v1.3.0...v1.3.1) (2020-09-14)

## [1.3.0](http://inindca///compare/v1.2.0...v1.3.0) (2020-09-11)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The library provides a baseline set of CSS styles in the package under `dist/gen

- Baseline styles for browser elements
- Classes for specific typography patterns
- CSS variables for colors (coming soon)
- CSS variables for colors
- CSS variables for spacing (coming soon)

The best mechanism for importing the stylesheet into your project will depend on how you handle CSS in your project in general. Reach out to the Common UI Development group if you're having trouble with your specific integration.
Expand Down
39 changes: 0 additions & 39 deletions docs/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 docs/src/component-listing/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function bootstrap() {
let components = Object.keys(COMPONENT_SPEC)
.filter(component => !COMPONENT_SPEC[component].hidePage)
.sort((a, b) => {
return a < b ? -1 : 1;
return shortName(a) < shortName(b) ? -1 : 1;
});

document.body.appendChild(
Expand Down
16 changes: 10 additions & 6 deletions docs/src/components-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,16 @@
"attributes": {
"compact": "checkbox",
"object-table": "checkbox",
"epmty-message": "text"
"epmty-message": "text",
"columns-order": "text",
"resizable-columns": "checkbox",
"selectable-rows": "checkbox"
},
"events": {}
"events": {
"sortChanged": "Fired when sorting of the table column is changed",
"selectionChanged": "Fired when table row was selected/unselected"
}
},
"typography": {
"attributes": {},
"events": {}
}
"typography": {},
"color": {}
}
3 changes: 1 addition & 2 deletions docs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ module.exports = {
devServer: {
compress: true,
port: 8080,
serveIndex: true,
disableHostCheck: true
serveIndex: true
}
};

Expand Down
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
{
"name": "@genesys/common-webcomponents",
"version": "1.3.0",
"version": "1.5.1",
"description": "Common webcomponents",
"main": "dist/stencil-wrapper.js",
"types": "dist/types/index.d.ts",
Expand Down
8 changes: 5 additions & 3 deletions scripts/templates/component/component.less.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import (reference) '../../../style/color.less';

// Variables part

// Style
Expand All @@ -9,7 +11,7 @@

// Dark
.{{componentName}}-dark-theme {
color: @gux-off-white;
color: @gux-type-dark;
};

.{{componentPrefix}}dark-theme {
Expand All @@ -24,7 +26,7 @@

// Light
.{{componentName}}-light-theme {
color: @gux-grey-2;
color: @gux-type;
};

.{{componentPrefix}}light-theme {
Expand All @@ -40,4 +42,4 @@
// Default Theme
{{componentName}} {
.{{componentName}}-light-theme();
}
}
29 changes: 29 additions & 0 deletions src/common-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,32 @@ const DATE_STRING_POSTFIX: string = 'Z'; // always use UTC
export function fromIsoTimeString(timeStr: string): Date {
return new Date(DATE_STRING_PREFIX + timeStr.trim() + DATE_STRING_POSTFIX);
}

/********************************************************
* DOM/Event Utilities *
* *
* Helpers for components *
********************************************************/

/**
* Checks to see if an event originated within an element matching a specific selector and
* if it did, passes the element to a handler function and returns the handler's result.
*/
export function whenEventIsFrom<T>(
selector: string,
event: Event,
handler: (element: HTMLElement) => T
): T | null {
// Don't search for matches above the node where we captured the event;
const exitTarget = event.currentTarget as HTMLElement;
// Start with the oringal event target
let checkTarget = event.target as HTMLElement;
while (checkTarget !== exitTarget && checkTarget !== null) {
if (checkTarget.matches(selector)) {
return handler(checkTarget);
} else {
checkTarget = checkTarget.parentElement;
}
}
return null;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import (reference) '../../../../style/color.less';

// Variables part

Expand Down Expand Up @@ -40,7 +41,7 @@ gux-form-field-beta {

// Dark
.gux-form-field-dark-theme {
color: @gux-off-white;
color: @gux-type-dark;
};

.gux-dark-theme {
Expand All @@ -55,7 +56,7 @@ gux-form-field-beta.gux-dark-theme {

// Light
.gux-form-field-light-theme {
color: @gux-grey-2;
color: @gux-type;
};

.gux-light-theme {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import (reference) '../../../../../../style/color.less';

// Style
gux-error-message-beta {
.container {
Expand All @@ -16,7 +18,7 @@ gux-error-message-beta {

// Dark
.gux-error-message-dark-theme {
color: @gux-off-white;
color: @gux-type-dark;
};

.gux-dark-theme {
Expand All @@ -31,7 +33,7 @@ gux-error-message-beta.gux-dark-theme {

// Light
.gux-error-message-light-theme {
color: @gux-grey-2;
color: @gux-type;
};

.gux-light-theme {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import (reference) '../../../../../../style/color.less';

@gux-icon-checkbox-unchecked: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cpath fill='%2398a7b8' d='M416 32v352h-352v-352h352zM448 416v-416h-416v416h416z' /%3E%3C/svg%3E");
@gux-icon-checkbox-unchecked-hover: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cpath fill='%232a60c8' d='M416 32v352h-352v-352h352zM448 416v-416h-416v416h416z' /%3E%3C/svg%3E");
@gux-icon-checkbox-checked: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cpath fill='%232a60c8' d='M144 272l96 -64l224 224l32 -32l-256 -320l-128 160zM416 228l32 40v-268h-416v416h353l-32 -32h-289v-352h352v196z' /%3E%3C/svg%3E");
Expand Down Expand Up @@ -56,8 +58,8 @@ gux-input-checkbox-beta {
position: absolute;
left: 4px;
top: 6px;
width: @gux-icon-size-default;
height: @gux-icon-size-default;
width: @gux-icon-size-default-global;
height: @gux-icon-size-default-global;
}

label.gux-unchecked::after {
Expand Down Expand Up @@ -86,7 +88,7 @@ gux-input-checkbox-beta {
}

.gux-input-checkbox-dark-theme {
color: @gux-off-white;
color: @gux-type-dark;

label.gux-checked::after {
background-image: @gux-icon-checkbox-checked-dark;
Expand All @@ -113,7 +115,7 @@ gux-input-checkbox-beta.gux-dark-theme {

// Light
.gux-input-checkbox-light-theme {
color: @gux-grey-2;
color: @gux-type;
}

.gux-light-theme {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import (reference) '../../../../../../style/color.less';

// Variables part
@background: #f9fafb;

Expand Down Expand Up @@ -25,15 +27,15 @@ gux-input-color-beta {
box-shadow: 0 0 0 0 transparent;
transition: box-shadow 0.2s;
background-color: @background;
border: 1px solid @gux-border-alt;
border: 1px solid #dae1e8;
border-radius: 2px;
cursor: pointer;

&:focus,
&.opened {
border-color: @gux-dark-blue;
border-color: @gux-genesys-dark-blue;
outline: none;
box-shadow: 0 0 4px fade(@gux-blue, 50%);
box-shadow: 0 0 4px fade(@gux-genesys-blue, 50%);
}

&:disabled {
Expand All @@ -53,7 +55,7 @@ gux-input-color-beta {
margin: 9px 0;
float: left;
font-size: 12px;
color: @gux-grey-2;
color: @gux-type;
}

.gux-input-color-color-select {
Expand Down Expand Up @@ -92,25 +94,25 @@ gux-input-color-beta {

// Dark
.gux-input-color-dark-theme {
color: @gux-off-white;
color: @gux-type-dark;

.gux-input-color-main-element {
border-color: @gux-grey-1;
background-color: @gux-border-dark;
border-color: @gux-grey-global;
background-color: #555d66;
}

.gux-input-color-main-element:focus,
.gux-input-color-opened {
border-color: @gux-blue;
border-color: @gux-genesys-blue;
box-shadow: none;
}

.gux-input-color-color-name {
color: @gux-off-white;
color: @gux-type-dark;
}

gux-icon {
color: @gux-off-white;
color: @gux-type-dark;
}
}

Expand All @@ -126,7 +128,7 @@ gux-input-color-beta.gux-dark-theme {

// Light
.gux-input-color-light-theme {
color: @gux-grey-2;
color: @gux-type;
}

.gux-light-theme {
Expand Down
Loading