@ucd-lib/theme-elements 3.0.5 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/brand/ucd-theme-quick-links/ucd-theme-quick-links.js +11 -0
- package/brand/ucd-theme-quick-links/ucd-theme-quick-links.tpl.js +6 -5
- package/brand/ucd-theme-search-form/ucd-theme-search-form.js +6 -3
- package/brand/ucd-theme-search-form/ucd-theme-search-form.tpl.js +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,8 @@ import { MutationObserverController, WaitController } from '../../utils/controll
|
|
|
17
17
|
* @property {Boolean} opened - Menu is open
|
|
18
18
|
* @property {Number} animationDuration - Length of animation when opening/closing menu
|
|
19
19
|
* @property {Boolean} useIcon - Show a custom icon next to the title
|
|
20
|
+
* @property {String} href - URL to navigate to when the button is clicked. Disables dropdown.
|
|
21
|
+
* @property {Boolean} disableDropdown - Disables dropdown functionality. Fires btn-click event instead.
|
|
20
22
|
*/
|
|
21
23
|
export default class UcdThemeQuickLinks extends LitElement {
|
|
22
24
|
|
|
@@ -27,6 +29,8 @@ export default class UcdThemeQuickLinks extends LitElement {
|
|
|
27
29
|
opened: {type: Boolean},
|
|
28
30
|
animationDuration: {type: Number, attribute: "animation-duration"},
|
|
29
31
|
useIcon: {type: Boolean, attribute: "use-icon"},
|
|
32
|
+
href: {type: String},
|
|
33
|
+
disableDropdown: {type: Boolean, attribute: "disable-dropdown"},
|
|
30
34
|
_links: {type: Array, state: true},
|
|
31
35
|
_hasCustomIcons: {type: Boolean, state: true},
|
|
32
36
|
_transitioning: {type: Boolean, state: true},
|
|
@@ -143,6 +147,13 @@ export default class UcdThemeQuickLinks extends LitElement {
|
|
|
143
147
|
* @description Attached to menu open/close button
|
|
144
148
|
*/
|
|
145
149
|
async _onBtnClick(){
|
|
150
|
+
if ( this.href ){
|
|
151
|
+
window.location.href = this.href;
|
|
152
|
+
return;
|
|
153
|
+
} else if ( this.disableDropdown ) {
|
|
154
|
+
this.dispatchEvent(new CustomEvent('btn-click'));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
146
157
|
let didToggle;
|
|
147
158
|
if ( this.opened ) {
|
|
148
159
|
didToggle = await this.close();
|
|
@@ -62,22 +62,23 @@ export function styles() {
|
|
|
62
62
|
padding: 0px;
|
|
63
63
|
border: 0px;
|
|
64
64
|
border-radius: 50%;
|
|
65
|
-
background-color: #ffbf00;
|
|
65
|
+
background-color: var(--ucd-theme-quick-links-icon-bg-color, #ffbf00);
|
|
66
66
|
background-size: 50%;
|
|
67
|
-
color: rgb(255, 255, 255);
|
|
68
67
|
text-indent: inherit;
|
|
69
68
|
margin-left: .75rem;
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
.quick-links__title.show-icon .custom-icon ::slotted(svg) {
|
|
73
|
-
fill:
|
|
72
|
+
fill: var(--ucd-theme-quick-links-icon-color, #fff);
|
|
74
73
|
height: 65%;
|
|
75
74
|
width: 65%;
|
|
76
75
|
margin: 0 auto;
|
|
77
76
|
}
|
|
78
|
-
|
|
79
77
|
.quick-links__title.show-icon:hover .custom-icon, .quick-links__title.show-icon:focus .custom-icon {
|
|
80
|
-
background-color: #13639e;
|
|
78
|
+
background-color: var(--ucd-theme-quick-links-icon-bg-color-hover, #13639e);
|
|
79
|
+
}
|
|
80
|
+
.quick-links__title.show-icon:hover .custom-icon ::slotted(svg), .quick-links__title.show-icon:focus .custom-icon ::slotted(svg) {
|
|
81
|
+
fill: var(--ucd-theme-quick-links-icon-color-hover, #fff);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
.quick-links__title.show-icon {
|
|
@@ -29,7 +29,8 @@ export default class UcdThemeSearchForm extends LitElement {
|
|
|
29
29
|
formClass: {type: String, attribute: "form-class"},
|
|
30
30
|
labelText: {type: String, attribute: "label-text"},
|
|
31
31
|
inputClass: {type: String, attribute: "input-class"},
|
|
32
|
-
queryParam: {type: String, attribute: "query-param"}
|
|
32
|
+
queryParam: {type: String, attribute: "query-param"},
|
|
33
|
+
clearOnSearch: {type: Boolean, attribute: "clear-on-search"}
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -48,6 +49,7 @@ export default class UcdThemeSearchForm extends LitElement {
|
|
|
48
49
|
this.inputClass = "";
|
|
49
50
|
this.value = "";
|
|
50
51
|
this.queryParam = "searchterm";
|
|
52
|
+
this.clearOnSearch = false;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
/**
|
|
@@ -87,10 +89,11 @@ export default class UcdThemeSearchForm extends LitElement {
|
|
|
87
89
|
},
|
|
88
90
|
bubbles: true,
|
|
89
91
|
composed: true });
|
|
90
|
-
|
|
92
|
+
|
|
91
93
|
this.dispatchEvent(e);
|
|
92
|
-
}
|
|
93
94
|
|
|
95
|
+
if( this.clearOnSearch ) this.value = '';
|
|
96
|
+
}
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
customElements.define('ucd-theme-search-form', UcdThemeSearchForm);
|