q2-tecton-elements 1.12.0-alpha.0 → 1.12.2
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/cjs/{icons-4595ee47.js → icons-9bd0febe.js} +10 -0
- package/dist/cjs/{index-a55d3c34.js → index-773c3eec.js} +25 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +3 -3
- package/dist/cjs/q2-calendar.cjs.entry.js +17 -5
- package/dist/cjs/q2-card.cjs.entry.js +89 -0
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +4 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +17 -6
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +2 -2
- package/dist/cjs/q2-input.cjs.entry.js +12 -7
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-option-list.cjs.entry.js +357 -0
- package/dist/cjs/q2-option.cjs.entry.js +2 -10
- package/dist/cjs/q2-pagination.cjs.entry.js +118 -0
- package/dist/cjs/q2-pill.cjs.entry.js +137 -0
- package/dist/cjs/q2-radio-group.cjs.entry.js +40 -12
- package/dist/cjs/q2-radio.cjs.entry.js +20 -3
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +28 -11
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
- package/dist/cjs/q2-tab-container.cjs.entry.js +5 -1
- package/dist/cjs/q2-tag.cjs.entry.js +94 -0
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/q2-btn/styles.css +1 -1
- package/dist/collection/components/q2-calendar/helpers.js +6 -0
- package/dist/collection/components/q2-calendar/index.js +27 -4
- package/dist/collection/components/q2-calendar/styles.css +1 -1
- package/dist/collection/components/q2-card/index.js +290 -0
- package/dist/collection/components/q2-card/styles.css +161 -0
- package/dist/collection/components/q2-checkbox/index.js +32 -4
- package/dist/collection/components/q2-checkbox/styles.css +2 -1
- package/dist/collection/components/q2-checkbox-group/index.js +21 -0
- package/dist/collection/components/q2-dropdown/styles.css +3 -3
- package/dist/collection/components/q2-icon/icons.js +10 -0
- package/dist/collection/components/q2-input/index.js +63 -6
- package/dist/collection/components/q2-input/styles.css +25 -33
- package/dist/collection/components/q2-loading/styles.css +1 -1
- package/dist/collection/components/q2-option/index.js +19 -25
- package/dist/collection/components/q2-option/styles.css +5 -0
- package/dist/collection/components/q2-option-list/index.js +646 -0
- package/dist/collection/components/q2-option-list/styles.css +128 -0
- package/dist/collection/components/q2-pagination/index.js +277 -0
- package/dist/collection/components/q2-pagination/styles.css +120 -0
- package/dist/collection/components/q2-pill/index.js +324 -0
- package/dist/collection/components/q2-pill/styles.css +227 -0
- package/dist/collection/components/q2-radio/index.js +38 -1
- package/dist/collection/components/q2-radio-group/index.js +64 -19
- package/dist/collection/components/q2-select/index.js +44 -9
- package/dist/collection/components/q2-select/styles.css +4 -4
- package/dist/collection/components/q2-stepper/styles.css +8 -8
- package/dist/collection/components/q2-tab-container/index.js +4 -0
- package/dist/collection/components/q2-tag/index.js +200 -0
- package/dist/collection/components/q2-tag/styles.css +141 -0
- package/dist/collection/utils/index.js +24 -12
- package/dist/esm/{icons-3ee662ea.js → icons-6a143c2f.js} +10 -0
- package/dist/esm/{index-ec6660af.js → index-fa32f694.js} +25 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +3 -3
- package/dist/esm/q2-calendar.entry.js +17 -5
- package/dist/esm/q2-card.entry.js +85 -0
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +4 -1
- package/dist/esm/q2-checkbox.entry.js +17 -6
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +2 -2
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +2 -2
- package/dist/esm/q2-input.entry.js +12 -7
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-option-list.entry.js +353 -0
- package/dist/esm/q2-option.entry.js +3 -11
- package/dist/esm/q2-pagination.entry.js +114 -0
- package/dist/esm/q2-pill.entry.js +133 -0
- package/dist/esm/q2-radio-group.entry.js +41 -13
- package/dist/esm/q2-radio.entry.js +20 -3
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +28 -11
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-tab-container.entry.js +5 -1
- package/dist/esm/q2-tag.entry.js +90 -0
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/p-08668234.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-0a7cff38.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-167a19fd.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-06fff43d.entry.js → p-2afdc922.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-30bf5f44.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-34415315.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-3c6f73cb.js +1 -0
- package/dist/q2-tecton-elements/p-54300d2f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-54f0d64e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-58d95376.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5b906cf1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5effd81a.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7ce98c1a.entry.js +1 -0
- package/dist/q2-tecton-elements/p-91dba21f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-9a3c37ab.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-a0248299.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-aca8302b.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-af202624.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c5e55b9f.entry.js → p-b9c2c1d3.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-c3d68d5c.js +1 -0
- package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-c5199147.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-843b1ee9.entry.js → p-c5e6f7fa.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-50967020.entry.js → p-d3058002.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d65aaed2.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-d9bc6494.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-df86f160.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-9a977ee6.entry.js → p-e38080d2.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-e9d69ba8.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f98dc161.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-fa9e3825.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-b281c349.entry.js → p-fe6407a4.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/elements/q2-tag-test.js +151 -0
- package/dist/test/helpers.js +14 -3
- package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
- package/dist/types/components/q2-calendar/index.d.ts +1 -0
- package/dist/types/components/q2-card/index.d.ts +31 -0
- package/dist/types/components/q2-checkbox/index.d.ts +3 -1
- package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
- package/dist/types/components/q2-input/index.d.ts +3 -0
- package/dist/types/components/q2-option/index.d.ts +2 -3
- package/dist/types/components/q2-option-list/index.d.ts +62 -0
- package/dist/types/components/q2-pagination/index.d.ts +30 -0
- package/dist/types/components/q2-pill/index.d.ts +39 -0
- package/dist/types/components/q2-radio/index.d.ts +4 -1
- package/dist/types/components/q2-radio-group/index.d.ts +5 -1
- package/dist/types/components/q2-select/index.d.ts +1 -0
- package/dist/types/components/q2-tag/index.d.ts +28 -0
- package/dist/types/components.d.ts +175 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/workspace/workspace/tecton-production_release_1.12.x/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
- package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → tecton-production_release_1.12.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +4 -1
- package/package.json +2 -2
- package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
- package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
- package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ac859fcc.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
- package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*:active {
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
*:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-shadow: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-moz-focus-inner {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
button {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host(.sr),
|
|
30
|
+
:host(.sr) button {
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sr,
|
|
43
|
+
.sr button {
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hidden {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([hidden]) {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.invisible {
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host {
|
|
68
|
+
position: relative;
|
|
69
|
+
width: 100%;
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.content {
|
|
74
|
+
margin-top: var(--tct-option-list-margin, var(--t-option-list-margin, var(--app-scale-1x, 5px)));
|
|
75
|
+
position: absolute;
|
|
76
|
+
height: 0;
|
|
77
|
+
opacity: 0;
|
|
78
|
+
visibility: hidden;
|
|
79
|
+
background-color: var(--app-white);
|
|
80
|
+
color: var(--t-font-color);
|
|
81
|
+
z-index: 100;
|
|
82
|
+
width: max-content;
|
|
83
|
+
min-width: var(--tct-option-list-min-width, var(--t-option-list-min-width, 135px));
|
|
84
|
+
box-shadow: var(--app-shadow-1);
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
text-align: start;
|
|
87
|
+
transition: opacity var(--app-tween-1);
|
|
88
|
+
border-radius: var(--tct-option-list-border-radius, var(--t-option-list-border-radius, 0));
|
|
89
|
+
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
|
|
90
|
+
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));
|
|
91
|
+
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));
|
|
92
|
+
scrollbar-width: thin;
|
|
93
|
+
scrollbar-color: var(--comp-scrollbar-color) transparent;
|
|
94
|
+
}
|
|
95
|
+
.content::-webkit-scrollbar {
|
|
96
|
+
width: var(--comp-scrollbar-size);
|
|
97
|
+
height: var(--comp-scrollbar-size);
|
|
98
|
+
margin: 5px;
|
|
99
|
+
}
|
|
100
|
+
.content::-webkit-scrollbar-thumb {
|
|
101
|
+
background: var(--comp-scrollbar-color);
|
|
102
|
+
border-radius: var(--comp-scrollbar-border-radius);
|
|
103
|
+
}
|
|
104
|
+
.content::-webkit-scrollbar-track {
|
|
105
|
+
background: transparent;
|
|
106
|
+
border-radius: var(--comp-scrollbar-border-radius);
|
|
107
|
+
}
|
|
108
|
+
:host(:not([align=right])) .content {
|
|
109
|
+
left: 0;
|
|
110
|
+
}
|
|
111
|
+
:host([align=right]) .content {
|
|
112
|
+
right: 0;
|
|
113
|
+
}
|
|
114
|
+
:host([open]) .content {
|
|
115
|
+
display: block;
|
|
116
|
+
height: auto;
|
|
117
|
+
overflow: auto;
|
|
118
|
+
opacity: 1;
|
|
119
|
+
visibility: visible;
|
|
120
|
+
}
|
|
121
|
+
:host([is-sizeable]) .content {
|
|
122
|
+
display: block;
|
|
123
|
+
height: auto;
|
|
124
|
+
}
|
|
125
|
+
:host([alignment=right]) .content {
|
|
126
|
+
left: unset;
|
|
127
|
+
right: 0;
|
|
128
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Component, State, Prop, h, Listen, Element, Event } from '@stencil/core';
|
|
2
|
+
import { isEventFromElement, loc, nextPaint, overrideFocus } from 'src/utils';
|
|
3
|
+
export class Q2Pagination {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.handlePageChange = (page) => {
|
|
6
|
+
const { totalPages, inputField } = this;
|
|
7
|
+
if (page < 1) {
|
|
8
|
+
page = 1;
|
|
9
|
+
}
|
|
10
|
+
else if (page > totalPages) {
|
|
11
|
+
page = totalPages;
|
|
12
|
+
}
|
|
13
|
+
if (inputField.value !== `${page}`)
|
|
14
|
+
inputField.value = `${page}`;
|
|
15
|
+
if (!this.hostElement.onchange) {
|
|
16
|
+
this.page = page;
|
|
17
|
+
}
|
|
18
|
+
this.change.emit({ value: page });
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
////////// LIFECYCLE HOOKS ////////
|
|
22
|
+
componentDidLoad() {
|
|
23
|
+
if (this.recordsOnly || this.pagesOnly)
|
|
24
|
+
return;
|
|
25
|
+
this.containerWidth = this.containerElement.clientWidth;
|
|
26
|
+
this.resizeObserver = new ResizeObserver(() => this.checkSize());
|
|
27
|
+
this.resizeObserver.observe(this.hostElement);
|
|
28
|
+
overrideFocus(this.hostElement);
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
var _a;
|
|
32
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
33
|
+
}
|
|
34
|
+
onHostElementFocus(event) {
|
|
35
|
+
var _a;
|
|
36
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
37
|
+
return;
|
|
38
|
+
const { isFullViewHidden, containerElement, inputField } = this;
|
|
39
|
+
if (isFullViewHidden) {
|
|
40
|
+
(_a = containerElement.querySelector('q2-btn:not([disabled])')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
inputField.focus();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
get isFullViewHidden() {
|
|
47
|
+
return this.isSmall || this.recordsOnly || this.pagesOnly;
|
|
48
|
+
}
|
|
49
|
+
get pageWithDefault() {
|
|
50
|
+
return this.page || 1;
|
|
51
|
+
}
|
|
52
|
+
get perPageWithDefault() {
|
|
53
|
+
return this.perPage || 10;
|
|
54
|
+
}
|
|
55
|
+
get totalWithDefault() {
|
|
56
|
+
return this.total || 0;
|
|
57
|
+
}
|
|
58
|
+
get recordTypeWithDefault() {
|
|
59
|
+
return this.recordType || loc('tecton.element.pagination.defaultRecordType');
|
|
60
|
+
}
|
|
61
|
+
get currentRange() {
|
|
62
|
+
const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;
|
|
63
|
+
const start = (page - 1) * perPage + 1;
|
|
64
|
+
const end = Math.min(page * perPage, total);
|
|
65
|
+
return `${start} - ${end}`;
|
|
66
|
+
}
|
|
67
|
+
get totalPages() {
|
|
68
|
+
const { pagesOnly, totalWithDefault: total, perPageWithDefault: perPage, pages } = this;
|
|
69
|
+
if (pagesOnly && pages && !isNaN(parseInt(`${pages}`)))
|
|
70
|
+
return pages;
|
|
71
|
+
return Math.ceil(total / perPage);
|
|
72
|
+
}
|
|
73
|
+
checkSize() {
|
|
74
|
+
const { hostElement, containerElement } = this;
|
|
75
|
+
const isOverflowing = this.containerWidth > hostElement.clientWidth;
|
|
76
|
+
this.isSmall = isOverflowing;
|
|
77
|
+
if (isOverflowing)
|
|
78
|
+
return;
|
|
79
|
+
nextPaint(() => {
|
|
80
|
+
const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;
|
|
81
|
+
if (containerWidthHasNotChanged)
|
|
82
|
+
return;
|
|
83
|
+
this.containerWidth = containerElement.clientWidth;
|
|
84
|
+
this.checkSize();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
////////// OBSERVERS //////////
|
|
88
|
+
render() {
|
|
89
|
+
const { pagesOnly, isFullViewHidden, recordTypeWithDefault: recordType, totalPages, totalWithDefault: total, pageWithDefault: page, currentRange } = this;
|
|
90
|
+
const onFirstPage = page === 1;
|
|
91
|
+
const onLastPage = page === totalPages;
|
|
92
|
+
return (h("nav", { class: "container", ref: el => (this.containerElement = el), "aria-label": loc('tecton.element.pagination.title') },
|
|
93
|
+
h("div", { class: "description", "test-id": "description" }, pagesOnly
|
|
94
|
+
? loc('tecton.element.pagination.pages', {
|
|
95
|
+
current: page,
|
|
96
|
+
total: totalPages
|
|
97
|
+
})
|
|
98
|
+
: loc('tecton.element.pagination.description', {
|
|
99
|
+
range: currentRange,
|
|
100
|
+
recordType: recordType.toLowerCase(),
|
|
101
|
+
total: total.toLocaleString()
|
|
102
|
+
})),
|
|
103
|
+
h("div", { class: "btn-group" },
|
|
104
|
+
h("q2-btn", { label: "tecton.element.pagination.goToFirstPage", disabled: onFirstPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(1), "test-id": "firstPageBtn", "hide-label": true },
|
|
105
|
+
h("q2-icon", { type: "chevron-double-left" })),
|
|
106
|
+
h("q2-btn", { label: loc('tecton.element.pagination.goToPage', [page - 1]), disabled: onFirstPage, onClick: () => this.handlePageChange(page - 1), "test-id": "prevPageBtn", "hide-label": true },
|
|
107
|
+
h("q2-icon", { type: "chevron-left" }))),
|
|
108
|
+
h("div", { class: "controls", hidden: isFullViewHidden, "test-id": "controls" },
|
|
109
|
+
h("span", { "aria-hidden": "true" }, loc('tecton.element.pagination.page')),
|
|
110
|
+
h("div", { class: "input-wrapper", onClick: () => this.inputField.dispatchEvent(new FocusEvent('focus')) },
|
|
111
|
+
h("q2-input", { type: "number", value: `${page}`, min: 1, max: this.totalPages, hideLabel: true, optional: true, label: `${loc('tecton.element.pagination.page')} (${loc('tecton.element.pagination.ofPages', [
|
|
112
|
+
totalPages.toLocaleString()
|
|
113
|
+
])})`, onChange: event => this.handlePageChange(event.detail.value), "test-id": "pageInput", current: "page", ref: el => (this.inputField = el) })),
|
|
114
|
+
h("span", { "aria-hidden": "true" }, loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()]))),
|
|
115
|
+
h("div", { class: "btn-group" },
|
|
116
|
+
h("q2-btn", { label: loc('tecton.element.pagination.goToPage', [page + 1]), disabled: onLastPage, onClick: () => this.handlePageChange(page + 1), "test-id": "nextPageBtn", "hide-label": true },
|
|
117
|
+
h("q2-icon", { type: "chevron-right" })),
|
|
118
|
+
h("q2-btn", { label: "tecton.element.pagination.goToLastPage", disabled: onLastPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(totalPages), "test-id": "lastPageBtn", "hide-label": true },
|
|
119
|
+
h("q2-icon", { type: "chevron-double-right" })))));
|
|
120
|
+
}
|
|
121
|
+
static get is() { return "q2-pagination"; }
|
|
122
|
+
static get encapsulation() { return "shadow"; }
|
|
123
|
+
static get originalStyleUrls() { return {
|
|
124
|
+
"$": ["styles.scss"]
|
|
125
|
+
}; }
|
|
126
|
+
static get styleUrls() { return {
|
|
127
|
+
"$": ["styles.css"]
|
|
128
|
+
}; }
|
|
129
|
+
static get properties() { return {
|
|
130
|
+
"recordType": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "string",
|
|
135
|
+
"resolved": "string",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": ""
|
|
143
|
+
},
|
|
144
|
+
"attribute": "record-type",
|
|
145
|
+
"reflect": false
|
|
146
|
+
},
|
|
147
|
+
"perPage": {
|
|
148
|
+
"type": "number",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "number",
|
|
152
|
+
"resolved": "number",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": false,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": ""
|
|
160
|
+
},
|
|
161
|
+
"attribute": "per-page",
|
|
162
|
+
"reflect": false
|
|
163
|
+
},
|
|
164
|
+
"total": {
|
|
165
|
+
"type": "number",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "number",
|
|
169
|
+
"resolved": "number",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": ""
|
|
177
|
+
},
|
|
178
|
+
"attribute": "total",
|
|
179
|
+
"reflect": true
|
|
180
|
+
},
|
|
181
|
+
"page": {
|
|
182
|
+
"type": "number",
|
|
183
|
+
"mutable": true,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "number",
|
|
186
|
+
"resolved": "number",
|
|
187
|
+
"references": {}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": ""
|
|
194
|
+
},
|
|
195
|
+
"attribute": "page",
|
|
196
|
+
"reflect": true
|
|
197
|
+
},
|
|
198
|
+
"pages": {
|
|
199
|
+
"type": "number",
|
|
200
|
+
"mutable": true,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "number",
|
|
203
|
+
"resolved": "number",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": false,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": ""
|
|
211
|
+
},
|
|
212
|
+
"attribute": "pages",
|
|
213
|
+
"reflect": true
|
|
214
|
+
},
|
|
215
|
+
"recordsOnly": {
|
|
216
|
+
"type": "boolean",
|
|
217
|
+
"mutable": true,
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "boolean",
|
|
220
|
+
"resolved": "boolean",
|
|
221
|
+
"references": {}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": ""
|
|
228
|
+
},
|
|
229
|
+
"attribute": "records-only",
|
|
230
|
+
"reflect": true
|
|
231
|
+
},
|
|
232
|
+
"pagesOnly": {
|
|
233
|
+
"type": "boolean",
|
|
234
|
+
"mutable": true,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "boolean",
|
|
237
|
+
"resolved": "boolean",
|
|
238
|
+
"references": {}
|
|
239
|
+
},
|
|
240
|
+
"required": false,
|
|
241
|
+
"optional": false,
|
|
242
|
+
"docs": {
|
|
243
|
+
"tags": [],
|
|
244
|
+
"text": ""
|
|
245
|
+
},
|
|
246
|
+
"attribute": "pages-only",
|
|
247
|
+
"reflect": true
|
|
248
|
+
}
|
|
249
|
+
}; }
|
|
250
|
+
static get states() { return {
|
|
251
|
+
"isSmall": {}
|
|
252
|
+
}; }
|
|
253
|
+
static get events() { return [{
|
|
254
|
+
"method": "change",
|
|
255
|
+
"name": "change",
|
|
256
|
+
"bubbles": true,
|
|
257
|
+
"cancelable": true,
|
|
258
|
+
"composed": true,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": ""
|
|
262
|
+
},
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "any",
|
|
265
|
+
"resolved": "any",
|
|
266
|
+
"references": {}
|
|
267
|
+
}
|
|
268
|
+
}]; }
|
|
269
|
+
static get elementRef() { return "hostElement"; }
|
|
270
|
+
static get listeners() { return [{
|
|
271
|
+
"name": "focus",
|
|
272
|
+
"method": "onHostElementFocus",
|
|
273
|
+
"target": undefined,
|
|
274
|
+
"capture": false,
|
|
275
|
+
"passive": false
|
|
276
|
+
}]; }
|
|
277
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*:active {
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
*:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-shadow: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-moz-focus-inner {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
button {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host(.sr),
|
|
30
|
+
:host(.sr) button {
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sr,
|
|
43
|
+
.sr button {
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hidden {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([hidden]) {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.invisible {
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host {
|
|
68
|
+
text-align: right;
|
|
69
|
+
display: block;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([hidden]) {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.container {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
column-gap: var(--tct-pagination-column-gap, var(--t-pagination-column-gap, var(--app-scale-2x, 10px)));
|
|
79
|
+
align-items: center;
|
|
80
|
+
height: var(--tct-pagination-height, var(--t-pagination-height, 44px));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.btn-group {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: var(--tct-pagination-btn-gap, var(--t-pagination-btn-gap, 0));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.description,
|
|
89
|
+
.controls {
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.controls {
|
|
94
|
+
display: grid;
|
|
95
|
+
grid-template-columns: auto 50px auto;
|
|
96
|
+
align-items: center;
|
|
97
|
+
gap: var(--tct-pagination-controls-gap, var(--t-pagination-controls-gap, var(--app-scale-1x, 5px)));
|
|
98
|
+
}
|
|
99
|
+
.controls[hidden] {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.input-wrapper {
|
|
104
|
+
height: var(--tct-pagination-height, var(--t-pagination-height, 44px));
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
q2-icon {
|
|
110
|
+
--tct-icon-size: var(--tct-pagination-icon-size, var(--t-pagination-icon-size, 12px));
|
|
111
|
+
color: var(--tct-pagination-icon-color, var(--t-pagination-icon-color, var(--t-text, #4d4d4d)));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
q2-input {
|
|
115
|
+
--tct-input-margin-top: 0;
|
|
116
|
+
--tct-input-margin-bottom: 0;
|
|
117
|
+
--tct-input-height: var(--tct-pagination-input-height, var(--t-pagination-input-height, 30px));
|
|
118
|
+
--tct-input-min-height: var(--tct-input-height);
|
|
119
|
+
--tct-input-align: center;
|
|
120
|
+
}
|