Update CDN
This commit is contained in:
18
dist/sigpro-ui.cjs
vendored
18
dist/sigpro-ui.cjs
vendored
@@ -1104,11 +1104,12 @@ var NavbarModule = /*#__PURE__*/Object.freeze({
|
|||||||
|
|
||||||
/** RADIO */
|
/** RADIO */
|
||||||
const Radio = (props) => {
|
const Radio = (props) => {
|
||||||
const { label, tooltip, value, ...rest } = props;
|
const { label, tooltip, value, name, ...rest } = props;
|
||||||
|
|
||||||
const radioEl = sigpro.$html("input", {
|
const radioEl = sigpro.$html("input", {
|
||||||
...rest,
|
...rest,
|
||||||
type: "radio",
|
type: "radio",
|
||||||
|
name: name,
|
||||||
class: joinClass("radio", props.class),
|
class: joinClass("radio", props.class),
|
||||||
checked: () => val(value) === props.value,
|
checked: () => val(value) === props.value,
|
||||||
disabled: () => val(props.disabled),
|
disabled: () => val(props.disabled),
|
||||||
@@ -1159,9 +1160,7 @@ var RangeModule = /*#__PURE__*/Object.freeze({
|
|||||||
|
|
||||||
/** RATING */
|
/** RATING */
|
||||||
const Rating = (props) => {
|
const Rating = (props) => {
|
||||||
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
const { value, count = 5, mask = "mask-star", readonly = false, onchange, ...rest } = props;
|
||||||
|
|
||||||
// Generamos un ID único para el grupo de radio buttons
|
|
||||||
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
||||||
|
|
||||||
return sigpro.$html(
|
return sigpro.$html(
|
||||||
@@ -1172,16 +1171,19 @@ const Rating = (props) => {
|
|||||||
},
|
},
|
||||||
Array.from({ length: val(count) }, (_, i) => {
|
Array.from({ length: val(count) }, (_, i) => {
|
||||||
const starValue = i + 1;
|
const starValue = i + 1;
|
||||||
|
|
||||||
return sigpro.$html("input", {
|
return sigpro.$html("input", {
|
||||||
type: "radio",
|
type: "radio",
|
||||||
name: ratingGroup,
|
name: ratingGroup,
|
||||||
class: `mask ${mask}`,
|
class: `mask ${mask}`,
|
||||||
"aria-label": `${starValue} star`,
|
|
||||||
checked: () => Math.round(val(value)) === starValue,
|
checked: () => Math.round(val(value)) === starValue,
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
if (!val(readonly) && typeof value === "function") {
|
if (!val(readonly)) {
|
||||||
value(starValue);
|
if (typeof onchange === "function") {
|
||||||
|
onchange(starValue);
|
||||||
|
}
|
||||||
|
else if (typeof value === "function") {
|
||||||
|
value(starValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
18
dist/sigpro-ui.esm.js
vendored
18
dist/sigpro-ui.esm.js
vendored
@@ -1100,11 +1100,12 @@ var NavbarModule = /*#__PURE__*/Object.freeze({
|
|||||||
|
|
||||||
/** RADIO */
|
/** RADIO */
|
||||||
const Radio = (props) => {
|
const Radio = (props) => {
|
||||||
const { label, tooltip, value, ...rest } = props;
|
const { label, tooltip, value, name, ...rest } = props;
|
||||||
|
|
||||||
const radioEl = $html("input", {
|
const radioEl = $html("input", {
|
||||||
...rest,
|
...rest,
|
||||||
type: "radio",
|
type: "radio",
|
||||||
|
name: name,
|
||||||
class: joinClass("radio", props.class),
|
class: joinClass("radio", props.class),
|
||||||
checked: () => val(value) === props.value,
|
checked: () => val(value) === props.value,
|
||||||
disabled: () => val(props.disabled),
|
disabled: () => val(props.disabled),
|
||||||
@@ -1155,9 +1156,7 @@ var RangeModule = /*#__PURE__*/Object.freeze({
|
|||||||
|
|
||||||
/** RATING */
|
/** RATING */
|
||||||
const Rating = (props) => {
|
const Rating = (props) => {
|
||||||
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
const { value, count = 5, mask = "mask-star", readonly = false, onchange, ...rest } = props;
|
||||||
|
|
||||||
// Generamos un ID único para el grupo de radio buttons
|
|
||||||
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
||||||
|
|
||||||
return $html(
|
return $html(
|
||||||
@@ -1168,16 +1167,19 @@ const Rating = (props) => {
|
|||||||
},
|
},
|
||||||
Array.from({ length: val(count) }, (_, i) => {
|
Array.from({ length: val(count) }, (_, i) => {
|
||||||
const starValue = i + 1;
|
const starValue = i + 1;
|
||||||
|
|
||||||
return $html("input", {
|
return $html("input", {
|
||||||
type: "radio",
|
type: "radio",
|
||||||
name: ratingGroup,
|
name: ratingGroup,
|
||||||
class: `mask ${mask}`,
|
class: `mask ${mask}`,
|
||||||
"aria-label": `${starValue} star`,
|
|
||||||
checked: () => Math.round(val(value)) === starValue,
|
checked: () => Math.round(val(value)) === starValue,
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
if (!val(readonly) && typeof value === "function") {
|
if (!val(readonly)) {
|
||||||
value(starValue);
|
if (typeof onchange === "function") {
|
||||||
|
onchange(starValue);
|
||||||
|
}
|
||||||
|
else if (typeof value === "function") {
|
||||||
|
value(starValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
18
dist/sigpro-ui.umd.js
vendored
18
dist/sigpro-ui.umd.js
vendored
@@ -1101,11 +1101,12 @@ var SigProUI = (function (exports, sigpro) {
|
|||||||
|
|
||||||
/** RADIO */
|
/** RADIO */
|
||||||
const Radio = (props) => {
|
const Radio = (props) => {
|
||||||
const { label, tooltip, value, ...rest } = props;
|
const { label, tooltip, value, name, ...rest } = props;
|
||||||
|
|
||||||
const radioEl = sigpro.$html("input", {
|
const radioEl = sigpro.$html("input", {
|
||||||
...rest,
|
...rest,
|
||||||
type: "radio",
|
type: "radio",
|
||||||
|
name: name,
|
||||||
class: joinClass("radio", props.class),
|
class: joinClass("radio", props.class),
|
||||||
checked: () => val(value) === props.value,
|
checked: () => val(value) === props.value,
|
||||||
disabled: () => val(props.disabled),
|
disabled: () => val(props.disabled),
|
||||||
@@ -1156,9 +1157,7 @@ var SigProUI = (function (exports, sigpro) {
|
|||||||
|
|
||||||
/** RATING */
|
/** RATING */
|
||||||
const Rating = (props) => {
|
const Rating = (props) => {
|
||||||
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
const { value, count = 5, mask = "mask-star", readonly = false, onchange, ...rest } = props;
|
||||||
|
|
||||||
// Generamos un ID único para el grupo de radio buttons
|
|
||||||
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
||||||
|
|
||||||
return sigpro.$html(
|
return sigpro.$html(
|
||||||
@@ -1169,16 +1168,19 @@ var SigProUI = (function (exports, sigpro) {
|
|||||||
},
|
},
|
||||||
Array.from({ length: val(count) }, (_, i) => {
|
Array.from({ length: val(count) }, (_, i) => {
|
||||||
const starValue = i + 1;
|
const starValue = i + 1;
|
||||||
|
|
||||||
return sigpro.$html("input", {
|
return sigpro.$html("input", {
|
||||||
type: "radio",
|
type: "radio",
|
||||||
name: ratingGroup,
|
name: ratingGroup,
|
||||||
class: `mask ${mask}`,
|
class: `mask ${mask}`,
|
||||||
"aria-label": `${starValue} star`,
|
|
||||||
checked: () => Math.round(val(value)) === starValue,
|
checked: () => Math.round(val(value)) === starValue,
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
if (!val(readonly) && typeof value === "function") {
|
if (!val(readonly)) {
|
||||||
value(starValue);
|
if (typeof onchange === "function") {
|
||||||
|
onchange(starValue);
|
||||||
|
}
|
||||||
|
else if (typeof value === "function") {
|
||||||
|
value(starValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
2
dist/sigpro-ui.umd.min.js
vendored
2
dist/sigpro-ui.umd.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user