@rogieking/figui3 1.2.1 → 1.2.3
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/example.html +35 -0
- package/fig.css +4 -0
- package/fig.js +14 -2
- package/package.json +1 -1
package/example.html
CHANGED
|
@@ -553,6 +553,41 @@
|
|
|
553
553
|
<fig-spinner></fig-spinner>
|
|
554
554
|
|
|
555
555
|
<h2>Misc.</h2>
|
|
556
|
+
<hstack>
|
|
557
|
+
<fig-tooltip text="Tooltip"
|
|
558
|
+
delay="0">
|
|
559
|
+
<fig-chit />
|
|
560
|
+
</fig-tooltip>
|
|
561
|
+
<fig-tooltip text="Tooltip"
|
|
562
|
+
delay="0">
|
|
563
|
+
<fig-chit />
|
|
564
|
+
</fig-tooltip>
|
|
565
|
+
<fig-tooltip text="Tooltip"
|
|
566
|
+
delay="0">
|
|
567
|
+
<fig-chit />
|
|
568
|
+
</fig-tooltip>
|
|
569
|
+
<fig-tooltip text="Tooltip"
|
|
570
|
+
delay="0">
|
|
571
|
+
<fig-chit />
|
|
572
|
+
</fig-tooltip>
|
|
573
|
+
<fig-tooltip text="Tooltip"
|
|
574
|
+
delay="0">
|
|
575
|
+
<fig-chit />
|
|
576
|
+
</fig-tooltip>
|
|
577
|
+
<fig-tooltip text="Tooltip"
|
|
578
|
+
delay="0">
|
|
579
|
+
<fig-chit />
|
|
580
|
+
</fig-tooltip>
|
|
581
|
+
|
|
582
|
+
</hstack>
|
|
583
|
+
|
|
584
|
+
<fig-field>
|
|
585
|
+
<label>Minimal ranges</label>
|
|
586
|
+
<fig-slider text="true"
|
|
587
|
+
default="50"
|
|
588
|
+
variant="minimal"
|
|
589
|
+
value="50"></fig-slider>
|
|
590
|
+
</fig-field>
|
|
556
591
|
<fig-field direction="horizontal">
|
|
557
592
|
<label>Opacity</label>
|
|
558
593
|
<fig-slider type="opacity"
|
package/fig.css
CHANGED
|
@@ -1087,6 +1087,9 @@ fig-chit {
|
|
|
1087
1087
|
grid-area: 1/1;
|
|
1088
1088
|
place-self: center;
|
|
1089
1089
|
}
|
|
1090
|
+
input[type="color"] {
|
|
1091
|
+
opacity: 0;
|
|
1092
|
+
}
|
|
1090
1093
|
input[type="color"]::-webkit-color-swatch-wrapper {
|
|
1091
1094
|
background: none;
|
|
1092
1095
|
}
|
|
@@ -1743,6 +1746,7 @@ fig-slider {
|
|
|
1743
1746
|
position: relative;
|
|
1744
1747
|
display: block;
|
|
1745
1748
|
width: 100%;
|
|
1749
|
+
box-shadow: none;
|
|
1746
1750
|
|
|
1747
1751
|
/* Track */
|
|
1748
1752
|
&::before {
|
package/fig.js
CHANGED
|
@@ -204,7 +204,8 @@ class FigTooltip extends HTMLElement {
|
|
|
204
204
|
constructor() {
|
|
205
205
|
super();
|
|
206
206
|
this.action = this.getAttribute("action") || "hover";
|
|
207
|
-
|
|
207
|
+
let delay = parseInt(this.getAttribute("delay"));
|
|
208
|
+
this.delay = !isNaN(delay) ? delay : 500;
|
|
208
209
|
this.isOpen = false;
|
|
209
210
|
}
|
|
210
211
|
connectedCallback() {
|
|
@@ -318,6 +319,18 @@ class FigTooltip extends HTMLElement {
|
|
|
318
319
|
this.hidePopup();
|
|
319
320
|
}
|
|
320
321
|
}
|
|
322
|
+
static get observedAttributes() {
|
|
323
|
+
return ["action", "delay"];
|
|
324
|
+
}
|
|
325
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
326
|
+
if (name === "action") {
|
|
327
|
+
this.action = newValue;
|
|
328
|
+
}
|
|
329
|
+
if (name === "delay") {
|
|
330
|
+
let delay = parseInt(newValue);
|
|
331
|
+
this.delay = !isNaN(delay) ? delay : 500;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
321
334
|
}
|
|
322
335
|
|
|
323
336
|
customElements.define("fig-tooltip", FigTooltip);
|
|
@@ -941,7 +954,6 @@ class FigInputText extends HTMLElement {
|
|
|
941
954
|
Number(this.value) + step,
|
|
942
955
|
false
|
|
943
956
|
).toFixed(2);
|
|
944
|
-
console.log("MM:", value, this.max);
|
|
945
957
|
this.setAttribute("value", value);
|
|
946
958
|
}
|
|
947
959
|
}
|