@kubex/zinc 1.1.20 → 1.1.21
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/dist/custom-elements.json +15 -1
- package/dist/web-types.json +1 -1
- package/dist/zn.d.ts +4 -1
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +9 -9
- package/package.json +1 -1
- package/scss/shared/_table.scss +0 -4
- package/src/components/icon/icon.component.ts +32 -14
- package/src/components/status-indicator/status-indicator.scss +1 -1
package/package.json
CHANGED
package/scss/shared/_table.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {choose} from 'lit/directives/choose.js';
|
|
2
2
|
import {classMap} from "lit/directives/class-map.js";
|
|
3
|
-
import {type CSSResultGroup, html, render, unsafeCSS} from 'lit';
|
|
3
|
+
import {type CSSResultGroup, html, type PropertyValues, render, unsafeCSS} from 'lit';
|
|
4
4
|
import {icons} from 'lucide';
|
|
5
5
|
import {property} from 'lit/decorators.js';
|
|
6
6
|
import {sha256} from '../../utilities/sha256';
|
|
@@ -90,6 +90,8 @@ export default class ZnIcon extends ZincElement {
|
|
|
90
90
|
gravatarOptions = "";
|
|
91
91
|
defaultLibrary: IconLibrary = "material-symbols-outlined";
|
|
92
92
|
|
|
93
|
+
private libraryAutoSet = false;
|
|
94
|
+
|
|
93
95
|
convertToLibrary(input: string): IconLibrary {
|
|
94
96
|
return this.convertIndicatorToLibrary(input) ?? this.defaultLibrary
|
|
95
97
|
}
|
|
@@ -140,6 +142,33 @@ export default class ZnIcon extends ZincElement {
|
|
|
140
142
|
connectedCallback() {
|
|
141
143
|
super.connectedCallback();
|
|
142
144
|
|
|
145
|
+
// load the material icons font if the library is set to material
|
|
146
|
+
render(html`
|
|
147
|
+
<link
|
|
148
|
+
href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.8/dist/kubex-icons.css"
|
|
149
|
+
rel="stylesheet">
|
|
150
|
+
<link
|
|
151
|
+
href="https://cdn.lineicons.com/5.0/lineicons.css"
|
|
152
|
+
rel="stylesheet">
|
|
153
|
+
<link
|
|
154
|
+
href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined|Material+Icons|Material+Icons+Round|Material+Icons+Sharp|Material+Icons+Two+Tone|Material+Icons+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
|
|
155
|
+
rel="stylesheet">`, document.head);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
protected override willUpdate(changedProperties: PropertyValues<this>) {
|
|
159
|
+
super.willUpdate(changedProperties);
|
|
160
|
+
|
|
161
|
+
if (changedProperties.has('src')) {
|
|
162
|
+
this.parseSrc();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private parseSrc() {
|
|
167
|
+
if (this.libraryAutoSet) {
|
|
168
|
+
this.library = undefined as unknown as IconLibrary;
|
|
169
|
+
this.libraryAutoSet = false;
|
|
170
|
+
}
|
|
171
|
+
|
|
143
172
|
let hashFragment = '';
|
|
144
173
|
|
|
145
174
|
if (this.src && this.src.includes('#')) {
|
|
@@ -157,8 +186,8 @@ export default class ZnIcon extends ZincElement {
|
|
|
157
186
|
if (libraryOrDomain.includes('.')) {
|
|
158
187
|
this.library = this.library ?? "gravatar";
|
|
159
188
|
} else if ((this.library === undefined) && indicatedLibrary !== undefined) {
|
|
160
|
-
// if split[1] is a valid library name, set it
|
|
161
189
|
this.library = indicatedLibrary;
|
|
190
|
+
this.libraryAutoSet = true;
|
|
162
191
|
this.src = this.src.slice(0, atIndex);
|
|
163
192
|
} else if (this.library !== undefined && indicatedLibrary === this.library) {
|
|
164
193
|
this.src = this.src.slice(0, atIndex);
|
|
@@ -173,21 +202,10 @@ export default class ZnIcon extends ZincElement {
|
|
|
173
202
|
} else if (!this.library && this.src && !this.src.includes('/')) {
|
|
174
203
|
this.applyHashFragment(hashFragment);
|
|
175
204
|
this.library = this.defaultLibrary;
|
|
205
|
+
this.libraryAutoSet = true;
|
|
176
206
|
} else {
|
|
177
207
|
this.applyHashFragment(hashFragment);
|
|
178
208
|
}
|
|
179
|
-
|
|
180
|
-
// load the material icons font if the library is set to material
|
|
181
|
-
render(html`
|
|
182
|
-
<link
|
|
183
|
-
href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.8/dist/kubex-icons.css"
|
|
184
|
-
rel="stylesheet">
|
|
185
|
-
<link
|
|
186
|
-
href="https://cdn.lineicons.com/5.0/lineicons.css"
|
|
187
|
-
rel="stylesheet">
|
|
188
|
-
<link
|
|
189
|
-
href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined|Material+Icons|Material+Icons+Round|Material+Icons+Sharp|Material+Icons+Two+Tone|Material+Icons+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
|
|
190
|
-
rel="stylesheet">`, document.head);
|
|
191
209
|
}
|
|
192
210
|
|
|
193
211
|
private applyHashFragment(hashFragment: string) {
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
50% {
|
|
117
117
|
background-color: rgba(var(--indicator-alt-color), 0.8);
|
|
118
118
|
border-color: rgb(var(--indicator-alt-color));
|
|
119
|
-
box-shadow: 0 0
|
|
119
|
+
box-shadow: 0 0 4px 2px rgba(var(--indicator-alt-color), 0.5);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|