@dnb/eufemia 9.16.2 → 9.16.3
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/CHANGELOG.md +10 -0
- package/cjs/components/input-masked/InputMaskedHooks.js +3 -2
- package/cjs/components/input-masked/InputMaskedUtils.js +2 -2
- package/cjs/components/pagination/Pagination.d.ts +6 -0
- package/cjs/components/pagination/Pagination.js +2 -0
- package/cjs/components/pagination/PaginationBar.js +1 -1
- package/cjs/components/pagination/PaginationInfinity.js +152 -89
- package/cjs/components/pagination/PaginationProvider.js +65 -68
- package/cjs/components/tabs/style/_tabs.scss +5 -1
- package/cjs/components/tabs/style/dnb-tabs.css +4 -1
- package/cjs/components/tabs/style/dnb-tabs.min.css +1 -1
- package/cjs/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/cjs/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/cjs/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/cjs/shared/component-helper.js +3 -1
- package/cjs/shared/helpers.js +23 -12
- package/cjs/style/dnb-ui-components.css +4 -1
- package/cjs/style/dnb-ui-components.min.css +1 -1
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.css +37 -34
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +37 -34
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/components/input-masked/InputMaskedHooks.js +3 -2
- package/components/input-masked/InputMaskedUtils.js +3 -3
- package/components/pagination/Pagination.d.ts +6 -0
- package/components/pagination/Pagination.js +2 -0
- package/components/pagination/PaginationBar.js +1 -1
- package/components/pagination/PaginationInfinity.js +137 -67
- package/components/pagination/PaginationProvider.js +64 -68
- package/components/tabs/style/_tabs.scss +5 -1
- package/components/tabs/style/dnb-tabs.css +4 -1
- package/components/tabs/style/dnb-tabs.min.css +1 -1
- package/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/es/components/input-masked/InputMaskedHooks.js +3 -2
- package/es/components/input-masked/InputMaskedUtils.js +3 -3
- package/es/components/pagination/Pagination.d.ts +6 -0
- package/es/components/pagination/Pagination.js +2 -0
- package/es/components/pagination/PaginationBar.js +1 -1
- package/es/components/pagination/PaginationInfinity.js +110 -37
- package/es/components/pagination/PaginationProvider.js +57 -61
- package/es/components/tabs/style/_tabs.scss +5 -1
- package/es/components/tabs/style/dnb-tabs.css +4 -1
- package/es/components/tabs/style/dnb-tabs.min.css +1 -1
- package/es/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/es/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/es/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/es/shared/component-helper.js +1 -0
- package/es/shared/helpers.js +18 -11
- package/es/style/dnb-ui-components.css +4 -1
- package/es/style/dnb-ui-components.min.css +1 -1
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.css +37 -34
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/es/style/themes/theme-ui/dnb-theme-ui.css +37 -34
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/esm/components/input-masked/InputMaskedHooks.js +3 -2
- package/esm/components/input-masked/InputMaskedUtils.js +3 -3
- package/esm/components/pagination/Pagination.d.ts +6 -0
- package/esm/components/pagination/Pagination.js +2 -0
- package/esm/components/pagination/PaginationBar.js +1 -1
- package/esm/components/pagination/PaginationInfinity.js +137 -67
- package/esm/components/pagination/PaginationProvider.js +64 -68
- package/esm/components/tabs/style/_tabs.scss +5 -1
- package/esm/components/tabs/style/dnb-tabs.css +4 -1
- package/esm/components/tabs/style/dnb-tabs.min.css +1 -1
- package/esm/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/esm/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/esm/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/esm/dnb-ui-components.min.mjs +3 -3
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +1 -1
- package/esm/dnb-ui-lib.min.mjs +3 -3
- package/esm/dnb-ui-web-components.min.mjs +3 -3
- package/esm/shared/component-helper.js +1 -0
- package/esm/shared/helpers.js +18 -11
- package/esm/style/dnb-ui-components.css +4 -1
- package/esm/style/dnb-ui-components.min.css +1 -1
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.css +37 -34
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/esm/style/themes/theme-ui/dnb-theme-ui.css +37 -34
- package/esm/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/package.json +2 -2
- package/shared/component-helper.js +1 -0
- package/shared/helpers.js +18 -11
- package/style/dnb-ui-components.css +4 -1
- package/style/dnb-ui-components.min.css +1 -1
- package/style/themes/theme-open-banking/dnb-theme-open-banking.css +37 -34
- package/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/style/themes/theme-ui/dnb-theme-ui.css +37 -34
- package/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/umd/dnb-ui-components.min.js +4 -4
- package/umd/dnb-ui-elements.min.js +3 -3
- package/umd/dnb-ui-extensions.min.js +1 -1
- package/umd/dnb-ui-lib.min.js +1 -1
- package/umd/dnb-ui-web-components.min.js +3 -3
|
@@ -211,7 +211,7 @@ html[data-visual-test] .dnb-tabs .dnb-tabs__scroll-nav-button {
|
|
|
211
211
|
user-select: none;
|
|
212
212
|
-webkit-user-select: none;
|
|
213
213
|
margin: 0;
|
|
214
|
-
padding: 0
|
|
214
|
+
padding: 0 0.125rem;
|
|
215
215
|
/* 1/16*4 */
|
|
216
216
|
background-color: transparent;
|
|
217
217
|
border-bottom: 1px solid transparent;
|
|
@@ -242,6 +242,9 @@ html[data-visual-test] .dnb-tabs .dnb-tabs__scroll-nav-button {
|
|
|
242
242
|
height: 0;
|
|
243
243
|
visibility: hidden;
|
|
244
244
|
overflow: hidden; }
|
|
245
|
+
.dnb-tabs__button .dnb-dummy,
|
|
246
|
+
.dnb-core-style .dnb-tabs .dnb-tabs__button .dnb-dummy {
|
|
247
|
+
margin-top: 0.25rem; }
|
|
245
248
|
.dnb-tabs__button::after,
|
|
246
249
|
.dnb-core-style .dnb-tabs .dnb-tabs__button::after {
|
|
247
250
|
content: '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dnb-tabs{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;color:var(--color-black-80,#333);font-family:DNB,sans-serif;font-family:var(--font-family-default);font-size:1rem;font-size:var(--font-size-small);font-style:normal;font-weight:400;font-weight:var(--font-weight-basis);line-height:1.5rem;line-height:var(--line-height-basis);margin:0;padding:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-break:break-word}.dnb-tabs *,.dnb-tabs :after,.dnb-tabs :before{background-repeat:no-repeat;-webkit-box-sizing:border-box;box-sizing:border-box}.dnb-tabs :after,.dnb-tabs :before{text-decoration:inherit;vertical-align:inherit}.dnb-tabs__tabs{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;z-index:1}.dnb-tabs__tabs,.dnb-tabs__tabs.dnb-section--spacing{padding-bottom:0}.dnb-tabs__tabs__tablist{-webkit-box-flex:0;-ms-scroll-chaining:none;-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;-ms-overflow-style:none;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:0 1 auto;flex:0 1 auto;margin:0 -.5rem;overflow-x:auto;overscroll-behavior:contain;padding:0 .5rem;scrollbar-color:#14555a transparent;scrollbar-color:var(--color-emerald-green) transparent;scrollbar-width:thin;scrollbar-width:none}.dnb-tabs__tabs__tablist:focus{outline:none}html[data-whatinput=keyboard] .dnb-tabs__tabs__tablist:focus{--border-color:var(--color-emerald-green);border-color:transparent;-webkit-box-shadow:0 0 0 .125rem var(--border-color);box-shadow:0 0 0 .125rem var(--border-color)}@media screen and (-ms-high-contrast:none){html[data-whatinput=keyboard] .dnb-tabs__tabs__tablist:focus{-webkit-box-shadow:0 0 0 .125rem #14555a;box-shadow:0 0 0 .125rem #14555a;-webkit-box-shadow:0 0 0 .125rem var(--color-emerald-green);box-shadow:0 0 0 .125rem var(--color-emerald-green)}}html:not([data-visual-test]) .dnb-tabs__tabs__tablist{scroll-behavior:smooth}html[data-visual-test] .dnb-tabs__tabs__tablist{scroll-behavior:auto!important}.dnb-tabs__tabs__tablist::-webkit-scrollbar{display:none}.dnb-tabs__tabs--left .dnb-tabs__tabs__tablist{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.dnb-tabs__tabs--right .dnb-tabs__tabs__tablist{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-pack:end;-ms-flex-pack:end;flex-grow:1;justify-content:flex-end}.dnb-tabs__tabs--center .dnb-tabs__tabs__tablist{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.dnb-tabs__tabs:before{bottom:0;content:"";height:1px;left:-100vw;position:absolute;width:100vw;z-index:-1}.dnb-tabs:not(.dnb-tabs--has-scrollbar) .dnb-tabs__tabs__tablist{margin-left:-.5rem;padding-left:.5rem}.dnb-tabs__scroll-nav-button{display:none;opacity:0;position:absolute;-webkit-transition:opacity .6s ease-out;transition:opacity .6s ease-out;z-index:2}.dnb-tabs__scroll-nav-button.dnb-button--primary{background-color:#14555a;background-color:var(--color-emerald-green)}.dnb-tabs__scroll-nav-button:first-of-type{left:-2.5rem}.dnb-tabs__scroll-nav-button:last-of-type{right:-2.5rem}.dnb-tabs__scroll-nav-button--visible{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.dnb-tabs__scroll-nav-button--hide{opacity:0!important;pointer-events:none}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:first-of-type{left:0}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:last-of-type{right:0}html[data-visual-test] .dnb-tabs .dnb-tabs__scroll-nav-button{-webkit-transition:none;transition:none}.dnb-tabs__button__snap{display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 1rem 0 1.5rem}@media screen and (max-width:40em){.dnb-tabs__button__snap{padding:0 1rem}}.dnb-tabs__button__snap:first-of-type{padding-left:0}.dnb-tabs__button__snap:last-of-type{padding-right:.5rem}.dnb-tabs--has-scrollbar .dnb-tabs__button__snap:last-of-type{padding-right:1.5rem}.dnb-core-style .dnb-tabs .dnb-tabs__button,.dnb-tabs__button{background-color:transparent;border:none;cursor:pointer;font-size:1.125rem;font-size:var(--font-size-basis);line-height:1.5rem;line-height:var(--line-height-basis);margin:0;outline:none;padding
|
|
1
|
+
.dnb-tabs{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;color:var(--color-black-80,#333);font-family:DNB,sans-serif;font-family:var(--font-family-default);font-size:1rem;font-size:var(--font-size-small);font-style:normal;font-weight:400;font-weight:var(--font-weight-basis);line-height:1.5rem;line-height:var(--line-height-basis);margin:0;padding:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-break:break-word}.dnb-tabs *,.dnb-tabs :after,.dnb-tabs :before{background-repeat:no-repeat;-webkit-box-sizing:border-box;box-sizing:border-box}.dnb-tabs :after,.dnb-tabs :before{text-decoration:inherit;vertical-align:inherit}.dnb-tabs__tabs{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;z-index:1}.dnb-tabs__tabs,.dnb-tabs__tabs.dnb-section--spacing{padding-bottom:0}.dnb-tabs__tabs__tablist{-webkit-box-flex:0;-ms-scroll-chaining:none;-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;-ms-overflow-style:none;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:0 1 auto;flex:0 1 auto;margin:0 -.5rem;overflow-x:auto;overscroll-behavior:contain;padding:0 .5rem;scrollbar-color:#14555a transparent;scrollbar-color:var(--color-emerald-green) transparent;scrollbar-width:thin;scrollbar-width:none}.dnb-tabs__tabs__tablist:focus{outline:none}html[data-whatinput=keyboard] .dnb-tabs__tabs__tablist:focus{--border-color:var(--color-emerald-green);border-color:transparent;-webkit-box-shadow:0 0 0 .125rem var(--border-color);box-shadow:0 0 0 .125rem var(--border-color)}@media screen and (-ms-high-contrast:none){html[data-whatinput=keyboard] .dnb-tabs__tabs__tablist:focus{-webkit-box-shadow:0 0 0 .125rem #14555a;box-shadow:0 0 0 .125rem #14555a;-webkit-box-shadow:0 0 0 .125rem var(--color-emerald-green);box-shadow:0 0 0 .125rem var(--color-emerald-green)}}html:not([data-visual-test]) .dnb-tabs__tabs__tablist{scroll-behavior:smooth}html[data-visual-test] .dnb-tabs__tabs__tablist{scroll-behavior:auto!important}.dnb-tabs__tabs__tablist::-webkit-scrollbar{display:none}.dnb-tabs__tabs--left .dnb-tabs__tabs__tablist{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.dnb-tabs__tabs--right .dnb-tabs__tabs__tablist{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-pack:end;-ms-flex-pack:end;flex-grow:1;justify-content:flex-end}.dnb-tabs__tabs--center .dnb-tabs__tabs__tablist{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.dnb-tabs__tabs:before{bottom:0;content:"";height:1px;left:-100vw;position:absolute;width:100vw;z-index:-1}.dnb-tabs:not(.dnb-tabs--has-scrollbar) .dnb-tabs__tabs__tablist{margin-left:-.5rem;padding-left:.5rem}.dnb-tabs__scroll-nav-button{display:none;opacity:0;position:absolute;-webkit-transition:opacity .6s ease-out;transition:opacity .6s ease-out;z-index:2}.dnb-tabs__scroll-nav-button.dnb-button--primary{background-color:#14555a;background-color:var(--color-emerald-green)}.dnb-tabs__scroll-nav-button:first-of-type{left:-2.5rem}.dnb-tabs__scroll-nav-button:last-of-type{right:-2.5rem}.dnb-tabs__scroll-nav-button--visible{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.dnb-tabs__scroll-nav-button--hide{opacity:0!important;pointer-events:none}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:first-of-type{left:0}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:last-of-type{right:0}html[data-visual-test] .dnb-tabs .dnb-tabs__scroll-nav-button{-webkit-transition:none;transition:none}.dnb-tabs__button__snap{display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 1rem 0 1.5rem}@media screen and (max-width:40em){.dnb-tabs__button__snap{padding:0 1rem}}.dnb-tabs__button__snap:first-of-type{padding-left:0}.dnb-tabs__button__snap:last-of-type{padding-right:.5rem}.dnb-tabs--has-scrollbar .dnb-tabs__button__snap:last-of-type{padding-right:1.5rem}.dnb-core-style .dnb-tabs .dnb-tabs__button,.dnb-tabs__button{background-color:transparent;border:none;cursor:pointer;font-size:1.125rem;font-size:var(--font-size-basis);line-height:1.5rem;line-height:var(--line-height-basis);margin:0;outline:none;padding:0 .125rem;position:relative;text-decoration:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:1}.dnb-core-style .dnb-tabs .dnb-tabs__button__title .dnb-icon,.dnb-tabs__button__title .dnb-icon{font-size:1rem;font-size:var(--font-size-small);-webkit-transform:translateY(-.125rem);transform:translateY(-.125rem)}.dnb-core-style .dnb-tabs .dnb-tabs__button .dnb-dummy,.dnb-tabs__button .dnb-dummy{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:0;margin-top:.25rem;overflow:hidden;visibility:hidden}.dnb-core-style .dnb-tabs .dnb-tabs__button:after,.dnb-tabs__button:after{bottom:0;content:"";height:1px;left:0;position:absolute;right:0;width:100%;z-index:-1}.dnb-tabs__content--spacing{padding-top:2rem}
|
|
@@ -65,8 +65,10 @@
|
|
|
65
65
|
font-size: 1.125rem;
|
|
66
66
|
font-size: var(--font-size-basis);
|
|
67
67
|
text-align: center;
|
|
68
|
+
display: block;
|
|
68
69
|
color: #007272;
|
|
69
|
-
color: var(--color-sea-green);
|
|
70
|
+
color: var(--color-sea-green);
|
|
71
|
+
padding: 0.5rem 0 0.25rem 0; }
|
|
70
72
|
|
|
71
73
|
html:not([data-whatintent='touch']) .dnb-tabs__button:hover[disabled] {
|
|
72
74
|
cursor: not-allowed; }
|
|
@@ -75,48 +77,49 @@ html:not([data-whatintent='touch']) .dnb-tabs__button:hover:not([disabled]) {
|
|
|
75
77
|
background-color: #d2f0e9;
|
|
76
78
|
background-color: var(--color-mint-green-50); }
|
|
77
79
|
html:not([data-whatintent='touch']) .dnb-tabs__button:hover:not([disabled])::after {
|
|
78
|
-
height:
|
|
79
|
-
border-radius:
|
|
80
|
+
height: 2px;
|
|
81
|
+
border-radius: 2px;
|
|
80
82
|
background-color: #007272;
|
|
81
83
|
background-color: var(--color-sea-green); }
|
|
82
84
|
|
|
83
|
-
.dnb-tabs__button:focus
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
85
|
+
.dnb-tabs__button:focus {
|
|
86
|
+
overflow: visible; }
|
|
87
|
+
.dnb-tabs__button:focus::before {
|
|
88
|
+
content: '';
|
|
89
|
+
position: absolute;
|
|
90
|
+
z-index: 1;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: -0.5rem;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
right: -0.5rem;
|
|
95
|
+
height: inherit;
|
|
96
|
+
border-radius: inherit;
|
|
97
|
+
outline: none; }
|
|
98
|
+
html[data-whatinput='keyboard'] .dnb-tabs__button:focus::before {
|
|
99
|
+
--border-color: var(--color-emerald-green);
|
|
100
|
+
-webkit-box-shadow: 0 0 0 0.125rem var(--border-color);
|
|
101
|
+
box-shadow: 0 0 0 0.125rem var(--border-color);
|
|
102
|
+
border-color: transparent; }
|
|
103
|
+
@media screen and (-ms-high-contrast: none) {
|
|
104
|
+
html[data-whatinput='keyboard'] .dnb-tabs__button:focus::before {
|
|
105
|
+
-webkit-box-shadow: 0 0 0 0.125rem #14555a;
|
|
106
|
+
box-shadow: 0 0 0 0.125rem #14555a;
|
|
107
|
+
-webkit-box-shadow: 0 0 0 0.125rem var(--color-emerald-green);
|
|
108
|
+
box-shadow: 0 0 0 0.125rem var(--color-emerald-green); } }
|
|
109
|
+
.dnb-tabs__button:focus::before {
|
|
110
|
+
top: 0.5rem;
|
|
111
|
+
left: -0.375rem;
|
|
112
|
+
right: -0.375rem;
|
|
113
|
+
bottom: 0.5rem;
|
|
114
|
+
border-radius: 1.5rem; }
|
|
112
115
|
|
|
113
116
|
.dnb-tabs__button[disabled] .dnb-tabs__button__title {
|
|
114
117
|
color: #b3dada;
|
|
115
118
|
color: var(--color-sea-green-30); }
|
|
116
119
|
|
|
117
120
|
.dnb-tabs__button:not([disabled]):active::after, .dnb-tabs__button:not([disabled]).selected::after {
|
|
118
|
-
height:
|
|
119
|
-
border-radius:
|
|
121
|
+
height: 2px;
|
|
122
|
+
border-radius: 2px;
|
|
120
123
|
background-color: #007272;
|
|
121
124
|
background-color: var(--color-sea-green); }
|
|
122
125
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dnb-tabs__tabs:not(.dnb-section):before{background-color:#ebebeb;background-color:var(--color-black-8);-webkit-box-shadow:100vw 0 0 0 #ebebeb;box-shadow:100vw 0 0 0 #ebebeb;-webkit-box-shadow:100vw 0 0 0 var(--color-black-8);box-shadow:100vw 0 0 0 var(--color-black-8)}.dnb-tabs__tabs__tablist:focus{border-radius:.5rem}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:first-of-type{border-radius:0 50% 50% 0}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:last-of-type{border-radius:50% 0 0 50%}.dnb-tabs--at-edge .dnb-tabs__tabs__tablist:focus{border-radius:0}.dnb-tabs__content:focus{position:relative}.dnb-tabs__content:focus:after{border-radius:.5rem;bottom:-.5rem;content:"";left:-.5rem;max-width:100vw;outline:none;position:absolute;right:-.5rem;top:.125rem;z-index:-1}html[data-whatinput=keyboard] .dnb-tabs__content:focus:after{--border-color:var(--color-emerald-green);border-color:transparent;-webkit-box-shadow:0 0 0 .125rem var(--border-color);box-shadow:0 0 0 .125rem var(--border-color)}@media screen and (-ms-high-contrast:none){html[data-whatinput=keyboard] .dnb-tabs__content:focus:after{-webkit-box-shadow:0 0 0 .125rem #14555a;box-shadow:0 0 0 .125rem #14555a;-webkit-box-shadow:0 0 0 .125rem var(--color-emerald-green);box-shadow:0 0 0 .125rem var(--color-emerald-green)}}.dnb-tabs__button__title{color:#007272;color:var(--color-sea-green);font-size:1.125rem;font-size:var(--font-size-basis);font-weight:400;font-weight:var(--font-weight-regular);text-align:center}html:not([data-whatintent=touch]) .dnb-tabs__button:hover[disabled]{cursor:not-allowed}html:not([data-whatintent=touch]) .dnb-tabs__button:hover:not([disabled]){background-color:#d2f0e9;background-color:var(--color-mint-green-50)}html:not([data-whatintent=touch]) .dnb-tabs__button:hover:not([disabled]):after{background-color:#007272;background-color:var(--color-sea-green);border-radius:
|
|
1
|
+
.dnb-tabs__tabs:not(.dnb-section):before{background-color:#ebebeb;background-color:var(--color-black-8);-webkit-box-shadow:100vw 0 0 0 #ebebeb;box-shadow:100vw 0 0 0 #ebebeb;-webkit-box-shadow:100vw 0 0 0 var(--color-black-8);box-shadow:100vw 0 0 0 var(--color-black-8)}.dnb-tabs__tabs__tablist:focus{border-radius:.5rem}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:first-of-type{border-radius:0 50% 50% 0}.dnb-tabs--at-edge .dnb-tabs__scroll-nav-button:last-of-type{border-radius:50% 0 0 50%}.dnb-tabs--at-edge .dnb-tabs__tabs__tablist:focus{border-radius:0}.dnb-tabs__content:focus{position:relative}.dnb-tabs__content:focus:after{border-radius:.5rem;bottom:-.5rem;content:"";left:-.5rem;max-width:100vw;outline:none;position:absolute;right:-.5rem;top:.125rem;z-index:-1}html[data-whatinput=keyboard] .dnb-tabs__content:focus:after{--border-color:var(--color-emerald-green);border-color:transparent;-webkit-box-shadow:0 0 0 .125rem var(--border-color);box-shadow:0 0 0 .125rem var(--border-color)}@media screen and (-ms-high-contrast:none){html[data-whatinput=keyboard] .dnb-tabs__content:focus:after{-webkit-box-shadow:0 0 0 .125rem #14555a;box-shadow:0 0 0 .125rem #14555a;-webkit-box-shadow:0 0 0 .125rem var(--color-emerald-green);box-shadow:0 0 0 .125rem var(--color-emerald-green)}}.dnb-tabs__button__title{color:#007272;color:var(--color-sea-green);display:block;font-size:1.125rem;font-size:var(--font-size-basis);font-weight:400;font-weight:var(--font-weight-regular);padding:.5rem 0 .25rem;text-align:center}html:not([data-whatintent=touch]) .dnb-tabs__button:hover[disabled]{cursor:not-allowed}html:not([data-whatintent=touch]) .dnb-tabs__button:hover:not([disabled]){background-color:#d2f0e9;background-color:var(--color-mint-green-50)}html:not([data-whatintent=touch]) .dnb-tabs__button:hover:not([disabled]):after{background-color:#007272;background-color:var(--color-sea-green);border-radius:2px;height:2px}.dnb-tabs__button:focus{overflow:visible}.dnb-tabs__button:focus:before{border-radius:inherit;bottom:0;content:"";height:inherit;left:-.5rem;outline:none;position:absolute;right:-.5rem;top:0;z-index:1}html[data-whatinput=keyboard] .dnb-tabs__button:focus:before{--border-color:var(--color-emerald-green);border-color:transparent;-webkit-box-shadow:0 0 0 .125rem var(--border-color);box-shadow:0 0 0 .125rem var(--border-color)}@media screen and (-ms-high-contrast:none){html[data-whatinput=keyboard] .dnb-tabs__button:focus:before{-webkit-box-shadow:0 0 0 .125rem #14555a;box-shadow:0 0 0 .125rem #14555a;-webkit-box-shadow:0 0 0 .125rem var(--color-emerald-green);box-shadow:0 0 0 .125rem var(--color-emerald-green)}}.dnb-tabs__button:focus:before{border-radius:1.5rem;bottom:.5rem;left:-.375rem;right:-.375rem;top:.5rem}.dnb-tabs__button[disabled] .dnb-tabs__button__title{color:#b3dada;color:var(--color-sea-green-30)}.dnb-tabs__button:not([disabled]).selected:after,.dnb-tabs__button:not([disabled]):active:after{background-color:#007272;background-color:var(--color-sea-green);border-radius:2px;height:2px}.dnb-tabs__button:not([disabled]).selected .dnb-tabs__button__title,.dnb-tabs__button:not([disabled]):active .dnb-tabs__button__title{color:#14555a;color:var(--color-emerald-green)}.dnb-tabs__button:not([disabled]).selected .dnb-tabs__button__title,.dnb-tabs__button span[hidden]{font-weight:500;font-weight:var(--font-weight-medium)}
|
|
@@ -62,27 +62,30 @@
|
|
|
62
62
|
font-size: var(--font-size-basis);
|
|
63
63
|
text-align: center;
|
|
64
64
|
|
|
65
|
+
display: block;
|
|
65
66
|
color: var(--color-sea-green);
|
|
67
|
+
padding: 0.5rem 0 0.25rem 0;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
// hover
|
|
69
71
|
@include hover() {
|
|
70
72
|
background-color: var(--color-mint-green-50);
|
|
71
73
|
&::after {
|
|
72
|
-
height:
|
|
73
|
-
border-radius:
|
|
74
|
+
height: 2px;
|
|
75
|
+
border-radius: 2px;
|
|
74
76
|
background-color: var(--color-sea-green);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
&:focus {
|
|
79
81
|
@include buttonFocusRing();
|
|
82
|
+
overflow: visible;
|
|
80
83
|
&::before {
|
|
81
|
-
top:
|
|
82
|
-
|
|
83
|
-
right: 0;
|
|
84
|
-
|
|
85
|
-
border-radius:
|
|
84
|
+
top: 0.5rem;
|
|
85
|
+
left: -0.375rem; // For overflow purposes
|
|
86
|
+
right: -0.375rem; // For overflow purposes
|
|
87
|
+
bottom: 0.5rem;
|
|
88
|
+
border-radius: 1.5rem;
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
|
|
@@ -95,8 +98,8 @@
|
|
|
95
98
|
&:not([disabled]):active,
|
|
96
99
|
&:not([disabled]).selected {
|
|
97
100
|
&::after {
|
|
98
|
-
height:
|
|
99
|
-
border-radius:
|
|
101
|
+
height: 2px;
|
|
102
|
+
border-radius: 2px;
|
|
100
103
|
background-color: var(--color-sea-green);
|
|
101
104
|
}
|
|
102
105
|
}
|
|
@@ -232,8 +232,9 @@ const useCallEvent = ({
|
|
|
232
232
|
value = value || event.target.value;
|
|
233
233
|
const keyCode = keycode(event);
|
|
234
234
|
const selStart = event.target.selectionStart;
|
|
235
|
+
const isUnidentified = event.which === 229 || keyCode === undefined;
|
|
235
236
|
|
|
236
|
-
if (name === 'on_key_down' && !(maskParams !== null && maskParams !== void 0 && maskParams.allowLeadingZeroes) && (keyCode === '0' || value.replace(/[^\d]/g, '') === '' && decimalSeparators.test(keyCode))) {
|
|
237
|
+
if (name === 'on_key_down' && !isUnidentified && !(maskParams !== null && maskParams !== void 0 && maskParams.allowLeadingZeroes) && (keyCode === '0' || value.replace(/[^\d]/g, '') === '' && decimalSeparators.test(keyCode))) {
|
|
237
238
|
const testValue = (value.slice(0, selStart) + '0' + value.slice(selStart + 1, value.length)).replace(/[^\d]/g, '');
|
|
238
239
|
|
|
239
240
|
if (/^0/.test(testValue)) {
|
|
@@ -242,7 +243,7 @@ const useCallEvent = ({
|
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
|
|
245
|
-
if (name === 'on_key_down' && maskParams !== null && maskParams !== void 0 && maskParams.decimalSymbol) {
|
|
246
|
+
if (name === 'on_key_down' && !isUnidentified && maskParams !== null && maskParams !== void 0 && maskParams.decimalSymbol) {
|
|
246
247
|
const hasDecimalSymbol = value.includes(maskParams.decimalSymbol);
|
|
247
248
|
const allowedDecimals = maskParams.decimalLimit > 0 || maskParams.allowDecimal !== false;
|
|
248
249
|
|
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { format, getDecimalSeparator, getThousandsSeparator } from '../number-format/NumberUtils';
|
|
8
8
|
import { warn } from '../../shared/component-helper';
|
|
9
|
-
import { IS_IE11 } from '../../shared/helpers';
|
|
9
|
+
import { IS_IE11, IS_ANDROID } from '../../shared/helpers';
|
|
10
10
|
const enableLocaleSupportWhen = ['as_number', 'as_percent', 'as_currency'];
|
|
11
11
|
const enableNumberMaskWhen = ['as_number', 'as_percent', 'as_currency', 'number_mask', 'currency_mask'];
|
|
12
12
|
export const invisibleSpace = '\u200B';
|
|
@@ -67,7 +67,7 @@ export const correctNumberValue = ({
|
|
|
67
67
|
|
|
68
68
|
if (endsWithDecimal) {
|
|
69
69
|
value = `${value}${decimalSymbol}`;
|
|
70
|
-
} else if (endsWithZeroAndDecimal) {
|
|
70
|
+
} else if (endsWithZeroAndDecimal && !numberValue.endsWith(`${decimalSymbol}0`)) {
|
|
71
71
|
value = `${value}${decimalSymbol}0`;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -187,7 +187,7 @@ export const handleNumberMask = ({
|
|
|
187
187
|
export function getInputModeFromMask(mask) {
|
|
188
188
|
const maskParams = mask === null || mask === void 0 ? void 0 : mask.maskParams;
|
|
189
189
|
|
|
190
|
-
if (maskParams && (mask === null || mask === void 0 ? void 0 : mask.instanceOf) === 'createNumberMask') {
|
|
190
|
+
if (!IS_ANDROID && maskParams && (mask === null || mask === void 0 ? void 0 : mask.instanceOf) === 'createNumberMask') {
|
|
191
191
|
return maskParams.allowDecimal && maskParams.decimalLimit !== 0 ? 'decimal' : 'numeric';
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -80,6 +80,8 @@ export type PaginationChildren =
|
|
|
80
80
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
81
81
|
*/
|
|
82
82
|
export interface PaginationProps extends React.HTMLProps<HTMLElement> {
|
|
83
|
+
debug?: boolean;
|
|
84
|
+
|
|
83
85
|
/**
|
|
84
86
|
* The page show in the very beginning. If `current_page` is set, then it may not make too much sense to set this as well.
|
|
85
87
|
*/
|
|
@@ -356,6 +358,8 @@ export type PaginationInstanceChildren =
|
|
|
356
358
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
357
359
|
*/
|
|
358
360
|
export interface PaginationInstanceProps {
|
|
361
|
+
debug?: boolean;
|
|
362
|
+
|
|
359
363
|
/**
|
|
360
364
|
* The page show in the very beginning. If `current_page` is set, then it may not make too much sense to set this as well.
|
|
361
365
|
*/
|
|
@@ -634,6 +638,8 @@ export type InfinityMarkerChildren =
|
|
|
634
638
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
635
639
|
*/
|
|
636
640
|
export interface InfinityMarkerProps {
|
|
641
|
+
debug?: boolean;
|
|
642
|
+
|
|
637
643
|
/**
|
|
638
644
|
* The page show in the very beginning. If `current_page` is set, then it may not make too much sense to set this as well.
|
|
639
645
|
*/
|
|
@@ -23,6 +23,7 @@ import { PaginationIndicator } from './PaginationHelpers';
|
|
|
23
23
|
import InfinityScroller from './PaginationInfinity';
|
|
24
24
|
import PaginationBar from './PaginationBar';
|
|
25
25
|
const paginationPropTypes = process.env.NODE_ENV !== "production" ? _objectSpread(_objectSpread({
|
|
26
|
+
debug: PropTypes.bool,
|
|
26
27
|
startup_page: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
27
28
|
current_page: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
28
29
|
page_count: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -61,6 +62,7 @@ const paginationPropTypes = process.env.NODE_ENV !== "production" ? _objectSprea
|
|
|
61
62
|
on_end: PropTypes.func
|
|
62
63
|
}) : {};
|
|
63
64
|
const paginationDefaultProps = {
|
|
65
|
+
debug: null,
|
|
64
66
|
startup_page: null,
|
|
65
67
|
current_page: null,
|
|
66
68
|
page_count: null,
|
|
@@ -50,7 +50,7 @@ export default class PaginationBar extends React.PureComponent {
|
|
|
50
50
|
|
|
51
51
|
componentDidMount() {
|
|
52
52
|
const context = this.context.pagination;
|
|
53
|
-
const currentPage = context.startupPage || context.currentPage;
|
|
53
|
+
const currentPage = context.startupPage || context.currentPage || 1;
|
|
54
54
|
const items = context.prefillItems(currentPage, {
|
|
55
55
|
skipObserver: true
|
|
56
56
|
});
|
|
@@ -10,7 +10,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import ReactDOM from 'react-dom';
|
|
13
|
-
import { warn, isTrue, dispatchCustomElementEvent } from '../../shared/component-helper';
|
|
13
|
+
import { warn, isTrue, dispatchCustomElementEvent, getPreviousSibling } from '../../shared/component-helper';
|
|
14
14
|
import Context from '../../shared/Context';
|
|
15
15
|
import Button from '../button/Button';
|
|
16
16
|
import { preparePageElement, isTrElement, PaginationIndicator } from './PaginationHelpers';
|
|
@@ -25,20 +25,26 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
25
25
|
startup_count
|
|
26
26
|
} = this.context.pagination;
|
|
27
27
|
const startupCount = parseFloat(startup_count);
|
|
28
|
+
let newPageNo, skipObserver, callStartupEvent, preventWaitForDelay;
|
|
28
29
|
|
|
29
|
-
for (let i = 0
|
|
30
|
+
for (let i = 0; i < startupCount; ++i) {
|
|
30
31
|
newPageNo = startupPage + i;
|
|
32
|
+
skipObserver = newPageNo < startupCount;
|
|
33
|
+
callStartupEvent = i === 0;
|
|
34
|
+
preventWaitForDelay = i <= startupCount - 1;
|
|
31
35
|
this.getNewContent(newPageNo, {
|
|
32
36
|
position: 'after',
|
|
33
|
-
skipObserver
|
|
37
|
+
skipObserver
|
|
34
38
|
}, {
|
|
35
|
-
|
|
39
|
+
callStartupEvent,
|
|
40
|
+
preventWaitForDelay
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
43
|
});
|
|
39
44
|
|
|
40
45
|
_defineProperty(this, "getNewContent", (newPageNo, props = {}, {
|
|
41
|
-
|
|
46
|
+
callStartupEvent = false,
|
|
47
|
+
preventWaitForDelay = false
|
|
42
48
|
} = {}) => {
|
|
43
49
|
const {
|
|
44
50
|
pageCount,
|
|
@@ -58,9 +64,12 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
const items = this.context.pagination.prefillItems(newPageNo, props);
|
|
61
|
-
this.context.pagination.setItems(items, () =>
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
this.context.pagination.setItems(items, () => {
|
|
68
|
+
this.callEventHandler(newPageNo, {
|
|
69
|
+
callStartupEvent,
|
|
70
|
+
preventWaitForDelay
|
|
71
|
+
});
|
|
72
|
+
});
|
|
64
73
|
});
|
|
65
74
|
|
|
66
75
|
this.hideIndicator = isTrue(context.pagination.hide_progress_indicator);
|
|
@@ -75,47 +84,66 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
75
84
|
this.callOnUnmount.forEach(f => typeof f === 'function' && f());
|
|
76
85
|
}
|
|
77
86
|
|
|
78
|
-
waitForReachedTime(fn,
|
|
87
|
+
waitForReachedTime(fn, params) {
|
|
79
88
|
this.callbackBuffer = this.callbackBuffer || [];
|
|
80
89
|
this.callbackBuffer.push({
|
|
81
90
|
fn,
|
|
82
|
-
|
|
91
|
+
params
|
|
92
|
+
});
|
|
93
|
+
this.callBuffer({
|
|
94
|
+
minTime: params.preventWaitForDelay ? -1 : this.context.pagination.minTime
|
|
83
95
|
});
|
|
84
|
-
this.callBuffer();
|
|
85
96
|
}
|
|
86
97
|
|
|
87
|
-
callBuffer(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
callBuffer({
|
|
99
|
+
minTime = this.context.pagination.minTime
|
|
100
|
+
} = {}) {
|
|
101
|
+
if (this.callbackBuffer.length === 0) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
91
105
|
const diff = this._lastCall > 0 ? new Date().getTime() - this._lastCall : 0;
|
|
92
106
|
const waitTime = diff < minTime ? minTime : 0;
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
|
|
108
|
+
const nextTick = () => {
|
|
95
109
|
if (this.callbackBuffer.length > 0) {
|
|
96
110
|
this._lastCall = new Date().getTime();
|
|
97
111
|
const {
|
|
98
112
|
fn,
|
|
99
|
-
|
|
113
|
+
params
|
|
100
114
|
} = this.callbackBuffer.shift();
|
|
101
|
-
fn(
|
|
102
|
-
this.callBuffer(
|
|
115
|
+
fn(params);
|
|
116
|
+
this.callBuffer({
|
|
117
|
+
minTime: params.preventWaitForDelay ? -1 : minTime
|
|
118
|
+
});
|
|
103
119
|
}
|
|
104
|
-
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
if (minTime > 0) {
|
|
123
|
+
clearTimeout(this._bufferTimeout);
|
|
124
|
+
this._bufferTimeout = setTimeout(nextTick, waitTime);
|
|
125
|
+
} else {
|
|
126
|
+
nextTick();
|
|
127
|
+
}
|
|
105
128
|
}
|
|
106
129
|
|
|
107
130
|
callEventHandler(pageNumber, {
|
|
108
|
-
|
|
131
|
+
callStartupEvent = false,
|
|
132
|
+
preventWaitForDelay = false,
|
|
109
133
|
callOnEnd = false,
|
|
110
134
|
onDispatch = null
|
|
111
135
|
} = {}) {
|
|
112
136
|
this.waitForReachedTime(({
|
|
113
137
|
pageNumber,
|
|
114
|
-
|
|
138
|
+
callStartupEvent
|
|
115
139
|
}) => {
|
|
116
140
|
const context = this.context.pagination;
|
|
117
141
|
|
|
118
142
|
const createEvent = eventName => {
|
|
143
|
+
if (isNaN(pageNumber)) {
|
|
144
|
+
pageNumber = 1;
|
|
145
|
+
}
|
|
146
|
+
|
|
119
147
|
const ret = dispatchCustomElementEvent(context, eventName, _objectSpread({
|
|
120
148
|
page: pageNumber,
|
|
121
149
|
pageNo: pageNumber,
|
|
@@ -134,7 +162,7 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
134
162
|
if (callOnEnd) {
|
|
135
163
|
createEvent('on_end');
|
|
136
164
|
} else {
|
|
137
|
-
if (
|
|
165
|
+
if (callStartupEvent) {
|
|
138
166
|
createEvent('on_startup');
|
|
139
167
|
} else {
|
|
140
168
|
createEvent('on_change');
|
|
@@ -144,7 +172,8 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
144
172
|
}
|
|
145
173
|
}, {
|
|
146
174
|
pageNumber,
|
|
147
|
-
|
|
175
|
+
callStartupEvent,
|
|
176
|
+
preventWaitForDelay
|
|
148
177
|
});
|
|
149
178
|
}
|
|
150
179
|
|
|
@@ -155,19 +184,41 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
155
184
|
const {
|
|
156
185
|
lowerPage,
|
|
157
186
|
upperPage,
|
|
187
|
+
currentPage,
|
|
158
188
|
pageCount,
|
|
159
189
|
hasEndedInfinity,
|
|
160
190
|
parallelLoadCount,
|
|
191
|
+
debug,
|
|
192
|
+
current_page,
|
|
161
193
|
fallback_element,
|
|
162
194
|
marker_element,
|
|
163
195
|
indicator_element
|
|
164
196
|
} = this.context.pagination;
|
|
165
197
|
|
|
198
|
+
if (debug) {
|
|
199
|
+
console.info('PaginationInfinity.render', {
|
|
200
|
+
current_page,
|
|
201
|
+
lowerPage,
|
|
202
|
+
upperPage,
|
|
203
|
+
currentPage,
|
|
204
|
+
pageCount
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
166
208
|
const Marker = () => React.createElement(InteractionMarker, {
|
|
209
|
+
debug: debug,
|
|
167
210
|
pageNumber: upperPage,
|
|
168
211
|
markerElement: marker_element || fallback_element,
|
|
169
212
|
onVisible: pageNumber => {
|
|
170
|
-
|
|
213
|
+
if (debug) {
|
|
214
|
+
console.info('PaginationInfinity.onVisible', {
|
|
215
|
+
pageNumber
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
let newPageNo;
|
|
220
|
+
|
|
221
|
+
for (let i = 0; i < parallelLoadCount; ++i) {
|
|
171
222
|
newPageNo = pageNumber + 1 + i;
|
|
172
223
|
this.context.pagination.onPageUpdate(() => {
|
|
173
224
|
this.context.pagination.setState({
|
|
@@ -197,7 +248,7 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
197
248
|
}
|
|
198
249
|
});
|
|
199
250
|
|
|
200
|
-
return React.createElement(React.Fragment, null, lowerPage > 1 && React.createElement(LoadButton, null), children, !hasEndedInfinity && (typeof pageCount === 'undefined' || upperPage < pageCount) && React.createElement(Marker, null), !hasEndedInfinity && !this.hideIndicator && (typeof pageCount === 'undefined' || upperPage < pageCount) && React.createElement(PaginationIndicator, {
|
|
251
|
+
return React.createElement(React.Fragment, null, parseFloat(current_page) > 0 && lowerPage > 1 && React.createElement(LoadButton, null), children, !hasEndedInfinity && parseFloat(current_page) > 0 && (typeof pageCount === 'undefined' || upperPage < pageCount) && React.createElement(Marker, null), !hasEndedInfinity && !this.hideIndicator && (typeof pageCount === 'undefined' || upperPage < pageCount) && React.createElement(PaginationIndicator, {
|
|
201
252
|
indicator_element: indicator_element || fallback_element
|
|
202
253
|
}));
|
|
203
254
|
}
|
|
@@ -216,16 +267,16 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
216
267
|
indicator_element
|
|
217
268
|
} = this.context.pagination;
|
|
218
269
|
|
|
219
|
-
if (this.context.pagination.useMarkerOnly) {
|
|
220
|
-
return this.handleInfinityMarker();
|
|
221
|
-
}
|
|
222
|
-
|
|
223
270
|
if (!(items && items.length > 0)) {
|
|
224
271
|
clearTimeout(this._startupTimeout);
|
|
225
272
|
this._startupTimeout = setTimeout(this.startup, 1);
|
|
226
273
|
return null;
|
|
227
274
|
}
|
|
228
275
|
|
|
276
|
+
if (this.context.pagination.useMarkerOnly) {
|
|
277
|
+
return this.handleInfinityMarker();
|
|
278
|
+
}
|
|
279
|
+
|
|
229
280
|
const Element = preparePageElement(page_element || React.Fragment);
|
|
230
281
|
return items.map(({
|
|
231
282
|
pageNumber,
|
|
@@ -241,7 +292,9 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
241
292
|
pageNumber: pageNumber,
|
|
242
293
|
markerElement: marker_element || fallback_element,
|
|
243
294
|
onVisible: pageNumber => {
|
|
244
|
-
|
|
295
|
+
let newPageNo;
|
|
296
|
+
|
|
297
|
+
for (let i = 0; i < parallelLoadCount; ++i) {
|
|
245
298
|
newPageNo = pageNumber + 1 + i;
|
|
246
299
|
this.getNewContent(newPageNo, {
|
|
247
300
|
position: 'after',
|
|
@@ -250,6 +303,7 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
250
303
|
}
|
|
251
304
|
}
|
|
252
305
|
});
|
|
306
|
+
const showIndicator = (parallelLoadCount > 1 && idx > 0 ? isLastItem : true) && !hasContent && !this.hideIndicator;
|
|
253
307
|
return React.createElement(Elem, {
|
|
254
308
|
key: pageNumber,
|
|
255
309
|
ref: ref
|
|
@@ -261,7 +315,7 @@ export default class InfinityScroller extends React.PureComponent {
|
|
|
261
315
|
skipObserver: true,
|
|
262
316
|
event
|
|
263
317
|
})
|
|
264
|
-
}), placeMakerBeforeContent && marker, content, !placeMakerBeforeContent && marker,
|
|
318
|
+
}), placeMakerBeforeContent && marker, content, !placeMakerBeforeContent && marker, showIndicator && React.createElement(PaginationIndicator, {
|
|
265
319
|
indicator_element: indicator_element || fallback_element
|
|
266
320
|
}), hasContent && this.useLoadButton && isLastItem && (typeof pageCount === 'undefined' || pageNumber < pageCount) && React.createElement(InfinityLoadButton, {
|
|
267
321
|
element: fallback_element,
|
|
@@ -343,14 +397,31 @@ class InteractionMarker extends React.PureComponent {
|
|
|
343
397
|
this._isMounted = true;
|
|
344
398
|
(_this$intersectionObs2 = this.intersectionObserver) === null || _this$intersectionObs2 === void 0 ? void 0 : _this$intersectionObs2.observe(this._ref.current);
|
|
345
399
|
}
|
|
400
|
+
|
|
401
|
+
if (this.props.debug) {
|
|
402
|
+
const height = this.getContentHeight();
|
|
403
|
+
console.info('PaginationInfinity.getContentHeight', height);
|
|
404
|
+
}
|
|
346
405
|
}
|
|
347
406
|
|
|
348
407
|
componentWillUnmount() {
|
|
349
|
-
var _this$intersectionObs3;
|
|
350
|
-
|
|
351
408
|
this._isMounted = false;
|
|
352
|
-
|
|
353
|
-
(
|
|
409
|
+
|
|
410
|
+
if (this.intersectionObserver) {
|
|
411
|
+
clearTimeout(this._readyTimeout);
|
|
412
|
+
this.intersectionObserver.disconnect();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
getContentHeight() {
|
|
417
|
+
let height = 0;
|
|
418
|
+
|
|
419
|
+
try {
|
|
420
|
+
const sibling = getPreviousSibling('dnb-table', this._ref.current);
|
|
421
|
+
height = parseFloat(window.getComputedStyle(sibling.querySelector('tbody')).height);
|
|
422
|
+
} catch (e) {}
|
|
423
|
+
|
|
424
|
+
return height;
|
|
354
425
|
}
|
|
355
426
|
|
|
356
427
|
render() {
|
|
@@ -375,10 +446,12 @@ class InteractionMarker extends React.PureComponent {
|
|
|
375
446
|
}
|
|
376
447
|
|
|
377
448
|
_defineProperty(InteractionMarker, "defaultProps", {
|
|
449
|
+
debug: null,
|
|
378
450
|
markerElement: null
|
|
379
451
|
});
|
|
380
452
|
|
|
381
453
|
process.env.NODE_ENV !== "production" ? InteractionMarker.propTypes = {
|
|
454
|
+
debug: PropTypes.bool,
|
|
382
455
|
pageNumber: PropTypes.number.isRequired,
|
|
383
456
|
onVisible: PropTypes.func.isRequired,
|
|
384
457
|
markerElement: PropTypes.oneOfType([PropTypes.object, PropTypes.node, PropTypes.func, PropTypes.string])
|