@descope/web-components-ui 1.0.370 → 1.0.371
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +18 -32
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
- package/dist/umd/descope-button-index-js.js +2 -2
- package/dist/umd/descope-icon-index-js.js +1 -1
- package/dist/umd/descope-upload-file-index-js.js +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-icon/IconClass.js +17 -30
- package/src/theme/components/button.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
@@ -2674,7 +2674,7 @@ const componentName$V = getComponentName('icon');
|
|
2674
2674
|
|
2675
2675
|
class RawIcon extends createBaseClass({ componentName: componentName$V, baseSelector: 'slot' }) {
|
2676
2676
|
static get observedAttributes() {
|
2677
|
-
return ['src'
|
2677
|
+
return ['src'];
|
2678
2678
|
}
|
2679
2679
|
|
2680
2680
|
#icon;
|
@@ -2699,36 +2699,23 @@ class RawIcon extends createBaseClass({ componentName: componentName$V, baseSele
|
|
2699
2699
|
`;
|
2700
2700
|
}
|
2701
2701
|
|
2702
|
-
get fillColor() {
|
2703
|
-
return this.getAttribute('fill-color') === 'true';
|
2704
|
-
}
|
2705
|
-
|
2706
2702
|
get src() {
|
2707
2703
|
return this.getAttribute('src');
|
2708
2704
|
}
|
2709
2705
|
|
2710
2706
|
// in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes
|
2711
2707
|
// with the value from the `st-fill` attribute
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
2718
|
-
|
2719
|
-
|
2720
|
-
)
|
2721
|
-
|
2722
|
-
|
2723
|
-
fillCssVar('*[fill]');
|
2724
|
-
fillCssVar('path');
|
2725
|
-
}
|
2726
|
-
}
|
2727
|
-
|
2728
|
-
resetIcon() {
|
2729
|
-
if (!this.#icon) return;
|
2730
|
-
this.innerHTML = '';
|
2731
|
-
this.appendChild(this.#icon.cloneNode(true));
|
2708
|
+
// eslint-disable-next-line class-methods-use-this
|
2709
|
+
updateFillColor(node) {
|
2710
|
+
// set fill to root node and all its relevant selectors
|
2711
|
+
const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];
|
2712
|
+
|
2713
|
+
elementsToReplace.forEach((ele) => {
|
2714
|
+
ele.setAttribute(
|
2715
|
+
'fill',
|
2716
|
+
`var(${IconClass.cssVarList.fill}, ${ele.getAttribute('fill') || "''"})`
|
2717
|
+
);
|
2718
|
+
});
|
2732
2719
|
}
|
2733
2720
|
|
2734
2721
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
@@ -2738,13 +2725,13 @@ class RawIcon extends createBaseClass({ componentName: componentName$V, baseSele
|
|
2738
2725
|
|
2739
2726
|
if (attrName === 'src') {
|
2740
2727
|
createIcon(this.src).then((res) => {
|
2741
|
-
this
|
2742
|
-
|
2743
|
-
|
2728
|
+
this.innerHTML = '';
|
2729
|
+
if (res) {
|
2730
|
+
const clonedNode = res.cloneNode(true);
|
2731
|
+
this.updateFillColor(clonedNode);
|
2732
|
+
this.appendChild(clonedNode);
|
2733
|
+
}
|
2744
2734
|
});
|
2745
|
-
} else if (attrName === 'fill-color') {
|
2746
|
-
this.resetIcon();
|
2747
|
-
this.updateFillColor();
|
2748
2735
|
}
|
2749
2736
|
}
|
2750
2737
|
}
|
@@ -2969,7 +2956,6 @@ const button = {
|
|
2969
2956
|
[compVars$6.outlineColor]: 'transparent',
|
2970
2957
|
|
2971
2958
|
[compVars$6.iconSize]: '1.5em',
|
2972
|
-
[compVars$6.iconColor]: 'currentColor',
|
2973
2959
|
|
2974
2960
|
size: {
|
2975
2961
|
xs: { [compVars$6.fontSize]: '12px' },
|