bromcom-ui 2.4.12 → 2.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-f2e73379.entry.js → p-027c7708.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1b314bd5.entry.js → p-1cd97811.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d4fd1619.entry.js → p-1fc98e5a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5f44988e.entry.js → p-2bd4c2ba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-59c0459d.entry.js → p-3c1b8095.entry.js} +1 -1
- package/dist/bromcom-ui/p-3d40f6ce.js +1 -0
- package/dist/bromcom-ui/p-4054d5e3.js +1 -0
- package/dist/bromcom-ui/{p-6f9c4492.entry.js → p-7175652d.entry.js} +1 -1
- package/dist/bromcom-ui/p-9f47196d.js +1 -0
- package/dist/bromcom-ui/{p-3d463d45.entry.js → p-af83c581.entry.js} +1 -1
- package/dist/bromcom-ui/{p-89aab923.js → p-b5f0649f.js} +1 -1
- package/dist/bromcom-ui/p-c28be553.entry.js +1 -0
- package/dist/bromcom-ui/p-c6e58492.js +1 -0
- package/dist/bromcom-ui/{p-841a7311.entry.js → p-d4d5758f.entry.js} +1 -1
- package/dist/bromcom-ui/p-e42b15f4.js +1 -0
- package/dist/bromcom-ui/{p-ac4d2284.entry.js → p-ea79fd86.entry.js} +1 -1
- package/dist/cjs/{bcm-6463472f.js → bcm-5dcc129b.js} +6 -0
- package/dist/cjs/bcm-avatar_33.cjs.entry.js +5 -5
- package/dist/cjs/bcm-icon-2_2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-list.cjs.entry.js +287 -221
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +4 -4
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
- package/dist/cjs/bcm-popover-box.cjs.entry.js +4 -4
- package/dist/cjs/bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/bcm-search-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-stepper.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tag-2.cjs.entry.js +2 -2
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/{generate-2330fd84.js → generate-daf8998f.js} +10 -0
- package/dist/cjs/{label-template-317aee92.js → label-template-39ce726c.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popover-placement-e5e2f665.js → popover-placement-dacc8fc9.js} +5 -6
- package/dist/cjs/{stepper-states-3c341aa6.js → stepper-states-56f0862b.js} +1 -1
- package/dist/cjs/{string-helper-acab31b6.js → string-helper-991c7e7d.js} +1 -1
- package/dist/collection/components/organism/list/list-key-control.js +104 -0
- package/dist/collection/components/organism/list/list.css +15 -6
- package/dist/collection/components/organism/list/list.js +211 -213
- package/dist/collection/helper/generate.js +10 -0
- package/dist/collection/models/bcm.js +6 -0
- package/dist/collection/templates/list-item-template.js +6 -5
- package/dist/collection/utils/popover-placement.js +4 -5
- package/dist/esm/{bcm-0d5f0281.js → bcm-1571bb45.js} +6 -0
- package/dist/esm/bcm-avatar_33.entry.js +5 -5
- package/dist/esm/bcm-icon-2_2.entry.js +2 -2
- package/dist/esm/bcm-list.entry.js +287 -221
- package/dist/esm/bcm-popconfirm-box.entry.js +4 -4
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover-box.entry.js +4 -4
- package/dist/esm/bcm-popover.entry.js +2 -2
- package/dist/esm/bcm-search-2.entry.js +3 -3
- package/dist/esm/bcm-stepper.entry.js +3 -3
- package/dist/esm/bcm-tag-2.entry.js +2 -2
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/{generate-2ee52515.js → generate-3a3196bb.js} +10 -0
- package/dist/esm/{label-template-dcde83fb.js → label-template-6989c6ba.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popover-placement-0b415c4e.js → popover-placement-38aa9b63.js} +5 -6
- package/dist/esm/{stepper-states-8d16f3b0.js → stepper-states-b821e069.js} +1 -1
- package/dist/esm/{string-helper-acc53dad.js → string-helper-cfa6df93.js} +1 -1
- package/dist/types/components/organism/list/list-key-control.d.ts +21 -0
- package/dist/types/components/organism/list/list.d.ts +26 -24
- package/dist/types/components.d.ts +5 -3
- package/dist/types/models/bcm-types.d.ts +1 -0
- package/dist/types/models/bcm.d.ts +5 -1
- package/dist/types/templates/list-item-template.d.ts +1 -0
- package/dist/types/templates/list-template.d.ts +1 -0
- package/package.json +2 -2
- package/dist/bromcom-ui/p-18d770ad.js +0 -1
- package/dist/bromcom-ui/p-3cbd2cb0.js +0 -1
- package/dist/bromcom-ui/p-545d742a.entry.js +0 -1
- package/dist/bromcom-ui/p-8754d990.js +0 -1
- package/dist/bromcom-ui/p-93082523.js +0 -1
- package/dist/bromcom-ui/p-dd76fa74.js +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export class ListKeyControl {
|
|
2
|
+
constructor(keyCode, element) {
|
|
3
|
+
this.keyCode = keyCode;
|
|
4
|
+
this.element = element;
|
|
5
|
+
}
|
|
6
|
+
getKeyCode() {
|
|
7
|
+
return this.keyCode;
|
|
8
|
+
}
|
|
9
|
+
isUp() {
|
|
10
|
+
return this.keyCode === 38;
|
|
11
|
+
}
|
|
12
|
+
isDown() {
|
|
13
|
+
return this.keyCode === 40;
|
|
14
|
+
}
|
|
15
|
+
isLeft() {
|
|
16
|
+
return this.keyCode === 37;
|
|
17
|
+
}
|
|
18
|
+
isRight() {
|
|
19
|
+
return this.keyCode === 39;
|
|
20
|
+
}
|
|
21
|
+
isEnter() {
|
|
22
|
+
return this.keyCode === 13;
|
|
23
|
+
}
|
|
24
|
+
isEscape() {
|
|
25
|
+
return this.keyCode === 27;
|
|
26
|
+
}
|
|
27
|
+
isSpace() {
|
|
28
|
+
return this.keyCode === 32;
|
|
29
|
+
}
|
|
30
|
+
getFocusedElement() {
|
|
31
|
+
return this.element.querySelectorAll('.bcm-list__item.focused')[0] || null;
|
|
32
|
+
}
|
|
33
|
+
getFirstElement() {
|
|
34
|
+
return this.element.querySelectorAll('.bcm-list__item')[0] || null;
|
|
35
|
+
}
|
|
36
|
+
getNextElement() {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.nextElementSibling) || this.getFirstElement();
|
|
39
|
+
}
|
|
40
|
+
getPreviousElement() {
|
|
41
|
+
var _a;
|
|
42
|
+
return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.previousElementSibling) || this.getFirstElement();
|
|
43
|
+
}
|
|
44
|
+
getChildElement() {
|
|
45
|
+
var _a;
|
|
46
|
+
return ((_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.bcm-list__item')[0]) || null;
|
|
47
|
+
}
|
|
48
|
+
getParentElement() {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
return ((_b = (_a = this.getFocusedElement()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) || null;
|
|
51
|
+
}
|
|
52
|
+
setFocus(element) {
|
|
53
|
+
element.focus();
|
|
54
|
+
}
|
|
55
|
+
keydown() {
|
|
56
|
+
debugger;
|
|
57
|
+
const focusedElement = this.getFocusedElement();
|
|
58
|
+
const nextElement = this.getNextElement();
|
|
59
|
+
const previousElement = this.getPreviousElement();
|
|
60
|
+
const childElement = this.getChildElement();
|
|
61
|
+
const parentElement = this.getParentElement();
|
|
62
|
+
if (this.isUp()) {
|
|
63
|
+
if (focusedElement) {
|
|
64
|
+
if (previousElement) {
|
|
65
|
+
this.setFocus(previousElement);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.setFocus(parentElement);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.setFocus(this.getFirstElement());
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (this.isDown()) {
|
|
76
|
+
if (focusedElement) {
|
|
77
|
+
if (nextElement) {
|
|
78
|
+
this.setFocus(nextElement);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.setFocus(this.getFirstElement());
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.setFocus(this.getFirstElement());
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else if (this.isLeft()) {
|
|
89
|
+
if (parentElement) {
|
|
90
|
+
this.setFocus(parentElement);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else if (this.isRight()) {
|
|
94
|
+
if (childElement) {
|
|
95
|
+
this.setFocus(childElement);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (this.isEnter()) {
|
|
99
|
+
if (focusedElement) {
|
|
100
|
+
console.log('seçilen element: ', focusedElement);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -18562,14 +18562,14 @@
|
|
|
18562
18562
|
.bcm-list__container.full-width {
|
|
18563
18563
|
width: 100%;
|
|
18564
18564
|
}
|
|
18565
|
-
.bcm-list__container.bcm-list__type-select, .bcm-list__container.bcm-list__type-autocomplete {
|
|
18565
|
+
.bcm-list__container.bcm-list__type-linked-component, .bcm-list__container.bcm-list__type-select, .bcm-list__container.bcm-list__type-autocomplete {
|
|
18566
18566
|
opacity: 0;
|
|
18567
18567
|
visibility: hidden;
|
|
18568
18568
|
position: absolute;
|
|
18569
18569
|
top: 0;
|
|
18570
18570
|
left: 0;
|
|
18571
18571
|
}
|
|
18572
|
-
.bcm-list__container.bcm-list__type-select.is-open, .bcm-list__container.bcm-list__type-autocomplete.is-open {
|
|
18572
|
+
.bcm-list__container.bcm-list__type-linked-component.is-open, .bcm-list__container.bcm-list__type-select.is-open, .bcm-list__container.bcm-list__type-autocomplete.is-open {
|
|
18573
18573
|
opacity: 1;
|
|
18574
18574
|
visibility: visible;
|
|
18575
18575
|
z-index: 10800;
|
|
@@ -18688,11 +18688,20 @@
|
|
|
18688
18688
|
border-color: var(--bcm-color-prime-blue-5);
|
|
18689
18689
|
box-shadow: 0px 0px 4px var(--bcm-color-prime-blue-6);
|
|
18690
18690
|
}
|
|
18691
|
+
.bcm-list__item {
|
|
18692
|
+
padding: 2px 8px;
|
|
18693
|
+
}
|
|
18694
|
+
.bcm-list__item.disabled {
|
|
18695
|
+
user-select: none;
|
|
18696
|
+
}
|
|
18691
18697
|
.bcm-list__item:focus {
|
|
18692
|
-
|
|
18698
|
+
outline: none;
|
|
18693
18699
|
}
|
|
18694
|
-
.bcm-list__item.
|
|
18695
|
-
|
|
18700
|
+
.bcm-list__item:focus > .bcm-list__item-content {
|
|
18701
|
+
background-color: var(--bcm-color-prime-blue-1);
|
|
18702
|
+
}
|
|
18703
|
+
.bcm-list__item:focus > .bcm-list__item-content:not(.disabled) {
|
|
18704
|
+
color: var(--bcm-color-grey-8);
|
|
18696
18705
|
}
|
|
18697
18706
|
.bcm-list__item-content {
|
|
18698
18707
|
display: flex;
|
|
@@ -18701,12 +18710,12 @@
|
|
|
18701
18710
|
align-items: stretch;
|
|
18702
18711
|
cursor: pointer;
|
|
18703
18712
|
padding: 0;
|
|
18704
|
-
margin: 0 8px;
|
|
18705
18713
|
color: var(--bcm-color-grey-8);
|
|
18706
18714
|
background-color: var(--bcm-color-grey-1);
|
|
18707
18715
|
}
|
|
18708
18716
|
.bcm-list__item-content.disabled {
|
|
18709
18717
|
color: var(--bcm-color-grey-6);
|
|
18718
|
+
user-select: none;
|
|
18710
18719
|
}
|
|
18711
18720
|
.bcm-list__item-content.selected {
|
|
18712
18721
|
color: var(--bcm-color-prime-blue-6);
|