@ucd-lib/theme-elements 0.0.8 → 0.0.11
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-brand-textbox/ucd-theme-brand-textbox.js +60 -0
- package/brand/ucd-theme-brand-textbox/ucd-theme-brand-textbox.tpl.js +40 -0
- package/brand/ucd-theme-breadcrumbs/ucd-theme-breadcrumbs.js +28 -0
- package/brand/ucd-theme-breadcrumbs/ucd-theme-breadcrumbs.tpl.js +24 -0
- package/brand/ucd-theme-focal-link/ucd-theme-focal-link.js +28 -0
- package/brand/ucd-theme-focal-link/ucd-theme-focal-link.tpl.js +25 -0
- package/brand/ucd-theme-header/ucd-theme-header.js +47 -3
- package/brand/ucd-theme-list-accordion/ucd-theme-list-accordion.js +14 -25
- package/brand/ucd-theme-list-accordion/ucd-theme-list-accordion.tpl.js +0 -2
- package/package.json +1 -1
- package/ucdlib/ucdlib-icons/editor.js +305 -0
- package/ucdlib/ucdlib-icons/utils.js +3 -2
- package/ucdlib/ucdlib-iconset/ucdlib-iconset.js +14 -0
- package/ucdlib/ucdlib-sils-search-redirect/ucdlib-sils-search-redirect.js +138 -0
- package/ucdlib/ucdlib-sils-search-redirect/ucdlib-sils-search-redirect.tpl.js +108 -0
- package/utils/controllers/index.js +5 -0
- package/utils/controllers/popstate-observer.js +51 -0
- package/utils/controllers/sils-primo.js +124 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import {render, styles} from "./ucd-theme-brand-textbox.tpl.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @class UcdThemeBrandTextbox
|
|
6
|
+
* @classdesc Component class for displaying a collapsible content in a colored box
|
|
7
|
+
* Pattern Lab Url:
|
|
8
|
+
* - http://dev.webstyleguide.ucdavis.edu/redesign/?p=organisms-branding-textbox-collapse
|
|
9
|
+
* @property {String} brandColor - A UCD brand color slug
|
|
10
|
+
* @property {Boolean} collapsible - Content can be collapsed/expanded
|
|
11
|
+
* @property {Boolean} collapsed - Content is collapsed
|
|
12
|
+
*
|
|
13
|
+
* @examples
|
|
14
|
+
* <ucd-theme-brand-textbox collapsible brand-color="primary">
|
|
15
|
+
* <p>hello world!</p>
|
|
16
|
+
* </ucd-theme-brand-textbox>
|
|
17
|
+
*/
|
|
18
|
+
export default class UcdThemeBrandTextbox extends LitElement {
|
|
19
|
+
|
|
20
|
+
static get properties() {
|
|
21
|
+
return {
|
|
22
|
+
brandColor: {type: String, attribute: 'brand-color'},
|
|
23
|
+
collapsible: {type: Boolean},
|
|
24
|
+
collapsed: {type: Boolean, reflect: true}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static get styles() {
|
|
29
|
+
return styles();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
this.collapsible = false;
|
|
35
|
+
this.collapsed = false;
|
|
36
|
+
this.brandColor = "";
|
|
37
|
+
this.render = render.bind(this);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @method _getBaseClasses
|
|
42
|
+
* @description Returns CSS classes for this element's first child
|
|
43
|
+
* @private
|
|
44
|
+
* @returns {Object}
|
|
45
|
+
*/
|
|
46
|
+
_getBaseClasses(){
|
|
47
|
+
const out = {
|
|
48
|
+
"brand-textbox": true,
|
|
49
|
+
"category-brand__background": true,
|
|
50
|
+
};
|
|
51
|
+
out[`category-brand--${this.brandColor}`] = this.brandColor;
|
|
52
|
+
out['brand-textbox--collapsible'] = this.collapsible;
|
|
53
|
+
out['brand-textbox--closed'] = this.collapsible && this.collapsed;
|
|
54
|
+
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
customElements.define('ucd-theme-brand-textbox', UcdThemeBrandTextbox);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { html, css } from 'lit';
|
|
2
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import brandStyles from "@ucd-lib/theme-sass/4_component/_category-brand.css.js"
|
|
4
|
+
import textBoxStyles from "@ucd-lib/theme-sass/4_component/_brand-textbox.css.js"
|
|
5
|
+
|
|
6
|
+
export function styles() {
|
|
7
|
+
const elementStyles = css`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
*, ::before, ::after {
|
|
12
|
+
box-sizing: inherit;
|
|
13
|
+
}
|
|
14
|
+
.brand-textbox__button{
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
.brand-textbox--collapsible .brand-textbox__button {
|
|
18
|
+
display: block;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
return [
|
|
23
|
+
brandStyles,
|
|
24
|
+
textBoxStyles,
|
|
25
|
+
elementStyles];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function render() {
|
|
29
|
+
return html`
|
|
30
|
+
<section class=${classMap(this._getBaseClasses())}>
|
|
31
|
+
<div class="brand-textbox__content">
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</div>
|
|
34
|
+
<button
|
|
35
|
+
class="brand-textbox__button"
|
|
36
|
+
@click=${() => this.collapsed = !this.collapsed}
|
|
37
|
+
title="Open/Close Message">Toggle this message area open and closed.</button>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
`;}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import {render, styles} from "./ucd-theme-breadcrumbs.tpl";
|
|
3
|
+
|
|
4
|
+
import {Mixin, MainDomElement} from '../../elements/utils/mixins';
|
|
5
|
+
import {BrandedPageElement } from "../utils/index.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default class PageBrandBreadcrumbs extends Mixin(LitElement)
|
|
9
|
+
.with(MainDomElement, BrandedPageElement ) {
|
|
10
|
+
|
|
11
|
+
static get properties() {
|
|
12
|
+
return {
|
|
13
|
+
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static get styles() {
|
|
18
|
+
return styles();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.render = render.bind(this);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
customElements.define('page-brand-breadcrumbs', PageBrandBreadcrumbs);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { html, css } from 'lit';
|
|
2
|
+
|
|
3
|
+
import formStyles from "@ucd-lib/theme-sass/1_base_html/_forms.css.js";
|
|
4
|
+
import breadcrumbsStyles from "@ucd-lib/theme-sass/";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export function styles() {
|
|
8
|
+
const elementStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
formStyles,
|
|
16
|
+
focalLinkStyles,
|
|
17
|
+
vertLinkStyles,
|
|
18
|
+
elementStyles];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function render() {
|
|
22
|
+
return html`
|
|
23
|
+
|
|
24
|
+
`;}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import {render, styles} from "./ucd-theme-focal-link.tpl";
|
|
3
|
+
|
|
4
|
+
import {Mixin, MainDomElement} from '../../elements/utils/mixins';
|
|
5
|
+
import {BrandedPageElement } from "../utils/index.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default class PageBrandFocalLink extends Mixin(LitElement)
|
|
9
|
+
.with(MainDomElement, BrandedPageElement ) {
|
|
10
|
+
|
|
11
|
+
static get properties() {
|
|
12
|
+
return {
|
|
13
|
+
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static get styles() {
|
|
18
|
+
return styles();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.render = render.bind(this);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
customElements.define('page-brand-focal-link', PageBrandFocalLink);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { html, css } from 'lit';
|
|
2
|
+
|
|
3
|
+
import formStyles from "@ucd-lib/theme-sass/1_base_html/_forms.css.js";
|
|
4
|
+
import focalLinkStyles from "@ucd-lib/theme-sass/4_component/_focal-link.css.js";
|
|
5
|
+
import vertLinkStyles from "@ucd-lib/theme-sass/4_component/_vertical-link.css.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export function styles() {
|
|
9
|
+
const elementStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
return [
|
|
16
|
+
formStyles,
|
|
17
|
+
focalLinkStyles,
|
|
18
|
+
vertLinkStyles,
|
|
19
|
+
elementStyles];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function render() {
|
|
23
|
+
return html`
|
|
24
|
+
|
|
25
|
+
`;}
|
|
@@ -4,6 +4,7 @@ import {render, styles} from "./ucd-theme-header.tpl.js";
|
|
|
4
4
|
import {
|
|
5
5
|
IntersectionObserverController,
|
|
6
6
|
MutationObserverController,
|
|
7
|
+
PopStateObserverController,
|
|
7
8
|
WaitController } from '../../utils/controllers';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -51,10 +52,12 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
51
52
|
preventFixed: {type: Boolean, attribute: "prevent-fixed"},
|
|
52
53
|
isDemo: {type: Boolean, attribute: "is-demo"},
|
|
53
54
|
_transitioning: {type: Boolean, state: true},
|
|
55
|
+
_hasPrimaryNav: {type: Boolean, state: true},
|
|
54
56
|
_hasSlottedBranding: {type: Boolean, state: true},
|
|
55
57
|
_hasQuickLinks: {type: Boolean, state: true},
|
|
56
58
|
_hasSearch: {type: Boolean, state: true},
|
|
57
|
-
_brandingBarInView: {type: Boolean, state: true}
|
|
59
|
+
_brandingBarInView: {type: Boolean, state: true},
|
|
60
|
+
_components: {type: Object, state: true}
|
|
58
61
|
};
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -68,6 +71,7 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
68
71
|
|
|
69
72
|
this.mutationObserver = new MutationObserverController(this);
|
|
70
73
|
this.wait = new WaitController(this);
|
|
74
|
+
new PopStateObserverController(this, "_onLocationChange");
|
|
71
75
|
|
|
72
76
|
this.siteName = "";
|
|
73
77
|
this.siteUrl = "/";
|
|
@@ -77,14 +81,21 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
77
81
|
this.isDemo = false;
|
|
78
82
|
|
|
79
83
|
this._transitioning = false;
|
|
84
|
+
this._hasPrimaryNav = false;
|
|
80
85
|
this._hasSlottedBranding = false;
|
|
81
86
|
this._hasQuickLinks = false;
|
|
82
87
|
this._hasSearch = false;
|
|
83
88
|
this._animationDuration = 500;
|
|
84
89
|
this._brandingBarInView = false;
|
|
90
|
+
this._slottedComponents = {};
|
|
85
91
|
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
/**
|
|
95
|
+
* @method connectedCallback
|
|
96
|
+
* @private
|
|
97
|
+
* @description Custom element lifecycle method
|
|
98
|
+
*/
|
|
88
99
|
connectedCallback(){
|
|
89
100
|
super.connectedCallback();
|
|
90
101
|
if ( !this.preventFixed ) {
|
|
@@ -92,6 +103,11 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
92
103
|
}
|
|
93
104
|
}
|
|
94
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @method firstUpdated
|
|
108
|
+
* @private
|
|
109
|
+
* @description Lit lifecycle hook
|
|
110
|
+
*/
|
|
95
111
|
firstUpdated(){
|
|
96
112
|
if ( !this.preventFixed ) {
|
|
97
113
|
let aboveNav = this.renderRoot.getElementById('branding-bar-container');
|
|
@@ -99,11 +115,33 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
99
115
|
}
|
|
100
116
|
}
|
|
101
117
|
|
|
118
|
+
/**
|
|
119
|
+
* @method _onLocationChange
|
|
120
|
+
* @description Called when url changes by popstate controller
|
|
121
|
+
*/
|
|
122
|
+
_onLocationChange(){
|
|
123
|
+
this.close();
|
|
124
|
+
if ( this._hasQuickLinks ){
|
|
125
|
+
this._slottedComponents.quickLinks.close();
|
|
126
|
+
}
|
|
127
|
+
if ( this._hasSearch ){
|
|
128
|
+
this._slottedComponents.search.close();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @method _onBrandingBarIntersection
|
|
134
|
+
* @private
|
|
135
|
+
* @description Called by intersection observer when branding bar enters/exits screen
|
|
136
|
+
* @param {*} entries
|
|
137
|
+
*/
|
|
102
138
|
_onBrandingBarIntersection(entries){
|
|
103
139
|
let offSetValue = 0;
|
|
104
140
|
try {
|
|
105
141
|
offSetValue = this.renderRoot.getElementById('nav-bar').getBoundingClientRect().height;
|
|
106
|
-
} catch (error) {
|
|
142
|
+
} catch (error) {
|
|
143
|
+
//
|
|
144
|
+
}
|
|
107
145
|
if ( offSetValue > 150 ) offSetValue = 0;
|
|
108
146
|
entries.forEach(entry => {
|
|
109
147
|
this._brandingBarInView = entry.isIntersecting;
|
|
@@ -112,7 +150,7 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
112
150
|
} else {
|
|
113
151
|
this.style.marginBottom = offSetValue + "px";
|
|
114
152
|
}
|
|
115
|
-
})
|
|
153
|
+
});
|
|
116
154
|
}
|
|
117
155
|
|
|
118
156
|
/**
|
|
@@ -232,14 +270,18 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
232
270
|
let primaryNav = this.querySelector('ucd-theme-primary-nav');
|
|
233
271
|
if ( primaryNav ) {
|
|
234
272
|
primaryNav.setAttribute('slot', 'primary-nav');
|
|
273
|
+
this._hasPrimaryNav = true;
|
|
274
|
+
this._slottedComponents.primaryNav = primaryNav;
|
|
235
275
|
} else {
|
|
236
276
|
console.warn("No 'ucd-theme-primary-nav' child element found!");
|
|
277
|
+
this._hasPrimaryNav = false;
|
|
237
278
|
}
|
|
238
279
|
|
|
239
280
|
let quickLinks = this.querySelector('ucd-theme-quick-links');
|
|
240
281
|
if ( quickLinks ) {
|
|
241
282
|
quickLinks.setAttribute('slot', 'quick-links');
|
|
242
283
|
this._hasQuickLinks = true;
|
|
284
|
+
this._slottedComponents.quickLinks = quickLinks;
|
|
243
285
|
} else {
|
|
244
286
|
this._hasQuickLinks = false;
|
|
245
287
|
}
|
|
@@ -248,6 +290,7 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
248
290
|
if ( search ) {
|
|
249
291
|
search.setAttribute('slot', 'search');
|
|
250
292
|
this._hasSearch = true;
|
|
293
|
+
this._slottedComponents.search = search;
|
|
251
294
|
} else {
|
|
252
295
|
this._hasSearch = false;
|
|
253
296
|
}
|
|
@@ -256,6 +299,7 @@ export default class UcdThemeHeader extends LitElement {
|
|
|
256
299
|
if ( UcdlibBrandingBar ) {
|
|
257
300
|
UcdlibBrandingBar.setAttribute('slot', 'branding-bar');
|
|
258
301
|
this._hasSlottedBranding = true;
|
|
302
|
+
this._slottedComponents.brandingBar = UcdlibBrandingBar;
|
|
259
303
|
} else if ( this.querySelector("*[slot='branding-bar']") ){
|
|
260
304
|
this._hasSlottedBranding = true;
|
|
261
305
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { render, styles } from './ucd-theme-list-accordion.tpl.js';
|
|
3
|
+
import { MutationObserverController, WaitController } from '../../utils/controllers';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @class UcdThemeListAccordion
|
|
@@ -27,16 +28,19 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
27
28
|
_listItems: { attribute: false, state: true },
|
|
28
29
|
_availableStyles: { attribute: false, state: true },
|
|
29
30
|
_expandedItems: { attribute: false, state: true },
|
|
31
|
+
role: {type: String, reflect: true}
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
constructor() {
|
|
34
36
|
super();
|
|
35
37
|
this.render = render.bind(this);
|
|
38
|
+
this.mutationObserver = new MutationObserverController(this);
|
|
36
39
|
this._listItems = [];
|
|
37
40
|
this._availableStyles = ['accordion', 'faq'];
|
|
38
41
|
this.listStyle = this._availableStyles[0];
|
|
39
42
|
this._expandedItems = new Set();
|
|
43
|
+
this.role = 'list';
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
static get styles() {
|
|
@@ -44,11 +48,12 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
/**
|
|
47
|
-
* @method
|
|
48
|
-
* @
|
|
51
|
+
* @method willUpdate
|
|
52
|
+
* @private
|
|
53
|
+
* @description Lit lifecycle method called right before an element updates
|
|
49
54
|
* @param {Map} props - properties that have changed
|
|
50
55
|
*/
|
|
51
|
-
|
|
56
|
+
willUpdate(props) {
|
|
52
57
|
if (props.has('listStyle')) {
|
|
53
58
|
if (!this._availableStyles.includes(this.listStyle.toLowerCase())) {
|
|
54
59
|
this.listStyle = this._availableStyles[0];
|
|
@@ -56,27 +61,6 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
/**
|
|
60
|
-
* @method connectedCallback
|
|
61
|
-
* @description Native lifecycle method called when element is connected
|
|
62
|
-
*/
|
|
63
|
-
connectedCallback() {
|
|
64
|
-
super.connectedCallback();
|
|
65
|
-
this._childListObserver = new MutationObserver((mutationsList, observer) =>
|
|
66
|
-
this._onChildListMutation(mutationsList, observer)
|
|
67
|
-
);
|
|
68
|
-
this._childListObserver.observe(this, { childList: true });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @method disconnectedCallback
|
|
73
|
-
* @description Native lifecycle method called when element is disconnected
|
|
74
|
-
*/
|
|
75
|
-
disconnectedCallback() {
|
|
76
|
-
this._childListObserver.disconnect();
|
|
77
|
-
super.disconnectedCallback();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
64
|
/**
|
|
81
65
|
* @method toggleItemVisiblity
|
|
82
66
|
* @description Expands/collapses an item
|
|
@@ -116,6 +100,7 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
116
100
|
/**
|
|
117
101
|
* @method _onTitleClick
|
|
118
102
|
* @description Attached to item title
|
|
103
|
+
* @private
|
|
119
104
|
* @param {Event} e
|
|
120
105
|
*/
|
|
121
106
|
_onTitleClick(e) {
|
|
@@ -126,6 +111,7 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
126
111
|
/**
|
|
127
112
|
* @method _onTitleKeyUp
|
|
128
113
|
* @description Attached to item title
|
|
114
|
+
* @private
|
|
129
115
|
* @param {Event} e
|
|
130
116
|
*/
|
|
131
117
|
_onTitleKeyUp(e) {
|
|
@@ -136,12 +122,12 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
136
122
|
|
|
137
123
|
/**
|
|
138
124
|
* @method _onChildListMutation
|
|
125
|
+
* @private
|
|
139
126
|
* @description Attached to self, responds to changes in children
|
|
140
127
|
*/
|
|
141
128
|
_onChildListMutation() {
|
|
142
129
|
let listItems = [];
|
|
143
130
|
Array.from(this.children).forEach((child, index) => {
|
|
144
|
-
if (child.tagName !== 'DIV') return;
|
|
145
131
|
child.setAttribute('slot', 'list-item-' + index);
|
|
146
132
|
if (this.listStyle === 'faq') {
|
|
147
133
|
child.style.display = 'inline';
|
|
@@ -155,6 +141,7 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
155
141
|
/**
|
|
156
142
|
* @method _dispatchItemToggleEvent
|
|
157
143
|
* @description Fires 'item-toggle' custom event when user expands/collapses an item
|
|
144
|
+
* @private
|
|
158
145
|
* @param {Number} index - The index of the item in the _listItems array property
|
|
159
146
|
*/
|
|
160
147
|
_dispatchItemToggleEvent(index) {
|
|
@@ -178,6 +165,7 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
178
165
|
/**
|
|
179
166
|
* @method _isTitle
|
|
180
167
|
* @description Item is title or question.
|
|
168
|
+
* @private
|
|
181
169
|
* @param {Number} i - Array index.
|
|
182
170
|
* @returns {Boolean}
|
|
183
171
|
*/
|
|
@@ -188,6 +176,7 @@ export default class UcdThemeListAccordion extends LitElement {
|
|
|
188
176
|
/**
|
|
189
177
|
* @method _isContent
|
|
190
178
|
* @description Item is content or answer.
|
|
179
|
+
* @private
|
|
191
180
|
* @param {Number} i - Array index.
|
|
192
181
|
* @returns {Boolean}
|
|
193
182
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html, css } from 'lit';
|
|
2
2
|
|
|
3
3
|
import listCss from "@ucd-lib/theme-sass/2_base_class/_lists.css.js";
|
|
4
|
-
import { motionCollapse } from "../../utils/directives/motion-collapse";
|
|
5
4
|
|
|
6
5
|
export function styles() {
|
|
7
6
|
let customStyles = css`
|
|
@@ -40,7 +39,6 @@ ${this._listItems.map((item, index) => html`
|
|
|
40
39
|
` : html`
|
|
41
40
|
<li
|
|
42
41
|
id="accordion-${index}-panel"
|
|
43
|
-
${motionCollapse({duration: 300})}
|
|
44
42
|
class="item-content"
|
|
45
43
|
role="region"
|
|
46
44
|
aria-labelledby="accordion-${index}"
|
package/package.json
CHANGED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { renderIconSet } from "./utils";
|
|
3
|
+
|
|
4
|
+
const template = html`
|
|
5
|
+
<!-- All icons prefixed with 'fa' by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (CC BY 4.0) -->
|
|
6
|
+
<svg><defs>
|
|
7
|
+
<g id="attach-file">
|
|
8
|
+
<path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"/>
|
|
9
|
+
</g>
|
|
10
|
+
<g id="attach-money">
|
|
11
|
+
<path d="M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"/>
|
|
12
|
+
</g>
|
|
13
|
+
<g id="border-all">
|
|
14
|
+
<path d="M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z"/>
|
|
15
|
+
</g>
|
|
16
|
+
<g id="border-bottom">
|
|
17
|
+
<path d="M9 11H7v2h2v-2zm4 4h-2v2h2v-2zM9 3H7v2h2V3zm4 8h-2v2h2v-2zM5 3H3v2h2V3zm8 4h-2v2h2V7zm4 4h-2v2h2v-2zm-4-8h-2v2h2V3zm4 0h-2v2h2V3zm2 10h2v-2h-2v2zm0 4h2v-2h-2v2zM5 7H3v2h2V7zm14-4v2h2V3h-2zm0 6h2V7h-2v2zM5 11H3v2h2v-2zM3 21h18v-2H3v2zm2-6H3v2h2v-2z"/>
|
|
18
|
+
</g>
|
|
19
|
+
<g id="border-clear">
|
|
20
|
+
<path d="M7 5h2V3H7v2zm0 8h2v-2H7v2zm0 8h2v-2H7v2zm4-4h2v-2h-2v2zm0 4h2v-2h-2v2zm-8 0h2v-2H3v2zm0-4h2v-2H3v2zm0-4h2v-2H3v2zm0-4h2V7H3v2zm0-4h2V3H3v2zm8 8h2v-2h-2v2zm8 4h2v-2h-2v2zm0-4h2v-2h-2v2zm0 8h2v-2h-2v2zm0-12h2V7h-2v2zm-8 0h2V7h-2v2zm8-6v2h2V3h-2zm-8 2h2V3h-2v2zm4 16h2v-2h-2v2zm0-8h2v-2h-2v2zm0-8h2V3h-2v2z"/>
|
|
21
|
+
</g>
|
|
22
|
+
<g id="border-color">
|
|
23
|
+
<path d="M17.75 7L14 3.25l-10 10V17h3.75l10-10zm2.96-2.96c.39-.39.39-1.02 0-1.41L18.37.29c-.39-.39-1.02-.39-1.41 0L15 2.25 18.75 6l1.96-1.96z"/>
|
|
24
|
+
<path fill-opacity=".36" d="M0 20h24v4H0z"/>
|
|
25
|
+
</g>
|
|
26
|
+
<g id="border-horizontal">
|
|
27
|
+
<path d="M3 21h2v-2H3v2zM5 7H3v2h2V7zM3 17h2v-2H3v2zm4 4h2v-2H7v2zM5 3H3v2h2V3zm4 0H7v2h2V3zm8 0h-2v2h2V3zm-4 4h-2v2h2V7zm0-4h-2v2h2V3zm6 14h2v-2h-2v2zm-8 4h2v-2h-2v2zm-8-8h18v-2H3v2zM19 3v2h2V3h-2zm0 6h2V7h-2v2zm-8 8h2v-2h-2v2zm4 4h2v-2h-2v2zm4 0h2v-2h-2v2z"/>
|
|
28
|
+
</g>
|
|
29
|
+
<g id="border-inner">
|
|
30
|
+
<path d="M3 21h2v-2H3v2zm4 0h2v-2H7v2zM5 7H3v2h2V7zM3 17h2v-2H3v2zM9 3H7v2h2V3zM5 3H3v2h2V3zm12 0h-2v2h2V3zm2 6h2V7h-2v2zm0-6v2h2V3h-2zm-4 18h2v-2h-2v2zM13 3h-2v8H3v2h8v8h2v-8h8v-2h-8V3zm6 18h2v-2h-2v2zm0-4h2v-2h-2v2z"/>
|
|
31
|
+
</g>
|
|
32
|
+
<g id="border-left">
|
|
33
|
+
<path d="M11 21h2v-2h-2v2zm0-4h2v-2h-2v2zm0-12h2V3h-2v2zm0 4h2V7h-2v2zm0 4h2v-2h-2v2zm-4 8h2v-2H7v2zM7 5h2V3H7v2zm0 8h2v-2H7v2zm-4 8h2V3H3v18zM19 9h2V7h-2v2zm-4 12h2v-2h-2v2zm4-4h2v-2h-2v2zm0-14v2h2V3h-2zm0 10h2v-2h-2v2zm0 8h2v-2h-2v2zm-4-8h2v-2h-2v2zm0-8h2V3h-2v2z"/>
|
|
34
|
+
</g>
|
|
35
|
+
<g id="border-outer">
|
|
36
|
+
<path d="M13 7h-2v2h2V7zm0 4h-2v2h2v-2zm4 0h-2v2h2v-2zM3 3v18h18V3H3zm16 16H5V5h14v14zm-6-4h-2v2h2v-2zm-4-4H7v2h2v-2z"/>
|
|
37
|
+
</g>
|
|
38
|
+
<g id="border-right">
|
|
39
|
+
<path d="M7 21h2v-2H7v2zM3 5h2V3H3v2zm4 0h2V3H7v2zm0 8h2v-2H7v2zm-4 8h2v-2H3v2zm8 0h2v-2h-2v2zm-8-8h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm8 8h2v-2h-2v2zm4-4h2v-2h-2v2zm4-10v18h2V3h-2zm-4 18h2v-2h-2v2zm0-16h2V3h-2v2zm-4 8h2v-2h-2v2zm0-8h2V3h-2v2zm0 4h2V7h-2v2z"/>
|
|
40
|
+
</g>
|
|
41
|
+
<g id="border-style">
|
|
42
|
+
<path d="M15 21h2v-2h-2v2zm4 0h2v-2h-2v2zM7 21h2v-2H7v2zm4 0h2v-2h-2v2zm8-4h2v-2h-2v2zm0-4h2v-2h-2v2zM3 3v18h2V5h16V3H3zm16 6h2V7h-2v2z"/>
|
|
43
|
+
</g>
|
|
44
|
+
<g id="border-top">
|
|
45
|
+
<path d="M7 21h2v-2H7v2zm0-8h2v-2H7v2zm4 0h2v-2h-2v2zm0 8h2v-2h-2v2zm-8-4h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2v-2H3v2zm0-4h2V7H3v2zm8 8h2v-2h-2v2zm8-8h2V7h-2v2zm0 4h2v-2h-2v2zM3 3v2h18V3H3zm16 14h2v-2h-2v2zm-4 4h2v-2h-2v2zM11 9h2V7h-2v2zm8 12h2v-2h-2v2zm-4-8h2v-2h-2v2z"/>
|
|
46
|
+
</g>
|
|
47
|
+
<g id="border-vertical">
|
|
48
|
+
<path d="M3 9h2V7H3v2zm0-4h2V3H3v2zm4 16h2v-2H7v2zm0-8h2v-2H7v2zm-4 0h2v-2H3v2zm0 8h2v-2H3v2zm0-4h2v-2H3v2zM7 5h2V3H7v2zm12 12h2v-2h-2v2zm-8 4h2V3h-2v18zm8 0h2v-2h-2v2zm0-8h2v-2h-2v2zm0-10v2h2V3h-2zm0 6h2V7h-2v2zm-4-4h2V3h-2v2zm0 16h2v-2h-2v2zm0-8h2v-2h-2v2z"/>
|
|
49
|
+
</g>
|
|
50
|
+
<g id="bubble-chart">
|
|
51
|
+
<circle cx="7.2" cy="14.4" r="3.2"/>
|
|
52
|
+
<circle cx="14.8" cy="18" r="2"/>
|
|
53
|
+
<circle cx="15.2" cy="8.8" r="4.8"/>
|
|
54
|
+
</g>
|
|
55
|
+
<g id="drag-handle">
|
|
56
|
+
<path d="M20 9H4v2h16V9zM4 15h16v-2H4v2z"/>
|
|
57
|
+
</g>
|
|
58
|
+
<g id="format-align-center">
|
|
59
|
+
<path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"/>
|
|
60
|
+
</g>
|
|
61
|
+
<g id="format-align-justify">
|
|
62
|
+
<path d="M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zm0-6v2h18V3H3z"/>
|
|
63
|
+
</g>
|
|
64
|
+
<g id="format-align-left">
|
|
65
|
+
<path d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"/>
|
|
66
|
+
</g>
|
|
67
|
+
<g id="format-align-right">
|
|
68
|
+
<path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"/>
|
|
69
|
+
</g>
|
|
70
|
+
<g id="format-bold">
|
|
71
|
+
<path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"/>
|
|
72
|
+
</g>
|
|
73
|
+
<g id="format-clear">
|
|
74
|
+
<path d="M3.27 5L2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27 3.27 5zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5H6z"/>
|
|
75
|
+
</g>
|
|
76
|
+
<g id="format-color-fill">
|
|
77
|
+
<path d="M16.56 8.94L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10L10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z"/>
|
|
78
|
+
<path fill-opacity=".36" d="M0 20h24v4H0z"/>
|
|
79
|
+
</g>
|
|
80
|
+
<g id="format-color-reset">
|
|
81
|
+
<path d="M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31zm-.88 3.12L12.5 12.5 5.27 5.27 4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6 1.52 0 2.9-.57 3.96-1.5l2.63 2.63 1.27-1.27-2.74-2.74z"/>
|
|
82
|
+
</g>
|
|
83
|
+
<g id="format-color-text">
|
|
84
|
+
<path fill-opacity=".36" d="M0 20h24v4H0z"/>
|
|
85
|
+
<path d="M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62z"/>
|
|
86
|
+
</g>
|
|
87
|
+
<g id="format-indent-decrease">
|
|
88
|
+
<path d="M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"/>
|
|
89
|
+
</g>
|
|
90
|
+
<g id="format-indent-increase">
|
|
91
|
+
<path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"/>
|
|
92
|
+
</g>
|
|
93
|
+
<g id="format-italic">
|
|
94
|
+
<path d="M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"/>
|
|
95
|
+
</g>
|
|
96
|
+
<g id="format-line-spacing">
|
|
97
|
+
<path d="M6 7h2.5L5 3.5 1.5 7H4v10H1.5L5 20.5 8.5 17H6V7zm4-2v2h12V5H10zm0 14h12v-2H10v2zm0-6h12v-2H10v2z"/>
|
|
98
|
+
</g>
|
|
99
|
+
<g id="format-list-bulleted">
|
|
100
|
+
<path d="M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"/>
|
|
101
|
+
</g>
|
|
102
|
+
<g id="format-list-numbered">
|
|
103
|
+
<path d="M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"/>
|
|
104
|
+
</g>
|
|
105
|
+
<g id="format-paint">
|
|
106
|
+
<path d="M18 4V3c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V6h1v4H9v11c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-9h8V4h-3z"/>
|
|
107
|
+
</g>
|
|
108
|
+
<g id="format-quote">
|
|
109
|
+
<path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"/>
|
|
110
|
+
</g>
|
|
111
|
+
<g id="format-shapes">
|
|
112
|
+
<path d="M23 7V1h-6v2H7V1H1v6h2v10H1v6h6v-2h10v2h6v-6h-2V7h2zM3 3h2v2H3V3zm2 18H3v-2h2v2zm12-2H7v-2H5V7h2V5h10v2h2v10h-2v2zm4 2h-2v-2h2v2zM19 5V3h2v2h-2zm-5.27 9h-3.49l-.73 2H7.89l3.4-9h1.4l3.41 9h-1.63l-.74-2zm-3.04-1.26h2.61L12 8.91l-1.31 3.83z"/>
|
|
113
|
+
</g>
|
|
114
|
+
<g id="format-size">
|
|
115
|
+
<path d="M9 4v3h5v12h3V7h5V4H9zm-6 8h3v7h3v-7h3V9H3v3z"/>
|
|
116
|
+
</g>
|
|
117
|
+
<g id="format-strikethrough">
|
|
118
|
+
<path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/>
|
|
119
|
+
</g>
|
|
120
|
+
<g id="format-textdirection-l-to-r">
|
|
121
|
+
<path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"/>
|
|
122
|
+
</g>
|
|
123
|
+
<g id="format-textdirection-r-to-l">
|
|
124
|
+
<path d="M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zm-2 7v-3l-4 4 4 4v-3h12v-2H8z"/>
|
|
125
|
+
</g>
|
|
126
|
+
<g id="format-underlined">
|
|
127
|
+
<path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"/>
|
|
128
|
+
</g>
|
|
129
|
+
<g id="functions">
|
|
130
|
+
<path d="M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"/>
|
|
131
|
+
</g>
|
|
132
|
+
<g id="highlight">
|
|
133
|
+
<path d="M6 14l3 3v5h6v-5l3-3V9H6zm5-12h2v3h-2zM3.5 5.875L4.914 4.46l2.12 2.122L5.62 7.997zm13.46.71l2.123-2.12 1.414 1.414L18.375 8z"/>
|
|
134
|
+
</g>
|
|
135
|
+
<g id="insert-chart">
|
|
136
|
+
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"/>
|
|
137
|
+
</g>
|
|
138
|
+
<g id="insert-comment">
|
|
139
|
+
<path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/>
|
|
140
|
+
</g>
|
|
141
|
+
<g id="insert-drive-file">
|
|
142
|
+
<path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"/>
|
|
143
|
+
</g>
|
|
144
|
+
<g id="insert-emoticon">
|
|
145
|
+
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/>
|
|
146
|
+
</g>
|
|
147
|
+
<g id="insert-invitation">
|
|
148
|
+
<path d="M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"/>
|
|
149
|
+
</g>
|
|
150
|
+
<g id="insert-link">
|
|
151
|
+
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
152
|
+
</g>
|
|
153
|
+
<g id="insert-photo">
|
|
154
|
+
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
|
|
155
|
+
</g>
|
|
156
|
+
<g id="linear-scale">
|
|
157
|
+
<path d="M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z"/>
|
|
158
|
+
</g>
|
|
159
|
+
<g id="merge-type">
|
|
160
|
+
<path d="M17 20.41L18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z"/>
|
|
161
|
+
</g>
|
|
162
|
+
<g id="mode-comment">
|
|
163
|
+
<path d="M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18z"/>
|
|
164
|
+
</g>
|
|
165
|
+
<g id="mode-edit">
|
|
166
|
+
<path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>
|
|
167
|
+
</g>
|
|
168
|
+
<g id="monetization-on">
|
|
169
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"/>
|
|
170
|
+
</g>
|
|
171
|
+
<g id="money-off">
|
|
172
|
+
<path d="M12.5 6.9c1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-.53.12-1.03.3-1.48.54l1.47 1.47c.41-.17.91-.27 1.51-.27zM5.33 4.06L4.06 5.33 7.5 8.77c0 2.08 1.56 3.21 3.91 3.91l3.51 3.51c-.34.48-1.05.91-2.42.91-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c.96-.18 1.82-.55 2.45-1.12l2.22 2.22 1.27-1.27L5.33 4.06z"/>
|
|
173
|
+
</g>
|
|
174
|
+
<g id="multiline-chart">
|
|
175
|
+
<path d="M22 6.92l-1.41-1.41-2.85 3.21C15.68 6.4 12.83 5 9.61 5 6.72 5 4.07 6.16 2 8l1.42 1.42C5.12 7.93 7.27 7 9.61 7c2.74 0 5.09 1.26 6.77 3.24l-2.88 3.24-4-4L2 16.99l1.5 1.5 6-6.01 4 4 4.05-4.55c.75 1.35 1.25 2.9 1.44 4.55H21c-.22-2.3-.95-4.39-2.04-6.14L22 6.92z"/>
|
|
176
|
+
</g>
|
|
177
|
+
<g id="pie-chart-outlined">
|
|
178
|
+
<path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm1 2.07c3.61.45 6.48 3.33 6.93 6.93H13V4.07zM4 12c0-4.06 3.07-7.44 7-7.93v15.87c-3.93-.5-7-3.88-7-7.94zm9 7.93V13h6.93c-.45 3.61-3.32 6.48-6.93 6.93z"/>
|
|
179
|
+
</g>
|
|
180
|
+
<g id="pie-chart">
|
|
181
|
+
<path d="M11 2v20c-5.07-.5-9-4.79-9-10s3.93-9.5 9-10zm2.03 0v8.99H22c-.47-4.74-4.24-8.52-8.97-8.99zm0 11.01V22c4.74-.47 8.5-4.25 8.97-8.99h-8.97z"/>
|
|
182
|
+
</g>
|
|
183
|
+
<g id="publish">
|
|
184
|
+
<path d="M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"/>
|
|
185
|
+
</g>
|
|
186
|
+
<g id="short-text">
|
|
187
|
+
<path d="M4 9h16v2H4zm0 4h10v2H4z"/>
|
|
188
|
+
</g>
|
|
189
|
+
<g id="show-chart">
|
|
190
|
+
<path d="M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"/>
|
|
191
|
+
</g>
|
|
192
|
+
<g id="space-bar">
|
|
193
|
+
<path d="M18 9v4H6V9H4v6h16V9z"/>
|
|
194
|
+
</g>
|
|
195
|
+
<g id="strikethrough-s">
|
|
196
|
+
<path d="M7.24 8.75c-.26-.48-.39-1.03-.39-1.67 0-.61.13-1.16.4-1.67.26-.5.63-.93 1.11-1.29.48-.35 1.05-.63 1.7-.83.66-.19 1.39-.29 2.18-.29.81 0 1.54.11 2.21.34.66.22 1.23.54 1.69.94.47.4.83.88 1.08 1.43.25.55.38 1.15.38 1.81h-3.01c0-.31-.05-.59-.15-.85-.09-.27-.24-.49-.44-.68-.2-.19-.45-.33-.75-.44-.3-.1-.66-.16-1.06-.16-.39 0-.74.04-1.03.13-.29.09-.53.21-.72.36-.19.16-.34.34-.44.55-.1.21-.15.43-.15.66 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.05-.08-.11-.17-.15-.25zM21 12v-2H3v2h9.62c.18.07.4.14.55.2.37.17.66.34.87.51.21.17.35.36.43.57.07.2.11.43.11.69 0 .23-.05.45-.14.66-.09.2-.23.38-.42.53-.19.15-.42.26-.71.35-.29.08-.63.13-1.01.13-.43 0-.83-.04-1.18-.13s-.66-.23-.91-.42c-.25-.19-.45-.44-.59-.75-.14-.31-.25-.76-.25-1.21H6.4c0 .55.08 1.13.24 1.58.16.45.37.85.65 1.21.28.35.6.66.98.92.37.26.78.48 1.22.65.44.17.9.3 1.38.39.48.08.96.13 1.44.13.8 0 1.53-.09 2.18-.28s1.21-.45 1.67-.79c.46-.34.82-.77 1.07-1.27s.38-1.07.38-1.71c0-.6-.1-1.14-.31-1.61-.05-.11-.11-.23-.17-.33H21z"/>
|
|
197
|
+
</g>
|
|
198
|
+
<g id="text-fields">
|
|
199
|
+
<path d="M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"/>
|
|
200
|
+
</g>
|
|
201
|
+
<g id="title">
|
|
202
|
+
<path d="M5 4v3h5.5v12h3V7H19V4z"/>
|
|
203
|
+
</g>
|
|
204
|
+
<g id="vertical-align-bottom">
|
|
205
|
+
<path d="M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z"/>
|
|
206
|
+
</g>
|
|
207
|
+
<g id="vertical-align-center">
|
|
208
|
+
<path d="M8 19h3v4h2v-4h3l-4-4-4 4zm8-14h-3V1h-2v4H8l4 4 4-4zM4 11v2h16v-2H4z"/>
|
|
209
|
+
</g>
|
|
210
|
+
<g id="vertical-align-top">
|
|
211
|
+
<path d="M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"/>
|
|
212
|
+
</g>
|
|
213
|
+
<g id="wrap-text">
|
|
214
|
+
<path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3 3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"/>
|
|
215
|
+
</g>
|
|
216
|
+
<g id="fa-arrows-alt" viewBox="0 0 512 512">
|
|
217
|
+
<path d="M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"/>
|
|
218
|
+
</g>
|
|
219
|
+
<g id="fa-heading" viewBox="0 0 512 512">
|
|
220
|
+
<path d="M448 96v320h32a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H320a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h32V288H160v128h32a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H32a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h32V96H32a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16h-32v128h192V96h-32a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16z"/>
|
|
221
|
+
</g>
|
|
222
|
+
<g id="fa-image" viewBox="0 0 512 512">
|
|
223
|
+
<path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"/>
|
|
224
|
+
</g>
|
|
225
|
+
<g id="fa-quote-left" viewBox="0 0 512 512">
|
|
226
|
+
<path d="M464 256h-80v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8c-88.4 0-160 71.6-160 160v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48zm-288 0H96v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8C71.6 32 0 103.6 0 192v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"/>
|
|
227
|
+
</g>
|
|
228
|
+
<g id="fa-eye" viewBox="0 0 576 512">
|
|
229
|
+
<path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"/>
|
|
230
|
+
</g>
|
|
231
|
+
<g id="fa-square" viewBox="0 0 448 512">
|
|
232
|
+
<path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z"/>
|
|
233
|
+
</g>
|
|
234
|
+
<g id="fa-link" viewBox="0 0 512 512">
|
|
235
|
+
<path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/>
|
|
236
|
+
</g>
|
|
237
|
+
<g id="fa-check-circle" viewBox="0 0 512 512">
|
|
238
|
+
<path d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/>
|
|
239
|
+
</g>
|
|
240
|
+
<g id="fa-user" viewBox="0 0 448 512">
|
|
241
|
+
<path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/>
|
|
242
|
+
</g>
|
|
243
|
+
<g id="fa-palette" viewBox="0 0 512 512">
|
|
244
|
+
<path d="M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"/>
|
|
245
|
+
</g>
|
|
246
|
+
<g id="fa-vector-square" viewBox="0 0 512 512">
|
|
247
|
+
<path d="M512 128V32c0-17.67-14.33-32-32-32h-96c-17.67 0-32 14.33-32 32H160c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v96c0 17.67 14.33 32 32 32v192c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h96c17.67 0 32-14.33 32-32h192c0 17.67 14.33 32 32 32h96c17.67 0 32-14.33 32-32v-96c0-17.67-14.33-32-32-32V160c17.67 0 32-14.33 32-32zm-96-64h32v32h-32V64zM64 64h32v32H64V64zm32 384H64v-32h32v32zm352 0h-32v-32h32v32zm-32-96h-32c-17.67 0-32 14.33-32 32v32H160v-32c0-17.67-14.33-32-32-32H96V160h32c17.67 0 32-14.33 32-32V96h192v32c0 17.67 14.33 32 32 32h32v192z"/>
|
|
248
|
+
</g>
|
|
249
|
+
<g id="fa-undo" viewBox="0 0 512 512">
|
|
250
|
+
<path d="M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"/>
|
|
251
|
+
</g>
|
|
252
|
+
<g id="fa-arrows-alt-v" viewBox="0 0 256 512">
|
|
253
|
+
<path d="M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z"/>
|
|
254
|
+
</g>
|
|
255
|
+
<g id="fa-circle" viewBox="0 0 512 512">
|
|
256
|
+
<path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"/>
|
|
257
|
+
</g>
|
|
258
|
+
<g id="fa-external-link-alt" viewBox="0 0 512 512">
|
|
259
|
+
<path d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"/>
|
|
260
|
+
</g>
|
|
261
|
+
<g id="fa-tag" viewBox="0 0 512 512">
|
|
262
|
+
<path d="M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z"/>
|
|
263
|
+
</g>
|
|
264
|
+
<g id="fa-tags" viewBox="0 0 640 512">
|
|
265
|
+
<path d="M497.941 225.941L286.059 14.059A48 48 0 0 0 252.118 0H48C21.49 0 0 21.49 0 48v204.118a48 48 0 0 0 14.059 33.941l211.882 211.882c18.744 18.745 49.136 18.746 67.882 0l204.118-204.118c18.745-18.745 18.745-49.137 0-67.882zM112 160c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm513.941 133.823L421.823 497.941c-18.745 18.745-49.137 18.745-67.882 0l-.36-.36L527.64 323.522c16.999-16.999 26.36-39.6 26.36-63.64s-9.362-46.641-26.36-63.64L331.397 0h48.721a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882z"/>
|
|
266
|
+
</g>
|
|
267
|
+
<g id="fa-th-list" viewBox="0 0 512 512">
|
|
268
|
+
<path d="M149.333 216v80c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-80c0-13.255 10.745-24 24-24h101.333c13.255 0 24 10.745 24 24zM0 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zM125.333 32H24C10.745 32 0 42.745 0 56v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zm80 448H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zm-24-424v80c0 13.255 10.745 24 24 24H488c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24zm24 264H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24z"/>
|
|
269
|
+
</g>
|
|
270
|
+
<g id="fa-columns" viewBox="0 0 512 512">
|
|
271
|
+
<path d="M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64V160h160v256zm224 0H288V160h160v256z"/>
|
|
272
|
+
</g>
|
|
273
|
+
<g id="fa-box" viewBox="0 0 512 512">
|
|
274
|
+
<path d="M509.5 184.6L458.9 32.8C452.4 13.2 434.1 0 413.4 0H272v192h238.7c-.4-2.5-.4-5-1.2-7.4zM240 0H98.6c-20.7 0-39 13.2-45.5 32.8L2.5 184.6c-.8 2.4-.8 4.9-1.2 7.4H240V0zM0 224v240c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V224H0z"/>
|
|
275
|
+
</g>
|
|
276
|
+
<g id="fa-fill" viewBox="0 0 512 512">
|
|
277
|
+
<path d="M502.63 217.06L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.77c-6.24-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.63l86.19 86.18-94.76 94.76c-37.49 37.49-37.49 98.26 0 135.75l117.19 117.19c18.75 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.88-28.12l221.57-221.57c12.49-12.5 12.49-32.76 0-45.26zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.61 58.6c12.49 12.49 32.75 12.49 45.24 0 12.49-12.49 12.49-32.75 0-45.24l-58.61-58.6 58.95-58.95 162.45 162.44-48.35 48.34z"/>
|
|
278
|
+
</g>
|
|
279
|
+
<g id="fa-star" viewBox="0 0 576 512">
|
|
280
|
+
<path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/>
|
|
281
|
+
</g>
|
|
282
|
+
<g id="fa-passport" viewBox="0 0 448 512">
|
|
283
|
+
<path d="M129.62 176h39.09c1.49-27.03 6.54-51.35 14.21-70.41-27.71 13.24-48.02 39.19-53.3 70.41zm0 32c5.29 31.22 25.59 57.17 53.3 70.41-7.68-19.06-12.72-43.38-14.21-70.41h-39.09zM224 286.69c7.69-7.45 20.77-34.42 23.43-78.69h-46.87c2.67 44.26 15.75 71.24 23.44 78.69zM200.57 176h46.87c-2.66-44.26-15.74-71.24-23.43-78.69-7.7 7.45-20.78 34.43-23.44 78.69zm64.51 102.41c27.71-13.24 48.02-39.19 53.3-70.41h-39.09c-1.49 27.03-6.53 51.35-14.21 70.41zM416 0H64C28.65 0 0 28.65 0 64v384c0 35.35 28.65 64 64 64h352c17.67 0 32-14.33 32-32V32c0-17.67-14.33-32-32-32zm-80 416H112c-8.8 0-16-7.2-16-16s7.2-16 16-16h224c8.8 0 16 7.2 16 16s-7.2 16-16 16zm-112-96c-70.69 0-128-57.31-128-128S153.31 64 224 64s128 57.31 128 128-57.31 128-128 128zm41.08-214.41c7.68 19.06 12.72 43.38 14.21 70.41h39.09c-5.28-31.22-25.59-57.17-53.3-70.41z"/>
|
|
284
|
+
</g>
|
|
285
|
+
<g id="fa-bars" viewBox="0 0 448 512">
|
|
286
|
+
<path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/>
|
|
287
|
+
</g>
|
|
288
|
+
<g id="fa-hourglass" viewBox="0 0 384 512">
|
|
289
|
+
<path d="M360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64z"/>
|
|
290
|
+
</g>
|
|
291
|
+
<g id="fa-ellipsis-h" viewBox="0 0 512 512">
|
|
292
|
+
<path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/>
|
|
293
|
+
</g>
|
|
294
|
+
<g id="fa-bold" viewBox="0 0 384 512">
|
|
295
|
+
<path d="M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z"/>
|
|
296
|
+
</g>
|
|
297
|
+
<g id="fa-search" viewBox="0 0 512 512">
|
|
298
|
+
<path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/>
|
|
299
|
+
</g>
|
|
300
|
+
<g id="fa-icons" viewBox="0 0 512 512">
|
|
301
|
+
<path d="M116.65 219.35a15.68 15.68 0 0 0 22.65 0l96.75-99.83c28.15-29 26.5-77.1-4.91-103.88C203.75-7.7 163-3.5 137.86 22.44L128 32.58l-9.85-10.14C93.05-3.5 52.25-7.7 24.86 15.64c-31.41 26.78-33 74.85-5 103.88zm143.92 100.49h-48l-7.08-14.24a27.39 27.39 0 0 0-25.66-17.78h-71.71a27.39 27.39 0 0 0-25.66 17.78l-7 14.24h-48A27.45 27.45 0 0 0 0 347.3v137.25A27.44 27.44 0 0 0 27.43 512h233.14A27.45 27.45 0 0 0 288 484.55V347.3a27.45 27.45 0 0 0-27.43-27.46zM144 468a52 52 0 1 1 52-52 52 52 0 0 1-52 52zm355.4-115.9h-60.58l22.36-50.75c2.1-6.65-3.93-13.21-12.18-13.21h-75.59c-6.3 0-11.66 3.9-12.5 9.1l-16.8 106.93c-1 6.3 4.88 11.89 12.5 11.89h62.31l-24.2 83c-1.89 6.65 4.2 12.9 12.23 12.9a13.26 13.26 0 0 0 10.92-5.25l92.4-138.91c4.88-6.91-1.16-15.7-10.87-15.7zM478.08.33L329.51 23.17C314.87 25.42 304 38.92 304 54.83V161.6a83.25 83.25 0 0 0-16-1.7c-35.35 0-64 21.48-64 48s28.65 48 64 48c35.2 0 63.73-21.32 64-47.66V99.66l112-17.22v47.18a83.25 83.25 0 0 0-16-1.7c-35.35 0-64 21.48-64 48s28.65 48 64 48c35.2 0 63.73-21.32 64-47.66V32c0-19.48-16-34.42-33.92-31.67z"/>
|
|
302
|
+
</g>
|
|
303
|
+
</defs></svg>`;
|
|
304
|
+
|
|
305
|
+
renderIconSet(template, "editor", 24, "Editor");
|
|
@@ -8,8 +8,9 @@ import { html, render } from "lit-html";
|
|
|
8
8
|
* @param {TemplateResult} icons - SVG html string of icons
|
|
9
9
|
* @param {String} name - name of iconset.
|
|
10
10
|
* @param {Number} size - size of icons
|
|
11
|
+
* @param {String} label - Friendly name of iconset
|
|
11
12
|
*/
|
|
12
|
-
function renderIconSet(icons, name, size=24){
|
|
13
|
+
function renderIconSet(icons, name, size=24, label=""){
|
|
13
14
|
const containerId = `ucdlib-icons--${name}`;
|
|
14
15
|
let container = document.getElementById(containerId);
|
|
15
16
|
if ( !container ){
|
|
@@ -19,7 +20,7 @@ function renderIconSet(icons, name, size=24){
|
|
|
19
20
|
document.head.appendChild(container);
|
|
20
21
|
}
|
|
21
22
|
const template = html`
|
|
22
|
-
<ucdlib-iconset name=${name} size=${size}>
|
|
23
|
+
<ucdlib-iconset name=${name} size=${size} label=${label}>
|
|
23
24
|
${icons}
|
|
24
25
|
</ucdlib-iconset>
|
|
25
26
|
`;
|
|
@@ -9,6 +9,7 @@ import { MutationObserverController } from '../../utils/controllers';
|
|
|
9
9
|
*
|
|
10
10
|
* @property {String} name - Name of the icon set. Usage: <ucdlib-icon icon="{thisProperty}:{icon}"></ucdlib-icon>
|
|
11
11
|
* @property {Number} size - The size of an individual icon. Note that icons must be square.
|
|
12
|
+
* @property {String} label - Optional friendly label for iconset.
|
|
12
13
|
* @example
|
|
13
14
|
* <ucdlib-iconset name="arrows">
|
|
14
15
|
<svg>
|
|
@@ -26,6 +27,7 @@ export default class UcdlibIconset extends Mixin(LitElement)
|
|
|
26
27
|
return {
|
|
27
28
|
name: {type: String},
|
|
28
29
|
size: {type: Number},
|
|
30
|
+
label: {type: String},
|
|
29
31
|
_iconMap: {type: Object, state: true}
|
|
30
32
|
};
|
|
31
33
|
}
|
|
@@ -35,6 +37,7 @@ export default class UcdlibIconset extends Mixin(LitElement)
|
|
|
35
37
|
this.mutationObserver = new MutationObserverController(this, {subtree: true, childList: true});
|
|
36
38
|
|
|
37
39
|
this.name = "";
|
|
40
|
+
this.label = "";
|
|
38
41
|
this.size = 24;
|
|
39
42
|
this._iconMap = {};
|
|
40
43
|
this.style.display = "none";
|
|
@@ -63,6 +66,17 @@ export default class UcdlibIconset extends Mixin(LitElement)
|
|
|
63
66
|
return Object.keys(this._iconMap);
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
/**
|
|
70
|
+
* @method getLabel
|
|
71
|
+
* @description Returns a friendly label of iconset
|
|
72
|
+
* @returns {String}
|
|
73
|
+
*/
|
|
74
|
+
getLabel(){
|
|
75
|
+
if ( this.label ) return this.label;
|
|
76
|
+
|
|
77
|
+
return this.name.replace(/-/g, " ");
|
|
78
|
+
}
|
|
79
|
+
|
|
66
80
|
/**
|
|
67
81
|
* @method applyIcon
|
|
68
82
|
* @description Adds icon to ucdlib-icon element from iconset
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import {render, styles} from "./ucdlib-sils-search-redirect.tpl.js";
|
|
3
|
+
|
|
4
|
+
import { SilsPrimoController } from '../../utils/controllers';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @class UcdlibSilsSearchRedirect
|
|
8
|
+
* @classdesc Search widget that redirects a user's query to SILS Primo
|
|
9
|
+
* @property {String} query - The search query
|
|
10
|
+
* @property {Boolean} ucdOnly - Limits search to UC Davis libraries only
|
|
11
|
+
* @property {Boolean} darkBackground - Adjusts colors for display on a dark background
|
|
12
|
+
* @property {Boolean} preventRedirect - Will not send user to Primo on form submission
|
|
13
|
+
* @property {String} headingText - Text to display above main text input
|
|
14
|
+
* @property {String} inputPlaceholder - Placeholder for main text input
|
|
15
|
+
* @property {String} host - Primo host
|
|
16
|
+
*/
|
|
17
|
+
export default class UcdlibSilsSearchRedirect extends LitElement {
|
|
18
|
+
|
|
19
|
+
static get properties() {
|
|
20
|
+
return {
|
|
21
|
+
query: {type: String},
|
|
22
|
+
ucdOnly: {type: Boolean, attribute: "ucd-only"},
|
|
23
|
+
darkBackground: {type: Boolean, attribute: "dark-background"},
|
|
24
|
+
preventRedirect: {type: Boolean, attribute: "prevent-redirect"},
|
|
25
|
+
headingText: {type: String, attribute: "heading-text"},
|
|
26
|
+
inputPlaceholder: {type: String, attribute: "input-placeholder"},
|
|
27
|
+
host: {type: String},
|
|
28
|
+
role: {type: String, reflect: true},
|
|
29
|
+
ariaLabel: {type: String, attribute: "aria-label", reflect: true}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static get styles() {
|
|
34
|
+
return styles();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
this.render = render.bind(this);
|
|
40
|
+
this.query = "";
|
|
41
|
+
this.ucdOnly = false;
|
|
42
|
+
this.darkBackground = false;
|
|
43
|
+
this.headingText = "Search UC Library Materials";
|
|
44
|
+
this.inputPlaceholder = "All UC books, journals, articles + more";
|
|
45
|
+
this.role = "form";
|
|
46
|
+
this.ariaLabel = "Search UC Library Materials";
|
|
47
|
+
this.host = "";
|
|
48
|
+
this._updatePrimoController();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @method willUpdate
|
|
53
|
+
* @description Lit lifecycle hook
|
|
54
|
+
* @private
|
|
55
|
+
* @param {Map} props - Properties that have changed
|
|
56
|
+
*/
|
|
57
|
+
willUpdate(props){
|
|
58
|
+
this._updatePrimoController(props);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @method _onQueryChange
|
|
63
|
+
* @private
|
|
64
|
+
* @description Attached to primary text input
|
|
65
|
+
* @param {Event} e - Input event
|
|
66
|
+
*/
|
|
67
|
+
_onQueryChange(e){
|
|
68
|
+
let text = e.target.value ? e.target.value : "";
|
|
69
|
+
this.query = text;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @method _onCorpusChange
|
|
74
|
+
* @private
|
|
75
|
+
* @description Attached to ucd-only checkbox
|
|
76
|
+
* @param {Event} e - Input event
|
|
77
|
+
*/
|
|
78
|
+
_onCorpusChange(e){
|
|
79
|
+
this.ucdOnly = e.target.checked;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @method _onSubmit
|
|
84
|
+
* @description Called on form submit
|
|
85
|
+
* @private
|
|
86
|
+
* @param {Event} e - submit event
|
|
87
|
+
*/
|
|
88
|
+
_onSubmit(e){
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
let corpus = this.ucdOnly ? "ucd" : "everything";
|
|
91
|
+
let advanced = e.submitter.id == "advanced-search";
|
|
92
|
+
|
|
93
|
+
let url = this.primo.makeSearchUrl(this.query, corpus, advanced);
|
|
94
|
+
if ( this.preventRedirect ) {
|
|
95
|
+
this.dispatchEvent(new CustomEvent('search', {
|
|
96
|
+
detail : {url}
|
|
97
|
+
}));
|
|
98
|
+
} else {
|
|
99
|
+
window.location = url;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @method _updatePrimoController
|
|
106
|
+
* @description Updates the config values of the Primo controller based on ele attributes
|
|
107
|
+
* @private
|
|
108
|
+
* @param {Map} props - Properties that have changed in current lifecycle
|
|
109
|
+
*/
|
|
110
|
+
_updatePrimoController(props){
|
|
111
|
+
let primoConfig = {};
|
|
112
|
+
|
|
113
|
+
// Get primo config values from ele attributes
|
|
114
|
+
const attrs = [
|
|
115
|
+
{ele: 'host', ctl: 'host'}
|
|
116
|
+
];
|
|
117
|
+
if ( props ){
|
|
118
|
+
attrs.forEach(attr => {
|
|
119
|
+
if ( props.has(attr.ele) && this[attr.ele] ) {
|
|
120
|
+
primoConfig[attr.ctl] = this[attr.ele];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// instantiate or update controller
|
|
126
|
+
if ( !this.primo ) {
|
|
127
|
+
this.primo = new SilsPrimoController(
|
|
128
|
+
this,
|
|
129
|
+
primoConfig
|
|
130
|
+
);
|
|
131
|
+
} else {
|
|
132
|
+
this.primo.updateConfig(primoConfig);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
customElements.define('ucdlib-sils-search-redirect', UcdlibSilsSearchRedirect);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { html, css, unsafeCSS } from 'lit';
|
|
2
|
+
|
|
3
|
+
import normalizeCss from "@ucd-lib/theme-sass/normalize.css.js";
|
|
4
|
+
import headingCss from "@ucd-lib/theme-sass/1_base_html/_headings.css";
|
|
5
|
+
import headingClassesCss from "@ucd-lib/theme-sass/2_base_class/_headings.css";
|
|
6
|
+
import formsCss from "@ucd-lib/theme-sass/1_base_html/_forms.css";
|
|
7
|
+
import formsClassesCss from "@ucd-lib/theme-sass/2_base_class/_forms.css";
|
|
8
|
+
import buttonCss from "@ucd-lib/theme-sass/2_base_class/_buttons.css";
|
|
9
|
+
import spacingUtilityCss from "@ucd-lib/theme-sass/6_utility/_u-space.css";
|
|
10
|
+
import { categoryBrands } from "@ucd-lib/theme-sass/colors";
|
|
11
|
+
|
|
12
|
+
export function styles() {
|
|
13
|
+
const elementStyles = css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
max-width: 500px;
|
|
17
|
+
margin: auto;
|
|
18
|
+
}
|
|
19
|
+
h2 {
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
.search-bar {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-flow: row nowrap;
|
|
25
|
+
}
|
|
26
|
+
.search-bar button {
|
|
27
|
+
font-family: "Font Awesome 5 Free";
|
|
28
|
+
min-width: unset;
|
|
29
|
+
font-size: 1.2rem;
|
|
30
|
+
padding: 0 .75rem;
|
|
31
|
+
min-height: 0;
|
|
32
|
+
}
|
|
33
|
+
.search-bar button:hover {
|
|
34
|
+
padding-right: .75rem;
|
|
35
|
+
padding-left: .75rem;
|
|
36
|
+
}
|
|
37
|
+
.search-bar input {
|
|
38
|
+
flex-grow: 1;
|
|
39
|
+
}
|
|
40
|
+
.search-options {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-flow: row wrap;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
}
|
|
46
|
+
.search-options label {
|
|
47
|
+
color: ${unsafeCSS(categoryBrands.primary.hex)};
|
|
48
|
+
padding-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
input[type=checkbox] {
|
|
51
|
+
margin-right: 0;
|
|
52
|
+
}
|
|
53
|
+
.search-options button {
|
|
54
|
+
border: none;
|
|
55
|
+
background-color: inherit;
|
|
56
|
+
color: ${unsafeCSS(categoryBrands.primary.hex)};
|
|
57
|
+
text-decoration: underline;
|
|
58
|
+
padding: 0;
|
|
59
|
+
font-family: inherit;
|
|
60
|
+
}
|
|
61
|
+
.dark h2 {
|
|
62
|
+
color: ${unsafeCSS(categoryBrands.secondary.hex)}
|
|
63
|
+
}
|
|
64
|
+
.dark .search-options label {
|
|
65
|
+
color: #fff;
|
|
66
|
+
}
|
|
67
|
+
.dark .search-options button {
|
|
68
|
+
color: #fff;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
return [
|
|
74
|
+
normalizeCss,
|
|
75
|
+
headingCss,
|
|
76
|
+
headingClassesCss,
|
|
77
|
+
formsCss,
|
|
78
|
+
formsClassesCss,
|
|
79
|
+
buttonCss,
|
|
80
|
+
spacingUtilityCss,
|
|
81
|
+
elementStyles];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function render() {
|
|
85
|
+
return html`
|
|
86
|
+
<form
|
|
87
|
+
@submit=${this._onSubmit}
|
|
88
|
+
aria-label=${this.ariaLabel}
|
|
89
|
+
class="${this.darkBackground ? 'dark' : 'light'}">
|
|
90
|
+
|
|
91
|
+
${this.headingText ? html`
|
|
92
|
+
<h2 class="heading--highlight u-space-mb">${this.headingText}</h2>
|
|
93
|
+
` : html``}
|
|
94
|
+
|
|
95
|
+
<div class="search-bar">
|
|
96
|
+
<input type="text" .value=${this.query} @input=${this._onQueryChange} placeholder=${this.inputPlaceholder}>
|
|
97
|
+
<button id="simple-search" type="submit" class="btn btn--primary-input"> </button>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="search-options">
|
|
101
|
+
<div class="checkbox u-space-mr--small u-space-mt--small">
|
|
102
|
+
<input id="corpus" type="checkbox" ?checked=${this.ucdOnly} @input=${this._onCorpusChange}><label for="corpus">UC Davis libraries only</label>
|
|
103
|
+
</div>
|
|
104
|
+
<button id="advanced-search" class="u-space-mt--small" type="submit">Advanced Search</button>
|
|
105
|
+
</div>
|
|
106
|
+
</form>
|
|
107
|
+
|
|
108
|
+
`;}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { BreakPointsController } from "./break-points";
|
|
2
2
|
import { IntersectionObserverController } from "./intersection-observer";
|
|
3
3
|
import { MutationObserverController } from "./mutation-observer";
|
|
4
|
+
import { PopStateObserverController } from "./popstate-observer";
|
|
5
|
+
import { SilsPrimoController } from "./sils-primo";
|
|
4
6
|
import { WaitController } from "./wait";
|
|
5
7
|
|
|
8
|
+
|
|
6
9
|
export {
|
|
7
10
|
BreakPointsController,
|
|
8
11
|
IntersectionObserverController,
|
|
9
12
|
MutationObserverController,
|
|
13
|
+
PopStateObserverController,
|
|
14
|
+
SilsPrimoController,
|
|
10
15
|
WaitController,
|
|
11
16
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class PopStateObserverController
|
|
3
|
+
* @classdesc Controller for attaching a popstate event listener to a Lit element.
|
|
4
|
+
*
|
|
5
|
+
* @property {LitElement} host - 'this' from a Lit element
|
|
6
|
+
* @property {String} callback - Name of element method called on popstate. Default: '_onPopstate'
|
|
7
|
+
*
|
|
8
|
+
* @examples
|
|
9
|
+
* // Instantiate this controller in the constructor of your element
|
|
10
|
+
* new PopStateObserverController(this, "_onLocationChange");
|
|
11
|
+
*/
|
|
12
|
+
export class PopStateObserverController{
|
|
13
|
+
|
|
14
|
+
constructor(host, callback="_onPopstate"){
|
|
15
|
+
(this.host = host).addController(this);
|
|
16
|
+
this.callback = callback;
|
|
17
|
+
this._onPopstate = this._onPopstate.bind(this);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
hostConnected(){
|
|
21
|
+
window.addEventListener('popstate', this._onPopstate);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
hostDisconnected(){
|
|
25
|
+
window.removeEventListener('popstate', this._onPopstate);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_onPopstate(e){
|
|
29
|
+
if ( !this.host[this.callback]){
|
|
30
|
+
console.warn(
|
|
31
|
+
`Element has no '${this.callback}' method.
|
|
32
|
+
Either add this method, or change the 'callback' argument on instantiation.`
|
|
33
|
+
);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let locationObject = this._getLocationObject();
|
|
37
|
+
this.host[this.callback](locationObject, e);
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_getLocationObject(){
|
|
42
|
+
let location = {
|
|
43
|
+
fullpath : window.location.href.replace(window.location.origin, '').replace(/^\/+/, '/'),
|
|
44
|
+
pathname : window.location.pathname.replace(/^\/+/, '/'),
|
|
45
|
+
path : window.location.pathname.replace(/(^\/+|\/+$)/g, '').split('/'),
|
|
46
|
+
query : new URLSearchParams(window.location.search),
|
|
47
|
+
hash : window.location.hash.replace(/^#/, '')
|
|
48
|
+
};
|
|
49
|
+
return location;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class SilsPrimoController
|
|
3
|
+
* @classdesc Utility for interacting with UC Libraries' discovery tool
|
|
4
|
+
*
|
|
5
|
+
* @property {LitElement} host - 'this' from a Lit element
|
|
6
|
+
* @property {Object} config - Basic Primo configuration values (host, uris, etc)
|
|
7
|
+
*/
|
|
8
|
+
export class SilsPrimoController{
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @method constructor
|
|
12
|
+
* @description Called on instantiation
|
|
13
|
+
* @param {LitElement} host - Element
|
|
14
|
+
* @param {Object} config - Config values
|
|
15
|
+
*/
|
|
16
|
+
constructor(host, config={}){
|
|
17
|
+
(this.host = host).addController(this);
|
|
18
|
+
this.updateConfig(config);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @method updateConfig
|
|
23
|
+
* @description Updates the config property.
|
|
24
|
+
* @param {Object} config - Values to overide the default.
|
|
25
|
+
*/
|
|
26
|
+
updateConfig(config){
|
|
27
|
+
const UCD_TAB = "LibraryCatalog";
|
|
28
|
+
let _config = {
|
|
29
|
+
host: "https://search.library.ucdavis.edu",
|
|
30
|
+
paths: {
|
|
31
|
+
search: "discovery/search",
|
|
32
|
+
browse: "discovery/browse"
|
|
33
|
+
},
|
|
34
|
+
defaultParams: {
|
|
35
|
+
vid: "01UCD_INST:UCD"
|
|
36
|
+
},
|
|
37
|
+
corpora: {
|
|
38
|
+
everything: {
|
|
39
|
+
tab: "UCSILSDefaultSearch",
|
|
40
|
+
scope: "DN_and_CI"
|
|
41
|
+
},
|
|
42
|
+
uc: {
|
|
43
|
+
tab: "UCSDiscoveryNetwork",
|
|
44
|
+
scope: "UCSDiscoveryNetwork"
|
|
45
|
+
},
|
|
46
|
+
ucd: {
|
|
47
|
+
tab: UCD_TAB,
|
|
48
|
+
scope: "MyInstitution",
|
|
49
|
+
},
|
|
50
|
+
specialCollections: {
|
|
51
|
+
tab: UCD_TAB,
|
|
52
|
+
scope: "SSPEC"
|
|
53
|
+
},
|
|
54
|
+
medical: {
|
|
55
|
+
tab: UCD_TAB,
|
|
56
|
+
scope: "BLAISDELL"
|
|
57
|
+
},
|
|
58
|
+
healthSciences: {
|
|
59
|
+
tab: UCD_TAB,
|
|
60
|
+
scope: "CARLSON"
|
|
61
|
+
},
|
|
62
|
+
law: {
|
|
63
|
+
tab: UCD_TAB,
|
|
64
|
+
scope: "Mabie"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
this.config = Object.assign(_config, config);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @method makeSearchUrl
|
|
74
|
+
* @description Makes a Primo Search URL
|
|
75
|
+
* @param {String} query - A search term or phrase
|
|
76
|
+
* @param {String} corpus - The bib corpus to search against.
|
|
77
|
+
* Sets 'tab' and 'search_scope' params. Must be a recognized keyword in the corpora config object:
|
|
78
|
+
* everything, uc, ucd, specialCollections, medical, healthSciences, law
|
|
79
|
+
* @param {Boolean} advanced - Expands the advanced search interface
|
|
80
|
+
* @param {Object} additionalParams - Any additional url params. Has the final say.
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
83
|
+
makeSearchUrl( query, corpus="everything", advanced=false, additionalParams={} ){
|
|
84
|
+
let url = `${this._trailingSlashIt(this.config.host)}${this.config.paths.search}`;
|
|
85
|
+
|
|
86
|
+
let params = Object.assign({}, this.config.defaultParams);
|
|
87
|
+
|
|
88
|
+
if ( advanced ) {
|
|
89
|
+
params['mode'] = 'advanced';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if ( query ) {
|
|
93
|
+
params['query'] = 'any,contains,' + query.replace(/,/g, ' ');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if ( this.config.corpora[corpus] ) {
|
|
97
|
+
params['tab'] = this.config.corpora[corpus].tab;
|
|
98
|
+
params['search_scope'] = this.config.corpora[corpus].scope;
|
|
99
|
+
} else {
|
|
100
|
+
console.warn(`${corpus} is not a recognized corpus`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if ( additionalParams ){
|
|
104
|
+
Object.assign(params, additionalParams);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
params = new URLSearchParams(params);
|
|
108
|
+
return `${url}?${params.toString()}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @method _trailingSlashIt
|
|
113
|
+
* @description Adds trailing slash to string if not already present
|
|
114
|
+
* @private
|
|
115
|
+
* @param {String} str
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
118
|
+
_trailingSlashIt(str){
|
|
119
|
+
if ( str.endsWith('/') ){
|
|
120
|
+
return str;
|
|
121
|
+
}
|
|
122
|
+
return str + "/";
|
|
123
|
+
}
|
|
124
|
+
}
|