@fluid-topics/ft-icon 0.3.8 → 0.3.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/build/ft-icon.d.ts +8 -3
- package/build/ft-icon.js +73 -53
- package/build/ft-icon.light.js +38 -38
- package/build/ft-icon.min.js +43 -38
- package/package.json +3 -3
package/build/ft-icon.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropertyValues } from "lit";
|
|
1
2
|
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
3
|
export declare enum FtIconVariants {
|
|
3
4
|
fluid_topics = "fluid-topics",
|
|
@@ -16,11 +17,15 @@ export declare const FtIconCssVariables: {
|
|
|
16
17
|
};
|
|
17
18
|
export declare class FtIcon extends FtLitElement implements FtIconProperties {
|
|
18
19
|
static elementDefinitions: ElementDefinitionsMap;
|
|
19
|
-
|
|
20
|
+
static styles: import("lit").CSSResult;
|
|
20
21
|
variant: FtIconVariants;
|
|
22
|
+
value?: string;
|
|
23
|
+
private resolvedIcon;
|
|
21
24
|
private slottedContent?;
|
|
22
|
-
protected
|
|
25
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
23
26
|
get textContent(): string;
|
|
24
|
-
|
|
27
|
+
protected update(changedProperties: PropertyValues): void;
|
|
28
|
+
private resolveIcon;
|
|
29
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
25
30
|
}
|
|
26
31
|
//# sourceMappingURL=ft-icon.d.ts.map
|
package/build/ft-icon.js
CHANGED
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, html, nothing } from "lit";
|
|
8
|
-
import { property, query } from "lit/decorators.js";
|
|
8
|
+
import { property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { FtCssVariableFactory, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
11
11
|
import { FtFileFormatIcons, FtIcons } from "./icons";
|
|
@@ -26,53 +26,13 @@ export class FtIcon extends FtLitElement {
|
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
28
|
this.variant = FtIconVariants.fluid_topics;
|
|
29
|
+
this.resolvedIcon = nothing;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
getStyles() {
|
|
32
|
-
return css `
|
|
33
|
-
:host {
|
|
34
|
-
display: inline-block;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host, i.ft-icon {
|
|
38
|
-
width: ${FtIconCssVariables.size};
|
|
39
|
-
height: ${FtIconCssVariables.size};
|
|
40
|
-
text-align: center;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
i.ft-icon {
|
|
44
|
-
font-size: ${FtIconCssVariables.size};
|
|
45
|
-
line-height: 1;
|
|
46
|
-
font-weight: normal;
|
|
47
|
-
text-transform: none;
|
|
48
|
-
font-style: normal;
|
|
49
|
-
font-variant: normal;
|
|
50
|
-
speak: none;
|
|
51
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
52
|
-
text-rendering: auto;
|
|
53
|
-
-webkit-font-smoothing: antialiased;
|
|
54
|
-
-moz-osx-font-smoothing: grayscale;
|
|
55
|
-
vertical-align: ${FtIconCssVariables.verticalAlign};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ft-icon--fluid-topics {
|
|
59
|
-
font-family: ${FtIconCssVariables.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.ft-icon--file-format {
|
|
63
|
-
font-family: ${FtIconCssVariables.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.ft-icon--material {
|
|
67
|
-
font-family: ${FtIconCssVariables.materialFontFamily}, "Material Icons", sans-serif;
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
getTemplate() {
|
|
31
|
+
render() {
|
|
72
32
|
return html `
|
|
73
33
|
<i class="ft-icon ${"ft-icon--" + this.variant}">
|
|
74
|
-
${unsafeHTML(this.
|
|
75
|
-
<slot
|
|
34
|
+
${unsafeHTML(this.resolvedIcon)}
|
|
35
|
+
<slot ?hidden=${this.variant !== "material"}></slot>
|
|
76
36
|
</i>
|
|
77
37
|
`;
|
|
78
38
|
}
|
|
@@ -80,22 +40,82 @@ export class FtIcon extends FtLitElement {
|
|
|
80
40
|
var _a, _b;
|
|
81
41
|
return (_b = (_a = this.slottedContent) === null || _a === void 0 ? void 0 : _a.assignedNodes().map(n => n.textContent).join("").trim()) !== null && _b !== void 0 ? _b : "";
|
|
82
42
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return (_a = FtFileFormatIcons[content.toUpperCase()]) !== null && _a !== void 0 ? _a : content;
|
|
43
|
+
update(changedProperties) {
|
|
44
|
+
super.update(changedProperties);
|
|
45
|
+
if (["value", "variant"].some(p => changedProperties.has(p))) {
|
|
46
|
+
this.resolveIcon();
|
|
88
47
|
}
|
|
89
|
-
|
|
90
|
-
|
|
48
|
+
}
|
|
49
|
+
resolveIcon() {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
let content = this.value || this.textContent;
|
|
52
|
+
switch (this.variant) {
|
|
53
|
+
case FtIconVariants.file_format:
|
|
54
|
+
this.resolvedIcon = (_a = FtFileFormatIcons[content.toUpperCase()]) !== null && _a !== void 0 ? _a : content;
|
|
55
|
+
break;
|
|
56
|
+
case FtIconVariants.fluid_topics:
|
|
57
|
+
this.resolvedIcon = (_b = FtIcons[content.toUpperCase()]) !== null && _b !== void 0 ? _b : content;
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
this.resolvedIcon = nothing;
|
|
91
61
|
}
|
|
92
|
-
|
|
62
|
+
}
|
|
63
|
+
firstUpdated(_changedProperties) {
|
|
64
|
+
super.firstUpdated(_changedProperties);
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
this.resolveIcon();
|
|
67
|
+
});
|
|
93
68
|
}
|
|
94
69
|
}
|
|
95
70
|
FtIcon.elementDefinitions = {};
|
|
71
|
+
//language=css
|
|
72
|
+
FtIcon.styles = css `
|
|
73
|
+
:host {
|
|
74
|
+
display: inline-block;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host, i.ft-icon {
|
|
78
|
+
width: ${FtIconCssVariables.size};
|
|
79
|
+
height: ${FtIconCssVariables.size};
|
|
80
|
+
text-align: center;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
i.ft-icon {
|
|
84
|
+
font-size: ${FtIconCssVariables.size};
|
|
85
|
+
line-height: 1;
|
|
86
|
+
font-weight: normal;
|
|
87
|
+
text-transform: none;
|
|
88
|
+
font-style: normal;
|
|
89
|
+
font-variant: normal;
|
|
90
|
+
speak: none;
|
|
91
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
92
|
+
text-rendering: auto;
|
|
93
|
+
-webkit-font-smoothing: antialiased;
|
|
94
|
+
-moz-osx-font-smoothing: grayscale;
|
|
95
|
+
vertical-align: ${FtIconCssVariables.verticalAlign};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ft-icon--fluid-topics {
|
|
99
|
+
font-family: ${FtIconCssVariables.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ft-icon--file-format {
|
|
103
|
+
font-family: ${FtIconCssVariables.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ft-icon--material {
|
|
107
|
+
font-family: ${FtIconCssVariables.materialFontFamily}, "Material Icons", sans-serif;
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
96
110
|
__decorate([
|
|
97
111
|
property()
|
|
98
112
|
], FtIcon.prototype, "variant", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property()
|
|
115
|
+
], FtIcon.prototype, "value", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
state()
|
|
118
|
+
], FtIcon.prototype, "resolvedIcon", void 0);
|
|
99
119
|
__decorate([
|
|
100
120
|
query("slot")
|
|
101
121
|
], FtIcon.prototype, "slottedContent", void 0);
|
package/build/ft-icon.light.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
!function(e,t,a,i,o){var x,p;e.FtIcons=void 0,(x=e.FtIcons||(e.FtIcons={})).THIN_ARROW_LEFT="",x.THIN_ARROW_RIGHT="",x.MY_COLLECTIONS="",x.OFFLINE_SETTINGS="",x.MY_LIBRARY="",x.RATE_PLAIN="",x.RATE="",x.FEEDBACK_PLAIN="",x.STAR_PLAIN="",x.STAR="",x.THUMBS_DOWN_PLAIN="",x.THUMBS_DOWN="",x.THUMBS_UP_PLAIN="",x.THUMBS_UP="",x.PAUSE="",x.PLAY="",x.RELATIVES_PLAIN="",x.RELATIVES="",x.SHORTCUT_MENU="",x.PRINT="",x.DEFAULT_ROLES="",x.ACCOUNT_SETTINGS="",x.ONLINE="",x.OFFLINE="",x.UPLOAD="",x.BOOK_PLAIN="",x.SYNC="",x.SHARED_PBK="",x.COLLECTIONS="",x.SEARCH_IN_PUBLICATION="",x.BOOKS="",x.LOCKER="",x.ARROW_DOWN="",x.ARROW_LEFT="",x.ARROW_RIGHT="",x.ARROW_UP="",x.SAVE="",x.MAILS_AND_NOTIFICATIONS="",x.DOT="",x.MINUS="",x.PLUS="",x.FILTERS="",x.STRIPE_ARROW_RIGHT="",x.STRIPE_ARROW_LEFT="",x.ATTACHMENTS="",x.ADD_BOOKMARK="",x.BOOKMARK="",x.EXPORT="",x.MENU="",x.TAG="",x.TAG_PLAIN="",x.COPY_TO_CLIPBOARD="",x.COLUMNS="",x.ARTICLE="",x.CLOSE_PLAIN="",x.CHECK_PLAIN="",x.LOGOUT="",x.SIGN_IN="",x.THIN_ARROW="",x.TRIANGLE_BOTTOM="",x.TRIANGLE_LEFT="",x.TRIANGLE_RIGHT="",x.TRIANGLE_TOP="",x.FACET_HAS_DESCENDANT="",x.MINUS_PLAIN="",x.PLUS_PLAIN="",x.INFO="",x.ICON_EXPAND="",x.ICON_COLLAPSE="",x.ADD_TO_PBK="",x.ALERT="",x.ADD_ALERT="",x.BACK_TO_SEARCH="",x.DOWNLOAD="",x.EDIT="",x.FEEDBACK="",x.MODIFY_PBK="",x.SCHEDULED="",x.SEARCH="",x.SHARE="󨃱",x.TOC="",x.WRITE_UGC="",x.TRASH="",x.EXTLINK="",x.CALENDAR="",x.BOOK="",x.DOWNLOAD_PLAIN="",x.CHECK="",x.TOPICS="",x.EYE="\f06e",x.DISC="",x.CIRCLE="",x.SHARED="",x.SORT_UNSORTED="",x.SORT_UP="",x.SORT_DOWN="",x.WORKING="",x.CLOSE="",x.ZOOM_OUT="",x.ZOOM_IN="",x.ZOOM_REALSIZE="",x.ZOOM_FULLSCREEN="",x.ADMIN_RESTRICTED="",x.ADMIN_THEME="",x.WARNING="",x.CONTEXT="",x.SEARCH_HOME="",x.STEPS="",x.HOME="",x.TRANSLATE="",x.USER="",x.ADMIN="",x.ANALYTICS="",x.ADMIN_KHUB="",x.ADMIN_USERS="",x.ADMIN_INTEGRATION="",x.ADMIN_PORTAL="",e.FtFileFormatIcons=void 0,(p=e.FtFileFormatIcons||(e.FtFileFormatIcons={})).UNKNOWN="",p.ABW="",p.AUDIO="",p.AVI="",p.CHM="",p.CODE="",p.CSV="",p.DITA="",p.EPUB="",p.EXCEL="",p.FLAC="",p.GIF="",p.GZIP="",p.HTML="",p.IMAGE="",p.JPEG="",p.JSON="",p.M4A="",p.MOV="",p.MP3="",p.MP4="",p.OGG="",p.PDF="",p.PNG="",p.POWERPOINT="",p.RAR="",p.STP="",p.TEXT="",p.VIDEO="",p.WAV="",p.WMA="",p.WORD="",p.XML="",p.YAML="",p.ZIP="";const n=new Map([...["abw"].map((t=>[t,e.FtFileFormatIcons.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,e.FtFileFormatIcons.AUDIO])),...["avi"].map((t=>[t,e.FtFileFormatIcons.AVI])),...["chm","xhs"].map((t=>[t,e.FtFileFormatIcons.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,e.FtFileFormatIcons.CODE])),...["csv"].map((t=>[t,e.FtFileFormatIcons.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,e.FtFileFormatIcons.DITA])),...["epub"].map((t=>[t,e.FtFileFormatIcons.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,e.FtFileFormatIcons.EXCEL])),...["flac"].map((t=>[t,e.FtFileFormatIcons.FLAC])),...["gif"].map((t=>[t,e.FtFileFormatIcons.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,e.FtFileFormatIcons.GZIP])),...["html","htm","xhtml"].map((t=>[t,e.FtFileFormatIcons.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,e.FtFileFormatIcons.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,e.FtFileFormatIcons.JPEG])),...["json"].map((t=>[t,e.FtFileFormatIcons.JSON])),...["m4a","m4p"].map((t=>[t,e.FtFileFormatIcons.M4A])),...["mov","qt"].map((t=>[t,e.FtFileFormatIcons.MOV])),...["mp3"].map((t=>[t,e.FtFileFormatIcons.MP3])),...["mp4","m4v"].map((t=>[t,e.FtFileFormatIcons.MP4])),...["ogg","oga"].map((t=>[t,e.FtFileFormatIcons.OGG])),...["pdf","ps"].map((t=>[t,e.FtFileFormatIcons.PDF])),...["png"].map((t=>[t,e.FtFileFormatIcons.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,e.FtFileFormatIcons.POWERPOINT])),...["rar"].map((t=>[t,e.FtFileFormatIcons.RAR])),...["stp"].map((t=>[t,e.FtFileFormatIcons.STP])),...["txt","rtf","md","mdown"].map((t=>[t,e.FtFileFormatIcons.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,e.FtFileFormatIcons.VIDEO])),...["wav"].map((t=>[t,e.FtFileFormatIcons.WAV])),...["wma"].map((t=>[t,e.FtFileFormatIcons.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,e.FtFileFormatIcons.WORD])),...["xml","xsl","rdf"].map((t=>[t,e.FtFileFormatIcons.XML])),...["yaml","yml","x-yaml"].map((t=>[t,e.FtFileFormatIcons.YAML])),...["zip"].map((t=>[t,e.FtFileFormatIcons.ZIP]))]),l=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var m
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
!function(e,t,a,i,o){var x,p;e.FtIcons=void 0,(x=e.FtIcons||(e.FtIcons={})).THIN_ARROW_LEFT="",x.THIN_ARROW_RIGHT="",x.MY_COLLECTIONS="",x.OFFLINE_SETTINGS="",x.MY_LIBRARY="",x.RATE_PLAIN="",x.RATE="",x.FEEDBACK_PLAIN="",x.STAR_PLAIN="",x.STAR="",x.THUMBS_DOWN_PLAIN="",x.THUMBS_DOWN="",x.THUMBS_UP_PLAIN="",x.THUMBS_UP="",x.PAUSE="",x.PLAY="",x.RELATIVES_PLAIN="",x.RELATIVES="",x.SHORTCUT_MENU="",x.PRINT="",x.DEFAULT_ROLES="",x.ACCOUNT_SETTINGS="",x.ONLINE="",x.OFFLINE="",x.UPLOAD="",x.BOOK_PLAIN="",x.SYNC="",x.SHARED_PBK="",x.COLLECTIONS="",x.SEARCH_IN_PUBLICATION="",x.BOOKS="",x.LOCKER="",x.ARROW_DOWN="",x.ARROW_LEFT="",x.ARROW_RIGHT="",x.ARROW_UP="",x.SAVE="",x.MAILS_AND_NOTIFICATIONS="",x.DOT="",x.MINUS="",x.PLUS="",x.FILTERS="",x.STRIPE_ARROW_RIGHT="",x.STRIPE_ARROW_LEFT="",x.ATTACHMENTS="",x.ADD_BOOKMARK="",x.BOOKMARK="",x.EXPORT="",x.MENU="",x.TAG="",x.TAG_PLAIN="",x.COPY_TO_CLIPBOARD="",x.COLUMNS="",x.ARTICLE="",x.CLOSE_PLAIN="",x.CHECK_PLAIN="",x.LOGOUT="",x.SIGN_IN="",x.THIN_ARROW="",x.TRIANGLE_BOTTOM="",x.TRIANGLE_LEFT="",x.TRIANGLE_RIGHT="",x.TRIANGLE_TOP="",x.FACET_HAS_DESCENDANT="",x.MINUS_PLAIN="",x.PLUS_PLAIN="",x.INFO="",x.ICON_EXPAND="",x.ICON_COLLAPSE="",x.ADD_TO_PBK="",x.ALERT="",x.ADD_ALERT="",x.BACK_TO_SEARCH="",x.DOWNLOAD="",x.EDIT="",x.FEEDBACK="",x.MODIFY_PBK="",x.SCHEDULED="",x.SEARCH="",x.SHARE="󨃱",x.TOC="",x.WRITE_UGC="",x.TRASH="",x.EXTLINK="",x.CALENDAR="",x.BOOK="",x.DOWNLOAD_PLAIN="",x.CHECK="",x.TOPICS="",x.EYE="\f06e",x.DISC="",x.CIRCLE="",x.SHARED="",x.SORT_UNSORTED="",x.SORT_UP="",x.SORT_DOWN="",x.WORKING="",x.CLOSE="",x.ZOOM_OUT="",x.ZOOM_IN="",x.ZOOM_REALSIZE="",x.ZOOM_FULLSCREEN="",x.ADMIN_RESTRICTED="",x.ADMIN_THEME="",x.WARNING="",x.CONTEXT="",x.SEARCH_HOME="",x.STEPS="",x.HOME="",x.TRANSLATE="",x.USER="",x.ADMIN="",x.ANALYTICS="",x.ADMIN_KHUB="",x.ADMIN_USERS="",x.ADMIN_INTEGRATION="",x.ADMIN_PORTAL="",e.FtFileFormatIcons=void 0,(p=e.FtFileFormatIcons||(e.FtFileFormatIcons={})).UNKNOWN="",p.ABW="",p.AUDIO="",p.AVI="",p.CHM="",p.CODE="",p.CSV="",p.DITA="",p.EPUB="",p.EXCEL="",p.FLAC="",p.GIF="",p.GZIP="",p.HTML="",p.IMAGE="",p.JPEG="",p.JSON="",p.M4A="",p.MOV="",p.MP3="",p.MP4="",p.OGG="",p.PDF="",p.PNG="",p.POWERPOINT="",p.RAR="",p.STP="",p.TEXT="",p.VIDEO="",p.WAV="",p.WMA="",p.WORD="",p.XML="",p.YAML="",p.ZIP="";const n=new Map([...["abw"].map((t=>[t,e.FtFileFormatIcons.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,e.FtFileFormatIcons.AUDIO])),...["avi"].map((t=>[t,e.FtFileFormatIcons.AVI])),...["chm","xhs"].map((t=>[t,e.FtFileFormatIcons.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,e.FtFileFormatIcons.CODE])),...["csv"].map((t=>[t,e.FtFileFormatIcons.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,e.FtFileFormatIcons.DITA])),...["epub"].map((t=>[t,e.FtFileFormatIcons.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,e.FtFileFormatIcons.EXCEL])),...["flac"].map((t=>[t,e.FtFileFormatIcons.FLAC])),...["gif"].map((t=>[t,e.FtFileFormatIcons.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,e.FtFileFormatIcons.GZIP])),...["html","htm","xhtml"].map((t=>[t,e.FtFileFormatIcons.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,e.FtFileFormatIcons.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,e.FtFileFormatIcons.JPEG])),...["json"].map((t=>[t,e.FtFileFormatIcons.JSON])),...["m4a","m4p"].map((t=>[t,e.FtFileFormatIcons.M4A])),...["mov","qt"].map((t=>[t,e.FtFileFormatIcons.MOV])),...["mp3"].map((t=>[t,e.FtFileFormatIcons.MP3])),...["mp4","m4v"].map((t=>[t,e.FtFileFormatIcons.MP4])),...["ogg","oga"].map((t=>[t,e.FtFileFormatIcons.OGG])),...["pdf","ps"].map((t=>[t,e.FtFileFormatIcons.PDF])),...["png"].map((t=>[t,e.FtFileFormatIcons.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,e.FtFileFormatIcons.POWERPOINT])),...["rar"].map((t=>[t,e.FtFileFormatIcons.RAR])),...["stp"].map((t=>[t,e.FtFileFormatIcons.STP])),...["txt","rtf","md","mdown"].map((t=>[t,e.FtFileFormatIcons.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,e.FtFileFormatIcons.VIDEO])),...["wav"].map((t=>[t,e.FtFileFormatIcons.WAV])),...["wma"].map((t=>[t,e.FtFileFormatIcons.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,e.FtFileFormatIcons.WORD])),...["xml","xsl","rdf"].map((t=>[t,e.FtFileFormatIcons.XML])),...["yaml","yml","x-yaml"].map((t=>[t,e.FtFileFormatIcons.YAML])),...["zip"].map((t=>[t,e.FtFileFormatIcons.ZIP]))]),l=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var s,m=function(e,t,a,i){for(var o,x=arguments.length,p=x<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i,n=e.length-1;n>=0;n--)(o=e[n])&&(p=(x<3?o(p):x>3?o(t,a,p):o(t,a))||p);return x>3&&p&&Object.defineProperty(t,a,p),p};e.FtIconVariants=void 0,(s=e.FtIconVariants||(e.FtIconVariants={})).fluid_topics="fluid-topics",s.file_format="file-format",s.material="material";const c={size:t.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:t.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",t.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:t.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",t.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:t.FtCssVariableFactory.extend("--ft-icon-material-font-family",t.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:t.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")};class d extends t.FtLitElement{constructor(){super(...arguments),this.variant=e.FtIconVariants.fluid_topics,this.resolvedIcon=a.nothing}render(){return a.html`
|
|
2
|
+
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
3
|
+
${o.unsafeHTML(this.resolvedIcon)}
|
|
4
|
+
<slot ?hidden=${"material"!==this.variant}></slot>
|
|
5
|
+
</i>
|
|
6
|
+
`}get textContent(){var e,t;return null!==(t=null===(e=this.slottedContent)||void 0===e?void 0:e.assignedNodes().map((e=>e.textContent)).join("").trim())&&void 0!==t?t:""}update(e){super.update(e),["value","variant"].some((t=>e.has(t)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case e.FtIconVariants.file_format:this.resolvedIcon=null!==(t=e.FtFileFormatIcons[o.toUpperCase()])&&void 0!==t?t:o;break;case e.FtIconVariants.fluid_topics:this.resolvedIcon=null!==(i=e.FtIcons[o.toUpperCase()])&&void 0!==i?i:o;break;default:this.resolvedIcon=a.nothing}}firstUpdated(e){super.firstUpdated(e),setTimeout((()=>{this.resolveIcon()}))}}d.elementDefinitions={},d.styles=a.css`
|
|
7
|
+
:host {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
:host, i.ft-icon {
|
|
12
|
+
width: ${c.size};
|
|
13
|
+
height: ${c.size};
|
|
14
|
+
text-align: center;
|
|
15
|
+
}
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
i.ft-icon {
|
|
18
|
+
font-size: ${c.size};
|
|
19
|
+
line-height: 1;
|
|
20
|
+
font-weight: normal;
|
|
21
|
+
text-transform: none;
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-variant: normal;
|
|
24
|
+
speak: none;
|
|
25
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
26
|
+
text-rendering: auto;
|
|
27
|
+
-webkit-font-smoothing: antialiased;
|
|
28
|
+
-moz-osx-font-smoothing: grayscale;
|
|
29
|
+
vertical-align: ${c.verticalAlign};
|
|
30
|
+
}
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
.ft-icon--fluid-topics {
|
|
33
|
+
font-family: ${c.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
34
|
+
}
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
.ft-icon--file-format {
|
|
37
|
+
font-family: ${c.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
38
|
+
}
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
40
|
-
${o.unsafeHTML(this.getIcon())}
|
|
41
|
-
<slot @slotchange=${()=>this.requestUpdate()} ?hidden=${"material"!==this.variant}></slot>
|
|
42
|
-
</i>
|
|
43
|
-
`}get textContent(){var e,t;return null!==(t=null===(e=this.slottedContent)||void 0===e?void 0:e.assignedNodes().map((e=>e.textContent)).join("").trim())&&void 0!==t?t:""}getIcon(){var t,i;let o=this.textContent;return this.variant===e.FtIconVariants.file_format?null!==(t=e.FtFileFormatIcons[o.toUpperCase()])&&void 0!==t?t:o:this.variant===e.FtIconVariants.fluid_topics?null!==(i=e.FtIcons[o.toUpperCase()])&&void 0!==i?i:o:a.nothing}}f.elementDefinitions={},s([i.property()],f.prototype,"variant",void 0),s([i.query("slot")],f.prototype,"slottedContent",void 0),t.customElement("ft-icon")(f),e.FtIcon=f,e.FtIconCssVariables=c,e.resolveFileFormatIcon=function(t,a){var i,o,x,p;t=(null!=t?t:"").toLowerCase(),a=(null!=a?a:"").toLowerCase();const[m,s]=((null!==(i=l.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(p=null!==(x=null!==(o=n.get(s))&&void 0!==o?o:n.get(a))&&void 0!==x?x:n.get(m))&&void 0!==p?p:e.FtFileFormatIcons.UNKNOWN},Object.defineProperty(e,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML);
|
|
40
|
+
.ft-icon--material {
|
|
41
|
+
font-family: ${c.materialFontFamily}, "Material Icons", sans-serif;
|
|
42
|
+
}
|
|
43
|
+
`,m([i.property()],d.prototype,"variant",void 0),m([i.property()],d.prototype,"value",void 0),m([i.state()],d.prototype,"resolvedIcon",void 0),m([i.query("slot")],d.prototype,"slottedContent",void 0),t.customElement("ft-icon")(d),e.FtIcon=d,e.FtIconCssVariables=c,e.resolveFileFormatIcon=function(t,a){var i,o,x,p;t=(null!=t?t:"").toLowerCase(),a=(null!=a?a:"").toLowerCase();const[s,m]=((null!==(i=l.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(p=null!==(x=null!==(o=n.get(m))&&void 0!==o?o:n.get(a))&&void 0!==x?x:n.get(s))&&void 0!==p?p:e.FtFileFormatIcons.UNKNOWN},Object.defineProperty(e,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML);
|
package/build/ft-icon.min.js
CHANGED
|
@@ -85,49 +85,54 @@ const ct=2;
|
|
|
85
85
|
* Copyright 2017 Google LLC
|
|
86
86
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
87
87
|
*/
|
|
88
|
-
class pt extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.it=W,t.type!==ct)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===W||null==t)return this._t=void 0,this.it=t;if(t===B)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}pt.directiveName="unsafeHTML",pt.resultType=1;const ht=(t=>(...e)=>({_$litDirective$:t,values:e}))(pt);var dt,ut;t.FtIcons=void 0,(dt=t.FtIcons||(t.FtIcons={})).THIN_ARROW_LEFT="",dt.THIN_ARROW_RIGHT="",dt.MY_COLLECTIONS="",dt.OFFLINE_SETTINGS="",dt.MY_LIBRARY="",dt.RATE_PLAIN="",dt.RATE="",dt.FEEDBACK_PLAIN="",dt.STAR_PLAIN="",dt.STAR="",dt.THUMBS_DOWN_PLAIN="",dt.THUMBS_DOWN="",dt.THUMBS_UP_PLAIN="",dt.THUMBS_UP="",dt.PAUSE="",dt.PLAY="",dt.RELATIVES_PLAIN="",dt.RELATIVES="",dt.SHORTCUT_MENU="",dt.PRINT="",dt.DEFAULT_ROLES="",dt.ACCOUNT_SETTINGS="",dt.ONLINE="",dt.OFFLINE="",dt.UPLOAD="",dt.BOOK_PLAIN="",dt.SYNC="",dt.SHARED_PBK="",dt.COLLECTIONS="",dt.SEARCH_IN_PUBLICATION="",dt.BOOKS="",dt.LOCKER="",dt.ARROW_DOWN="",dt.ARROW_LEFT="",dt.ARROW_RIGHT="",dt.ARROW_UP="",dt.SAVE="",dt.MAILS_AND_NOTIFICATIONS="",dt.DOT="",dt.MINUS="",dt.PLUS="",dt.FILTERS="",dt.STRIPE_ARROW_RIGHT="",dt.STRIPE_ARROW_LEFT="",dt.ATTACHMENTS="",dt.ADD_BOOKMARK="",dt.BOOKMARK="",dt.EXPORT="",dt.MENU="",dt.TAG="",dt.TAG_PLAIN="",dt.COPY_TO_CLIPBOARD="",dt.COLUMNS="",dt.ARTICLE="",dt.CLOSE_PLAIN="",dt.CHECK_PLAIN="",dt.LOGOUT="",dt.SIGN_IN="",dt.THIN_ARROW="",dt.TRIANGLE_BOTTOM="",dt.TRIANGLE_LEFT="",dt.TRIANGLE_RIGHT="",dt.TRIANGLE_TOP="",dt.FACET_HAS_DESCENDANT="",dt.MINUS_PLAIN="",dt.PLUS_PLAIN="",dt.INFO="",dt.ICON_EXPAND="",dt.ICON_COLLAPSE="",dt.ADD_TO_PBK="",dt.ALERT="",dt.ADD_ALERT="",dt.BACK_TO_SEARCH="",dt.DOWNLOAD="",dt.EDIT="",dt.FEEDBACK="",dt.MODIFY_PBK="",dt.SCHEDULED="",dt.SEARCH="",dt.SHARE="󨃱",dt.TOC="",dt.WRITE_UGC="",dt.TRASH="",dt.EXTLINK="",dt.CALENDAR="",dt.BOOK="",dt.DOWNLOAD_PLAIN="",dt.CHECK="",dt.TOPICS="",dt.EYE="\f06e",dt.DISC="",dt.CIRCLE="",dt.SHARED="",dt.SORT_UNSORTED="",dt.SORT_UP="",dt.SORT_DOWN="",dt.WORKING="",dt.CLOSE="",dt.ZOOM_OUT="",dt.ZOOM_IN="",dt.ZOOM_REALSIZE="",dt.ZOOM_FULLSCREEN="",dt.ADMIN_RESTRICTED="",dt.ADMIN_THEME="",dt.WARNING="",dt.CONTEXT="",dt.SEARCH_HOME="",dt.STEPS="",dt.HOME="",dt.TRANSLATE="",dt.USER="",dt.ADMIN="",dt.ANALYTICS="",dt.ADMIN_KHUB="",dt.ADMIN_USERS="",dt.ADMIN_INTEGRATION="",dt.ADMIN_PORTAL="",t.FtFileFormatIcons=void 0,(ut=t.FtFileFormatIcons||(t.FtFileFormatIcons={})).UNKNOWN="",ut.ABW="",ut.AUDIO="",ut.AVI="",ut.CHM="",ut.CODE="",ut.CSV="",ut.DITA="",ut.EPUB="",ut.EXCEL="",ut.FLAC="",ut.GIF="",ut.GZIP="",ut.HTML="",ut.IMAGE="",ut.JPEG="",ut.JSON="",ut.M4A="",ut.MOV="",ut.MP3="",ut.MP4="",ut.OGG="",ut.PDF="",ut.PNG="",ut.POWERPOINT="",ut.RAR="",ut.STP="",ut.TEXT="",ut.VIDEO="",ut.WAV="",ut.WMA="",ut.WORD="",ut.XML="",ut.YAML="",ut.ZIP="";const xt=new Map([...["abw"].map((e=>[e,t.FtFileFormatIcons.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((e=>[e,t.FtFileFormatIcons.AUDIO])),...["avi"].map((e=>[e,t.FtFileFormatIcons.AVI])),...["chm","xhs"].map((e=>[e,t.FtFileFormatIcons.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((e=>[e,t.FtFileFormatIcons.CODE])),...["csv"].map((e=>[e,t.FtFileFormatIcons.CSV])),...["dita","ditamap","ditaval"].map((e=>[e,t.FtFileFormatIcons.DITA])),...["epub"].map((e=>[e,t.FtFileFormatIcons.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((e=>[e,t.FtFileFormatIcons.EXCEL])),...["flac"].map((e=>[e,t.FtFileFormatIcons.FLAC])),...["gif"].map((e=>[e,t.FtFileFormatIcons.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((e=>[e,t.FtFileFormatIcons.GZIP])),...["html","htm","xhtml"].map((e=>[e,t.FtFileFormatIcons.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((e=>[e,t.FtFileFormatIcons.IMAGE])),...["jpeg","jpg","jpe"].map((e=>[e,t.FtFileFormatIcons.JPEG])),...["json"].map((e=>[e,t.FtFileFormatIcons.JSON])),...["m4a","m4p"].map((e=>[e,t.FtFileFormatIcons.M4A])),...["mov","qt"].map((e=>[e,t.FtFileFormatIcons.MOV])),...["mp3"].map((e=>[e,t.FtFileFormatIcons.MP3])),...["mp4","m4v"].map((e=>[e,t.FtFileFormatIcons.MP4])),...["ogg","oga"].map((e=>[e,t.FtFileFormatIcons.OGG])),...["pdf","ps"].map((e=>[e,t.FtFileFormatIcons.PDF])),...["png"].map((e=>[e,t.FtFileFormatIcons.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((e=>[e,t.FtFileFormatIcons.POWERPOINT])),...["rar"].map((e=>[e,t.FtFileFormatIcons.RAR])),...["stp"].map((e=>[e,t.FtFileFormatIcons.STP])),...["txt","rtf","md","mdown"].map((e=>[e,t.FtFileFormatIcons.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((e=>[e,t.FtFileFormatIcons.VIDEO])),...["wav"].map((e=>[e,t.FtFileFormatIcons.WAV])),...["wma"].map((e=>[e,t.FtFileFormatIcons.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((e=>[e,t.FtFileFormatIcons.WORD])),...["xml","xsl","rdf"].map((e=>[e,t.FtFileFormatIcons.XML])),...["yaml","yml","x-yaml"].map((e=>[e,t.FtFileFormatIcons.YAML])),...["zip"].map((e=>[e,t.FtFileFormatIcons.ZIP]))]),ft=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var vt,mt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};t.FtIconVariants=void 0,(vt=t.FtIconVariants||(t.FtIconVariants={})).fluid_topics="fluid-topics",vt.file_format="file-format",vt.material="material";const bt={size:ot.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:ot.extend("--ft-icon-fluid-topics-font-family",ot.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:ot.extend("--ft-icon-file-format-font-family",ot.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:ot.extend("--ft-icon-material-font-family",ot.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:ot.create("--ft-icon-vertical-align","UNKNOWN","unset")};class gt extends lt{constructor(){super(...arguments),this.variant=t.FtIconVariants.fluid_topics}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
class pt extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.it=W,t.type!==ct)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===W||null==t)return this._t=void 0,this.it=t;if(t===B)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}pt.directiveName="unsafeHTML",pt.resultType=1;const ht=(t=>(...e)=>({_$litDirective$:t,values:e}))(pt);var dt,ut;t.FtIcons=void 0,(dt=t.FtIcons||(t.FtIcons={})).THIN_ARROW_LEFT="",dt.THIN_ARROW_RIGHT="",dt.MY_COLLECTIONS="",dt.OFFLINE_SETTINGS="",dt.MY_LIBRARY="",dt.RATE_PLAIN="",dt.RATE="",dt.FEEDBACK_PLAIN="",dt.STAR_PLAIN="",dt.STAR="",dt.THUMBS_DOWN_PLAIN="",dt.THUMBS_DOWN="",dt.THUMBS_UP_PLAIN="",dt.THUMBS_UP="",dt.PAUSE="",dt.PLAY="",dt.RELATIVES_PLAIN="",dt.RELATIVES="",dt.SHORTCUT_MENU="",dt.PRINT="",dt.DEFAULT_ROLES="",dt.ACCOUNT_SETTINGS="",dt.ONLINE="",dt.OFFLINE="",dt.UPLOAD="",dt.BOOK_PLAIN="",dt.SYNC="",dt.SHARED_PBK="",dt.COLLECTIONS="",dt.SEARCH_IN_PUBLICATION="",dt.BOOKS="",dt.LOCKER="",dt.ARROW_DOWN="",dt.ARROW_LEFT="",dt.ARROW_RIGHT="",dt.ARROW_UP="",dt.SAVE="",dt.MAILS_AND_NOTIFICATIONS="",dt.DOT="",dt.MINUS="",dt.PLUS="",dt.FILTERS="",dt.STRIPE_ARROW_RIGHT="",dt.STRIPE_ARROW_LEFT="",dt.ATTACHMENTS="",dt.ADD_BOOKMARK="",dt.BOOKMARK="",dt.EXPORT="",dt.MENU="",dt.TAG="",dt.TAG_PLAIN="",dt.COPY_TO_CLIPBOARD="",dt.COLUMNS="",dt.ARTICLE="",dt.CLOSE_PLAIN="",dt.CHECK_PLAIN="",dt.LOGOUT="",dt.SIGN_IN="",dt.THIN_ARROW="",dt.TRIANGLE_BOTTOM="",dt.TRIANGLE_LEFT="",dt.TRIANGLE_RIGHT="",dt.TRIANGLE_TOP="",dt.FACET_HAS_DESCENDANT="",dt.MINUS_PLAIN="",dt.PLUS_PLAIN="",dt.INFO="",dt.ICON_EXPAND="",dt.ICON_COLLAPSE="",dt.ADD_TO_PBK="",dt.ALERT="",dt.ADD_ALERT="",dt.BACK_TO_SEARCH="",dt.DOWNLOAD="",dt.EDIT="",dt.FEEDBACK="",dt.MODIFY_PBK="",dt.SCHEDULED="",dt.SEARCH="",dt.SHARE="󨃱",dt.TOC="",dt.WRITE_UGC="",dt.TRASH="",dt.EXTLINK="",dt.CALENDAR="",dt.BOOK="",dt.DOWNLOAD_PLAIN="",dt.CHECK="",dt.TOPICS="",dt.EYE="\f06e",dt.DISC="",dt.CIRCLE="",dt.SHARED="",dt.SORT_UNSORTED="",dt.SORT_UP="",dt.SORT_DOWN="",dt.WORKING="",dt.CLOSE="",dt.ZOOM_OUT="",dt.ZOOM_IN="",dt.ZOOM_REALSIZE="",dt.ZOOM_FULLSCREEN="",dt.ADMIN_RESTRICTED="",dt.ADMIN_THEME="",dt.WARNING="",dt.CONTEXT="",dt.SEARCH_HOME="",dt.STEPS="",dt.HOME="",dt.TRANSLATE="",dt.USER="",dt.ADMIN="",dt.ANALYTICS="",dt.ADMIN_KHUB="",dt.ADMIN_USERS="",dt.ADMIN_INTEGRATION="",dt.ADMIN_PORTAL="",t.FtFileFormatIcons=void 0,(ut=t.FtFileFormatIcons||(t.FtFileFormatIcons={})).UNKNOWN="",ut.ABW="",ut.AUDIO="",ut.AVI="",ut.CHM="",ut.CODE="",ut.CSV="",ut.DITA="",ut.EPUB="",ut.EXCEL="",ut.FLAC="",ut.GIF="",ut.GZIP="",ut.HTML="",ut.IMAGE="",ut.JPEG="",ut.JSON="",ut.M4A="",ut.MOV="",ut.MP3="",ut.MP4="",ut.OGG="",ut.PDF="",ut.PNG="",ut.POWERPOINT="",ut.RAR="",ut.STP="",ut.TEXT="",ut.VIDEO="",ut.WAV="",ut.WMA="",ut.WORD="",ut.XML="",ut.YAML="",ut.ZIP="";const xt=new Map([...["abw"].map((e=>[e,t.FtFileFormatIcons.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((e=>[e,t.FtFileFormatIcons.AUDIO])),...["avi"].map((e=>[e,t.FtFileFormatIcons.AVI])),...["chm","xhs"].map((e=>[e,t.FtFileFormatIcons.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((e=>[e,t.FtFileFormatIcons.CODE])),...["csv"].map((e=>[e,t.FtFileFormatIcons.CSV])),...["dita","ditamap","ditaval"].map((e=>[e,t.FtFileFormatIcons.DITA])),...["epub"].map((e=>[e,t.FtFileFormatIcons.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((e=>[e,t.FtFileFormatIcons.EXCEL])),...["flac"].map((e=>[e,t.FtFileFormatIcons.FLAC])),...["gif"].map((e=>[e,t.FtFileFormatIcons.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((e=>[e,t.FtFileFormatIcons.GZIP])),...["html","htm","xhtml"].map((e=>[e,t.FtFileFormatIcons.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((e=>[e,t.FtFileFormatIcons.IMAGE])),...["jpeg","jpg","jpe"].map((e=>[e,t.FtFileFormatIcons.JPEG])),...["json"].map((e=>[e,t.FtFileFormatIcons.JSON])),...["m4a","m4p"].map((e=>[e,t.FtFileFormatIcons.M4A])),...["mov","qt"].map((e=>[e,t.FtFileFormatIcons.MOV])),...["mp3"].map((e=>[e,t.FtFileFormatIcons.MP3])),...["mp4","m4v"].map((e=>[e,t.FtFileFormatIcons.MP4])),...["ogg","oga"].map((e=>[e,t.FtFileFormatIcons.OGG])),...["pdf","ps"].map((e=>[e,t.FtFileFormatIcons.PDF])),...["png"].map((e=>[e,t.FtFileFormatIcons.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((e=>[e,t.FtFileFormatIcons.POWERPOINT])),...["rar"].map((e=>[e,t.FtFileFormatIcons.RAR])),...["stp"].map((e=>[e,t.FtFileFormatIcons.STP])),...["txt","rtf","md","mdown"].map((e=>[e,t.FtFileFormatIcons.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((e=>[e,t.FtFileFormatIcons.VIDEO])),...["wav"].map((e=>[e,t.FtFileFormatIcons.WAV])),...["wma"].map((e=>[e,t.FtFileFormatIcons.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((e=>[e,t.FtFileFormatIcons.WORD])),...["xml","xsl","rdf"].map((e=>[e,t.FtFileFormatIcons.XML])),...["yaml","yml","x-yaml"].map((e=>[e,t.FtFileFormatIcons.YAML])),...["zip"].map((e=>[e,t.FtFileFormatIcons.ZIP]))]),ft=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var vt,mt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};t.FtIconVariants=void 0,(vt=t.FtIconVariants||(t.FtIconVariants={})).fluid_topics="fluid-topics",vt.file_format="file-format",vt.material="material";const bt={size:ot.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:ot.extend("--ft-icon-fluid-topics-font-family",ot.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:ot.extend("--ft-icon-file-format-font-family",ot.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:ot.extend("--ft-icon-material-font-family",ot.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:ot.create("--ft-icon-vertical-align","UNKNOWN","unset")};class gt extends lt{constructor(){super(...arguments),this.variant=t.FtIconVariants.fluid_topics,this.resolvedIcon=W}render(){return _`
|
|
89
|
+
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
90
|
+
${ht(this.resolvedIcon)}
|
|
91
|
+
<slot ?hidden=${"material"!==this.variant}></slot>
|
|
92
|
+
</i>
|
|
93
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var e,i;let s=this.value||this.textContent;switch(this.variant){case t.FtIconVariants.file_format:this.resolvedIcon=null!==(e=t.FtFileFormatIcons[s.toUpperCase()])&&void 0!==e?e:s;break;case t.FtIconVariants.fluid_topics:this.resolvedIcon=null!==(i=t.FtIcons[s.toUpperCase()])&&void 0!==i?i:s;break;default:this.resolvedIcon=W}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}var wt;gt.elementDefinitions={},gt.styles=c`
|
|
94
|
+
:host {
|
|
95
|
+
display: inline-block;
|
|
96
|
+
}
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
:host, i.ft-icon {
|
|
99
|
+
width: ${bt.size};
|
|
100
|
+
height: ${bt.size};
|
|
101
|
+
text-align: center;
|
|
102
|
+
}
|
|
98
103
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
i.ft-icon {
|
|
105
|
+
font-size: ${bt.size};
|
|
106
|
+
line-height: 1;
|
|
107
|
+
font-weight: normal;
|
|
108
|
+
text-transform: none;
|
|
109
|
+
font-style: normal;
|
|
110
|
+
font-variant: normal;
|
|
111
|
+
speak: none;
|
|
112
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
113
|
+
text-rendering: auto;
|
|
114
|
+
-webkit-font-smoothing: antialiased;
|
|
115
|
+
-moz-osx-font-smoothing: grayscale;
|
|
116
|
+
vertical-align: ${bt.verticalAlign};
|
|
117
|
+
}
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
.ft-icon--fluid-topics {
|
|
120
|
+
font-family: ${bt.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
121
|
+
}
|
|
117
122
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
.ft-icon--file-format {
|
|
124
|
+
font-family: ${bt.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
125
|
+
}
|
|
121
126
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
.ft-icon--material {
|
|
128
|
+
font-family: ${bt.materialFontFamily}, "Material Icons", sans-serif;
|
|
129
|
+
}
|
|
130
|
+
`,mt([i()],gt.prototype,"variant",void 0),mt([i()],gt.prototype,"value",void 0),mt([function(t){return i({...t,state:!0})}
|
|
131
|
+
/**
|
|
132
|
+
* @license
|
|
133
|
+
* Copyright 2017 Google LLC
|
|
134
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
135
|
+
*/()],gt.prototype,"resolvedIcon",void 0),mt([
|
|
131
136
|
/**
|
|
132
137
|
* @license
|
|
133
138
|
* Copyright 2017 Google LLC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-icon",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Typography components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "0.3.11",
|
|
23
23
|
"lit": "2.2.8"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "35c790329a8e7f9902aad2ea8d41386e5c0b36c9"
|
|
26
26
|
}
|