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 */
|
||||
const Radio = (props) => {
|
||||
const { label, tooltip, value, ...rest } = props;
|
||||
const { label, tooltip, value, name, ...rest } = props;
|
||||
|
||||
const radioEl = sigpro.$html("input", {
|
||||
...rest,
|
||||
type: "radio",
|
||||
name: name,
|
||||
class: joinClass("radio", props.class),
|
||||
checked: () => val(value) === props.value,
|
||||
disabled: () => val(props.disabled),
|
||||
@@ -1159,9 +1160,7 @@ var RangeModule = /*#__PURE__*/Object.freeze({
|
||||
|
||||
/** RATING */
|
||||
const Rating = (props) => {
|
||||
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
||||
|
||||
// Generamos un ID único para el grupo de radio buttons
|
||||
const { value, count = 5, mask = "mask-star", readonly = false, onchange, ...rest } = props;
|
||||
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
||||
|
||||
return sigpro.$html(
|
||||
@@ -1172,16 +1171,19 @@ const Rating = (props) => {
|
||||
},
|
||||
Array.from({ length: val(count) }, (_, i) => {
|
||||
const starValue = i + 1;
|
||||
|
||||
return sigpro.$html("input", {
|
||||
type: "radio",
|
||||
name: ratingGroup,
|
||||
class: `mask ${mask}`,
|
||||
"aria-label": `${starValue} star`,
|
||||
checked: () => Math.round(val(value)) === starValue,
|
||||
onchange: () => {
|
||||
if (!val(readonly) && typeof value === "function") {
|
||||
value(starValue);
|
||||
if (!val(readonly)) {
|
||||
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 */
|
||||
const Radio = (props) => {
|
||||
const { label, tooltip, value, ...rest } = props;
|
||||
const { label, tooltip, value, name, ...rest } = props;
|
||||
|
||||
const radioEl = $html("input", {
|
||||
...rest,
|
||||
type: "radio",
|
||||
name: name,
|
||||
class: joinClass("radio", props.class),
|
||||
checked: () => val(value) === props.value,
|
||||
disabled: () => val(props.disabled),
|
||||
@@ -1155,9 +1156,7 @@ var RangeModule = /*#__PURE__*/Object.freeze({
|
||||
|
||||
/** RATING */
|
||||
const Rating = (props) => {
|
||||
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
||||
|
||||
// Generamos un ID único para el grupo de radio buttons
|
||||
const { value, count = 5, mask = "mask-star", readonly = false, onchange, ...rest } = props;
|
||||
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
||||
|
||||
return $html(
|
||||
@@ -1168,16 +1167,19 @@ const Rating = (props) => {
|
||||
},
|
||||
Array.from({ length: val(count) }, (_, i) => {
|
||||
const starValue = i + 1;
|
||||
|
||||
return $html("input", {
|
||||
type: "radio",
|
||||
name: ratingGroup,
|
||||
class: `mask ${mask}`,
|
||||
"aria-label": `${starValue} star`,
|
||||
checked: () => Math.round(val(value)) === starValue,
|
||||
onchange: () => {
|
||||
if (!val(readonly) && typeof value === "function") {
|
||||
value(starValue);
|
||||
if (!val(readonly)) {
|
||||
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 */
|
||||
const Radio = (props) => {
|
||||
const { label, tooltip, value, ...rest } = props;
|
||||
const { label, tooltip, value, name, ...rest } = props;
|
||||
|
||||
const radioEl = sigpro.$html("input", {
|
||||
...rest,
|
||||
type: "radio",
|
||||
name: name,
|
||||
class: joinClass("radio", props.class),
|
||||
checked: () => val(value) === props.value,
|
||||
disabled: () => val(props.disabled),
|
||||
@@ -1156,9 +1157,7 @@ var SigProUI = (function (exports, sigpro) {
|
||||
|
||||
/** RATING */
|
||||
const Rating = (props) => {
|
||||
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
||||
|
||||
// Generamos un ID único para el grupo de radio buttons
|
||||
const { value, count = 5, mask = "mask-star", readonly = false, onchange, ...rest } = props;
|
||||
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
||||
|
||||
return sigpro.$html(
|
||||
@@ -1169,16 +1168,19 @@ var SigProUI = (function (exports, sigpro) {
|
||||
},
|
||||
Array.from({ length: val(count) }, (_, i) => {
|
||||
const starValue = i + 1;
|
||||
|
||||
return sigpro.$html("input", {
|
||||
type: "radio",
|
||||
name: ratingGroup,
|
||||
class: `mask ${mask}`,
|
||||
"aria-label": `${starValue} star`,
|
||||
checked: () => Math.round(val(value)) === starValue,
|
||||
onchange: () => {
|
||||
if (!val(readonly) && typeof value === "function") {
|
||||
value(starValue);
|
||||
if (!val(readonly)) {
|
||||
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