You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2021/02/18 21:42:03 UTC
[myfaces-tobago] branch master updated: rebuild themes
This is an automated email from the ASF dual-hosted git repository.
bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/master by this push:
new 1be678d rebuild themes
1be678d is described below
commit 1be678d9fd088c5da68fcf358197c06e4f7d51d0
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Feb 18 21:21:21 2021 +0100
rebuild themes
---
.../npm/dist/css/tobago.css | 176 +--
.../npm/dist/css/tobago.css.map | 2 +-
.../npm/dist/css/tobago.min.css | 2 +-
.../npm/dist/css/tobago.min.css.map | 2 +-
.../npm/dist/css/tobago.css | 176 +--
.../npm/dist/css/tobago.css.map | 2 +-
.../npm/dist/css/tobago.min.css | 2 +-
.../npm/dist/css/tobago.min.css.map | 2 +-
.../npm/dist/css/tobago.css | 176 +--
.../npm/dist/css/tobago.css.map | 2 +-
.../npm/dist/css/tobago.min.css | 2 +-
.../npm/dist/css/tobago.min.css.map | 2 +-
.../tobago-theme-speyside/npm/dist/css/tobago.css | 175 +--
.../npm/dist/css/tobago.css.map | 2 +-
.../npm/dist/css/tobago.min.css | 2 +-
.../npm/dist/css/tobago.min.css.map | 2 +-
.../tobago-theme-standard/npm/dist/css/tobago.css | 176 +--
.../npm/dist/css/tobago.css.map | 2 +-
.../npm/dist/css/tobago.min.css | 2 +-
.../npm/dist/css/tobago.min.css.map | 2 +-
.../npm/dist/js/tobago-all.js | 1 -
.../npm/dist/js/tobago-all.js.map | 2 +-
.../npm/dist/js/tobago-date-utils.js | 94 --
.../npm/dist/js/tobago-date-utils.js.map | 1 -
.../npm/dist/js/tobago-date.js | 4 +-
.../npm/dist/js/tobago-date.js.map | 2 +-
.../tobago-theme-standard/npm/dist/js/tobago-in.js | 5 +
.../npm/dist/js/tobago-in.js.map | 2 +-
.../npm/dist/js/tobago-suggest.js | 188 ++-
.../npm/dist/js/tobago-suggest.js.map | 2 +-
.../tobago-theme-standard/npm/dist/js/tobago.js | 1601 +++++++++++---------
.../npm/dist/js/tobago.js.map | 2 +-
32 files changed, 1379 insertions(+), 1434 deletions(-)
diff --git a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css
index ce6848d..3d31827 100644
--- a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css
+++ b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css
@@ -11319,6 +11319,17 @@ tobago-header.sticky-top {
tobago-in {
display: block;
}
+tobago-in .input-group > tobago-dropdown {
+ /* fix corner styling, because tobago-dropdown use a surrounding container inside an input group */
+}
+tobago-in .input-group > tobago-dropdown:not(:last-child) > .tobago-button {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+tobago-in .input-group > tobago-dropdown:not(:first-child) > .tobago-button {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
tobago-in .input-group tobago-select-one-choice {
/* fix style for surrounding container (tobago-select-one-choice).
According to bootstrap docs, <select class=.form-select> should be rendered directly to .input-group. But tobago
@@ -11333,7 +11344,43 @@ tobago-in .input-group tobago-select-one-choice.form-select {
tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
border: 0;
}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container {
+ position: absolute;
+}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container:after {
+ content: "";
+ border: 3px solid rgba(0, 0, 0, 0.12);
+ border-right-color: rgba(0, 0, 0, 0.48);
+ border-radius: 100%;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ z-index: 5;
+ transform: translateY(-50%);
+ -webkit-animation: rotate 1s linear infinite;
+ animation: rotate 1s linear infinite;
+}
+tobago-in tobago-suggest {
+ display: none;
+}
+@-webkit-keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
+
+@keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
.tobago-in-markup-fatal.border-danger:focus, .tobago-in-markup-error.border-danger:focus {
box-shadow: 0 0 0 0.2rem rgba(255, 0, 190, 0.25);
}
@@ -11351,6 +11398,26 @@ tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
text-align: right;
}
+.autocomplete-result-list {
+ padding: 0.5rem 0;
+ list-style: none;
+ background-color: #000000;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+ border-radius: 0.25rem;
+ overflow-y: auto;
+}
+.autocomplete-result-list .autocomplete-result {
+ padding: 0.25rem 1rem;
+}
+.autocomplete-result-list .autocomplete-result:hover, .autocomplete-result-list .autocomplete-result:focus, .autocomplete-result-list .autocomplete-result[aria-selected=true] {
+ color: #1e2125;
+ background-color: #d0d0d0;
+}
+.autocomplete-result-list .autocomplete-result:active {
+ color: #abf5ff;
+ background-color: #529696;
+}
+
/* label ----------------------------------------------------------- */
.tobago-label {
color: #6610f2 !important;
@@ -12168,115 +12235,6 @@ tobago-split-layout {
/* TODO: check, if needed (check also with iframes) */
}
-/* suggest ---------------------------------------------------------------------- */
-tobago-suggest {
- display: none;
-}
-
-.autocomplete-input {
- /*border: 1px solid #eee;*/
- /*border-radius: 8px;*/
- /*width: 100%;*/
- /*padding: 12px 12px 12px 48px;*/
- /*box-sizing: border-box;*/
- /*position: relative;*/
- /*font-size: 16px;*/
- /*line-height: 1.5;*/
- /*flex: 1;*/
- /*background-color: #eee;*/
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-input:focus, .autocomplete-input[aria-expanded=true] {
- /*border-color: rgba(0, 0, 0, .12);*/
- /*background-color: #fff;*/
- /*outline: none;*/
- /*box-shadow: 0 2px 2px rgba(0, 0, 0, .16)*/
-}
-
-[data-position=below] .autocomplete-input[aria-expanded=true] {
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
-}
-
-[data-position=above] .autocomplete-input[aria-expanded=true] {
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- z-index: 2;
-}
-
-.autocomplete[data-loading=true]:after {
- content: "";
- border: 3px solid rgba(0, 0, 0, 0.12);
- border-right-color: rgba(0, 0, 0, 0.48);
- border-radius: 100%;
- width: 20px;
- height: 20px;
- position: absolute;
- right: 12px;
- top: 50%;
- transform: translateY(-50%);
- -webkit-animation: rotate 1s linear infinite;
- animation: rotate 1s linear infinite;
-}
-
-.autocomplete-result-list {
- margin: 0;
- border: 1px solid rgba(0, 0, 0, 0.12);
- padding: 0;
- box-sizing: border-box;
- max-height: 296px;
- overflow-y: auto;
- background: #fff;
- list-style: none;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.16);
-}
-
-[data-position=below] .autocomplete-result-list {
- margin-top: -1px;
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- padding-bottom: 8px;
-}
-
-[data-position=above] .autocomplete-result-list {
- margin-bottom: -1px;
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
- padding-top: 8px;
-}
-
-.autocomplete-result {
- cursor: default;
- padding: 12px 12px 12px 48px;
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjY2NjIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-result:hover, .autocomplete-result[aria-selected=true] {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-@-webkit-keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
-
-@keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
/* tab / tab-group ----------------------------------------------------------------- */
tobago-tab .nav-link:not([href]):not([tabindex]) {
/* fix .nav-links without 'href'; bootstrap tab only works if 'href' is set */
diff --git a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css.map b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css.map
index 5d85510..cb5acd1 100644
--- a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css.map
+++ b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.css.map
@@ -1 +1 @@
-{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../scss/_custom.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/m [...]
\ No newline at end of file
+{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../scss/_custom.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/m [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css
index ff25f5c..79cf79c 100644
--- a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css
+++ b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css
@@ -1,2 +1,2 @@
-@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#ff00be;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#ffffff;--bs-gray:#777777;--bs-gray-dark:#323232;--bs-primary:#529696;--bs-secondary:#b2a76d;--bs-success:#abf5ff;--bs-info:#389c30;--bs-warning:#ff00be;--bs-danger:#ff00be;--bs-light:#ffffff;--bs-dark:#529696;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Robo [...]
+@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#ff00be;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#ffffff;--bs-gray:#777777;--bs-gray-dark:#323232;--bs-primary:#529696;--bs-secondary:#b2a76d;--bs-success:#abf5ff;--bs-info:#389c30;--bs-warning:#ff00be;--bs-danger:#ff00be;--bs-light:#ffffff;--bs-dark:#529696;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Robo [...]
/*# sourceMappingURL=tobago.min.css.map */
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css.map b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css.map
index 3a1f970..fb4d721 100644
--- a/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css.map
+++ b/tobago-theme/tobago-theme-charlotteville/npm/dist/css/tobago.min.css.map
@@ -1 +1 @@
-{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuCA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,QACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,SAAS,CAAE,aAAa,CAAE,UAAU,CAAE,MAAM,CAAE,gBAAgB,CAAE,KAAK,CAAE,WAAW,CAAE,iBAAiB,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,iBAAiB,CAAE,mBACnM,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAi [...]
\ No newline at end of file
+{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuCA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,QACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,SAAS,CAAE,aAAa,CAAE,UAAU,CAAE,MAAM,CAAE,gBAAgB,CAAE,KAAK,CAAE,WAAW,CAAE,iBAAiB,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,iBAAiB,CAAE,mBACnM,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAi [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css
index c5be199..eaaaadc 100644
--- a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css
+++ b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css
@@ -11342,6 +11342,17 @@ tobago-header.sticky-top {
tobago-in {
display: block;
}
+tobago-in .input-group > tobago-dropdown {
+ /* fix corner styling, because tobago-dropdown use a surrounding container inside an input group */
+}
+tobago-in .input-group > tobago-dropdown:not(:last-child) > .tobago-button {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+tobago-in .input-group > tobago-dropdown:not(:first-child) > .tobago-button {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
tobago-in .input-group tobago-select-one-choice {
/* fix style for surrounding container (tobago-select-one-choice).
According to bootstrap docs, <select class=.form-select> should be rendered directly to .input-group. But tobago
@@ -11356,7 +11367,43 @@ tobago-in .input-group tobago-select-one-choice.form-select {
tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
border: 0;
}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container {
+ position: absolute;
+}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container:after {
+ content: "";
+ border: 3px solid rgba(0, 0, 0, 0.12);
+ border-right-color: rgba(0, 0, 0, 0.48);
+ border-radius: 100%;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ z-index: 5;
+ transform: translateY(-50%);
+ -webkit-animation: rotate 1s linear infinite;
+ animation: rotate 1s linear infinite;
+}
+tobago-in tobago-suggest {
+ display: none;
+}
+
+@-webkit-keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
+@keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
.tobago-in-markup-fatal.border-danger:focus, .tobago-in-markup-error.border-danger:focus {
box-shadow: 0 0 0 0.2rem rgba(255, 178, 67, 0.25);
}
@@ -11374,6 +11421,26 @@ tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
text-align: right;
}
+.autocomplete-result-list {
+ padding: 0.5rem 0;
+ list-style: none;
+ background-color: #000000;
+ border: 2px solid rgba(0, 0, 0, 0.15);
+ border-radius: 0.25rem;
+ overflow-y: auto;
+}
+.autocomplete-result-list .autocomplete-result {
+ padding: 0.25rem 1rem;
+}
+.autocomplete-result-list .autocomplete-result:hover, .autocomplete-result-list .autocomplete-result:focus, .autocomplete-result-list .autocomplete-result[aria-selected=true] {
+ color: #1e2125;
+ background-color: #e9ecef;
+}
+.autocomplete-result-list .autocomplete-result:active {
+ color: #ffb243;
+ background-color: #d68200;
+}
+
/* label ----------------------------------------------------------- */
.tobago-label {
color: #6610f2 !important;
@@ -12191,115 +12258,6 @@ tobago-split-layout {
/* TODO: check, if needed (check also with iframes) */
}
-/* suggest ---------------------------------------------------------------------- */
-tobago-suggest {
- display: none;
-}
-
-.autocomplete-input {
- /*border: 1px solid #eee;*/
- /*border-radius: 8px;*/
- /*width: 100%;*/
- /*padding: 12px 12px 12px 48px;*/
- /*box-sizing: border-box;*/
- /*position: relative;*/
- /*font-size: 16px;*/
- /*line-height: 1.5;*/
- /*flex: 1;*/
- /*background-color: #eee;*/
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-input:focus, .autocomplete-input[aria-expanded=true] {
- /*border-color: rgba(0, 0, 0, .12);*/
- /*background-color: #fff;*/
- /*outline: none;*/
- /*box-shadow: 0 2px 2px rgba(0, 0, 0, .16)*/
-}
-
-[data-position=below] .autocomplete-input[aria-expanded=true] {
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
-}
-
-[data-position=above] .autocomplete-input[aria-expanded=true] {
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- z-index: 2;
-}
-
-.autocomplete[data-loading=true]:after {
- content: "";
- border: 3px solid rgba(0, 0, 0, 0.12);
- border-right-color: rgba(0, 0, 0, 0.48);
- border-radius: 100%;
- width: 20px;
- height: 20px;
- position: absolute;
- right: 12px;
- top: 50%;
- transform: translateY(-50%);
- -webkit-animation: rotate 1s linear infinite;
- animation: rotate 1s linear infinite;
-}
-
-.autocomplete-result-list {
- margin: 0;
- border: 1px solid rgba(0, 0, 0, 0.12);
- padding: 0;
- box-sizing: border-box;
- max-height: 296px;
- overflow-y: auto;
- background: #fff;
- list-style: none;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.16);
-}
-
-[data-position=below] .autocomplete-result-list {
- margin-top: -1px;
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- padding-bottom: 8px;
-}
-
-[data-position=above] .autocomplete-result-list {
- margin-bottom: -1px;
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
- padding-top: 8px;
-}
-
-.autocomplete-result {
- cursor: default;
- padding: 12px 12px 12px 48px;
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjY2NjIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-result:hover, .autocomplete-result[aria-selected=true] {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-@-webkit-keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
-
-@keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
/* tab / tab-group ----------------------------------------------------------------- */
tobago-tab .nav-link:not([href]):not([tabindex]) {
/* fix .nav-links without 'href'; bootstrap tab only works if 'href' is set */
diff --git a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css.map b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css.map
index 088cc61..31524e1 100644
--- a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css.map
+++ b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.css.map
@@ -1 +1 @@
-{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../scss/_custom.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/m [...]
\ No newline at end of file
+{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../scss/_custom.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/m [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css
index 21058c1..eb8107a 100644
--- a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css
+++ b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css
@@ -1,2 +1,2 @@
-@charset "UTF-8";@font-face{font-family:Amaranth;font-style:normal;font-weight:400;src:url("../fonts/Amaranth-Regular.otf") format("opentype")}@font-face{font-family:Amaranth;font-style:normal;font-weight:700;src:url("../fonts/Amaranth-Bold.otf") format("opentype")}@font-face{font-family:Amaranth;font-style:italic;src:url("../fonts/Amaranth-Italic.otf") format("opentype")}@font-face{font-family:Amaranth;font-style:italic;font-weight:700;src:url("../fonts/Amaranth-BoldItalic.otf") format( [...]
+@charset "UTF-8";@font-face{font-family:Amaranth;font-style:normal;font-weight:400;src:url("../fonts/Amaranth-Regular.otf") format("opentype")}@font-face{font-family:Amaranth;font-style:normal;font-weight:700;src:url("../fonts/Amaranth-Bold.otf") format("opentype")}@font-face{font-family:Amaranth;font-style:italic;src:url("../fonts/Amaranth-Italic.otf") format("opentype")}@font-face{font-family:Amaranth;font-style:italic;font-weight:700;src:url("../fonts/Amaranth-BoldItalic.otf") format( [...]
/*# sourceMappingURL=tobago.min.css.map */
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css.map b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css.map
index a4ffd44..24e65f4 100644
--- a/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css.map
+++ b/tobago-theme/tobago-theme-roxborough/npm/dist/css/tobago.min.css.map
@@ -1 +1 @@
-{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAiCA,WACE,YAAa,SACb,WAAY,OACZ,YAAa,IACb,IAAK,qCAAqC,mBAE5C,WACE,YAAa,SACb,WAAY,OACZ,YAAa,IACb,IAAK,kCAAkC,mBAEzC,WACE,YAAa,SACb,WAAY,OACZ,IAAK,oCAAoC,mBAE3C,WACE,YAAa,SACb,WAAY,OACZ,YAAa,IACb,IAAK,wCAAwC,mBAEvB,mBAAxB,uBACE,YAAa,QAAQ,CAAE,KAAK,CAAE,MAShC,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,Q [...]
\ No newline at end of file
+{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAiCA,WACE,YAAa,SACb,WAAY,OACZ,YAAa,IACb,IAAK,qCAAqC,mBAE5C,WACE,YAAa,SACb,WAAY,OACZ,YAAa,IACb,IAAK,kCAAkC,mBAEzC,WACE,YAAa,SACb,WAAY,OACZ,IAAK,oCAAoC,mBAE3C,WACE,YAAa,SACb,WAAY,OACZ,YAAa,IACb,IAAK,wCAAwC,mBAEvB,mBAAxB,uBACE,YAAa,QAAQ,CAAE,KAAK,CAAE,MAShC,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,Q [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css
index baef160..9303d39 100644
--- a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css
+++ b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css
@@ -11329,6 +11329,17 @@ tobago-header.sticky-top {
tobago-in {
display: block;
}
+tobago-in .input-group > tobago-dropdown {
+ /* fix corner styling, because tobago-dropdown use a surrounding container inside an input group */
+}
+tobago-in .input-group > tobago-dropdown:not(:last-child) > .tobago-button {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+tobago-in .input-group > tobago-dropdown:not(:first-child) > .tobago-button {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
tobago-in .input-group tobago-select-one-choice {
/* fix style for surrounding container (tobago-select-one-choice).
According to bootstrap docs, <select class=.form-select> should be rendered directly to .input-group. But tobago
@@ -11343,7 +11354,43 @@ tobago-in .input-group tobago-select-one-choice.form-select {
tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
border: 0;
}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container {
+ position: absolute;
+}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container:after {
+ content: "";
+ border: 3px solid rgba(0, 0, 0, 0.12);
+ border-right-color: rgba(0, 0, 0, 0.48);
+ border-radius: 100%;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ z-index: 5;
+ transform: translateY(-50%);
+ -webkit-animation: rotate 1s linear infinite;
+ animation: rotate 1s linear infinite;
+}
+tobago-in tobago-suggest {
+ display: none;
+}
+@-webkit-keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
+
+@keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
.tobago-in-markup-fatal.border-danger:focus, .tobago-in-markup-error.border-danger:focus {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
@@ -11361,6 +11408,26 @@ tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
text-align: right;
}
+.autocomplete-result-list {
+ padding: 0.5rem 0;
+ list-style: none;
+ background-color: #fff;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+ border-radius: 0.25rem;
+ overflow-y: auto;
+}
+.autocomplete-result-list .autocomplete-result {
+ padding: 0.25rem 1rem;
+}
+.autocomplete-result-list .autocomplete-result:hover, .autocomplete-result-list .autocomplete-result:focus, .autocomplete-result-list .autocomplete-result[aria-selected=true] {
+ color: #1e2125;
+ background-color: #e9ecef;
+}
+.autocomplete-result-list .autocomplete-result:active {
+ color: #fff;
+ background-color: #0d6efd;
+}
+
/* label ----------------------------------------------------------- */
.tobago-label {
color: #6610f2 !important;
@@ -12178,115 +12245,6 @@ tobago-split-layout {
/* TODO: check, if needed (check also with iframes) */
}
-/* suggest ---------------------------------------------------------------------- */
-tobago-suggest {
- display: none;
-}
-
-.autocomplete-input {
- /*border: 1px solid #eee;*/
- /*border-radius: 8px;*/
- /*width: 100%;*/
- /*padding: 12px 12px 12px 48px;*/
- /*box-sizing: border-box;*/
- /*position: relative;*/
- /*font-size: 16px;*/
- /*line-height: 1.5;*/
- /*flex: 1;*/
- /*background-color: #eee;*/
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-input:focus, .autocomplete-input[aria-expanded=true] {
- /*border-color: rgba(0, 0, 0, .12);*/
- /*background-color: #fff;*/
- /*outline: none;*/
- /*box-shadow: 0 2px 2px rgba(0, 0, 0, .16)*/
-}
-
-[data-position=below] .autocomplete-input[aria-expanded=true] {
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
-}
-
-[data-position=above] .autocomplete-input[aria-expanded=true] {
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- z-index: 2;
-}
-
-.autocomplete[data-loading=true]:after {
- content: "";
- border: 3px solid rgba(0, 0, 0, 0.12);
- border-right-color: rgba(0, 0, 0, 0.48);
- border-radius: 100%;
- width: 20px;
- height: 20px;
- position: absolute;
- right: 12px;
- top: 50%;
- transform: translateY(-50%);
- -webkit-animation: rotate 1s linear infinite;
- animation: rotate 1s linear infinite;
-}
-
-.autocomplete-result-list {
- margin: 0;
- border: 1px solid rgba(0, 0, 0, 0.12);
- padding: 0;
- box-sizing: border-box;
- max-height: 296px;
- overflow-y: auto;
- background: #fff;
- list-style: none;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.16);
-}
-
-[data-position=below] .autocomplete-result-list {
- margin-top: -1px;
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- padding-bottom: 8px;
-}
-
-[data-position=above] .autocomplete-result-list {
- margin-bottom: -1px;
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
- padding-top: 8px;
-}
-
-.autocomplete-result {
- cursor: default;
- padding: 12px 12px 12px 48px;
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjY2NjIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-result:hover, .autocomplete-result[aria-selected=true] {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-@-webkit-keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
-
-@keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
/* tab / tab-group ----------------------------------------------------------------- */
tobago-tab .nav-link:not([href]):not([tabindex]) {
/* fix .nav-links without 'href'; bootstrap tab only works if 'href' is set */
diff --git a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css.map b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css.map
index 814b255..6417baf 100644
--- a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css.map
+++ b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.css.map
@@ -1 +1 @@
-{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/mixins/_lists.scss","../../ [...]
\ No newline at end of file
+{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/mixins/_lists.scss","../../ [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css
index 7f1eeac..63781f4 100644
--- a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css
+++ b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css
@@ -1,2 +1,2 @@
-@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto, [...]
+@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto, [...]
/*# sourceMappingURL=tobago.min.css.map */
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css.map b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css.map
index 58fa1e5..22094c5 100644
--- a/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css.map
+++ b/tobago-theme/tobago-theme-scarborough/npm/dist/css/tobago.min.css.map
@@ -1 +1 @@
-{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuBA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,SAAS,CAAE,aAAa,CAAE,UAAU,CAAE,MAAM,CAAE,gBAAgB,CAAE,KAAK,CAAE,WAAW,CAAE,iBAAiB,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,iBAAiB,CAAE,mBACnM,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAi [...]
\ No newline at end of file
+{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuBA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,SAAS,CAAE,aAAa,CAAE,UAAU,CAAE,MAAM,CAAE,gBAAgB,CAAE,KAAK,CAAE,WAAW,CAAE,iBAAiB,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,iBAAiB,CAAE,mBACnM,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAi [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css
index 580479d..b270821 100644
--- a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css
+++ b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css
@@ -11043,6 +11043,17 @@ tobago-header.sticky-top {
tobago-in {
display: block;
}
+tobago-in .input-group > tobago-dropdown {
+ /* fix corner styling, because tobago-dropdown use a surrounding container inside an input group */
+}
+tobago-in .input-group > tobago-dropdown:not(:last-child) > .tobago-button {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+tobago-in .input-group > tobago-dropdown:not(:first-child) > .tobago-button {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
tobago-in .input-group tobago-select-one-choice {
/* fix style for surrounding container (tobago-select-one-choice).
According to bootstrap docs, <select class=.form-select> should be rendered directly to .input-group. But tobago
@@ -11057,7 +11068,43 @@ tobago-in .input-group tobago-select-one-choice.form-select {
tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
border: 0;
}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container {
+ position: absolute;
+}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container:after {
+ content: "";
+ border: 3px solid rgba(0, 0, 0, 0.12);
+ border-right-color: rgba(0, 0, 0, 0.48);
+ border-radius: 100%;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ z-index: 5;
+ transform: translateY(-50%);
+ -webkit-animation: rotate 1s linear infinite;
+ animation: rotate 1s linear infinite;
+}
+tobago-in tobago-suggest {
+ display: none;
+}
+
+@-webkit-keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
+@keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
.tobago-in-markup-fatal.border-danger:focus, .tobago-in-markup-error.border-danger:focus {
box-shadow: 0 0 0 0.2rem rgba(211, 0, 64, 0.25);
}
@@ -11075,6 +11122,25 @@ tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
text-align: right;
}
+.autocomplete-result-list {
+ padding: 0.5rem 0;
+ list-style: none;
+ background-color: #fff;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+ overflow-y: auto;
+}
+.autocomplete-result-list .autocomplete-result {
+ padding: 0.25rem 1rem;
+}
+.autocomplete-result-list .autocomplete-result:hover, .autocomplete-result-list .autocomplete-result:focus, .autocomplete-result-list .autocomplete-result[aria-selected=true] {
+ color: #1e2125;
+ background-color: #e3e4e5;
+}
+.autocomplete-result-list .autocomplete-result:active {
+ color: #fff;
+ background-color: #a36725;
+}
+
/* label ----------------------------------------------------------- */
.tobago-label {
color: #6610f2 !important;
@@ -11892,115 +11958,6 @@ tobago-split-layout {
/* TODO: check, if needed (check also with iframes) */
}
-/* suggest ---------------------------------------------------------------------- */
-tobago-suggest {
- display: none;
-}
-
-.autocomplete-input {
- /*border: 1px solid #eee;*/
- /*border-radius: 8px;*/
- /*width: 100%;*/
- /*padding: 12px 12px 12px 48px;*/
- /*box-sizing: border-box;*/
- /*position: relative;*/
- /*font-size: 16px;*/
- /*line-height: 1.5;*/
- /*flex: 1;*/
- /*background-color: #eee;*/
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-input:focus, .autocomplete-input[aria-expanded=true] {
- /*border-color: rgba(0, 0, 0, .12);*/
- /*background-color: #fff;*/
- /*outline: none;*/
- /*box-shadow: 0 2px 2px rgba(0, 0, 0, .16)*/
-}
-
-[data-position=below] .autocomplete-input[aria-expanded=true] {
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
-}
-
-[data-position=above] .autocomplete-input[aria-expanded=true] {
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- z-index: 2;
-}
-
-.autocomplete[data-loading=true]:after {
- content: "";
- border: 3px solid rgba(0, 0, 0, 0.12);
- border-right-color: rgba(0, 0, 0, 0.48);
- border-radius: 100%;
- width: 20px;
- height: 20px;
- position: absolute;
- right: 12px;
- top: 50%;
- transform: translateY(-50%);
- -webkit-animation: rotate 1s linear infinite;
- animation: rotate 1s linear infinite;
-}
-
-.autocomplete-result-list {
- margin: 0;
- border: 1px solid rgba(0, 0, 0, 0.12);
- padding: 0;
- box-sizing: border-box;
- max-height: 296px;
- overflow-y: auto;
- background: #fff;
- list-style: none;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.16);
-}
-
-[data-position=below] .autocomplete-result-list {
- margin-top: -1px;
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- padding-bottom: 8px;
-}
-
-[data-position=above] .autocomplete-result-list {
- margin-bottom: -1px;
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
- padding-top: 8px;
-}
-
-.autocomplete-result {
- cursor: default;
- padding: 12px 12px 12px 48px;
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjY2NjIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-result:hover, .autocomplete-result[aria-selected=true] {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-@-webkit-keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
-
-@keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
/* tab / tab-group ----------------------------------------------------------------- */
tobago-tab .nav-link:not([href]):not([tabindex]) {
/* fix .nav-links without 'href'; bootstrap tab only works if 'href' is set */
diff --git a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css.map b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css.map
index f116eb3..16e30b3 100644
--- a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css.map
+++ b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.css.map
@@ -1 +1 @@
-{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../scss/_custom.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/mixins/_lists.scss","../../node_modules/bootstrap/scss/_images.s [...]
\ No newline at end of file
+{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../scss/_custom.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/mixins/_lists.scss","../../node_modules/bootstrap/scss/_images.s [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css
index 895a686..688e474 100644
--- a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css
+++ b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css
@@ -1,2 +1,2 @@
-@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#3a2564;--bs-pink:#d63384;--bs-red:#d30040;--bs-orange:#d90;--bs-yellow:#ffc107;--bs-green:#1da332;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#788c94;--bs-gray-dark:#323232;--bs-primary:#185722;--bs-secondary:#d7d7d7;--bs-success:#1da332;--bs-info:#5bc0de;--bs-warning:#f0ad4e;--bs-danger:#d30040;--bs-light:#f7f7f7;--bs-dark:#323232;--bs-font-sans-serif:verdana,sans-serif;--bs-font-monospace:SFMono [...]
+@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#3a2564;--bs-pink:#d63384;--bs-red:#d30040;--bs-orange:#d90;--bs-yellow:#ffc107;--bs-green:#1da332;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#788c94;--bs-gray-dark:#323232;--bs-primary:#185722;--bs-secondary:#d7d7d7;--bs-success:#1da332;--bs-info:#5bc0de;--bs-warning:#f0ad4e;--bs-danger:#d30040;--bs-light:#f7f7f7;--bs-dark:#323232;--bs-font-sans-serif:verdana,sans-serif;--bs-font-monospace:SFMono [...]
/*# sourceMappingURL=tobago.min.css.map */
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css.map b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css.map
index 34ea3e7..b574760 100644
--- a/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css.map
+++ b/tobago-theme/tobago-theme-speyside/npm/dist/css/tobago.min.css.map
@@ -1 +1 @@
-{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuCA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,KACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,OAAO,CAAE,WAC/B,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAiB,CAAE,aAAa,CAAE,UAChG,cAAe,2EAGjB,EAEA,QADA,SAEE,WAAY,WAGd,MACE,UAAW,KAEb,8CACE,MACE,gBAAiB,QAIrB,KACE,OAAQ,EACR,YAAa,OA [...]
\ No newline at end of file
+{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuCA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,KACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,OAAO,CAAE,WAC/B,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAiB,CAAE,aAAa,CAAE,UAChG,cAAe,2EAGjB,EAEA,QADA,SAEE,WAAY,WAGd,MACE,UAAW,KAEb,8CACE,MACE,gBAAiB,QAIrB,KACE,OAAQ,EACR,YAAa,OA [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css
index 432764f..f308e62 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css
+++ b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css
@@ -11299,6 +11299,17 @@ tobago-header.sticky-top {
tobago-in {
display: block;
}
+tobago-in .input-group > tobago-dropdown {
+ /* fix corner styling, because tobago-dropdown use a surrounding container inside an input group */
+}
+tobago-in .input-group > tobago-dropdown:not(:last-child) > .tobago-button {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+tobago-in .input-group > tobago-dropdown:not(:first-child) > .tobago-button {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
tobago-in .input-group tobago-select-one-choice {
/* fix style for surrounding container (tobago-select-one-choice).
According to bootstrap docs, <select class=.form-select> should be rendered directly to .input-group. But tobago
@@ -11313,7 +11324,43 @@ tobago-in .input-group tobago-select-one-choice.form-select {
tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
border: 0;
}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container {
+ position: absolute;
+}
+tobago-in.autocomplete[data-loading=true] .autocomplete-pseudo-container:after {
+ content: "";
+ border: 3px solid rgba(0, 0, 0, 0.12);
+ border-right-color: rgba(0, 0, 0, 0.48);
+ border-radius: 100%;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ z-index: 5;
+ transform: translateY(-50%);
+ -webkit-animation: rotate 1s linear infinite;
+ animation: rotate 1s linear infinite;
+}
+tobago-in tobago-suggest {
+ display: none;
+}
+@-webkit-keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
+
+@keyframes rotate {
+ 0% {
+ transform: translateY(-50%) rotate(0deg);
+ }
+ to {
+ transform: translateY(-50%) rotate(359deg);
+ }
+}
.tobago-in-markup-fatal.border-danger:focus, .tobago-in-markup-error.border-danger:focus {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
@@ -11331,6 +11378,26 @@ tobago-in .input-group tobago-select-one-choice.form-select > .form-select {
text-align: right;
}
+.autocomplete-result-list {
+ padding: 0.5rem 0;
+ list-style: none;
+ background-color: #fff;
+ border: 1px solid rgba(0, 0, 0, 0.15);
+ border-radius: 0.25rem;
+ overflow-y: auto;
+}
+.autocomplete-result-list .autocomplete-result {
+ padding: 0.25rem 1rem;
+}
+.autocomplete-result-list .autocomplete-result:hover, .autocomplete-result-list .autocomplete-result:focus, .autocomplete-result-list .autocomplete-result[aria-selected=true] {
+ color: #1e2125;
+ background-color: #e9ecef;
+}
+.autocomplete-result-list .autocomplete-result:active {
+ color: #fff;
+ background-color: #0d6efd;
+}
+
/* label ----------------------------------------------------------- */
.tobago-label {
color: #6610f2 !important;
@@ -12148,115 +12215,6 @@ tobago-split-layout {
/* TODO: check, if needed (check also with iframes) */
}
-/* suggest ---------------------------------------------------------------------- */
-tobago-suggest {
- display: none;
-}
-
-.autocomplete-input {
- /*border: 1px solid #eee;*/
- /*border-radius: 8px;*/
- /*width: 100%;*/
- /*padding: 12px 12px 12px 48px;*/
- /*box-sizing: border-box;*/
- /*position: relative;*/
- /*font-size: 16px;*/
- /*line-height: 1.5;*/
- /*flex: 1;*/
- /*background-color: #eee;*/
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNjY2IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-input:focus, .autocomplete-input[aria-expanded=true] {
- /*border-color: rgba(0, 0, 0, .12);*/
- /*background-color: #fff;*/
- /*outline: none;*/
- /*box-shadow: 0 2px 2px rgba(0, 0, 0, .16)*/
-}
-
-[data-position=below] .autocomplete-input[aria-expanded=true] {
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
-}
-
-[data-position=above] .autocomplete-input[aria-expanded=true] {
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- z-index: 2;
-}
-
-.autocomplete[data-loading=true]:after {
- content: "";
- border: 3px solid rgba(0, 0, 0, 0.12);
- border-right-color: rgba(0, 0, 0, 0.48);
- border-radius: 100%;
- width: 20px;
- height: 20px;
- position: absolute;
- right: 12px;
- top: 50%;
- transform: translateY(-50%);
- -webkit-animation: rotate 1s linear infinite;
- animation: rotate 1s linear infinite;
-}
-
-.autocomplete-result-list {
- margin: 0;
- border: 1px solid rgba(0, 0, 0, 0.12);
- padding: 0;
- box-sizing: border-box;
- max-height: 296px;
- overflow-y: auto;
- background: #fff;
- list-style: none;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.16);
-}
-
-[data-position=below] .autocomplete-result-list {
- margin-top: -1px;
- border-top-color: transparent;
- border-radius: 0 0 8px 8px;
- padding-bottom: 8px;
-}
-
-[data-position=above] .autocomplete-result-list {
- margin-bottom: -1px;
- border-bottom-color: transparent;
- border-radius: 8px 8px 0 0;
- padding-top: 8px;
-}
-
-.autocomplete-result {
- cursor: default;
- padding: 12px 12px 12px 48px;
- /*background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjY2NjIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC00Ii8+PC9zdmc+");*/
- /*background-repeat: no-repeat;*/
- /*background-position: 12px*/
-}
-
-.autocomplete-result:hover, .autocomplete-result[aria-selected=true] {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-@-webkit-keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
-
-@keyframes rotate {
- 0% {
- transform: translateY(-50%) rotate(0deg);
- }
- to {
- transform: translateY(-50%) rotate(359deg);
- }
-}
/* tab / tab-group ----------------------------------------------------------------- */
tobago-tab .nav-link:not([href]):not([tabindex]) {
/* fix .nav-links without 'href'; bootstrap tab only works if 'href' is set */
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css.map b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css.map
index 2dd00fb..2bbd90c 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.css.map
@@ -1 +1 @@
-{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/mixins/_lists.scss","../../ [...]
\ No newline at end of file
+{"version":3,"sources":["tobago.css","../../scss/tobago-theme.scss","../../node_modules/bootstrap/scss/bootstrap.scss","../../node_modules/bootstrap/scss/_root.scss","../../node_modules/bootstrap/scss/_reboot.scss","../../node_modules/bootstrap/scss/_variables.scss","../../node_modules/bootstrap/scss/vendor/_rfs.scss","../../node_modules/bootstrap/scss/mixins/_border-radius.scss","../../node_modules/bootstrap/scss/_type.scss","../../node_modules/bootstrap/scss/mixins/_lists.scss","../../ [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css
index 51333e1..8e99d74 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css
+++ b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css
@@ -1,2 +1,2 @@
-@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto, [...]
+@charset "UTF-8";:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto, [...]
/*# sourceMappingURL=tobago.min.css.map */
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css.map b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css.map
index b900a1a..191337f 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/css/tobago.min.css.map
@@ -1 +1 @@
-{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuBA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,SAAS,CAAE,aAAa,CAAE,UAAU,CAAE,MAAM,CAAE,gBAAgB,CAAE,KAAK,CAAE,WAAW,CAAE,iBAAiB,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,iBAAiB,CAAE,mBACnM,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAi [...]
\ No newline at end of file
+{"version":3,"sources":["dist/css/tobago.css"],"names":[],"mappings":"iBAuBA,MACE,UAAW,QACX,YAAa,QACb,YAAa,QACb,UAAW,QACX,SAAU,QACV,YAAa,QACb,YAAa,QACb,WAAY,QACZ,UAAW,QACX,UAAW,QACX,WAAY,KACZ,UAAW,QACX,eAAgB,QAChB,aAAc,QACd,eAAgB,QAChB,aAAc,QACd,UAAW,QACX,aAAc,QACd,YAAa,QACb,WAAY,QACZ,UAAW,QACX,qBAAsB,SAAS,CAAE,aAAa,CAAE,UAAU,CAAE,MAAM,CAAE,gBAAgB,CAAE,KAAK,CAAE,WAAW,CAAE,iBAAiB,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,iBAAiB,CAAE,mBACnM,oBAAqB,cAAc,CAAE,KAAK,CAAE,MAAM,CAAE,QAAQ,CAAE,iBAAi [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js
index 04dc042..8dcb948 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js
@@ -18,7 +18,6 @@ import "./tobago-listener";
import "./tobago-bar";
import "./tobago-dropdown";
import "./tobago-date";
-import "./tobago-date-utils";
import "./tobago-command";
import "./tobago-file";
import "./tobago-focus";
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js.map b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js.map
index f78c75e..f54aea0 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-all.js.map
@@ -1 +1 @@
-{"version":3,"file":"tobago-all.js","sourceRoot":"","sources":["../../ts/tobago-all.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CA [...]
\ No newline at end of file
+{"version":3,"file":"tobago-all.js","sourceRoot":"","sources":["../../ts/tobago-all.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CA [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date-utils.js b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date-utils.js
deleted file mode 100644
index 397043c..0000000
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date-utils.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// XXX it might be nice, if this util was in tobago-date.ts, but in that case there are problems
-// XXX with Jest (UnitTesting)
-export class DateUtils {
- /*
- Get the pattern from the "Java world",
- see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/SimpleDateFormat.html
- and convert it to 'vanillajs-datepicker', see https://mymth.github.io/vanillajs-datepicker/#/date-string+format
- Attention: Not every pattern char is supported.
- */
- static convertPatternJava2Js(originalPattern) {
- let pattern;
- if (!originalPattern || originalPattern.length > 100) {
- console.warn("Pattern not supported: " + originalPattern);
- pattern = "";
- }
- else {
- pattern = originalPattern;
- }
- let analyzedPattern = "";
- let nextSegment = "";
- let escMode = false;
- for (let i = 0; i < pattern.length; i++) {
- const currentChar = pattern.charAt(i);
- if (currentChar == "'" && escMode == false) {
- escMode = true;
- analyzedPattern += DateUtils.convertPatternPart(nextSegment);
- nextSegment = "";
- }
- else if (currentChar == "'" && pattern.charAt(i + 1) == "'") {
- if (escMode) {
- nextSegment += "\\";
- }
- nextSegment += "'";
- i++;
- }
- else if (currentChar == "'" && escMode == true) {
- escMode = false;
- analyzedPattern += nextSegment;
- nextSegment = "";
- }
- else {
- if (escMode) {
- nextSegment += "\\";
- }
- nextSegment += currentChar;
- }
- }
- if (nextSegment != "") {
- if (escMode) {
- analyzedPattern += nextSegment;
- }
- else {
- analyzedPattern += this.convertPatternPart(nextSegment);
- }
- }
- return analyzedPattern;
- }
- static convertPatternPart(originalPattern) {
- let pattern = originalPattern;
- if (pattern.search("G") > -1 || pattern.search("W") > -1 || pattern.search("F") > -1
- || pattern.search("K") > -1 || pattern.search("z") > -1 || pattern.search("X") > -1) {
- console.warn("Pattern chars 'G', 'W', 'F', 'K', 'z' and 'X' are not supported: " + pattern);
- pattern = "";
- }
- if (pattern.search("y") > -1) {
- pattern = pattern.replace(/y/g, "y");
- }
- if (pattern.search("M") > -1) {
- pattern = pattern.replace(/M/g, "m");
- }
- if (pattern.search("d") > -1) {
- pattern = pattern.replace(/dd+/g, "dd");
- pattern = pattern.replace(/\bd\b/g, "d");
- }
- return pattern;
- }
-}
-//# sourceMappingURL=tobago-date-utils.js.map
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date-utils.js.map b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date-utils.js.map
deleted file mode 100644
index 79242ad..0000000
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date-utils.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tobago-date-utils.js","sourceRoot":"","sources":["../../ts/tobago-date-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,gGAAgG;AAChG,8BAA8B;AAE9B,MAAM,OAAO,SAAS;IAEpB;;;;;MAKE;IACK,MAAM,CAAC,qBAAqB,CAAC,eAAuB;QACzD,IAAI,OAAO,CAAC;QACZ,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,GAAG,EAAE;YACpD,OAAO,CAAC,IAAI,CAAC,yBAAyB,GAAG,eAAe,CAAC,CAAC;YAC1D,OAAO,GAAG,EAAE,CAAC;SACd;aAAM;YACL,OAAO,GAAG,eAAe,CAAC;SAC3B;QAED,IAAI,eAAe,GAAG,EAAE,CAAC;QACzB,IAAI,WAAW,GAAG,E [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js
index 5ccfc64..1ea6429 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js
@@ -16,7 +16,6 @@
*/
// @ts-ignore
import { Datepicker } from "vanillajs-datepicker";
-import { DateUtils } from "./tobago-date-utils";
import { Page } from "./tobago-page";
class DatePicker extends HTMLElement {
constructor() {
@@ -92,8 +91,7 @@ class DatePicker extends HTMLElement {
}
}
get pattern() {
- const pattern = this.getAttribute("pattern");
- return DateUtils.convertPatternJava2Js(pattern); // todo: to the conversation in Java, not here
+ return this.getAttribute("pattern");
}
get i18n() {
const i18n = this.getAttribute("i18n");
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js.map b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js.map
index 5cd4b77..2baff47 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-date.js.map
@@ -1 +1 @@
-{"version":3,"file":"tobago-date.js","sourceRoot":"","sources":["../../ts/tobago-date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,aAAa;AACb,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AAyBnC,MAAM,UAAW,SAAQ,WAAW;IAIlC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,iBAAiB;;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,MAAM,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI, [...]
\ No newline at end of file
+{"version":3,"file":"tobago-date.js","sourceRoot":"","sources":["../../ts/tobago-date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,aAAa;AACb,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AAyBnC,MAAM,UAAW,SAAQ,WAAW;IAIlC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,iBAAiB;;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,MAAM,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,CA [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js
index 41df659..3848bff 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js
@@ -16,12 +16,17 @@
*/
import { Listener, Phase } from "./tobago-listener";
import { Focus } from "./tobago-focus";
+import { Suggest } from "./tobago-suggest";
export class In extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.input.addEventListener("focus", Focus.setLastFocusId);
+ if (this.querySelector("tobago-suggest")) {
+ const suggest = new Suggest(this);
+ suggest.init();
+ }
}
get input() {
const rootNode = this.getRootNode();
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js.map b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js.map
index 3e99fe4..4a2ee16 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-in.js.map
@@ -1 +1 @@
-{"version":3,"file":"tobago-in.js","sourceRoot":"","sources":["../../ts/tobago-in.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAErC,MAAM,OAAO,EAAG,SAAQ,WAAW;IACjC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,KAAK;QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAA2B,CAAC;QAC7D,OAAO,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC [...]
\ No newline at end of file
+{"version":3,"file":"tobago-in.js","sourceRoot":"","sources":["../../ts/tobago-in.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,MAAM,OAAO,EAAG,SAAQ,WAAW;IACjC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;QAC3D,IAAI,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG, [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js
index 49ef02d..4a660e2 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js
@@ -14,56 +14,164 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import Autocomplete from "@trevoreyre/autocomplete-js/Autocomplete.js";
-export class Suggest extends HTMLElement {
- constructor() {
- super();
+import Autocomplete from "@trevoreyre/autocomplete-js";
+export class Suggest {
+ constructor(tobagoIn) {
+ this.tobagoIn = tobagoIn;
}
- get hiddenInput() {
- return this.querySelector(":scope > input[type=hidden]");
- }
- get suggestInput() {
- const root = this.getRootNode();
- return root.getElementById(this.for);
- }
- get base() {
- return this.suggestInput.closest("tobago-in");
- }
- get for() {
- return this.getAttribute("for");
- }
- set for(forValue) {
- this.setAttribute("for", forValue);
- }
- get items() {
- return JSON.parse(this.getAttribute("items"));
- }
- connectedCallback() {
- console.log("* autocomplete init *********************************************************************");
+ init() {
+ if (!this.suggest) {
+ console.warn("[tobago-suggest] could not find tobago-suggest");
+ return;
+ }
+ this.registerAjaxListener();
this.base.classList.add("autocomplete");
+ this.base.insertAdjacentHTML("afterbegin", `<div class="autocomplete-pseudo-container"></div>`);
this.suggestInput.classList.add("autocomplete-input");
this.suggestInput.insertAdjacentHTML("afterend", `<ul class="autocomplete-result-list"></ul>`);
const options = {
search: input => {
- console.debug("input = '" + input + "'");
- if (input.length < 1) {
+ console.debug("[tobago-suggest] input = '" + input + "'");
+ const minChars = this.minChars ? this.minChars : 1;
+ if (input.length < minChars) {
return [];
}
- const inputLower = input.toLowerCase();
- let strings = this.items.filter(country => {
- return country.toLowerCase().startsWith(inputLower);
+ this.hiddenInput.value = input.toLowerCase();
+ this.positioningSpinner();
+ return new Promise(resolve => {
+ if (input.length < 1) {
+ return resolve([]);
+ }
+ if (this.update) {
+ this.resolve = resolve;
+ const suggestId = this.suggest.id;
+ jsf.ajax.request(suggestId, null, {
+ "javax.faces.behavior.event": "suggest",
+ execute: suggestId,
+ render: suggestId
+ });
+ }
+ else {
+ return resolve(this.filterItems());
+ }
});
- console.debug("out = '" + strings + "'");
- return strings;
- }
+ },
+ onUpdate: (results, selectedIndex) => {
+ this.positioningResultList();
+ this.setResultListMaxHeight();
+ },
+ debounceTime: this.delay
};
- this.autocomplete = new Autocomplete(this.base, options);
- console.log(this.autocomplete);
+ new Autocomplete(this.base, options);
+ if (!this.localMenu) {
+ this.menuStore.append(this.resultList);
+ }
}
-}
-document.addEventListener("tobago.init", function (event) {
- if (window.customElements.get("tobago-suggest") == null) {
- window.customElements.define("tobago-suggest", Suggest);
+ registerAjaxListener() {
+ jsf.ajax.addOnEvent(this.resolvePromise.bind(this));
+ }
+ resolvePromise(event) {
+ if (event.source === this.suggest && event.status === "success") {
+ return this.resolve(this.filterItems());
+ }
+ }
+ filterItems() {
+ return this.items.filter(item => {
+ return item.toLowerCase().indexOf(this.hiddenInput.value) > -1;
+ });
+ }
+ positioningSpinner() {
+ const baseRect = this.base.getBoundingClientRect();
+ const suggestInputRect = this.suggestInput.getBoundingClientRect();
+ const suggestInputStyle = getComputedStyle(this.suggestInput);
+ this.pseudoContainer.style.left = suggestInputRect.x - baseRect.x + suggestInputRect.width
+ - parseFloat(getComputedStyle(this.pseudoContainer, ":after").width)
+ - parseFloat(suggestInputStyle.marginRight)
+ - parseFloat(suggestInputStyle.borderRight)
+ - parseFloat(suggestInputStyle.paddingRight) + "px";
+ this.pseudoContainer.style.top = suggestInputRect.y - baseRect.y + (suggestInputRect.height / 2) + "px";
+ }
+ positioningResultList() {
+ const space = 2;
+ if (this.localMenu) {
+ const parentRect = this.suggestInput.parentElement.getBoundingClientRect();
+ const suggestInputRect = this.suggestInput.getBoundingClientRect();
+ this.resultList.style.marginLeft = (suggestInputRect.x - parentRect.x) + "px";
+ this.resultList.style.maxWidth = suggestInputRect.width + "px";
+ this.resultList.style.marginTop = space + "px";
+ this.resultList.style.marginBottom = space + "px";
+ }
+ else {
+ const suggestInputRect = this.suggestInput.getBoundingClientRect();
+ this.resultList.style.minWidth = suggestInputRect.width + "px";
+ this.resultList.style.left = suggestInputRect.left + "px";
+ if (this.resultListPosition === "below") {
+ this.resultList.style.marginTop =
+ window.scrollY + suggestInputRect.top + suggestInputRect.height + space + "px";
+ this.resultList.style.marginBottom = null;
+ }
+ else if (this.resultListPosition === "above") {
+ this.resultList.style.marginTop = null;
+ this.resultList.style.marginBottom = -(window.scrollY + suggestInputRect.top - space) + "px";
+ }
+ }
+ }
+ setResultListMaxHeight() {
+ const resultListEntry = this.resultList.querySelector(".autocomplete-result");
+ if (this.maxItems && resultListEntry) {
+ const resultListStyle = getComputedStyle(this.resultList);
+ this.resultList.style.maxHeight = (parseFloat(resultListStyle.borderTop)
+ + parseFloat(resultListStyle.paddingTop)
+ + (this.maxItems * parseFloat(getComputedStyle(resultListEntry).height))
+ + parseFloat(resultListStyle.paddingBottom)
+ + parseFloat(resultListStyle.borderBottom)) + "px";
+ }
}
-});
+ get base() {
+ return this.tobagoIn;
+ }
+ get pseudoContainer() {
+ return this.base.querySelector(":scope > .autocomplete-pseudo-container");
+ }
+ get suggestInput() {
+ const root = this.base.getRootNode();
+ return root.getElementById(this.suggest.getAttribute("for"));
+ }
+ get suggest() {
+ return this.base.querySelector("tobago-suggest");
+ }
+ get hiddenInput() {
+ return this.suggest.querySelector(":scope > input[type=hidden]");
+ }
+ get items() {
+ return JSON.parse(this.suggest.getAttribute("items"));
+ }
+ get resultList() {
+ const root = this.base.getRootNode();
+ const resultListId = this.suggestInput.getAttribute("aria-owns");
+ return root.getElementById(resultListId);
+ }
+ get resultListPosition() {
+ return this.base.dataset.position;
+ }
+ get menuStore() {
+ const root = this.base.getRootNode();
+ return root.querySelector(".tobago-page-menuStore");
+ }
+ get update() {
+ return this.suggest.getAttribute("update") !== null;
+ }
+ get delay() {
+ return parseInt(this.suggest.getAttribute("delay"));
+ }
+ get maxItems() {
+ return parseInt(this.suggest.getAttribute("max-items"));
+ }
+ get minChars() {
+ return parseInt(this.suggest.getAttribute("min-chars"));
+ }
+ get localMenu() {
+ return this.suggest.getAttribute("local-menu") !== null;
+ }
+}
//# sourceMappingURL=tobago-suggest.js.map
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js.map b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js.map
index d1a645f..854f8cc 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago-suggest.js.map
@@ -1 +1 @@
-{"version":3,"file":"tobago-suggest.js","sourceRoot":"","sources":["../../ts/tobago-suggest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,YAAY,MAAM,6CAA6C,CAAC;AAEvE,MAAM,OAAO,OAAQ,SAAQ,WAAW;IA6BtC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IA3BD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,aAAa,CAAC,6BAA6B,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,YAAY;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAA2B,CAAC;QACzD,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAqB,CAAC;IAC3D,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,YAAY,CAAC, [...]
\ No newline at end of file
+{"version":3,"file":"tobago-suggest.js","sourceRoot":"","sources":["../../ts/tobago-suggest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,MAAM,OAAO,OAAO;IAMlB,YAAY,QAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;YAC/D,OAAO;SACR;QAED,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,kBAAkB,C [...]
\ No newline at end of file
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js
index 0177a22..5291dd1 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js
@@ -2869,100 +2869,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
- // XXX it might be nice, if this util was in tobago-date.ts, but in that case there are problems
- // XXX with Jest (UnitTesting)
- class DateUtils {
- /*
- Get the pattern from the "Java world",
- see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/text/SimpleDateFormat.html
- and convert it to 'vanillajs-datepicker', see https://mymth.github.io/vanillajs-datepicker/#/date-string+format
- Attention: Not every pattern char is supported.
- */
- static convertPatternJava2Js(originalPattern) {
- let pattern;
- if (!originalPattern || originalPattern.length > 100) {
- console.warn("Pattern not supported: " + originalPattern);
- pattern = "";
- }
- else {
- pattern = originalPattern;
- }
- let analyzedPattern = "";
- let nextSegment = "";
- let escMode = false;
- for (let i = 0; i < pattern.length; i++) {
- const currentChar = pattern.charAt(i);
- if (currentChar == "'" && escMode == false) {
- escMode = true;
- analyzedPattern += DateUtils.convertPatternPart(nextSegment);
- nextSegment = "";
- }
- else if (currentChar == "'" && pattern.charAt(i + 1) == "'") {
- if (escMode) {
- nextSegment += "\\";
- }
- nextSegment += "'";
- i++;
- }
- else if (currentChar == "'" && escMode == true) {
- escMode = false;
- analyzedPattern += nextSegment;
- nextSegment = "";
- }
- else {
- if (escMode) {
- nextSegment += "\\";
- }
- nextSegment += currentChar;
- }
- }
- if (nextSegment != "") {
- if (escMode) {
- analyzedPattern += nextSegment;
- }
- else {
- analyzedPattern += this.convertPatternPart(nextSegment);
- }
- }
- return analyzedPattern;
- }
- static convertPatternPart(originalPattern) {
- let pattern = originalPattern;
- if (pattern.search("G") > -1 || pattern.search("W") > -1 || pattern.search("F") > -1
- || pattern.search("K") > -1 || pattern.search("z") > -1 || pattern.search("X") > -1) {
- console.warn("Pattern chars 'G', 'W', 'F', 'K', 'z' and 'X' are not supported: " + pattern);
- pattern = "";
- }
- if (pattern.search("y") > -1) {
- pattern = pattern.replace(/y/g, "y");
- }
- if (pattern.search("M") > -1) {
- pattern = pattern.replace(/M/g, "m");
- }
- if (pattern.search("d") > -1) {
- pattern = pattern.replace(/dd+/g, "dd");
- pattern = pattern.replace(/\bd\b/g, "d");
- }
- return pattern;
- }
- }
-
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
class Config {
static set(key, value) {
this.map.set(key, value);
@@ -3468,6 +3374,7 @@
requiresIfExists: ['preventOverflow']
};
+ var round = Math.round;
var unsetSides = {
top: 'auto',
right: 'auto',
@@ -3483,8 +3390,8 @@
var win = window;
var dpr = win.devicePixelRatio || 1;
return {
- x: Math.round(x * dpr) / dpr || 0,
- y: Math.round(y * dpr) / dpr || 0
+ x: round(round(x * dpr) / dpr) || 0,
+ y: round(round(y * dpr) / dpr) || 0
};
}
@@ -3500,7 +3407,7 @@
adaptive = _ref2.adaptive,
roundOffsets = _ref2.roundOffsets;
- var _ref3 = roundOffsets ? roundOffsetsByDPR(offsets) : offsets,
+ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
_ref3$x = _ref3.x,
x = _ref3$x === void 0 ? 0 : _ref3$x,
_ref3$y = _ref3.y,
@@ -3799,7 +3706,7 @@
}
var scrollParent = getScrollParent(element);
- var isBody = getNodeName(scrollParent) === 'body';
+ var isBody = scrollParent === element.ownerDocument.body;
var win = getWindow(scrollParent);
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
var updatedList = list.concat(target);
@@ -10453,8 +10360,7 @@
}
}
get pattern() {
- const pattern = this.getAttribute("pattern");
- return DateUtils.convertPatternJava2Js(pattern); // todo: to the conversation in Java, not here
+ return this.getAttribute("pattern");
}
get i18n() {
const i18n = this.getAttribute("i18n");
@@ -10675,125 +10581,882 @@
}
});
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- class In extends HTMLElement {
- constructor() {
- super();
- }
- connectedCallback() {
- this.input.addEventListener("focus", Focus.setLastFocusId);
- }
- get input() {
- const rootNode = this.getRootNode();
- return rootNode.getElementById(this.id + "::field");
- }
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
}
- document.addEventListener("tobago.init", function (event) {
- if (window.customElements.get("tobago-in") == null) {
- window.customElements.define("tobago-in", In);
- }
- });
- // XXX regexp example only - blueprint
- class RegExpTest {
- constructor(element) {
- this.element = element;
- this.regexp = new RegExp(this.element.dataset.regexp);
- console.debug("constructor: '%s'", element.id);
- this.element.addEventListener("change", this.checkValue.bind(this));
- }
- static init(element) {
- for (const input of RegExpTest.selfOrElementsByClassName(element, "tobago-in")) { // todo only for data-regexp
- new RegExpTest(input);
- }
+
+ function _defineProperties$1(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+
+ function _createClass$1(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
+ return Constructor;
+ }
+
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ // Polyfill for element.matches, to support Internet Explorer. It's a relatively
+ // simple polyfill, so we'll just include it rather than require the user to
+ // include the polyfill themselves. Adapted from
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
+ var matches = function matches(element, selector) {
+ return element.matches ? element.matches(selector) : element.msMatchesSelector ? element.msMatchesSelector(selector) : element.webkitMatchesSelector ? element.webkitMatchesSelector(selector) : null;
+ };
+
+ // Polyfill for element.closest, to support Internet Explorer. It's a relatively
+
+ var closestPolyfill = function closestPolyfill(el, selector) {
+ var element = el;
+
+ while (element && element.nodeType === 1) {
+ if (matches(element, selector)) {
+ return element;
}
- /**
- * Find all elements (and also self) which have the class "className".
- * @param element Starting element in DOM to collect.
- * @param className Class of elements to find.
- */
- static selfOrElementsByClassName(element, className) {
- const result = new Array();
- if (element.classList.contains(className)) {
- result.push(element);
- }
- const list = element.getElementsByClassName(className);
- for (let i = 0; i < list.length; i++) {
- result.push(list.item(i));
+
+ element = element.parentNode;
+ }
+
+ return null;
+ };
+
+ var closest = function closest(element, selector) {
+ return element.closest ? element.closest(selector) : closestPolyfill(element, selector);
+ };
+
+ // Returns true if the value has a "then" function. Adapted from
+ // https://github.com/graphql/graphql-js/blob/499a75939f70c4863d44149371d6a99d57ff7c35/src/jsutils/isPromise.js
+ var isPromise = function isPromise(value) {
+ return Boolean(value && typeof value.then === 'function');
+ };
+
+ var AutocompleteCore = function AutocompleteCore() {
+ var _this = this;
+
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
+ search = _ref.search,
+ _ref$autoSelect = _ref.autoSelect,
+ autoSelect = _ref$autoSelect === void 0 ? false : _ref$autoSelect,
+ _ref$setValue = _ref.setValue,
+ setValue = _ref$setValue === void 0 ? function () {} : _ref$setValue,
+ _ref$setAttribute = _ref.setAttribute,
+ setAttribute = _ref$setAttribute === void 0 ? function () {} : _ref$setAttribute,
+ _ref$onUpdate = _ref.onUpdate,
+ onUpdate = _ref$onUpdate === void 0 ? function () {} : _ref$onUpdate,
+ _ref$onSubmit = _ref.onSubmit,
+ onSubmit = _ref$onSubmit === void 0 ? function () {} : _ref$onSubmit,
+ _ref$onShow = _ref.onShow,
+ onShow = _ref$onShow === void 0 ? function () {} : _ref$onShow,
+ _ref$onHide = _ref.onHide,
+ onHide = _ref$onHide === void 0 ? function () {} : _ref$onHide,
+ _ref$onLoading = _ref.onLoading,
+ onLoading = _ref$onLoading === void 0 ? function () {} : _ref$onLoading,
+ _ref$onLoaded = _ref.onLoaded,
+ onLoaded = _ref$onLoaded === void 0 ? function () {} : _ref$onLoaded;
+
+ _classCallCheck(this, AutocompleteCore);
+
+ _defineProperty(this, "value", '');
+
+ _defineProperty(this, "searchCounter", 0);
+
+ _defineProperty(this, "results", []);
+
+ _defineProperty(this, "selectedIndex", -1);
+
+ _defineProperty(this, "handleInput", function (event) {
+ var value = event.target.value;
+
+ _this.updateResults(value);
+
+ _this.value = value;
+ });
+
+ _defineProperty(this, "handleKeyDown", function (event) {
+ var key = event.key;
+
+ switch (key) {
+ case 'Up': // IE/Edge
+
+ case 'Down': // IE/Edge
+
+ case 'ArrowUp':
+ case 'ArrowDown':
+ {
+ var selectedIndex = key === 'ArrowUp' || key === 'Up' ? _this.selectedIndex - 1 : _this.selectedIndex + 1;
+ event.preventDefault();
+
+ _this.handleArrows(selectedIndex);
+
+ break;
}
- return result;
- }
- checkValue(event) {
- console.debug("changed: check if '%s' is okay!", this.regexp.toString());
- if (!this.regexp.test(this.element.value)) {
- this.element.classList.add("border-danger");
+
+ case 'Tab':
+ {
+ _this.selectResult();
+
+ break;
}
- else {
- this.element.classList.remove("border-danger");
+
+ case 'Enter':
+ {
+ var selectedResult = _this.results[_this.selectedIndex];
+
+ _this.selectResult();
+
+ _this.onSubmit(selectedResult);
+
+ break;
}
- }
- }
- Listener.register(RegExpTest.init, Phase.DOCUMENT_READY);
- Listener.register(RegExpTest.init, Phase.AFTER_UPDATE);
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- class Messages extends HTMLElement {
- constructor() {
- super();
- }
- connectedCallback() {
- for (let closeButton of this.closeButtons) {
- closeButton.addEventListener("click", this.closeAlert);
+ case 'Esc': // IE/Edge
+
+ case 'Escape':
+ {
+ _this.hideResults();
+
+ _this.setValue();
+
+ break;
}
+
+ default:
+ return;
}
- closeAlert(event) {
- this.closest(".alert").remove();
- }
- get closeButtons() {
- return this.querySelectorAll(".alert button.btn-close");
+ });
+
+ _defineProperty(this, "handleFocus", function (event) {
+ var value = event.target.value;
+
+ _this.updateResults(value);
+
+ _this.value = value;
+ });
+
+ _defineProperty(this, "handleBlur", function () {
+ _this.hideResults();
+ });
+
+ _defineProperty(this, "handleResultMouseDown", function (event) {
+ event.preventDefault();
+ });
+
+ _defineProperty(this, "handleResultClick", function (event) {
+ var target = event.target;
+ var result = closest(target, '[data-result-index]');
+
+ if (result) {
+ _this.selectedIndex = parseInt(result.dataset.resultIndex, 10);
+ var selectedResult = _this.results[_this.selectedIndex];
+
+ _this.selectResult();
+
+ _this.onSubmit(selectedResult);
}
- }
- document.addEventListener("tobago.init", function (event) {
- if (window.customElements.get("tobago-messages") == null) {
- window.customElements.define("tobago-messages", Messages);
+ });
+
+ _defineProperty(this, "handleArrows", function (selectedIndex) {
+ // Loop selectedIndex back to first or last result if out of bounds
+ var resultsCount = _this.results.length;
+ _this.selectedIndex = (selectedIndex % resultsCount + resultsCount) % resultsCount; // Update results and aria attributes
+
+ _this.onUpdate(_this.results, _this.selectedIndex);
+ });
+
+ _defineProperty(this, "selectResult", function () {
+ var selectedResult = _this.results[_this.selectedIndex];
+
+ if (selectedResult) {
+ _this.setValue(selectedResult);
}
- });
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ _this.hideResults();
+ });
+
+ _defineProperty(this, "updateResults", function (value) {
+ var currentSearch = ++_this.searchCounter;
+
+ _this.onLoading();
+
+ _this.search(value).then(function (results) {
+ if (currentSearch !== _this.searchCounter) {
+ return;
+ }
+
+ _this.results = results;
+
+ _this.onLoaded();
+
+ if (_this.results.length === 0) {
+ _this.hideResults();
+
+ return;
+ }
+
+ _this.selectedIndex = _this.autoSelect ? 0 : -1;
+
+ _this.onUpdate(_this.results, _this.selectedIndex);
+
+ _this.showResults();
+ });
+ });
+
+ _defineProperty(this, "showResults", function () {
+ _this.setAttribute('aria-expanded', true);
+
+ _this.onShow();
+ });
+
+ _defineProperty(this, "hideResults", function () {
+ _this.selectedIndex = -1;
+ _this.results = [];
+
+ _this.setAttribute('aria-expanded', false);
+
+ _this.setAttribute('aria-activedescendant', '');
+
+ _this.onUpdate(_this.results, _this.selectedIndex);
+
+ _this.onHide();
+ });
+
+ _defineProperty(this, "checkSelectedResultVisible", function (resultsElement) {
+ var selectedResultElement = resultsElement.querySelector("[data-result-index=\"".concat(_this.selectedIndex, "\"]"));
+
+ if (!selectedResultElement) {
+ return;
+ }
+
+ var resultsPosition = resultsElement.getBoundingClientRect();
+ var selectedPosition = selectedResultElement.getBoundingClientRect();
+
+ if (selectedPosition.top < resultsPosition.top) {
+ // Element is above viewable area
+ resultsElement.scrollTop -= resultsPosition.top - selectedPosition.top;
+ } else if (selectedPosition.bottom > resultsPosition.bottom) {
+ // Element is below viewable area
+ resultsElement.scrollTop += selectedPosition.bottom - resultsPosition.bottom;
+ }
+ });
+
+ this.search = isPromise(search) ? search : function (value) {
+ return Promise.resolve(search(value));
+ };
+ this.autoSelect = autoSelect;
+ this.setValue = setValue;
+ this.setAttribute = setAttribute;
+ this.onUpdate = onUpdate;
+ this.onSubmit = onSubmit;
+ this.onShow = onShow;
+ this.onHide = onHide;
+ this.onLoading = onLoading;
+ this.onLoaded = onLoaded;
+ };
+
+ // Generates a unique ID, with optional prefix. Adapted from
+ // https://github.com/lodash/lodash/blob/61acdd0c295e4447c9c10da04e287b1ebffe452c/uniqueId.js
+ var idCounter = 0;
+
+ var uniqueId = function uniqueId() {
+ var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+ return "".concat(prefix).concat(++idCounter);
+ };
+
+ // Calculates whether element2 should be above or below element1. Always
+ // places element2 below unless all of the following:
+ // 1. There isn't enough visible viewport below to fit element2
+ // 2. There is more room above element1 than there is below
+ // 3. Placing elemen2 above 1 won't overflow window
+ var getRelativePosition = function getRelativePosition(element1, element2) {
+ var position1 = element1.getBoundingClientRect();
+ var position2 = element2.getBoundingClientRect();
+ var positionAbove =
+ /* 1 */
+ position1.bottom + position2.height > window.innerHeight &&
+ /* 2 */
+ window.innerHeight - position1.bottom < position1.top &&
+ /* 3 */
+ window.pageYOffset + position1.top - position2.height > 0;
+ return positionAbove ? 'above' : 'below';
+ };
+
+ // Credit David Walsh (https://davidwalsh.name/javascript-debounce-function)
+ // Returns a function, that, as long as it continues to be invoked, will not
+ // be triggered. The function will be called after it stops being called for
+ // N milliseconds. If `immediate` is passed, trigger the function on the
+ // leading edge, instead of the trailing.
+ var debounce$1 = function debounce(func, wait, immediate) {
+ var timeout;
+ return function executedFunction() {
+ var context = this;
+ var args = arguments;
+
+ var later = function later() {
+ timeout = null;
+ if (!immediate) func.apply(context, args);
+ };
+
+ var callNow = immediate && !timeout;
+ clearTimeout(timeout);
+ timeout = setTimeout(later, wait);
+ if (callNow) func.apply(context, args);
+ };
+ };
+
+ // string in the format: `key1="value1" key2="value2"` for easy use in an HTML string.
+
+ var Props =
+ /*#__PURE__*/
+ function () {
+ function Props(index, selectedIndex, baseClass) {
+ _classCallCheck(this, Props);
+
+ this.id = "".concat(baseClass, "-result-").concat(index);
+ this["class"] = "".concat(baseClass, "-result");
+ this['data-result-index'] = index;
+ this.role = 'option';
+
+ if (index === selectedIndex) {
+ this['aria-selected'] = 'true';
+ }
+ }
+
+ _createClass$1(Props, [{
+ key: "toString",
+ value: function toString() {
+ var _this = this;
+
+ return Object.keys(this).reduce(function (str, key) {
+ return "".concat(str, " ").concat(key, "=\"").concat(_this[key], "\"");
+ }, '');
+ }
+ }]);
+
+ return Props;
+ }();
+
+ var Autocomplete = function Autocomplete(root) {
+ var _this2 = this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ search = _ref.search,
+ _ref$onSubmit = _ref.onSubmit,
+ onSubmit = _ref$onSubmit === void 0 ? function () {} : _ref$onSubmit,
+ _ref$onUpdate = _ref.onUpdate,
+ onUpdate = _ref$onUpdate === void 0 ? function () {} : _ref$onUpdate,
+ _ref$baseClass = _ref.baseClass,
+ baseClass = _ref$baseClass === void 0 ? 'autocomplete' : _ref$baseClass,
+ autoSelect = _ref.autoSelect,
+ _ref$getResultValue = _ref.getResultValue,
+ getResultValue = _ref$getResultValue === void 0 ? function (result) {
+ return result;
+ } : _ref$getResultValue,
+ renderResult = _ref.renderResult,
+ _ref$debounceTime = _ref.debounceTime,
+ debounceTime = _ref$debounceTime === void 0 ? 0 : _ref$debounceTime;
+
+ _classCallCheck(this, Autocomplete);
+
+ _defineProperty(this, "expanded", false);
+
+ _defineProperty(this, "loading", false);
+
+ _defineProperty(this, "position", {});
+
+ _defineProperty(this, "resetPosition", true);
+
+ _defineProperty(this, "initialize", function () {
+ _this2.root.style.position = 'relative';
+
+ _this2.input.setAttribute('role', 'combobox');
+
+ _this2.input.setAttribute('autocomplete', 'off');
+
+ _this2.input.setAttribute('autocapitalize', 'off');
+
+ _this2.input.setAttribute('autocorrect', 'off');
+
+ _this2.input.setAttribute('spellcheck', 'false');
+
+ _this2.input.setAttribute('aria-autocomplete', 'list');
+
+ _this2.input.setAttribute('aria-haspopup', 'listbox');
+
+ _this2.input.setAttribute('aria-expanded', 'false');
+
+ _this2.resultList.setAttribute('role', 'listbox');
+
+ _this2.resultList.style.position = 'absolute';
+ _this2.resultList.style.zIndex = '1';
+ _this2.resultList.style.width = '100%';
+ _this2.resultList.style.boxSizing = 'border-box'; // Generate ID for results list if it doesn't have one
+
+ if (!_this2.resultList.id) {
+ _this2.resultList.id = uniqueId("".concat(_this2.baseClass, "-result-list-"));
+ }
+
+ _this2.input.setAttribute('aria-owns', _this2.resultList.id);
+
+ document.body.addEventListener('click', _this2.handleDocumentClick);
+
+ _this2.input.addEventListener('input', _this2.core.handleInput);
+
+ _this2.input.addEventListener('keydown', _this2.core.handleKeyDown);
+
+ _this2.input.addEventListener('focus', _this2.core.handleFocus);
+
+ _this2.input.addEventListener('blur', _this2.core.handleBlur);
+
+ _this2.resultList.addEventListener('mousedown', _this2.core.handleResultMouseDown);
+
+ _this2.resultList.addEventListener('click', _this2.core.handleResultClick);
+
+ _this2.updateStyle();
+ });
+
+ _defineProperty(this, "setAttribute", function (attribute, value) {
+ _this2.input.setAttribute(attribute, value);
+ });
+
+ _defineProperty(this, "setValue", function (result) {
+ _this2.input.value = result ? _this2.getResultValue(result) : '';
+ });
+
+ _defineProperty(this, "renderResult", function (result, props) {
+ return "<li ".concat(props, ">").concat(_this2.getResultValue(result), "</li>");
+ });
+
+ _defineProperty(this, "handleUpdate", function (results, selectedIndex) {
+ _this2.resultList.innerHTML = '';
+ results.forEach(function (result, index) {
+ var props = new Props(index, selectedIndex, _this2.baseClass);
+
+ var resultHTML = _this2.renderResult(result, props);
+
+ if (typeof resultHTML === 'string') {
+ _this2.resultList.insertAdjacentHTML('beforeend', resultHTML);
+ } else {
+ _this2.resultList.insertAdjacentElement('beforeend', resultHTML);
+ }
+ });
+
+ _this2.input.setAttribute('aria-activedescendant', selectedIndex > -1 ? "".concat(_this2.baseClass, "-result-").concat(selectedIndex) : '');
+
+ if (_this2.resetPosition) {
+ _this2.resetPosition = false;
+ _this2.position = getRelativePosition(_this2.input, _this2.resultList);
+
+ _this2.updateStyle();
+ }
+
+ _this2.core.checkSelectedResultVisible(_this2.resultList);
+
+ _this2.onUpdate(results, selectedIndex);
+ });
+
+ _defineProperty(this, "handleShow", function () {
+ _this2.expanded = true;
+
+ _this2.updateStyle();
+ });
+
+ _defineProperty(this, "handleHide", function () {
+ _this2.expanded = false;
+ _this2.resetPosition = true;
+
+ _this2.updateStyle();
+ });
+
+ _defineProperty(this, "handleLoading", function () {
+ _this2.loading = true;
+
+ _this2.updateStyle();
+ });
+
+ _defineProperty(this, "handleLoaded", function () {
+ _this2.loading = false;
+
+ _this2.updateStyle();
+ });
+
+ _defineProperty(this, "handleDocumentClick", function (event) {
+ if (_this2.root.contains(event.target)) {
+ return;
+ }
+
+ _this2.core.hideResults();
+ });
+
+ _defineProperty(this, "updateStyle", function () {
+ _this2.root.dataset.expanded = _this2.expanded;
+ _this2.root.dataset.loading = _this2.loading;
+ _this2.root.dataset.position = _this2.position;
+ _this2.resultList.style.visibility = _this2.expanded ? 'visible' : 'hidden';
+ _this2.resultList.style.pointerEvents = _this2.expanded ? 'auto' : 'none';
+
+ if (_this2.position === 'below') {
+ _this2.resultList.style.bottom = null;
+ _this2.resultList.style.top = '100%';
+ } else {
+ _this2.resultList.style.top = null;
+ _this2.resultList.style.bottom = '100%';
+ }
+ });
+
+ this.root = typeof root === 'string' ? document.querySelector(root) : root;
+ this.input = this.root.querySelector('input');
+ this.resultList = this.root.querySelector('ul');
+ this.baseClass = baseClass;
+ this.getResultValue = getResultValue;
+ this.onUpdate = onUpdate;
+
+ if (typeof renderResult === 'function') {
+ this.renderResult = renderResult;
+ }
+
+ var core = new AutocompleteCore({
+ search: search,
+ autoSelect: autoSelect,
+ setValue: this.setValue,
+ setAttribute: this.setAttribute,
+ onUpdate: this.handleUpdate,
+ onSubmit: onSubmit,
+ onShow: this.handleShow,
+ onHide: this.handleHide,
+ onLoading: this.handleLoading,
+ onLoaded: this.handleLoaded
+ });
+
+ if (debounceTime > 0) {
+ core.handleInput = debounce$1(core.handleInput, debounceTime);
+ }
+
+ this.core = core;
+ this.initialize();
+ } // Set up aria attributes and events
+ ;
+
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ class Suggest {
+ constructor(tobagoIn) {
+ this.tobagoIn = tobagoIn;
+ }
+ init() {
+ if (!this.suggest) {
+ console.warn("[tobago-suggest] could not find tobago-suggest");
+ return;
+ }
+ this.registerAjaxListener();
+ this.base.classList.add("autocomplete");
+ this.base.insertAdjacentHTML("afterbegin", `<div class="autocomplete-pseudo-container"></div>`);
+ this.suggestInput.classList.add("autocomplete-input");
+ this.suggestInput.insertAdjacentHTML("afterend", `<ul class="autocomplete-result-list"></ul>`);
+ const options = {
+ search: input => {
+ console.debug("[tobago-suggest] input = '" + input + "'");
+ const minChars = this.minChars ? this.minChars : 1;
+ if (input.length < minChars) {
+ return [];
+ }
+ this.hiddenInput.value = input.toLowerCase();
+ this.positioningSpinner();
+ return new Promise(resolve => {
+ if (input.length < 1) {
+ return resolve([]);
+ }
+ if (this.update) {
+ this.resolve = resolve;
+ const suggestId = this.suggest.id;
+ jsf.ajax.request(suggestId, null, {
+ "javax.faces.behavior.event": "suggest",
+ execute: suggestId,
+ render: suggestId
+ });
+ }
+ else {
+ return resolve(this.filterItems());
+ }
+ });
+ },
+ onUpdate: (results, selectedIndex) => {
+ this.positioningResultList();
+ this.setResultListMaxHeight();
+ },
+ debounceTime: this.delay
+ };
+ new Autocomplete(this.base, options);
+ if (!this.localMenu) {
+ this.menuStore.append(this.resultList);
+ }
+ }
+ registerAjaxListener() {
+ jsf.ajax.addOnEvent(this.resolvePromise.bind(this));
+ }
+ resolvePromise(event) {
+ if (event.source === this.suggest && event.status === "success") {
+ return this.resolve(this.filterItems());
+ }
+ }
+ filterItems() {
+ return this.items.filter(item => {
+ return item.toLowerCase().indexOf(this.hiddenInput.value) > -1;
+ });
+ }
+ positioningSpinner() {
+ const baseRect = this.base.getBoundingClientRect();
+ const suggestInputRect = this.suggestInput.getBoundingClientRect();
+ const suggestInputStyle = getComputedStyle(this.suggestInput);
+ this.pseudoContainer.style.left = suggestInputRect.x - baseRect.x + suggestInputRect.width
+ - parseFloat(getComputedStyle(this.pseudoContainer, ":after").width)
+ - parseFloat(suggestInputStyle.marginRight)
+ - parseFloat(suggestInputStyle.borderRight)
+ - parseFloat(suggestInputStyle.paddingRight) + "px";
+ this.pseudoContainer.style.top = suggestInputRect.y - baseRect.y + (suggestInputRect.height / 2) + "px";
+ }
+ positioningResultList() {
+ const space = 2;
+ if (this.localMenu) {
+ const parentRect = this.suggestInput.parentElement.getBoundingClientRect();
+ const suggestInputRect = this.suggestInput.getBoundingClientRect();
+ this.resultList.style.marginLeft = (suggestInputRect.x - parentRect.x) + "px";
+ this.resultList.style.maxWidth = suggestInputRect.width + "px";
+ this.resultList.style.marginTop = space + "px";
+ this.resultList.style.marginBottom = space + "px";
+ }
+ else {
+ const suggestInputRect = this.suggestInput.getBoundingClientRect();
+ this.resultList.style.minWidth = suggestInputRect.width + "px";
+ this.resultList.style.left = suggestInputRect.left + "px";
+ if (this.resultListPosition === "below") {
+ this.resultList.style.marginTop =
+ window.scrollY + suggestInputRect.top + suggestInputRect.height + space + "px";
+ this.resultList.style.marginBottom = null;
+ }
+ else if (this.resultListPosition === "above") {
+ this.resultList.style.marginTop = null;
+ this.resultList.style.marginBottom = -(window.scrollY + suggestInputRect.top - space) + "px";
+ }
+ }
+ }
+ setResultListMaxHeight() {
+ const resultListEntry = this.resultList.querySelector(".autocomplete-result");
+ if (this.maxItems && resultListEntry) {
+ const resultListStyle = getComputedStyle(this.resultList);
+ this.resultList.style.maxHeight = (parseFloat(resultListStyle.borderTop)
+ + parseFloat(resultListStyle.paddingTop)
+ + (this.maxItems * parseFloat(getComputedStyle(resultListEntry).height))
+ + parseFloat(resultListStyle.paddingBottom)
+ + parseFloat(resultListStyle.borderBottom)) + "px";
+ }
+ }
+ get base() {
+ return this.tobagoIn;
+ }
+ get pseudoContainer() {
+ return this.base.querySelector(":scope > .autocomplete-pseudo-container");
+ }
+ get suggestInput() {
+ const root = this.base.getRootNode();
+ return root.getElementById(this.suggest.getAttribute("for"));
+ }
+ get suggest() {
+ return this.base.querySelector("tobago-suggest");
+ }
+ get hiddenInput() {
+ return this.suggest.querySelector(":scope > input[type=hidden]");
+ }
+ get items() {
+ return JSON.parse(this.suggest.getAttribute("items"));
+ }
+ get resultList() {
+ const root = this.base.getRootNode();
+ const resultListId = this.suggestInput.getAttribute("aria-owns");
+ return root.getElementById(resultListId);
+ }
+ get resultListPosition() {
+ return this.base.dataset.position;
+ }
+ get menuStore() {
+ const root = this.base.getRootNode();
+ return root.querySelector(".tobago-page-menuStore");
+ }
+ get update() {
+ return this.suggest.getAttribute("update") !== null;
+ }
+ get delay() {
+ return parseInt(this.suggest.getAttribute("delay"));
+ }
+ get maxItems() {
+ return parseInt(this.suggest.getAttribute("max-items"));
+ }
+ get minChars() {
+ return parseInt(this.suggest.getAttribute("min-chars"));
+ }
+ get localMenu() {
+ return this.suggest.getAttribute("local-menu") !== null;
+ }
+ }
+
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ class In extends HTMLElement {
+ constructor() {
+ super();
+ }
+ connectedCallback() {
+ this.input.addEventListener("focus", Focus.setLastFocusId);
+ if (this.querySelector("tobago-suggest")) {
+ const suggest = new Suggest(this);
+ suggest.init();
+ }
+ }
+ get input() {
+ const rootNode = this.getRootNode();
+ return rootNode.getElementById(this.id + "::field");
+ }
+ }
+ document.addEventListener("tobago.init", function (event) {
+ if (window.customElements.get("tobago-in") == null) {
+ window.customElements.define("tobago-in", In);
+ }
+ });
+ // XXX regexp example only - blueprint
+ class RegExpTest {
+ constructor(element) {
+ this.element = element;
+ this.regexp = new RegExp(this.element.dataset.regexp);
+ console.debug("constructor: '%s'", element.id);
+ this.element.addEventListener("change", this.checkValue.bind(this));
+ }
+ static init(element) {
+ for (const input of RegExpTest.selfOrElementsByClassName(element, "tobago-in")) { // todo only for data-regexp
+ new RegExpTest(input);
+ }
+ }
+ /**
+ * Find all elements (and also self) which have the class "className".
+ * @param element Starting element in DOM to collect.
+ * @param className Class of elements to find.
+ */
+ static selfOrElementsByClassName(element, className) {
+ const result = new Array();
+ if (element.classList.contains(className)) {
+ result.push(element);
+ }
+ const list = element.getElementsByClassName(className);
+ for (let i = 0; i < list.length; i++) {
+ result.push(list.item(i));
+ }
+ return result;
+ }
+ checkValue(event) {
+ console.debug("changed: check if '%s' is okay!", this.regexp.toString());
+ if (!this.regexp.test(this.element.value)) {
+ this.element.classList.add("border-danger");
+ }
+ else {
+ this.element.classList.remove("border-danger");
+ }
+ }
+ }
+ Listener.register(RegExpTest.init, Phase.DOCUMENT_READY);
+ Listener.register(RegExpTest.init, Phase.AFTER_UPDATE);
+
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ class Messages extends HTMLElement {
+ constructor() {
+ super();
+ }
+ connectedCallback() {
+ for (let closeButton of this.closeButtons) {
+ closeButton.addEventListener("click", this.closeAlert);
+ }
+ }
+ closeAlert(event) {
+ this.closest(".alert").remove();
+ }
+ get closeButtons() {
+ return this.querySelectorAll(".alert button.btn-close");
+ }
+ }
+ document.addEventListener("tobago.init", function (event) {
+ if (window.customElements.get("tobago-messages") == null) {
+ window.customElements.define("tobago-messages", Messages);
+ }
+ });
+
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@@ -12412,528 +13075,6 @@
window.customElements.define("tobago-stars", Stars);
});
- // Polyfill for element.matches, to support Internet Explorer. It's a relatively
- // simple polyfill, so we'll just include it rather than require the user to
- // include the polyfill themselves. Adapted from
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
- const matches = (element, selector) => {
- return element.matches
- ? element.matches(selector)
- : element.msMatchesSelector
- ? element.msMatchesSelector(selector)
- : element.webkitMatchesSelector
- ? element.webkitMatchesSelector(selector)
- : null
- };
-
- // Polyfill for element.closest, to support Internet Explorer. It's a relatively
-
- const closestPolyfill = (el, selector) => {
- let element = el;
- while (element && element.nodeType === 1) {
- if (matches(element, selector)) {
- return element
- }
- element = element.parentNode;
- }
- return null
- };
-
- const closest = (element, selector) => {
- return element.closest
- ? element.closest(selector)
- : closestPolyfill(element, selector)
- };
-
- // Returns true if the value has a "then" function. Adapted from
- // https://github.com/graphql/graphql-js/blob/499a75939f70c4863d44149371d6a99d57ff7c35/src/jsutils/isPromise.js
- const isPromise = value => Boolean(value && typeof value.then === 'function');
-
- class AutocompleteCore {
- value = ''
- searchCounter = 0
- results = []
- selectedIndex = -1
-
- constructor({
- search,
- autoSelect = false,
- setValue = () => {},
- setAttribute = () => {},
- onUpdate = () => {},
- onSubmit = () => {},
- onShow = () => {},
- onHide = () => {},
- onLoading = () => {},
- onLoaded = () => {},
- } = {}) {
- this.search = isPromise(search)
- ? search
- : value => Promise.resolve(search(value));
- this.autoSelect = autoSelect;
- this.setValue = setValue;
- this.setAttribute = setAttribute;
- this.onUpdate = onUpdate;
- this.onSubmit = onSubmit;
- this.onShow = onShow;
- this.onHide = onHide;
- this.onLoading = onLoading;
- this.onLoaded = onLoaded;
- }
-
- handleInput = event => {
- const { value } = event.target;
- this.updateResults(value);
- this.value = value;
- }
-
- handleKeyDown = event => {
- const { key } = event;
-
- switch (key) {
- case 'Up': // IE/Edge
- case 'Down': // IE/Edge
- case 'ArrowUp':
- case 'ArrowDown': {
- const selectedIndex =
- key === 'ArrowUp' || key === 'Up'
- ? this.selectedIndex - 1
- : this.selectedIndex + 1;
- event.preventDefault();
- this.handleArrows(selectedIndex);
- break
- }
- case 'Tab': {
- this.selectResult();
- break
- }
- case 'Enter': {
- const selectedResult = this.results[this.selectedIndex];
- this.selectResult();
- this.onSubmit(selectedResult);
- break
- }
- case 'Esc': // IE/Edge
- case 'Escape': {
- this.hideResults();
- this.setValue();
- break
- }
- default:
- return
- }
- }
-
- handleFocus = event => {
- const { value } = event.target;
- this.updateResults(value);
- this.value = value;
- }
-
- handleBlur = () => {
- this.hideResults();
- }
-
- // The mousedown event fires before the blur event. Calling preventDefault() when
- // the results list is clicked will prevent it from taking focus, firing the
- // blur event on the input element, and closing the results list before click fires.
- handleResultMouseDown = event => {
- event.preventDefault();
- }
-
- handleResultClick = event => {
- const { target } = event;
- const result = closest(target, '[data-result-index]');
- if (result) {
- this.selectedIndex = parseInt(result.dataset.resultIndex, 10);
- const selectedResult = this.results[this.selectedIndex];
- this.selectResult();
- this.onSubmit(selectedResult);
- }
- }
-
- handleArrows = selectedIndex => {
- // Loop selectedIndex back to first or last result if out of bounds
- const resultsCount = this.results.length;
- this.selectedIndex =
- ((selectedIndex % resultsCount) + resultsCount) % resultsCount;
-
- // Update results and aria attributes
- this.onUpdate(this.results, this.selectedIndex);
- }
-
- selectResult = () => {
- const selectedResult = this.results[this.selectedIndex];
- if (selectedResult) {
- this.setValue(selectedResult);
- }
- this.hideResults();
- }
-
- updateResults = value => {
- const currentSearch = ++this.searchCounter;
- this.onLoading();
- this.search(value).then(results => {
- if (currentSearch !== this.searchCounter) {
- return
- }
- this.results = results;
- this.onLoaded();
-
- if (this.results.length === 0) {
- this.hideResults();
- return
- }
-
- this.selectedIndex = this.autoSelect ? 0 : -1;
- this.onUpdate(this.results, this.selectedIndex);
- this.showResults();
- });
- }
-
- showResults = () => {
- this.setAttribute('aria-expanded', true);
- this.onShow();
- }
-
- hideResults = () => {
- this.selectedIndex = -1;
- this.results = [];
- this.setAttribute('aria-expanded', false);
- this.setAttribute('aria-activedescendant', '');
- this.onUpdate(this.results, this.selectedIndex);
- this.onHide();
- }
-
- // Make sure selected result isn't scrolled out of view
- checkSelectedResultVisible = resultsElement => {
- const selectedResultElement = resultsElement.querySelector(
- `[data-result-index="${this.selectedIndex}"]`
- );
- if (!selectedResultElement) {
- return
- }
-
- const resultsPosition = resultsElement.getBoundingClientRect();
- const selectedPosition = selectedResultElement.getBoundingClientRect();
-
- if (selectedPosition.top < resultsPosition.top) {
- // Element is above viewable area
- resultsElement.scrollTop -= resultsPosition.top - selectedPosition.top;
- } else if (selectedPosition.bottom > resultsPosition.bottom) {
- // Element is below viewable area
- resultsElement.scrollTop +=
- selectedPosition.bottom - resultsPosition.bottom;
- }
- }
- }
-
- // Generates a unique ID, with optional prefix. Adapted from
- // https://github.com/lodash/lodash/blob/61acdd0c295e4447c9c10da04e287b1ebffe452c/uniqueId.js
- let idCounter = 0;
- const uniqueId = (prefix = '') => `${prefix}${++idCounter}`;
-
- // Calculates whether element2 should be above or below element1. Always
- // places element2 below unless all of the following:
- // 1. There isn't enough visible viewport below to fit element2
- // 2. There is more room above element1 than there is below
- // 3. Placing elemen2 above 1 won't overflow window
- const getRelativePosition = (element1, element2) => {
- const position1 = element1.getBoundingClientRect();
- const position2 = element2.getBoundingClientRect();
-
- const positionAbove =
- /* 1 */ position1.bottom + position2.height > window.innerHeight &&
- /* 2 */ window.innerHeight - position1.bottom < position1.top &&
- /* 3 */ window.pageYOffset + position1.top - position2.height > 0;
-
- return positionAbove ? 'above' : 'below'
- };
-
- // Credit David Walsh (https://davidwalsh.name/javascript-debounce-function)
-
- // Returns a function, that, as long as it continues to be invoked, will not
- // be triggered. The function will be called after it stops being called for
- // N milliseconds. If `immediate` is passed, trigger the function on the
- // leading edge, instead of the trailing.
- const debounce$1 = (func, wait, immediate) => {
- let timeout;
-
- return function executedFunction() {
- const context = this;
- const args = arguments;
-
- const later = function() {
- timeout = null;
- if (!immediate) func.apply(context, args);
- };
-
- const callNow = immediate && !timeout;
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
-
- if (callNow) func.apply(context, args);
- }
- };
-
- // Creates a props object with overridden toString function. toString returns an attributes
- // string in the format: `key1="value1" key2="value2"` for easy use in an HTML string.
- class Props {
- constructor(index, selectedIndex, baseClass) {
- this.id = `${baseClass}-result-${index}`;
- this.class = `${baseClass}-result`;
- this['data-result-index'] = index;
- this.role = 'option';
- if (index === selectedIndex) {
- this['aria-selected'] = 'true';
- }
- }
-
- toString() {
- return Object.keys(this).reduce(
- (str, key) => `${str} ${key}="${this[key]}"`,
- ''
- )
- }
- }
-
- class Autocomplete {
- expanded = false
- loading = false
- position = {}
- resetPosition = true
-
- constructor(
- root,
- {
- search,
- onSubmit = () => {},
- onUpdate = () => {},
- baseClass = 'autocomplete',
- autoSelect,
- getResultValue = result => result,
- renderResult,
- debounceTime = 0,
- } = {}
- ) {
- this.root = typeof root === 'string' ? document.querySelector(root) : root;
- this.input = this.root.querySelector('input');
- this.resultList = this.root.querySelector('ul');
- this.baseClass = baseClass;
- this.getResultValue = getResultValue;
- this.onUpdate = onUpdate;
- if (typeof renderResult === 'function') {
- this.renderResult = renderResult;
- }
-
- const core = new AutocompleteCore({
- search,
- autoSelect,
- setValue: this.setValue,
- setAttribute: this.setAttribute,
- onUpdate: this.handleUpdate,
- onSubmit,
- onShow: this.handleShow,
- onHide: this.handleHide,
- onLoading: this.handleLoading,
- onLoaded: this.handleLoaded,
- });
- if (debounceTime > 0) {
- core.handleInput = debounce$1(core.handleInput, debounceTime);
- }
- this.core = core;
-
- this.initialize();
- }
-
- // Set up aria attributes and events
- initialize = () => {
- this.root.style.position = 'relative';
-
- this.input.setAttribute('role', 'combobox');
- this.input.setAttribute('autocomplete', 'off');
- this.input.setAttribute('autocapitalize', 'off');
- this.input.setAttribute('autocorrect', 'off');
- this.input.setAttribute('spellcheck', 'false');
- this.input.setAttribute('aria-autocomplete', 'list');
- this.input.setAttribute('aria-haspopup', 'listbox');
- this.input.setAttribute('aria-expanded', 'false');
-
- this.resultList.setAttribute('role', 'listbox');
- this.resultList.style.position = 'absolute';
- this.resultList.style.zIndex = '1';
- this.resultList.style.width = '100%';
- this.resultList.style.boxSizing = 'border-box';
-
- // Generate ID for results list if it doesn't have one
- if (!this.resultList.id) {
- this.resultList.id = uniqueId(`${this.baseClass}-result-list-`);
- }
- this.input.setAttribute('aria-owns', this.resultList.id);
-
- document.body.addEventListener('click', this.handleDocumentClick);
- this.input.addEventListener('input', this.core.handleInput);
- this.input.addEventListener('keydown', this.core.handleKeyDown);
- this.input.addEventListener('focus', this.core.handleFocus);
- this.input.addEventListener('blur', this.core.handleBlur);
- this.resultList.addEventListener(
- 'mousedown',
- this.core.handleResultMouseDown
- );
- this.resultList.addEventListener('click', this.core.handleResultClick);
- this.updateStyle();
- }
-
- setAttribute = (attribute, value) => {
- this.input.setAttribute(attribute, value);
- }
-
- setValue = result => {
- this.input.value = result ? this.getResultValue(result) : '';
- }
-
- renderResult = (result, props) =>
- `<li ${props}>${this.getResultValue(result)}</li>`
-
- handleUpdate = (results, selectedIndex) => {
- this.resultList.innerHTML = '';
- results.forEach((result, index) => {
- const props = new Props(index, selectedIndex, this.baseClass);
- const resultHTML = this.renderResult(result, props);
- if (typeof resultHTML === 'string') {
- this.resultList.insertAdjacentHTML('beforeend', resultHTML);
- } else {
- this.resultList.insertAdjacentElement('beforeend', resultHTML);
- }
- });
-
- this.input.setAttribute(
- 'aria-activedescendant',
- selectedIndex > -1 ? `${this.baseClass}-result-${selectedIndex}` : ''
- );
-
- if (this.resetPosition) {
- this.resetPosition = false;
- this.position = getRelativePosition(this.input, this.resultList);
- this.updateStyle();
- }
- this.core.checkSelectedResultVisible(this.resultList);
- this.onUpdate(results, selectedIndex);
- }
-
- handleShow = () => {
- this.expanded = true;
- this.updateStyle();
- }
-
- handleHide = () => {
- this.expanded = false;
- this.resetPosition = true;
- this.updateStyle();
- }
-
- handleLoading = () => {
- this.loading = true;
- this.updateStyle();
- }
-
- handleLoaded = () => {
- this.loading = false;
- this.updateStyle();
- }
-
- handleDocumentClick = event => {
- if (this.root.contains(event.target)) {
- return
- }
- this.core.hideResults();
- }
-
- updateStyle = () => {
- this.root.dataset.expanded = this.expanded;
- this.root.dataset.loading = this.loading;
- this.root.dataset.position = this.position;
-
- this.resultList.style.visibility = this.expanded ? 'visible' : 'hidden';
- this.resultList.style.pointerEvents = this.expanded ? 'auto' : 'none';
- if (this.position === 'below') {
- this.resultList.style.bottom = null;
- this.resultList.style.top = '100%';
- } else {
- this.resultList.style.top = null;
- this.resultList.style.bottom = '100%';
- }
- }
- }
-
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- class Suggest extends HTMLElement {
- constructor() {
- super();
- }
- get hiddenInput() {
- return this.querySelector(":scope > input[type=hidden]");
- }
- get suggestInput() {
- const root = this.getRootNode();
- return root.getElementById(this.for);
- }
- get base() {
- return this.suggestInput.closest("tobago-in");
- }
- get for() {
- return this.getAttribute("for");
- }
- set for(forValue) {
- this.setAttribute("for", forValue);
- }
- get items() {
- return JSON.parse(this.getAttribute("items"));
- }
- connectedCallback() {
- console.log("* autocomplete init *********************************************************************");
- this.base.classList.add("autocomplete");
- this.suggestInput.classList.add("autocomplete-input");
- this.suggestInput.insertAdjacentHTML("afterend", `<ul class="autocomplete-result-list"></ul>`);
- const options = {
- search: input => {
- console.debug("input = '" + input + "'");
- if (input.length < 1) {
- return [];
- }
- const inputLower = input.toLowerCase();
- let strings = this.items.filter(country => {
- return country.toLowerCase().startsWith(inputLower);
- });
- console.debug("out = '" + strings + "'");
- return strings;
- }
- };
- this.autocomplete = new Autocomplete(this.base, options);
- console.log(this.autocomplete);
- }
- }
- document.addEventListener("tobago.init", function (event) {
- if (window.customElements.get("tobago-suggest") == null) {
- window.customElements.define("tobago-suggest", Suggest);
- }
- });
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
diff --git a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js.map b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js.map
index 3dc0052..3f5c87e 100644
--- a/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js.map
+++ b/tobago-theme/tobago-theme-standard/npm/dist/js/tobago.js.map
@@ -1 +1 @@
-{"version":3,"file":"tobago.js","sources":["tobago-listener.js","tobago-utils.js","tobago-bar.js","tobago-dropdown.js","../../node_modules/vanillajs-datepicker/js/lib/utils.js","../../node_modules/vanillajs-datepicker/js/lib/date.js","../../node_modules/vanillajs-datepicker/js/lib/date-format.js","../../node_modules/vanillajs-datepicker/js/lib/event.js","../../node_modules/vanillajs-datepicker/js/i18n/base-locales.js","../../node_modules/vanillajs-datepicker/js/options/defaultOptions.js" [...]
\ No newline at end of file
+{"version":3,"file":"tobago.js","sources":["tobago-listener.js","tobago-utils.js","tobago-bar.js","tobago-dropdown.js","../../node_modules/vanillajs-datepicker/js/lib/utils.js","../../node_modules/vanillajs-datepicker/js/lib/date.js","../../node_modules/vanillajs-datepicker/js/lib/date-format.js","../../node_modules/vanillajs-datepicker/js/lib/event.js","../../node_modules/vanillajs-datepicker/js/i18n/base-locales.js","../../node_modules/vanillajs-datepicker/js/options/defaultOptions.js" [...]
\ No newline at end of file