sigpro-ui 1.0.6
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/Readme.md +146 -0
- package/dist/sigpro-ui.cjs +1677 -0
- package/dist/sigpro-ui.esm.js +1621 -0
- package/dist/sigpro-ui.umd.js +1680 -0
- package/dist/sigpro-ui.umd.min.js +1 -0
- package/index.js +40 -0
- package/package.json +52 -0
- package/src/components/Accordion.js +24 -0
- package/src/components/Alert.js +50 -0
- package/src/components/Autocomplete.js +95 -0
- package/src/components/Badge.js +6 -0
- package/src/components/Button.js +39 -0
- package/src/components/Checkbox.js +21 -0
- package/src/components/Colorpicker.js +81 -0
- package/src/components/Datepicker.js +252 -0
- package/src/components/Drawer.js +18 -0
- package/src/components/Dropdown.js +37 -0
- package/src/components/Fab.js +51 -0
- package/src/components/Fieldset.js +19 -0
- package/src/components/Fileinput.js +113 -0
- package/src/components/Indicator.js +9 -0
- package/src/components/Input.js +77 -0
- package/src/components/List.js +18 -0
- package/src/components/Loading.js +13 -0
- package/src/components/Menu.js +25 -0
- package/src/components/Modal.js +31 -0
- package/src/components/Navbar.js +6 -0
- package/src/components/Radio.js +25 -0
- package/src/components/Range.js +24 -0
- package/src/components/Rating.js +34 -0
- package/src/components/Select.js +36 -0
- package/src/components/Stack.js +6 -0
- package/src/components/Stat.js +11 -0
- package/src/components/Swap.js +13 -0
- package/src/components/Table.js +60 -0
- package/src/components/Tabs.js +46 -0
- package/src/components/Timeline.js +52 -0
- package/src/components/Toast.js +63 -0
- package/src/components/Tooltip.js +6 -0
- package/src/components/index.js +110 -0
- package/src/core/i18n.js +26 -0
- package/src/core/icons.js +17 -0
- package/src/core/utils.js +5 -0
|
@@ -0,0 +1,1677 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var sigpro = require('sigpro');
|
|
6
|
+
|
|
7
|
+
const val = t => typeof t === "function" ? t() : t;
|
|
8
|
+
|
|
9
|
+
const joinClass = (t, l) => typeof l === "function"
|
|
10
|
+
? () => `${t} ${l() || ""}`.trim()
|
|
11
|
+
: `${t} ${l || ""}`.trim();
|
|
12
|
+
|
|
13
|
+
var Utils = /*#__PURE__*/Object.freeze({
|
|
14
|
+
__proto__: null,
|
|
15
|
+
joinClass: joinClass,
|
|
16
|
+
val: val
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/** ACCORDION */
|
|
20
|
+
const Accordion = (props, children) => {
|
|
21
|
+
const { title, name, open, ...rest } = props;
|
|
22
|
+
|
|
23
|
+
return sigpro.$html(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
...rest,
|
|
27
|
+
class: joinClass("collapse collapse-arrow bg-base-200 mb-2", props.class),
|
|
28
|
+
},
|
|
29
|
+
[
|
|
30
|
+
sigpro.$html("input", {
|
|
31
|
+
type: name ? "radio" : "checkbox",
|
|
32
|
+
name: name,
|
|
33
|
+
checked: open
|
|
34
|
+
}),
|
|
35
|
+
sigpro.$html("div", { class: "collapse-title text-xl font-medium" }, title),
|
|
36
|
+
sigpro.$html("div", { class: "collapse-content" }, children),
|
|
37
|
+
],
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var AccordionModule = /*#__PURE__*/Object.freeze({
|
|
42
|
+
__proto__: null,
|
|
43
|
+
Accordion: Accordion
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const iconShow = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADjSURBVDiN3dJNSgNBEAXgz4DZeAAVJ9tko2St3kaIFxAVt4KZeAD1GKKi7vQSydI/yHgALxAXU02GxniAFBR0v1ev+3V1sZSxjxtM8BM5wTX2/hNu4gFvOMI21iJ3cIwP3GMjF/dQ4RyraOMS34GPAmvjIrBeEnfwjoPGgSM8ooh8QtngB6Ep4BWnmaMqkY1LqqzmDC8tzNDK3/RHzLL9SloUYWfQIMuw3Yl8xrDBH6qbvZWALqbqBqVmlWF7GuKEDwPr5hbXcYdPnKBv/o39wL5wG7ULY1c9NGPzQRrjKrhli1/02zEjWyWMBwAAAABJRU5ErkJggg==";
|
|
47
|
+
const iconHide = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEDSURBVDiN1dK/K8VhFAbwD+VLGSxKcu9guSQ/Zils/gNkuaX4BxRZDTdklYU/QAaDlEVGGwu2Kz/uVbKJzWDwfuv1+jHz1Km3c85znuf0Hv4jxnD2W8MItnCJ5xAX2MQcHsOQL+jEAapYQD9aQwxiDy+B3JKSe1DHCpqQYQ0PeMJOpDyAmyAAirjGbDRwFYcoYCZSzjGP+8B1gqXEUT2QxyPlqaRnGceNeENzUswwil1MBocbSU9DCAXUUI6K25HtIo5QSVaooitP9OEO65iIbE+HXSvBVRbeNZQSR9pxGil3o83HNw5hEbfYR0dKFki5ci+u8OrzIQ1/R8xx7ocL+9t4B0HPOVXjoptxAAAAAElFTkSuQmCC";
|
|
48
|
+
const iconClose = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABcSURBVDiN3dIxDoAwCIXhL563g3bSm+hlq4O6GFNbO+k/EV54QIDfsSBk9IA5ZxCQEG+0eGi5BqDHivEhV2xSXXwy2EdOR3xLV+ta0/26wvSm+KTYpPmMzY/0QTZeZR2f+FxhRQAAAABJRU5ErkJggg==";
|
|
49
|
+
const iconCalendar = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACLSURBVDiN7dO9CQJBFEXhb38K0FwQrMNEVpuwB0NjrcYabECsQk0sQ1mTF4zIjrgmBh54MMx998AEwzOrmC5e8gJjbDHCJO7PHYI0v2JT4Ig9DljGwq5DkOZTLOCOMoIhBpknpHmFWx3ldaaUo6oTc2/ab7rl+508f8GvCC5oenTn4tM1cWg/nBNmD4fBH/Kfvt2TAAAAAElFTkSuQmCC";
|
|
50
|
+
const iconLock = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAWQAAAFkBqp2phgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACQSURBVDiN7dKxDcJQDATQJ0YgXQQ1bAgDEIZBETPQwjakIjRQ8CMSyR8SiZKTrvHZd/r+JsYSNZrEI1ZR4ywzfElcJ55xwiITOECNTVDf4jDGoEEZ1Etcxxg8pmjRDiahb7BH20uKKPVUkVmL+YjQArdI+PT2bO9Pd/A34O71Rd9QeN/LAFUSckfUscWuG3oCgP8nrDH6T5AAAAAASUVORK5CYII=";
|
|
51
|
+
const iconAbc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADFSURBVDiN7dCxSoIBFAXgr1BbgmgSB5ubxKAHaAkcgnBpySVaDET3WhzcpQfoHZojawgX0ZZcfAWDSDdBoeUKP/8ojZ7tnnPv4dzDFv+KZzwl5jf84B354C4wwjdeUV4vl7DCEsXgxmhigDpOMcMVjoKr7cTyI/ZxiE90wmCB4zi+RRatZOxd7OEavxHtBmvjIV5wH2a59N8ZXIZQisMCzkL/wgGq6EYffXzgHHNo4y5h+oBGlLjEBJVUiVP0cJJOtMUG+APtfyYzbH7eVgAAAABJRU5ErkJggg==";
|
|
52
|
+
const icon123 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAMxJREFUOI3t0bFKwlEUBvBfmmBEr1APIDZJ9AJJQyAIvkGP0C4uQruza+DUmuIc9AC9gBG4Nmpkw/8IB3Vw1w8u95zvnvPde77LEeUUV9HAF67QRA2nmMf5A+o4x3cWOsMYy8j7WMX6jaYbLBL/mAWe8RcHm1ihs8G94gVKQQzwlAouMcQo8p/Y28HdYpYFZmsi0MVdxD1MdrxsC500wijdvgtbI1AYtDbxMwkuFAZmE1uYwkkSqOIaHyHcxEU0vUXNPSqKr37fZ6xDwD9DPS0OyHjQHQAAAABJRU5ErkJggg==";
|
|
53
|
+
const iconMail = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC4SURBVDiNxdIxagJRFIXhLzLFBNJYaJslSEylWOhq3IorMGQ16SyjYCFiZWU5pTaDFvOUyTAZ8RHID69555577oXLf/OEGaY4R3g/4IhORHg3eOXYYvSAeRQ8OWQYYoNPvDQYnxUr7zBB1grCAv3QbIlxjXmAb7Txhq+rkFUKq9NUU8vcJiizwDtOWGEdmvTKqT+61H0GXsP7jSxpEGF/R1e3wkO0FBeVRnhTSBTneBB3yvOI4D/mAnvrIwKM5s4AAAAAAElFTkSuQmCC";
|
|
54
|
+
const iconInfo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAASVJREFUOI190r0uhFEQBuBnVxaF2PUTCkFchV0SV6BQi0rEbShFlCqNktJP0Iqf3i3YVSlXVEQozojP8e2+ySSTed+ZMzNnKnpjCFPhv+C9j/YPlnCBV3TCujhHq19iFftoYxOjBa4esTb2QvsP+7jFWJ9HxnEXRf5gGU9Z8gKucBl+sUgHTahE8AJnOCoIT/AcmhmsF7gtrGINBqWFFWcmLXMUhzjIuEbk1GA+2i/DNh4wUsK1MVfFV2GUHJO4xlsPHr8j1Eu44bAcDek2agP4lDZaxWMm3MEKbrL4hjT/8U+gJc00nglnw4qYkL5xMW9rTzqSvEiefI/dMrIaRTrSPzcKXCNinUguPeUfNKWj6kqH9Bz+aVnbvb6PtKTp8F/wUSb6Bu5YN5n7ff0kAAAAAElFTkSuQmCC";
|
|
55
|
+
const iconSuccess = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAQtJREFUOI2F0jFOAlEQBuAPImoFqyTa6TEEbfUihruYDYfwCAg3UDsTY20na0VjgqUWWuxgHsuy/skk82bmn/fPm9eyHXs4Cn+Br4baNZxjhk8UYUtMMWwitjHGHNfoJrlexObIo3YDY9zjoOGSQzxEkzVc4O0fctqkwCANzkJiE9LmI9ytDrvKB+tWGQnylIAsOB04VcrfdluO55CeYo6THfygVUne4jX8S1zho1LTDu7fCL2KxCe8oF8zUqb8G51VYGrzEffD6jDCJA0MY6bqnHXoK9d4Vk3kyk/S1KSPR9zUJdvRpAiJWZLLIlYEufYrrzBQ7nyJ97ClcuYN2dX1pejgOPwFvuuKfgHXiDR+HL1j1AAAAABJRU5ErkJggg==";
|
|
56
|
+
const iconError = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARZJREFUOI2V0j1KQ1EQBeDPp4lWRiMoKVyAK9AoiLgJGytxD9oJNhKyDyvBnw2IugC3YGKVRk1KRbR48yC5vjzwwIHL3DPnzp2ZGdMxj9U4D/BZoZ3ANu4wQj84xC3aVYkZuujhCItjd42I9dAJ7R908YDlikeaeAyTCezgpST5IJia9LFVlA0nOMd7It4IjuMttKeFQR17uKooPcUV9lHL0ArX0T8MPqLa1hx+MDNFWDX7LHLV4/VGiWghmGJJvhu1WXzLO5rhORGeYRf3SfwQNVwWgbZ8SZqJcD04jhX5GDfTsjryJUlN0uQnXJRdZmHSx7H8nwWWItaP5NJVLrCFG3mTXoNDXJeVPW185E1ai/MAX2WiX9S3NSPYbj+uAAAAAElFTkSuQmCC";
|
|
57
|
+
const iconWarning = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARJJREFUOI2l0r8uRFEQBvAfu9glwUYiUaxHUEl0VDpKeq+wpZBINAqFRHgTKg0tCSqVhmKDEM1u/Esodm725rq7iC+ZzMnM982ZmXP4JwpdchWsYBrXeMkj9XQQV3GEi+BMYR63v+mqiDPUUrEaTiP3I1ZxEOcySnE+jFxXVPEQPimWiCYzOdCbKbCFPe1Z+8PgBvvBycVMCIdSsY2wBEPBmcnrYBtraKRib2EJGljHjswLLuI8Z6SS9hLTl15iIR08wZLv2AzLYjk0YATP8n9lVWbrgUJohosYxCdG8Zghdvp5ldCUi6hrPd0VjvGEVzTxEYLkogGMYQ67uEtvcgKzGA8y9IV/D9/Evdb89Q7d/Q1fB8U0mpUmzV0AAAAASUVORK5CYII=";
|
|
58
|
+
const iconLeft = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABfSURBVDiNY2AY8oCZSHWxDAwMEgwMDHfJsaSAgYHhH9QQsjT/Z2BgKKe75gQGiLMLCSlkwiHOSI6t6ADmhYoBN6SIARIeidgkiUlIxxkYGB4xMDB8YmBguE6JSwYpAACvLRHTKwPjZgAAAABJRU5ErkJggg==";
|
|
59
|
+
const iconRight = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABNSURBVDiN3dAxCoAwFATRh3fU2oAHiDbi5Y1F2jT+gKLbzyy7/DYjUo8g4cTWI8koOF6XrOqc5ifDDVGJthfsj8OLujtHYJgwR+GP5QKMxA9/SolDQgAAAABJRU5ErkJggg==";
|
|
60
|
+
const iconLLeft = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABlSURBVDiN3ZLBDUBAEEUfmtCchA5woUMlOO1FCQrAwbqwf8eFhHd7mfzJn2Tg82TGvABywAmPUgOLD4XcDK9AJ/y5cOlrNsIvpCdPDL/FUbkX/t6Slv3+SjgQf6QBmIAZGAP+FzZJViOd89x8pAAAAABJRU5ErkJggg==";
|
|
61
|
+
const iconRRight = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABmSURBVDiN3dGxCoAgEMbxfz1dL1BTREJzmUv08trgDYcg6VCD3/YD7zvkoLmMgFEegLmmwAAecOJVvNeUWCAAt7IHjt9LThkyiRf9qC8oCom70u0BuDL+bngj/tNm/JqJePucW8wDvGYdzT0nMUkAAAAASUVORK5CYII=";
|
|
62
|
+
const iconUpload = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADNSURBVDiNndOxTgJRFIThz41ZDMFKqH0DLSRSq4lQ0RifUcMzUJlYQKjtLcHVSimBggPRNSzs/sk0kzPnTHEvxZyHKnGJD3yhXSWcYRnKwvvH0Y7wEG/4wQI1XOEek6LLF3FtiDoGoXp4WcxsSXILHjFCH/Nf/jy8ER6KGuTZNNhJvkFpEpygUyHbRi1BFy8VFryilyANlSVFerxn6N36IRVyG0PNEtdbkbmBU8zwdOCSJp4xRWNj3sWS5YGaRvM/f6GBa5ztafCJMb5hBQQ/MMwXLnnZAAAAAElFTkSuQmCC";
|
|
63
|
+
|
|
64
|
+
var Icons = /*#__PURE__*/Object.freeze({
|
|
65
|
+
__proto__: null,
|
|
66
|
+
icon123: icon123,
|
|
67
|
+
iconAbc: iconAbc,
|
|
68
|
+
iconCalendar: iconCalendar,
|
|
69
|
+
iconClose: iconClose,
|
|
70
|
+
iconError: iconError,
|
|
71
|
+
iconHide: iconHide,
|
|
72
|
+
iconInfo: iconInfo,
|
|
73
|
+
iconLLeft: iconLLeft,
|
|
74
|
+
iconLeft: iconLeft,
|
|
75
|
+
iconLock: iconLock,
|
|
76
|
+
iconMail: iconMail,
|
|
77
|
+
iconRRight: iconRRight,
|
|
78
|
+
iconRight: iconRight,
|
|
79
|
+
iconShow: iconShow,
|
|
80
|
+
iconSuccess: iconSuccess,
|
|
81
|
+
iconUpload: iconUpload,
|
|
82
|
+
iconWarning: iconWarning
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/** ALERT */
|
|
86
|
+
const Alert = (props, children) => {
|
|
87
|
+
const { type = "info", soft = true, ...rest } = props;
|
|
88
|
+
|
|
89
|
+
const icons = {
|
|
90
|
+
info: iconInfo,
|
|
91
|
+
success: iconSuccess,
|
|
92
|
+
warning: iconWarning,
|
|
93
|
+
error: iconError,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const typeClass = () => {
|
|
97
|
+
const t = val(type);
|
|
98
|
+
const map = {
|
|
99
|
+
info: "alert-info",
|
|
100
|
+
success: "alert-success",
|
|
101
|
+
warning: "alert-warning",
|
|
102
|
+
error: "alert-error",
|
|
103
|
+
};
|
|
104
|
+
return map[t] || t;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const content = children || props.message;
|
|
108
|
+
|
|
109
|
+
return sigpro.$html(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
...rest,
|
|
113
|
+
role: "alert",
|
|
114
|
+
class: () => `alert ${typeClass()} ${val(soft) ? "alert-soft" : ""} ${props.class || ""}`,
|
|
115
|
+
},
|
|
116
|
+
[
|
|
117
|
+
sigpro.$html("img", {
|
|
118
|
+
src: icons[val(type)] || icons.info,
|
|
119
|
+
class: "w-4 h-4 object-contain",
|
|
120
|
+
alt: val(type),
|
|
121
|
+
}),
|
|
122
|
+
sigpro.$html("div", { class: "flex-1" }, [
|
|
123
|
+
sigpro.$html("span", {}, [typeof content === "function" ? content() : content])
|
|
124
|
+
]),
|
|
125
|
+
props.actions ? sigpro.$html("div", { class: "flex-none" }, [
|
|
126
|
+
typeof props.actions === "function" ? props.actions() : props.actions
|
|
127
|
+
]) : null,
|
|
128
|
+
],
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
var AlertModule = /*#__PURE__*/Object.freeze({
|
|
133
|
+
__proto__: null,
|
|
134
|
+
Alert: Alert
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const i18n = {
|
|
138
|
+
es: {
|
|
139
|
+
close: "Cerrar",
|
|
140
|
+
confirm: "Confirmar",
|
|
141
|
+
cancel: "Cancelar",
|
|
142
|
+
search: "Buscar...",
|
|
143
|
+
loading: "Cargando...",
|
|
144
|
+
nodata: "Sin datos"
|
|
145
|
+
},
|
|
146
|
+
en: {
|
|
147
|
+
close: "Close",
|
|
148
|
+
confirm: "Confirm",
|
|
149
|
+
cancel: "Cancel",
|
|
150
|
+
search: "Search...",
|
|
151
|
+
loading: "Loading...",
|
|
152
|
+
nodata: "No data"
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const currentLocale = sigpro.$("es");
|
|
157
|
+
|
|
158
|
+
const tt = t => () => i18n[currentLocale()][t] || t;
|
|
159
|
+
|
|
160
|
+
/** INPUT */
|
|
161
|
+
const Input = (props) => {
|
|
162
|
+
const { label, tip, value, error, isSearch, icon, type = "text", ...rest } = props;
|
|
163
|
+
const isPassword = type === "password";
|
|
164
|
+
const visible = sigpro.$(false);
|
|
165
|
+
|
|
166
|
+
const iconsByType = {
|
|
167
|
+
text: iconAbc,
|
|
168
|
+
password: iconLock,
|
|
169
|
+
date: iconCalendar,
|
|
170
|
+
number: icon123,
|
|
171
|
+
email: iconMail,
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const inputEl = sigpro.$html("input", {
|
|
175
|
+
...rest,
|
|
176
|
+
type: () => (isPassword ? (visible() ? "text" : "password") : type),
|
|
177
|
+
placeholder: props.placeholder || label || (isSearch ? tt("search")() : " "),
|
|
178
|
+
class: joinClass("grow order-2 focus:outline-none", props.class),
|
|
179
|
+
value: value,
|
|
180
|
+
oninput: (e) => props.oninput?.(e),
|
|
181
|
+
disabled: () => val(props.disabled),
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const leftIcon = icon ? icon : iconsByType[type] ? sigpro.$html("img", { src: iconsByType[type], class: "opacity-50", alt: type }) : null;
|
|
185
|
+
|
|
186
|
+
return sigpro.$html(
|
|
187
|
+
"label",
|
|
188
|
+
{
|
|
189
|
+
class: () => joinClass("input input-bordered floating-label flex items-center gap-2 w-full relative", val(error) ? "input-error" : ""),
|
|
190
|
+
},
|
|
191
|
+
[
|
|
192
|
+
leftIcon ? sigpro.$html("div", { class: "order-1 shrink-0" }, leftIcon) : null,
|
|
193
|
+
label ? sigpro.$html("span", { class: "text-base-content/60 order-0" }, label) : null,
|
|
194
|
+
inputEl,
|
|
195
|
+
isPassword
|
|
196
|
+
? sigpro.$html(
|
|
197
|
+
"button",
|
|
198
|
+
{
|
|
199
|
+
type: "button",
|
|
200
|
+
class: "order-3 btn btn-ghost btn-xs btn-circle opacity-50 hover:opacity-100",
|
|
201
|
+
onclick: (e) => {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
visible(!visible());
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
() =>
|
|
207
|
+
sigpro.$html("img", {
|
|
208
|
+
class: "w-5 h-5",
|
|
209
|
+
src: visible() ? iconShow : iconHide,
|
|
210
|
+
}),
|
|
211
|
+
)
|
|
212
|
+
: null,
|
|
213
|
+
tip
|
|
214
|
+
? sigpro.$html(
|
|
215
|
+
"div",
|
|
216
|
+
{ class: "tooltip tooltip-left order-4", "data-tip": tip },
|
|
217
|
+
sigpro.$html("span", { class: "badge badge-ghost badge-xs cursor-help" }, "?"),
|
|
218
|
+
)
|
|
219
|
+
: null,
|
|
220
|
+
() => (val(error) ? sigpro.$html("span", { class: "text-error text-[10px] absolute -bottom-5 left-2" }, val(error)) : null),
|
|
221
|
+
],
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
var InputModule = /*#__PURE__*/Object.freeze({
|
|
226
|
+
__proto__: null,
|
|
227
|
+
Input: Input
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
/** AUTOCOMPLETE */
|
|
231
|
+
const Autocomplete = (props) => {
|
|
232
|
+
const { options = [], value, onSelect, label, placeholder, ...rest } = props;
|
|
233
|
+
|
|
234
|
+
const query = sigpro.$(val(value) || "");
|
|
235
|
+
const isOpen = sigpro.$(false);
|
|
236
|
+
const cursor = sigpro.$(-1);
|
|
237
|
+
|
|
238
|
+
const list = sigpro.$(() => {
|
|
239
|
+
const q = query().toLowerCase();
|
|
240
|
+
const data = val(options) || [];
|
|
241
|
+
return q
|
|
242
|
+
? data.filter((o) => (typeof o === "string" ? o : o.label).toLowerCase().includes(q))
|
|
243
|
+
: data;
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
const pick = (opt) => {
|
|
247
|
+
const valStr = typeof opt === "string" ? opt : opt.value;
|
|
248
|
+
const labelStr = typeof opt === "string" ? opt : opt.label;
|
|
249
|
+
|
|
250
|
+
query(labelStr);
|
|
251
|
+
if (typeof value === "function") value(valStr);
|
|
252
|
+
onSelect?.(opt);
|
|
253
|
+
|
|
254
|
+
isOpen(false);
|
|
255
|
+
cursor(-1);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const nav = (e) => {
|
|
259
|
+
const items = list();
|
|
260
|
+
if (e.key === "ArrowDown") {
|
|
261
|
+
e.preventDefault();
|
|
262
|
+
isOpen(true);
|
|
263
|
+
cursor(Math.min(cursor() + 1, items.length - 1));
|
|
264
|
+
} else if (e.key === "ArrowUp") {
|
|
265
|
+
e.preventDefault();
|
|
266
|
+
cursor(Math.max(cursor() - 1, 0));
|
|
267
|
+
} else if (e.key === "Enter" && cursor() >= 0) {
|
|
268
|
+
e.preventDefault();
|
|
269
|
+
pick(items[cursor()]);
|
|
270
|
+
} else if (e.key === "Escape") {
|
|
271
|
+
isOpen(false);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
return sigpro.$html("div", { class: "relative w-full" }, [
|
|
276
|
+
Input({
|
|
277
|
+
label,
|
|
278
|
+
placeholder: placeholder || tt("search")(),
|
|
279
|
+
value: query,
|
|
280
|
+
onfocus: () => isOpen(true),
|
|
281
|
+
onblur: () => setTimeout(() => isOpen(false), 150),
|
|
282
|
+
onkeydown: nav,
|
|
283
|
+
oninput: (e) => {
|
|
284
|
+
const v = e.target.value;
|
|
285
|
+
query(v);
|
|
286
|
+
if (typeof value === "function") value(v);
|
|
287
|
+
isOpen(true);
|
|
288
|
+
cursor(-1);
|
|
289
|
+
},
|
|
290
|
+
...rest,
|
|
291
|
+
}),
|
|
292
|
+
sigpro.$html(
|
|
293
|
+
"ul",
|
|
294
|
+
{
|
|
295
|
+
class: "absolute left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50",
|
|
296
|
+
style: () => (isOpen() && list().length ? "display:block" : "display:none"),
|
|
297
|
+
},
|
|
298
|
+
[
|
|
299
|
+
sigpro.$for(
|
|
300
|
+
list,
|
|
301
|
+
(opt, i) =>
|
|
302
|
+
sigpro.$html("li", {}, [
|
|
303
|
+
sigpro.$html(
|
|
304
|
+
"a",
|
|
305
|
+
{
|
|
306
|
+
class: () => `block w-full ${cursor() === i ? "active bg-primary text-primary-content" : ""}`,
|
|
307
|
+
onclick: () => pick(opt),
|
|
308
|
+
onmouseenter: () => cursor(i),
|
|
309
|
+
},
|
|
310
|
+
typeof opt === "string" ? opt : opt.label,
|
|
311
|
+
),
|
|
312
|
+
]),
|
|
313
|
+
(opt, i) => (typeof opt === "string" ? opt : opt.value) + i,
|
|
314
|
+
),
|
|
315
|
+
() => (list().length ? null : sigpro.$html("li", { class: "p-2 text-center opacity-50" }, "No results")),
|
|
316
|
+
],
|
|
317
|
+
),
|
|
318
|
+
]);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
var AutocompleteModule = /*#__PURE__*/Object.freeze({
|
|
322
|
+
__proto__: null,
|
|
323
|
+
Autocomplete: Autocomplete
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
/** BADGE */
|
|
327
|
+
const Badge = (props, children) =>
|
|
328
|
+
sigpro.$html("span", { ...props, class: joinClass("badge", props.class) }, children);
|
|
329
|
+
|
|
330
|
+
var BadgeModule = /*#__PURE__*/Object.freeze({
|
|
331
|
+
__proto__: null,
|
|
332
|
+
Badge: Badge
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
/** BUTTON */
|
|
336
|
+
const Button = (props, children) => {
|
|
337
|
+
const { badge, badgeClass, tooltip, icon, loading, ...rest } = props;
|
|
338
|
+
|
|
339
|
+
const btn = sigpro.$html(
|
|
340
|
+
"button",
|
|
341
|
+
{
|
|
342
|
+
...rest,
|
|
343
|
+
// Usamos props.class directamente
|
|
344
|
+
class: joinClass("btn", props.class),
|
|
345
|
+
disabled: () => val(loading) || val(props.disabled),
|
|
346
|
+
},
|
|
347
|
+
[
|
|
348
|
+
() => (val(loading) ? sigpro.$html("span", { class: "loading loading-spinner" }) : null),
|
|
349
|
+
icon ? sigpro.$html("span", { class: "mr-1" }, icon) : null,
|
|
350
|
+
children,
|
|
351
|
+
]
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
let out = btn;
|
|
355
|
+
|
|
356
|
+
if (badge) {
|
|
357
|
+
out = sigpro.$html("div", { class: "indicator" }, [
|
|
358
|
+
sigpro.$html(
|
|
359
|
+
"span",
|
|
360
|
+
{ class: joinClass("indicator-item badge", badgeClass || "badge-secondary") },
|
|
361
|
+
badge
|
|
362
|
+
),
|
|
363
|
+
out,
|
|
364
|
+
]);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return tooltip
|
|
368
|
+
? sigpro.$html("div", { class: "tooltip", "data-tip": tooltip }, out)
|
|
369
|
+
: out;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
var ButtonModule = /*#__PURE__*/Object.freeze({
|
|
373
|
+
__proto__: null,
|
|
374
|
+
Button: Button
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
/** CHECKBOX */
|
|
378
|
+
const Checkbox = (props) => {
|
|
379
|
+
const { value, tooltip, toggle, label, ...rest } = props;
|
|
380
|
+
|
|
381
|
+
const checkEl = sigpro.$html("input", {
|
|
382
|
+
...rest,
|
|
383
|
+
type: "checkbox",
|
|
384
|
+
class: () => (val(toggle) ? "toggle" : "checkbox"),
|
|
385
|
+
checked: value
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
const layout = sigpro.$html("label", { class: "label cursor-pointer justify-start gap-3" }, [
|
|
389
|
+
checkEl,
|
|
390
|
+
label ? sigpro.$html("span", { class: "label-text" }, label) : null,
|
|
391
|
+
]);
|
|
392
|
+
|
|
393
|
+
return tooltip ? sigpro.$html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
var CheckboxModule = /*#__PURE__*/Object.freeze({
|
|
397
|
+
__proto__: null,
|
|
398
|
+
Checkbox: Checkbox
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
/** COLORPICKER */
|
|
402
|
+
const Colorpicker = (props) => {
|
|
403
|
+
const { value, label, ...rest } = props;
|
|
404
|
+
const isOpen = sigpro.$(false);
|
|
405
|
+
|
|
406
|
+
const palette = [
|
|
407
|
+
...["#000", "#1A1A1A", "#333", "#4D4D4D", "#666", "#808080", "#B3B3B3", "#FFF"],
|
|
408
|
+
...["#450a0a", "#7f1d1d", "#991b1b", "#b91c1c", "#dc2626", "#ef4444", "#f87171", "#fca5a5"],
|
|
409
|
+
...["#431407", "#7c2d12", "#9a3412", "#c2410c", "#ea580c", "#f97316", "#fb923c", "#ffedd5"],
|
|
410
|
+
...["#713f12", "#a16207", "#ca8a04", "#eab308", "#facc15", "#fde047", "#fef08a", "#fff9c4"],
|
|
411
|
+
...["#064e3b", "#065f46", "#059669", "#10b981", "#34d399", "#4ade80", "#84cc16", "#d9f99d"],
|
|
412
|
+
...["#082f49", "#075985", "#0284c7", "#0ea5e9", "#38bdf8", "#7dd3fc", "#22d3ee", "#cffafe"],
|
|
413
|
+
...["#1e1b4b", "#312e81", "#4338ca", "#4f46e5", "#6366f1", "#818cf8", "#a5b4fc", "#e0e7ff"],
|
|
414
|
+
...["#2e1065", "#4c1d95", "#6d28d9", "#7c3aed", "#8b5cf6", "#a855f7", "#d946ef", "#fae8ff"],
|
|
415
|
+
];
|
|
416
|
+
|
|
417
|
+
const getColor = () => val(value) || "#000000";
|
|
418
|
+
|
|
419
|
+
return sigpro.$html("div", { class: "relative w-fit" }, [
|
|
420
|
+
sigpro.$html(
|
|
421
|
+
"button",
|
|
422
|
+
{
|
|
423
|
+
type: "button",
|
|
424
|
+
class: "btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case",
|
|
425
|
+
onclick: (e) => {
|
|
426
|
+
e.stopPropagation();
|
|
427
|
+
isOpen(!isOpen());
|
|
428
|
+
},
|
|
429
|
+
...rest,
|
|
430
|
+
},
|
|
431
|
+
[
|
|
432
|
+
sigpro.$html("div", {
|
|
433
|
+
class: "size-5 rounded-sm shadow-inner border border-black/10 shrink-0",
|
|
434
|
+
style: () => `background-color: ${getColor()}`,
|
|
435
|
+
}),
|
|
436
|
+
label ? sigpro.$html("span", { class: "opacity-80" }, label) : null,
|
|
437
|
+
],
|
|
438
|
+
),
|
|
439
|
+
|
|
440
|
+
sigpro.$if(isOpen, () =>
|
|
441
|
+
sigpro.$html(
|
|
442
|
+
"div",
|
|
443
|
+
{
|
|
444
|
+
class: "absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none",
|
|
445
|
+
onclick: (e) => e.stopPropagation(),
|
|
446
|
+
},
|
|
447
|
+
[
|
|
448
|
+
sigpro.$html(
|
|
449
|
+
"div",
|
|
450
|
+
{ class: "grid grid-cols-8 gap-1" },
|
|
451
|
+
palette.map((c) =>
|
|
452
|
+
sigpro.$html("button", {
|
|
453
|
+
type: "button",
|
|
454
|
+
style: `background-color: ${c}`,
|
|
455
|
+
class: () => {
|
|
456
|
+
const active = getColor().toLowerCase() === c.toLowerCase();
|
|
457
|
+
return `size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5
|
|
458
|
+
${active ? "ring-2 ring-offset-1 ring-primary z-10 scale-110" : ""}`;
|
|
459
|
+
},
|
|
460
|
+
onclick: () => {
|
|
461
|
+
if (typeof value === "function") value(c);
|
|
462
|
+
isOpen(false);
|
|
463
|
+
},
|
|
464
|
+
}),
|
|
465
|
+
),
|
|
466
|
+
),
|
|
467
|
+
],
|
|
468
|
+
),
|
|
469
|
+
),
|
|
470
|
+
|
|
471
|
+
sigpro.$if(isOpen, () =>
|
|
472
|
+
sigpro.$html("div", {
|
|
473
|
+
class: "fixed inset-0 z-[100]",
|
|
474
|
+
onclick: () => isOpen(false),
|
|
475
|
+
}),
|
|
476
|
+
),
|
|
477
|
+
]);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
var ColorpickerModule = /*#__PURE__*/Object.freeze({
|
|
481
|
+
__proto__: null,
|
|
482
|
+
Colorpicker: Colorpicker
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
/** DATEPICKER */
|
|
486
|
+
const Datepicker = (props) => {
|
|
487
|
+
const { value, range, label, placeholder, hour = false, ...rest } = props;
|
|
488
|
+
|
|
489
|
+
const isOpen = sigpro.$(false);
|
|
490
|
+
const internalDate = sigpro.$(new Date());
|
|
491
|
+
const hoverDate = sigpro.$(null);
|
|
492
|
+
const startHour = sigpro.$(0);
|
|
493
|
+
const endHour = sigpro.$(0);
|
|
494
|
+
const isRangeMode = () => val(range) === true;
|
|
495
|
+
|
|
496
|
+
const now = new Date();
|
|
497
|
+
const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
|
|
498
|
+
|
|
499
|
+
const formatDate = (d) => {
|
|
500
|
+
const year = d.getFullYear();
|
|
501
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
502
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
503
|
+
return `${year}-${month}-${day}`;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
const selectDate = (date) => {
|
|
507
|
+
const dateStr = formatDate(date);
|
|
508
|
+
const current = val(value);
|
|
509
|
+
|
|
510
|
+
if (isRangeMode()) {
|
|
511
|
+
if (!current?.start || (current.start && current.end)) {
|
|
512
|
+
if (typeof value === "function") {
|
|
513
|
+
value({
|
|
514
|
+
start: dateStr,
|
|
515
|
+
end: null,
|
|
516
|
+
...(hour && { startHour: startHour() }),
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
} else {
|
|
520
|
+
const start = current.start;
|
|
521
|
+
if (typeof value === "function") {
|
|
522
|
+
const newValue = dateStr < start ? { start: dateStr, end: start } : { start, end: dateStr };
|
|
523
|
+
if (hour) {
|
|
524
|
+
newValue.startHour = current.startHour || startHour();
|
|
525
|
+
newValue.endHour = current.endHour || endHour();
|
|
526
|
+
}
|
|
527
|
+
value(newValue);
|
|
528
|
+
}
|
|
529
|
+
isOpen(false);
|
|
530
|
+
}
|
|
531
|
+
} else {
|
|
532
|
+
if (typeof value === "function") {
|
|
533
|
+
value(hour ? `${dateStr}T${String(startHour()).padStart(2, "0")}:00:00` : dateStr);
|
|
534
|
+
}
|
|
535
|
+
isOpen(false);
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
const displayValue = sigpro.$(() => {
|
|
540
|
+
const v = val(value);
|
|
541
|
+
if (!v) return "";
|
|
542
|
+
if (typeof v === "string") {
|
|
543
|
+
if (hour && v.includes("T")) return v.replace("T", " ");
|
|
544
|
+
return v;
|
|
545
|
+
}
|
|
546
|
+
if (v.start && v.end) {
|
|
547
|
+
const startStr = hour && v.startHour ? `${v.start} ${String(v.startHour).padStart(2, "0")}:00` : v.start;
|
|
548
|
+
const endStr = hour && v.endHour ? `${v.end} ${String(v.endHour).padStart(2, "0")}:00` : v.end;
|
|
549
|
+
return `${startStr} - ${endStr}`;
|
|
550
|
+
}
|
|
551
|
+
if (v.start) {
|
|
552
|
+
const startStr = hour && v.startHour ? `${v.start} ${String(v.startHour).padStart(2, "0")}:00` : v.start;
|
|
553
|
+
return `${startStr}...`;
|
|
554
|
+
}
|
|
555
|
+
return "";
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
const move = (m) => {
|
|
559
|
+
const d = internalDate();
|
|
560
|
+
internalDate(new Date(d.getFullYear(), d.getMonth() + m, 1));
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
const moveYear = (y) => {
|
|
564
|
+
const d = internalDate();
|
|
565
|
+
internalDate(new Date(d.getFullYear() + y, d.getMonth(), 1));
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
const HourSlider = ({ value: hVal, onChange }) => {
|
|
569
|
+
return sigpro.$html("div", { class: "flex-1" }, [
|
|
570
|
+
sigpro.$html("div", { class: "flex gap-2 items-center" }, [
|
|
571
|
+
sigpro.$html("input", {
|
|
572
|
+
type: "range",
|
|
573
|
+
min: 0,
|
|
574
|
+
max: 23,
|
|
575
|
+
value: hVal,
|
|
576
|
+
class: "range range-xs flex-1",
|
|
577
|
+
oninput: (e) => {
|
|
578
|
+
const newHour = parseInt(e.target.value);
|
|
579
|
+
onChange(newHour);
|
|
580
|
+
},
|
|
581
|
+
}),
|
|
582
|
+
sigpro.$html("span", { class: "text-sm font-mono min-w-[48px] text-center" },
|
|
583
|
+
() => String(val(hVal)).padStart(2, "0") + ":00"
|
|
584
|
+
),
|
|
585
|
+
]),
|
|
586
|
+
]);
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
return sigpro.$html("div", { class: "relative w-full" }, [
|
|
590
|
+
Input({
|
|
591
|
+
label,
|
|
592
|
+
placeholder: placeholder || (isRangeMode() ? "Seleccionar rango..." : "Seleccionar fecha..."),
|
|
593
|
+
value: displayValue,
|
|
594
|
+
readonly: true,
|
|
595
|
+
icon: sigpro.$html("img", { src: iconCalendar, class: "opacity-40" }),
|
|
596
|
+
onclick: (e) => {
|
|
597
|
+
e.stopPropagation();
|
|
598
|
+
isOpen(!isOpen());
|
|
599
|
+
},
|
|
600
|
+
...rest,
|
|
601
|
+
}),
|
|
602
|
+
|
|
603
|
+
sigpro.$if(isOpen, () =>
|
|
604
|
+
sigpro.$html(
|
|
605
|
+
"div",
|
|
606
|
+
{
|
|
607
|
+
class: "absolute left-0 mt-2 p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[100] w-80 select-none",
|
|
608
|
+
onclick: (e) => e.stopPropagation(),
|
|
609
|
+
},
|
|
610
|
+
[
|
|
611
|
+
sigpro.$html("div", { class: "flex justify-between items-center mb-4 gap-1" }, [
|
|
612
|
+
sigpro.$html("div", { class: "flex gap-0.5" }, [
|
|
613
|
+
sigpro.$html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => moveYear(-1) },
|
|
614
|
+
sigpro.$html("img", { src: iconLLeft, class: "opacity-40" })
|
|
615
|
+
),
|
|
616
|
+
sigpro.$html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => move(-1) },
|
|
617
|
+
sigpro.$html("img", { src: iconLeft, class: "opacity-40" })
|
|
618
|
+
),
|
|
619
|
+
]),
|
|
620
|
+
sigpro.$html("span", { class: "font-bold uppercase flex-1 text-center" }, [
|
|
621
|
+
() => internalDate().toLocaleString("es-ES", { month: "short", year: "numeric" }),
|
|
622
|
+
]),
|
|
623
|
+
sigpro.$html("div", { class: "flex gap-0.5" }, [
|
|
624
|
+
sigpro.$html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => move(1) },
|
|
625
|
+
sigpro.$html("img", { src: iconRight, class: "opacity-40" })
|
|
626
|
+
),
|
|
627
|
+
sigpro.$html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => moveYear(1) },
|
|
628
|
+
sigpro.$html("img", { src: iconRRight, class: "opacity-40" })
|
|
629
|
+
),
|
|
630
|
+
]),
|
|
631
|
+
]),
|
|
632
|
+
|
|
633
|
+
sigpro.$html("div", { class: "grid grid-cols-7 gap-1", onmouseleave: () => hoverDate(null) }, [
|
|
634
|
+
...["L", "M", "X", "J", "V", "S", "D"].map((d) => sigpro.$html("div", { class: "text-[10px] opacity-40 font-bold text-center" }, d)),
|
|
635
|
+
() => {
|
|
636
|
+
const d = internalDate();
|
|
637
|
+
const year = d.getFullYear();
|
|
638
|
+
const month = d.getMonth();
|
|
639
|
+
const firstDay = new Date(year, month, 1).getDay();
|
|
640
|
+
const offset = firstDay === 0 ? 6 : firstDay - 1;
|
|
641
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
642
|
+
|
|
643
|
+
const nodes = [];
|
|
644
|
+
for (let i = 0; i < offset; i++) nodes.push(sigpro.$html("div"));
|
|
645
|
+
|
|
646
|
+
for (let i = 1; i <= daysInMonth; i++) {
|
|
647
|
+
const date = new Date(year, month, i);
|
|
648
|
+
const dStr = formatDate(date);
|
|
649
|
+
|
|
650
|
+
nodes.push(
|
|
651
|
+
sigpro.$html(
|
|
652
|
+
"button",
|
|
653
|
+
{
|
|
654
|
+
type: "button",
|
|
655
|
+
class: () => {
|
|
656
|
+
const v = val(value);
|
|
657
|
+
const h = hoverDate();
|
|
658
|
+
const isStart = typeof v === "string" ? v.split("T")[0] === dStr : v?.start === dStr;
|
|
659
|
+
const isEnd = v?.end === dStr;
|
|
660
|
+
let inRange = false;
|
|
661
|
+
|
|
662
|
+
if (isRangeMode() && v?.start) {
|
|
663
|
+
const start = v.start;
|
|
664
|
+
if (!v.end && h) {
|
|
665
|
+
inRange = (dStr > start && dStr <= h) || (dStr < start && dStr >= h);
|
|
666
|
+
} else if (v.end) {
|
|
667
|
+
inRange = dStr > start && dStr < v.end;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
const base = "btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative";
|
|
672
|
+
const state = isStart || isEnd ? "btn-primary z-10" : inRange ? "bg-primary/20 border-none rounded-none" : "btn-ghost";
|
|
673
|
+
const today = dStr === todayStr ? "ring-1 ring-primary ring-inset font-black text-primary" : "";
|
|
674
|
+
|
|
675
|
+
return `${base} ${state} ${today}`;
|
|
676
|
+
},
|
|
677
|
+
onmouseenter: () => { if (isRangeMode()) hoverDate(dStr); },
|
|
678
|
+
onclick: () => selectDate(date),
|
|
679
|
+
},
|
|
680
|
+
[i.toString()],
|
|
681
|
+
),
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
return nodes;
|
|
685
|
+
},
|
|
686
|
+
]),
|
|
687
|
+
|
|
688
|
+
hour ? sigpro.$html("div", { class: "mt-3 pt-2 border-t border-base-300" }, [
|
|
689
|
+
isRangeMode()
|
|
690
|
+
? sigpro.$html("div", { class: "flex gap-4" }, [
|
|
691
|
+
HourSlider({
|
|
692
|
+
value: startHour,
|
|
693
|
+
onChange: (newHour) => {
|
|
694
|
+
startHour(newHour);
|
|
695
|
+
const currentVal = val(value);
|
|
696
|
+
if (currentVal?.start) value({ ...currentVal, startHour: newHour });
|
|
697
|
+
},
|
|
698
|
+
}),
|
|
699
|
+
HourSlider({
|
|
700
|
+
value: endHour,
|
|
701
|
+
onChange: (newHour) => {
|
|
702
|
+
endHour(newHour);
|
|
703
|
+
const currentVal = val(value);
|
|
704
|
+
if (currentVal?.end) value({ ...currentVal, endHour: newHour });
|
|
705
|
+
},
|
|
706
|
+
}),
|
|
707
|
+
])
|
|
708
|
+
: HourSlider({
|
|
709
|
+
value: startHour,
|
|
710
|
+
onChange: (newHour) => {
|
|
711
|
+
startHour(newHour);
|
|
712
|
+
const currentVal = val(value);
|
|
713
|
+
if (currentVal && typeof currentVal === "string" && currentVal.includes("-")) {
|
|
714
|
+
value(currentVal.split("T")[0] + "T" + String(newHour).padStart(2, "0") + ":00:00");
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
}),
|
|
718
|
+
]) : null,
|
|
719
|
+
],
|
|
720
|
+
),
|
|
721
|
+
),
|
|
722
|
+
|
|
723
|
+
sigpro.$if(isOpen, () => sigpro.$html("div", { class: "fixed inset-0 z-[90]", onclick: () => isOpen(false) })),
|
|
724
|
+
]);
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
var DatepickerModule = /*#__PURE__*/Object.freeze({
|
|
728
|
+
__proto__: null,
|
|
729
|
+
Datepicker: Datepicker
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
/** DRAWER */
|
|
733
|
+
const Drawer = (props) =>
|
|
734
|
+
sigpro.$html("div", { class: joinClass("drawer", props.class) }, [
|
|
735
|
+
sigpro.$html("input", {
|
|
736
|
+
id: props.id,
|
|
737
|
+
type: "checkbox",
|
|
738
|
+
class: "drawer-toggle",
|
|
739
|
+
checked: props.open,
|
|
740
|
+
}),
|
|
741
|
+
sigpro.$html("div", { class: "drawer-content" }, props.content),
|
|
742
|
+
sigpro.$html("div", { class: "drawer-side" }, [
|
|
743
|
+
sigpro.$html("label", { for: props.id, class: "drawer-overlay", onclick: () => props.open?.(false) }),
|
|
744
|
+
sigpro.$html("div", { class: "min-h-full bg-base-200 w-80" }, props.side),
|
|
745
|
+
]),
|
|
746
|
+
]);
|
|
747
|
+
|
|
748
|
+
var DrawerModule = /*#__PURE__*/Object.freeze({
|
|
749
|
+
__proto__: null,
|
|
750
|
+
Drawer: Drawer
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
/** DROPDOWN */
|
|
754
|
+
const Dropdown = (props, children) => {
|
|
755
|
+
const { label, icon, ...rest } = props;
|
|
756
|
+
|
|
757
|
+
return sigpro.$html(
|
|
758
|
+
"div",
|
|
759
|
+
{
|
|
760
|
+
...rest,
|
|
761
|
+
class: () => `dropdown ${val(props.class) || props.class || ""}`,
|
|
762
|
+
},
|
|
763
|
+
[
|
|
764
|
+
sigpro.$html(
|
|
765
|
+
"div",
|
|
766
|
+
{
|
|
767
|
+
tabindex: 0,
|
|
768
|
+
role: "button",
|
|
769
|
+
class: "btn m-1 flex items-center gap-2",
|
|
770
|
+
},
|
|
771
|
+
[
|
|
772
|
+
icon ? (typeof icon === "function" ? icon() : icon) : null,
|
|
773
|
+
label ? (typeof label === "function" ? label() : label) : null
|
|
774
|
+
],
|
|
775
|
+
),
|
|
776
|
+
sigpro.$html(
|
|
777
|
+
"ul",
|
|
778
|
+
{
|
|
779
|
+
tabindex: 0,
|
|
780
|
+
class: "dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300",
|
|
781
|
+
},
|
|
782
|
+
[typeof children === "function" ? children() : children],
|
|
783
|
+
),
|
|
784
|
+
],
|
|
785
|
+
);
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
var DropdownModule = /*#__PURE__*/Object.freeze({
|
|
789
|
+
__proto__: null,
|
|
790
|
+
Dropdown: Dropdown
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
/** FAB (Floating Action Button) */
|
|
794
|
+
const Fab = (props) => {
|
|
795
|
+
const { icon, label, actions = [], position = "bottom-6 right-6", ...rest } = props;
|
|
796
|
+
|
|
797
|
+
return sigpro.$html(
|
|
798
|
+
"div",
|
|
799
|
+
{
|
|
800
|
+
...rest,
|
|
801
|
+
class: () => `fab fixed ${val(position)} flex flex-col-reverse items-end gap-3 z-[100] ${
|
|
802
|
+
props.class || ""
|
|
803
|
+
}`,
|
|
804
|
+
},
|
|
805
|
+
[
|
|
806
|
+
// Botón principal
|
|
807
|
+
sigpro.$html(
|
|
808
|
+
"div",
|
|
809
|
+
{
|
|
810
|
+
tabindex: 0,
|
|
811
|
+
role: "button",
|
|
812
|
+
class: "btn btn-lg btn-circle btn-primary shadow-2xl",
|
|
813
|
+
},
|
|
814
|
+
[
|
|
815
|
+
icon ? (typeof icon === "function" ? icon() : icon) : null,
|
|
816
|
+
!icon && label ? label : null
|
|
817
|
+
],
|
|
818
|
+
),
|
|
819
|
+
|
|
820
|
+
// Acciones secundarias (se despliegan hacia arriba)
|
|
821
|
+
...val(actions).map((act) =>
|
|
822
|
+
sigpro.$html("div", { class: "flex items-center gap-3 transition-all duration-300" }, [
|
|
823
|
+
act.label ? sigpro.$html("span", { class: "badge badge-ghost shadow-sm whitespace-nowrap" }, act.label) : null,
|
|
824
|
+
sigpro.$html(
|
|
825
|
+
"button",
|
|
826
|
+
{
|
|
827
|
+
type: "button",
|
|
828
|
+
class: `btn btn-circle shadow-lg ${act.class || ""}`,
|
|
829
|
+
onclick: (e) => {
|
|
830
|
+
e.stopPropagation();
|
|
831
|
+
act.onclick?.(e);
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
[act.icon ? (typeof act.icon === "function" ? act.icon() : act.icon) : act.text || ""],
|
|
835
|
+
),
|
|
836
|
+
]),
|
|
837
|
+
),
|
|
838
|
+
],
|
|
839
|
+
);
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
var FabModule = /*#__PURE__*/Object.freeze({
|
|
843
|
+
__proto__: null,
|
|
844
|
+
Fab: Fab
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
/** FIELDSET */
|
|
848
|
+
const Fieldset = (props, children) =>
|
|
849
|
+
sigpro.$html(
|
|
850
|
+
"fieldset",
|
|
851
|
+
{
|
|
852
|
+
...props,
|
|
853
|
+
class: joinClass("fieldset bg-base-200 border border-base-300 p-4 rounded-lg", props.class),
|
|
854
|
+
},
|
|
855
|
+
[
|
|
856
|
+
() => {
|
|
857
|
+
const legendText = val(props.legend);
|
|
858
|
+
return legendText ? sigpro.$html("legend", { class: "fieldset-legend font-bold" }, [legendText]) : null;
|
|
859
|
+
},
|
|
860
|
+
children,
|
|
861
|
+
],
|
|
862
|
+
);
|
|
863
|
+
|
|
864
|
+
var FieldsetModule = /*#__PURE__*/Object.freeze({
|
|
865
|
+
__proto__: null,
|
|
866
|
+
Fieldset: Fieldset
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
/** FILEINPUT */
|
|
870
|
+
const Fileinput = (props) => {
|
|
871
|
+
const { tooltip, max = 2, accept = "*", onSelect } = props;
|
|
872
|
+
|
|
873
|
+
const selectedFiles = sigpro.$([]);
|
|
874
|
+
const isDragging = sigpro.$(false);
|
|
875
|
+
const error = sigpro.$(null);
|
|
876
|
+
const MAX_BYTES = max * 1024 * 1024;
|
|
877
|
+
|
|
878
|
+
const handleFiles = (files) => {
|
|
879
|
+
const fileList = Array.from(files);
|
|
880
|
+
error(null);
|
|
881
|
+
const oversized = fileList.find((f) => f.size > MAX_BYTES);
|
|
882
|
+
|
|
883
|
+
if (oversized) {
|
|
884
|
+
error(`Máx ${max}MB`);
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
selectedFiles([...selectedFiles(), ...fileList]);
|
|
889
|
+
onSelect?.(selectedFiles());
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
const removeFile = (index) => {
|
|
893
|
+
const updated = selectedFiles().filter((_, i) => i !== index);
|
|
894
|
+
selectedFiles(updated);
|
|
895
|
+
onSelect?.(updated);
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
return sigpro.$html("fieldset", { class: "fieldset w-full p-0" }, [
|
|
899
|
+
sigpro.$html(
|
|
900
|
+
"div",
|
|
901
|
+
{
|
|
902
|
+
class: () => `w-full ${tooltip ? "tooltip tooltip-top before:z-50 after:z-50" : ""}`,
|
|
903
|
+
"data-tip": tooltip,
|
|
904
|
+
},
|
|
905
|
+
[
|
|
906
|
+
sigpro.$html(
|
|
907
|
+
"label",
|
|
908
|
+
{
|
|
909
|
+
class: () => `
|
|
910
|
+
relative flex items-center justify-between w-full h-12 px-4
|
|
911
|
+
border-2 border-dashed rounded-lg cursor-pointer
|
|
912
|
+
transition-all duration-200
|
|
913
|
+
${isDragging() ? "border-primary bg-primary/10" : "border-base-content/20 bg-base-100 hover:bg-base-200"}
|
|
914
|
+
`,
|
|
915
|
+
ondragover: (e) => {
|
|
916
|
+
e.preventDefault();
|
|
917
|
+
isDragging(true);
|
|
918
|
+
},
|
|
919
|
+
ondragleave: () => isDragging(false),
|
|
920
|
+
ondrop: (e) => {
|
|
921
|
+
e.preventDefault();
|
|
922
|
+
isDragging(false);
|
|
923
|
+
handleFiles(e.dataTransfer.files);
|
|
924
|
+
},
|
|
925
|
+
},
|
|
926
|
+
[
|
|
927
|
+
sigpro.$html("div", { class: "flex items-center gap-3 w-full" }, [
|
|
928
|
+
sigpro.$html("img", { src: iconUpload, class: "w-5 h-5 opacity-50 shrink-0" }),
|
|
929
|
+
sigpro.$html("span", { class: "text-sm opacity-70 truncate grow text-left" }, "Arrastra o selecciona archivos..."),
|
|
930
|
+
sigpro.$html("span", { class: "text-[10px] opacity-40 shrink-0" }, `Máx ${max}MB`),
|
|
931
|
+
]),
|
|
932
|
+
sigpro.$html("input", {
|
|
933
|
+
type: "file",
|
|
934
|
+
multiple: true,
|
|
935
|
+
accept: accept,
|
|
936
|
+
class: "hidden",
|
|
937
|
+
onchange: (e) => handleFiles(e.target.files),
|
|
938
|
+
}),
|
|
939
|
+
],
|
|
940
|
+
),
|
|
941
|
+
],
|
|
942
|
+
),
|
|
943
|
+
|
|
944
|
+
() => (error() ? sigpro.$html("span", { class: "text-[10px] text-error mt-1 px-1 font-medium" }, error()) : null),
|
|
945
|
+
|
|
946
|
+
sigpro.$if(
|
|
947
|
+
() => selectedFiles().length > 0,
|
|
948
|
+
() =>
|
|
949
|
+
sigpro.$html("ul", { class: "mt-2 space-y-1" }, [
|
|
950
|
+
sigpro.$for(
|
|
951
|
+
selectedFiles,
|
|
952
|
+
(file, index) =>
|
|
953
|
+
sigpro.$html("li", { class: "flex items-center justify-between p-1.5 pl-3 text-xs bg-base-200/50 rounded-md border border-base-300" }, [
|
|
954
|
+
sigpro.$html("div", { class: "flex items-center gap-2 truncate" }, [
|
|
955
|
+
sigpro.$html("span", { class: "opacity-50" }, "📄"),
|
|
956
|
+
sigpro.$html("span", { class: "truncate font-medium max-w-[200px]" }, file.name),
|
|
957
|
+
sigpro.$html("span", { class: "text-[9px] opacity-40" }, `(${(file.size / 1024).toFixed(0)} KB)`),
|
|
958
|
+
]),
|
|
959
|
+
sigpro.$html(
|
|
960
|
+
"button",
|
|
961
|
+
{
|
|
962
|
+
type: "button",
|
|
963
|
+
class: "btn btn-ghost btn-xs btn-circle",
|
|
964
|
+
onclick: (e) => {
|
|
965
|
+
e.preventDefault();
|
|
966
|
+
e.stopPropagation();
|
|
967
|
+
removeFile(index);
|
|
968
|
+
},
|
|
969
|
+
},
|
|
970
|
+
[sigpro.$html("img", { src: iconClose, class: "w-3 h-3 opacity-70" })],
|
|
971
|
+
),
|
|
972
|
+
]),
|
|
973
|
+
(file) => file.name + file.lastModified,
|
|
974
|
+
),
|
|
975
|
+
]),
|
|
976
|
+
),
|
|
977
|
+
]);
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
var FileinputModule = /*#__PURE__*/Object.freeze({
|
|
981
|
+
__proto__: null,
|
|
982
|
+
Fileinput: Fileinput
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
/** INDICATOR */
|
|
986
|
+
const Indicator = (props, children) =>
|
|
987
|
+
sigpro.$html("div", { class: joinClass("indicator", props.class) }, [
|
|
988
|
+
children,
|
|
989
|
+
sigpro.$html("span", { class: joinClass("indicator-item badge", props.badgeClass) }, props.badge),
|
|
990
|
+
]);
|
|
991
|
+
|
|
992
|
+
var IndicatorModule = /*#__PURE__*/Object.freeze({
|
|
993
|
+
__proto__: null,
|
|
994
|
+
Indicator: Indicator
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
/** LIST */
|
|
998
|
+
const List = (props) => {
|
|
999
|
+
const { items, header, render, keyFn, class: className } = props;
|
|
1000
|
+
|
|
1001
|
+
return sigpro.$html(
|
|
1002
|
+
"ul",
|
|
1003
|
+
{
|
|
1004
|
+
class: joinClass("list bg-base-100 rounded-box shadow-md", className),
|
|
1005
|
+
},
|
|
1006
|
+
[
|
|
1007
|
+
sigpro.$if(header, () => sigpro.$html("li", { class: "p-4 pb-2 text-xs opacity-60 tracking-wide" }, [val(header)])),
|
|
1008
|
+
sigpro.$for(items, (item, index) => sigpro.$html("li", { class: "list-row" }, [render(item, index)]), keyFn),
|
|
1009
|
+
],
|
|
1010
|
+
);
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
var ListModule = /*#__PURE__*/Object.freeze({
|
|
1014
|
+
__proto__: null,
|
|
1015
|
+
List: List
|
|
1016
|
+
});
|
|
1017
|
+
|
|
1018
|
+
/** LOADING (Overlay Component) */
|
|
1019
|
+
const Loading = (props) => {
|
|
1020
|
+
// Se espera un signal props.$show para controlar la visibilidad
|
|
1021
|
+
return sigpro.$if(props.$show, () =>
|
|
1022
|
+
sigpro.$html("div", {
|
|
1023
|
+
class: "fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm bg-base-100/30"
|
|
1024
|
+
}, [
|
|
1025
|
+
sigpro.$html("span", { class: "loading loading-spinner loading-lg text-primary" }),
|
|
1026
|
+
]),
|
|
1027
|
+
);
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
var LoadingModule = /*#__PURE__*/Object.freeze({
|
|
1031
|
+
__proto__: null,
|
|
1032
|
+
Loading: Loading
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
/** MENU */
|
|
1036
|
+
const Menu = (props) => {
|
|
1037
|
+
const renderItems = (items) =>
|
|
1038
|
+
sigpro.$for(
|
|
1039
|
+
() => items || [],
|
|
1040
|
+
(it) =>
|
|
1041
|
+
sigpro.$html("li", {}, [
|
|
1042
|
+
it.children
|
|
1043
|
+
? sigpro.$html("details", { open: it.open }, [
|
|
1044
|
+
sigpro.$html("summary", {}, [it.icon && sigpro.$html("span", { class: "mr-2" }, it.icon), it.label]),
|
|
1045
|
+
sigpro.$html("ul", {}, renderItems(it.children)),
|
|
1046
|
+
])
|
|
1047
|
+
: sigpro.$html("a", { class: () => (val(it.active) ? "active" : ""), onclick: it.onclick }, [
|
|
1048
|
+
it.icon && sigpro.$html("span", { class: "mr-2" }, it.icon),
|
|
1049
|
+
it.label,
|
|
1050
|
+
]),
|
|
1051
|
+
]),
|
|
1052
|
+
(it, i) => it.label || i,
|
|
1053
|
+
);
|
|
1054
|
+
|
|
1055
|
+
return sigpro.$html("ul", { ...props, class: joinClass("menu bg-base-200 rounded-box", props.class) }, renderItems(props.items));
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
var MenuModule = /*#__PURE__*/Object.freeze({
|
|
1059
|
+
__proto__: null,
|
|
1060
|
+
Menu: Menu
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
/** MODAL */
|
|
1064
|
+
const Modal = (props, children) => {
|
|
1065
|
+
const { title, buttons, open, ...rest } = props;
|
|
1066
|
+
const close = () => open(false);
|
|
1067
|
+
|
|
1068
|
+
return sigpro.$if(open, () =>
|
|
1069
|
+
sigpro.$html("dialog", { ...rest, class: "modal modal-open" }, [
|
|
1070
|
+
sigpro.$html("div", { class: "modal-box" }, [
|
|
1071
|
+
title ? sigpro.$html("h3", { class: "text-lg font-bold mb-4" }, title) : null,
|
|
1072
|
+
typeof children === "function" ? children() : children,
|
|
1073
|
+
sigpro.$html("div", { class: "modal-action flex gap-2" }, [
|
|
1074
|
+
...(Array.isArray(buttons) ? buttons : [buttons]).filter(Boolean),
|
|
1075
|
+
Button({ onclick: close }, tt("close")()),
|
|
1076
|
+
]),
|
|
1077
|
+
]),
|
|
1078
|
+
sigpro.$html(
|
|
1079
|
+
"form",
|
|
1080
|
+
{
|
|
1081
|
+
method: "dialog",
|
|
1082
|
+
class: "modal-backdrop",
|
|
1083
|
+
onclick: (e) => (e.preventDefault(), close()),
|
|
1084
|
+
},
|
|
1085
|
+
[sigpro.$html("button", {}, "close")],
|
|
1086
|
+
),
|
|
1087
|
+
]),
|
|
1088
|
+
);
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1091
|
+
var ModalModule = /*#__PURE__*/Object.freeze({
|
|
1092
|
+
__proto__: null,
|
|
1093
|
+
Modal: Modal
|
|
1094
|
+
});
|
|
1095
|
+
|
|
1096
|
+
/** NAVBAR */
|
|
1097
|
+
const Navbar = (props, children) =>
|
|
1098
|
+
sigpro.$html("div", { ...props, class: joinClass("navbar bg-base-100 shadow-sm px-4", props.class) }, children);
|
|
1099
|
+
|
|
1100
|
+
var NavbarModule = /*#__PURE__*/Object.freeze({
|
|
1101
|
+
__proto__: null,
|
|
1102
|
+
Navbar: Navbar
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
/** RADIO */
|
|
1106
|
+
const Radio = (props) => {
|
|
1107
|
+
const { label, tooltip, value, ...rest } = props;
|
|
1108
|
+
|
|
1109
|
+
const radioEl = sigpro.$html("input", {
|
|
1110
|
+
...rest,
|
|
1111
|
+
type: "radio",
|
|
1112
|
+
class: joinClass("radio", props.class),
|
|
1113
|
+
checked: () => val(value) === props.value,
|
|
1114
|
+
disabled: () => val(props.disabled),
|
|
1115
|
+
onclick: () => typeof value === "function" && value(props.value),
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
if (!label && !tooltip) return radioEl;
|
|
1119
|
+
|
|
1120
|
+
const layout = sigpro.$html("label", { class: "label cursor-pointer justify-start gap-3" }, [
|
|
1121
|
+
radioEl,
|
|
1122
|
+
label ? sigpro.$html("span", { class: "label-text" }, label) : null,
|
|
1123
|
+
]);
|
|
1124
|
+
|
|
1125
|
+
return tooltip ? sigpro.$html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1128
|
+
var RadioModule = /*#__PURE__*/Object.freeze({
|
|
1129
|
+
__proto__: null,
|
|
1130
|
+
Radio: Radio
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1133
|
+
/** RANGE */
|
|
1134
|
+
const Range = (props) => {
|
|
1135
|
+
const { label, tooltip, value, ...rest } = props;
|
|
1136
|
+
|
|
1137
|
+
const rangeEl = sigpro.$html("input", {
|
|
1138
|
+
...rest,
|
|
1139
|
+
type: "range",
|
|
1140
|
+
class: joinClass("range", props.class),
|
|
1141
|
+
value: value,
|
|
1142
|
+
disabled: () => val(props.disabled)
|
|
1143
|
+
});
|
|
1144
|
+
|
|
1145
|
+
if (!label && !tooltip) return rangeEl;
|
|
1146
|
+
|
|
1147
|
+
const layout = sigpro.$html("div", { class: "flex flex-col gap-2" }, [
|
|
1148
|
+
label ? sigpro.$html("span", { class: "label-text" }, label) : null,
|
|
1149
|
+
rangeEl
|
|
1150
|
+
]);
|
|
1151
|
+
|
|
1152
|
+
return tooltip ? sigpro.$html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
var RangeModule = /*#__PURE__*/Object.freeze({
|
|
1156
|
+
__proto__: null,
|
|
1157
|
+
Range: Range
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
/** RATING */
|
|
1161
|
+
const Rating = (props) => {
|
|
1162
|
+
const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
|
|
1163
|
+
|
|
1164
|
+
// Generamos un ID único para el grupo de radio buttons
|
|
1165
|
+
const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
|
|
1166
|
+
|
|
1167
|
+
return sigpro.$html(
|
|
1168
|
+
"div",
|
|
1169
|
+
{
|
|
1170
|
+
...rest,
|
|
1171
|
+
class: () => `rating ${val(readonly) ? "pointer-events-none" : ""} ${props.class || ""}`,
|
|
1172
|
+
},
|
|
1173
|
+
Array.from({ length: val(count) }, (_, i) => {
|
|
1174
|
+
const starValue = i + 1;
|
|
1175
|
+
|
|
1176
|
+
return sigpro.$html("input", {
|
|
1177
|
+
type: "radio",
|
|
1178
|
+
name: ratingGroup,
|
|
1179
|
+
class: `mask ${mask}`,
|
|
1180
|
+
"aria-label": `${starValue} star`,
|
|
1181
|
+
checked: () => Math.round(val(value)) === starValue,
|
|
1182
|
+
onchange: () => {
|
|
1183
|
+
if (!val(readonly) && typeof value === "function") {
|
|
1184
|
+
value(starValue);
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
});
|
|
1188
|
+
})
|
|
1189
|
+
);
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
var RatingModule = /*#__PURE__*/Object.freeze({
|
|
1193
|
+
__proto__: null,
|
|
1194
|
+
Rating: Rating
|
|
1195
|
+
});
|
|
1196
|
+
|
|
1197
|
+
/** SELECT */
|
|
1198
|
+
const Select = (props) => {
|
|
1199
|
+
const { label, options, value, ...rest } = props;
|
|
1200
|
+
|
|
1201
|
+
const selectEl = sigpro.$html(
|
|
1202
|
+
"select",
|
|
1203
|
+
{
|
|
1204
|
+
...rest,
|
|
1205
|
+
class: joinClass("select select-bordered w-full", props.class),
|
|
1206
|
+
value: value
|
|
1207
|
+
},
|
|
1208
|
+
sigpro.$for(
|
|
1209
|
+
() => val(options) || [],
|
|
1210
|
+
(opt) =>
|
|
1211
|
+
sigpro.$html(
|
|
1212
|
+
"option",
|
|
1213
|
+
{
|
|
1214
|
+
value: opt.value,
|
|
1215
|
+
$selected: () => String(val(value)) === String(opt.value),
|
|
1216
|
+
},
|
|
1217
|
+
opt.label,
|
|
1218
|
+
),
|
|
1219
|
+
(opt) => opt.value,
|
|
1220
|
+
),
|
|
1221
|
+
);
|
|
1222
|
+
|
|
1223
|
+
if (!label) return selectEl;
|
|
1224
|
+
|
|
1225
|
+
return sigpro.$html("label", { class: "fieldset-label flex flex-col gap-1" }, [
|
|
1226
|
+
sigpro.$html("span", {}, label),
|
|
1227
|
+
selectEl
|
|
1228
|
+
]);
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
var SelectModule = /*#__PURE__*/Object.freeze({
|
|
1232
|
+
__proto__: null,
|
|
1233
|
+
Select: Select
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
/** STACK */
|
|
1237
|
+
const Stack = (props, children) =>
|
|
1238
|
+
sigpro.$html("div", { ...props, class: joinClass("stack", props.class) }, children);
|
|
1239
|
+
|
|
1240
|
+
var StackModule = /*#__PURE__*/Object.freeze({
|
|
1241
|
+
__proto__: null,
|
|
1242
|
+
Stack: Stack
|
|
1243
|
+
});
|
|
1244
|
+
|
|
1245
|
+
/** STAT */
|
|
1246
|
+
const Stat = (props) =>
|
|
1247
|
+
sigpro.$html("div", { ...props, class: joinClass("stat", props.class) }, [
|
|
1248
|
+
props.icon && sigpro.$html("div", { class: "stat-figure text-secondary" }, props.icon),
|
|
1249
|
+
props.label && sigpro.$html("div", { class: "stat-title" }, props.label),
|
|
1250
|
+
sigpro.$html("div", { class: "stat-value" }, () => val(props.value) ?? props.value),
|
|
1251
|
+
props.desc && sigpro.$html("div", { class: "stat-desc" }, props.desc),
|
|
1252
|
+
]);
|
|
1253
|
+
|
|
1254
|
+
var StatModule = /*#__PURE__*/Object.freeze({
|
|
1255
|
+
__proto__: null,
|
|
1256
|
+
Stat: Stat
|
|
1257
|
+
});
|
|
1258
|
+
|
|
1259
|
+
/** SWAP */
|
|
1260
|
+
const Swap = (props) =>
|
|
1261
|
+
sigpro.$html("label", { class: joinClass("swap", props.class) }, [
|
|
1262
|
+
sigpro.$html("input", {
|
|
1263
|
+
type: "checkbox",
|
|
1264
|
+
checked: props.value
|
|
1265
|
+
}),
|
|
1266
|
+
sigpro.$html("div", { class: "swap-on" }, props.on),
|
|
1267
|
+
sigpro.$html("div", { class: "swap-off" }, props.off),
|
|
1268
|
+
]);
|
|
1269
|
+
|
|
1270
|
+
var SwapModule = /*#__PURE__*/Object.freeze({
|
|
1271
|
+
__proto__: null,
|
|
1272
|
+
Swap: Swap
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
/** TABLE */
|
|
1276
|
+
const Table = (props) => {
|
|
1277
|
+
const {
|
|
1278
|
+
items = [],
|
|
1279
|
+
columns = [],
|
|
1280
|
+
keyFn,
|
|
1281
|
+
zebra = false,
|
|
1282
|
+
pinRows = false,
|
|
1283
|
+
empty = tt("nodata")(),
|
|
1284
|
+
...rest
|
|
1285
|
+
} = props;
|
|
1286
|
+
|
|
1287
|
+
const tableClass = () => joinClass(
|
|
1288
|
+
"table",
|
|
1289
|
+
`${val(zebra) ? "table-zebra" : ""} ${val(pinRows) ? "table-pin-rows" : ""} ${props.class || ""}`
|
|
1290
|
+
);
|
|
1291
|
+
|
|
1292
|
+
return sigpro.$html("div", { class: "overflow-x-auto w-full bg-base-100 rounded-box border border-base-300" }, [
|
|
1293
|
+
sigpro.$html("table", { ...rest, class: tableClass }, [
|
|
1294
|
+
sigpro.$html("thead", {}, [
|
|
1295
|
+
sigpro.$html("tr", {},
|
|
1296
|
+
columns.map(col => sigpro.$html("th", { class: col.class || "" }, col.label))
|
|
1297
|
+
)
|
|
1298
|
+
]),
|
|
1299
|
+
sigpro.$html("tbody", {}, [
|
|
1300
|
+
sigpro.$for(items, (item, index) => {
|
|
1301
|
+
return sigpro.$html("tr", { class: "hover" },
|
|
1302
|
+
columns.map(col => {
|
|
1303
|
+
const cellContent = () => {
|
|
1304
|
+
if (col.render) return col.render(item, index);
|
|
1305
|
+
const value = item[col.key];
|
|
1306
|
+
return val(value);
|
|
1307
|
+
};
|
|
1308
|
+
return sigpro.$html("td", { class: col.class || "" }, [cellContent]);
|
|
1309
|
+
})
|
|
1310
|
+
);
|
|
1311
|
+
}, keyFn || ((item, idx) => item.id || idx)),
|
|
1312
|
+
|
|
1313
|
+
sigpro.$if(() => val(items).length === 0, () =>
|
|
1314
|
+
sigpro.$html("tr", {}, [
|
|
1315
|
+
sigpro.$html("td", { colspan: columns.length, class: "text-center p-10 opacity-50" }, [
|
|
1316
|
+
val(empty)
|
|
1317
|
+
])
|
|
1318
|
+
])
|
|
1319
|
+
)
|
|
1320
|
+
]),
|
|
1321
|
+
sigpro.$if(() => columns.some(c => c.footer), () =>
|
|
1322
|
+
sigpro.$html("tfoot", {}, [
|
|
1323
|
+
sigpro.$html("tr", {},
|
|
1324
|
+
columns.map(col => sigpro.$html("th", {}, col.footer || ""))
|
|
1325
|
+
)
|
|
1326
|
+
])
|
|
1327
|
+
)
|
|
1328
|
+
])
|
|
1329
|
+
]);
|
|
1330
|
+
};
|
|
1331
|
+
|
|
1332
|
+
var TableModule = /*#__PURE__*/Object.freeze({
|
|
1333
|
+
__proto__: null,
|
|
1334
|
+
Table: Table
|
|
1335
|
+
});
|
|
1336
|
+
|
|
1337
|
+
/** TABS */
|
|
1338
|
+
const Tabs = (props) => {
|
|
1339
|
+
const { items, ...rest } = props;
|
|
1340
|
+
const itemsSignal = typeof items === "function" ? items : () => items || [];
|
|
1341
|
+
|
|
1342
|
+
return sigpro.$html("div", { ...rest, class: "flex flex-col gap-4 w-full" }, [
|
|
1343
|
+
sigpro.$html(
|
|
1344
|
+
"div",
|
|
1345
|
+
{
|
|
1346
|
+
role: "tablist",
|
|
1347
|
+
class: joinClass("tabs tabs-box", props.class),
|
|
1348
|
+
},
|
|
1349
|
+
sigpro.$for(
|
|
1350
|
+
itemsSignal,
|
|
1351
|
+
(it) =>
|
|
1352
|
+
sigpro.$html(
|
|
1353
|
+
"a",
|
|
1354
|
+
{
|
|
1355
|
+
role: "tab",
|
|
1356
|
+
class: () => joinClass(
|
|
1357
|
+
"tab",
|
|
1358
|
+
val(it.active) && "tab-active",
|
|
1359
|
+
val(it.disabled) && "tab-disabled",
|
|
1360
|
+
it.tip && "tooltip"
|
|
1361
|
+
),
|
|
1362
|
+
"data-tip": it.tip,
|
|
1363
|
+
onclick: (e) => !val(it.disabled) && it.onclick?.(e),
|
|
1364
|
+
},
|
|
1365
|
+
it.label,
|
|
1366
|
+
),
|
|
1367
|
+
(t) => t.label,
|
|
1368
|
+
),
|
|
1369
|
+
),
|
|
1370
|
+
() => {
|
|
1371
|
+
const active = itemsSignal().find((it) => val(it.active));
|
|
1372
|
+
if (!active) return null;
|
|
1373
|
+
const content = val(active.content);
|
|
1374
|
+
return sigpro.$html("div", { class: "p-4" }, [
|
|
1375
|
+
typeof content === "function" ? content() : content
|
|
1376
|
+
]);
|
|
1377
|
+
},
|
|
1378
|
+
]);
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
var TabsModule = /*#__PURE__*/Object.freeze({
|
|
1382
|
+
__proto__: null,
|
|
1383
|
+
Tabs: Tabs
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
/** TIMELINE */
|
|
1387
|
+
const Timeline = (props) => {
|
|
1388
|
+
const { items = [], vertical = true, compact = false, ...rest } = props;
|
|
1389
|
+
|
|
1390
|
+
const icons = {
|
|
1391
|
+
info: iconInfo,
|
|
1392
|
+
success: iconSuccess,
|
|
1393
|
+
warning: iconWarning,
|
|
1394
|
+
error: iconError,
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
return sigpro.$html(
|
|
1398
|
+
"ul",
|
|
1399
|
+
{
|
|
1400
|
+
...rest,
|
|
1401
|
+
class: () =>
|
|
1402
|
+
`timeline ${val(vertical) ? "timeline-vertical" : "timeline-horizontal"} ${
|
|
1403
|
+
val(compact) ? "timeline-compact" : ""
|
|
1404
|
+
} ${props.class || ""}`,
|
|
1405
|
+
},
|
|
1406
|
+
[
|
|
1407
|
+
sigpro.$for(
|
|
1408
|
+
items,
|
|
1409
|
+
(item, i) => {
|
|
1410
|
+
const isFirst = i === 0;
|
|
1411
|
+
const isLast = i === val(items).length - 1;
|
|
1412
|
+
const itemType = item.type || "success";
|
|
1413
|
+
const renderSlot = (content) => (typeof content === "function" ? content() : content);
|
|
1414
|
+
|
|
1415
|
+
return sigpro.$html("li", { class: "flex-1" }, [
|
|
1416
|
+
!isFirst ? sigpro.$html("hr", { class: item.completed ? "bg-primary" : "" }) : null,
|
|
1417
|
+
sigpro.$html("div", { class: "timeline-start" }, [renderSlot(item.title)]),
|
|
1418
|
+
sigpro.$html("div", { class: "timeline-middle" }, [
|
|
1419
|
+
sigpro.$html("img", {
|
|
1420
|
+
src: icons[itemType] || item.icon || icons.success,
|
|
1421
|
+
class: "w-4 h-4 object-contain mx-1",
|
|
1422
|
+
alt: itemType,
|
|
1423
|
+
}),
|
|
1424
|
+
]),
|
|
1425
|
+
sigpro.$html("div", { class: "timeline-end timeline-box shadow-sm" }, [renderSlot(item.detail)]),
|
|
1426
|
+
!isLast ? sigpro.$html("hr", { class: item.completed ? "bg-primary" : "" }) : null,
|
|
1427
|
+
]);
|
|
1428
|
+
},
|
|
1429
|
+
(item, i) => item.id || i,
|
|
1430
|
+
),
|
|
1431
|
+
],
|
|
1432
|
+
);
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
var TimelineModule = /*#__PURE__*/Object.freeze({
|
|
1436
|
+
__proto__: null,
|
|
1437
|
+
Timeline: Timeline
|
|
1438
|
+
});
|
|
1439
|
+
|
|
1440
|
+
/** TOAST (Imperative Function) */
|
|
1441
|
+
const Toast = (message, type = "alert-success", duration = 3500) => {
|
|
1442
|
+
let container = document.getElementById("sigpro-toast-container");
|
|
1443
|
+
|
|
1444
|
+
// Crear el contenedor global si no existe
|
|
1445
|
+
if (!container) {
|
|
1446
|
+
container = sigpro.$html("div", {
|
|
1447
|
+
id: "sigpro-toast-container",
|
|
1448
|
+
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none",
|
|
1449
|
+
});
|
|
1450
|
+
document.body.appendChild(container);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
const toastHost = sigpro.$html("div", { style: "display: contents" });
|
|
1454
|
+
container.appendChild(toastHost);
|
|
1455
|
+
|
|
1456
|
+
let timeoutId;
|
|
1457
|
+
|
|
1458
|
+
const close = () => {
|
|
1459
|
+
clearTimeout(timeoutId);
|
|
1460
|
+
const el = toastHost.firstElementChild;
|
|
1461
|
+
if (el && !el.classList.contains("opacity-0")) {
|
|
1462
|
+
el.classList.add("translate-x-full", "opacity-0");
|
|
1463
|
+
setTimeout(() => {
|
|
1464
|
+
instance.destroy();
|
|
1465
|
+
toastHost.remove();
|
|
1466
|
+
// Limpiar el contenedor si ya no hay más toasts
|
|
1467
|
+
if (!container.hasChildNodes()) container.remove();
|
|
1468
|
+
}, 300);
|
|
1469
|
+
} else {
|
|
1470
|
+
instance.destroy();
|
|
1471
|
+
toastHost.remove();
|
|
1472
|
+
}
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
const ToastComponent = () => {
|
|
1476
|
+
const el = sigpro.$html(
|
|
1477
|
+
"div",
|
|
1478
|
+
{
|
|
1479
|
+
class: `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`,
|
|
1480
|
+
},
|
|
1481
|
+
[
|
|
1482
|
+
sigpro.$html("span", {}, [typeof message === "function" ? message() : message]),
|
|
1483
|
+
Button({ class: "btn-xs btn-circle btn-ghost", onclick: close }, "✕")
|
|
1484
|
+
],
|
|
1485
|
+
);
|
|
1486
|
+
|
|
1487
|
+
// Animación de entrada
|
|
1488
|
+
requestAnimationFrame(() => el.classList.remove("translate-x-10", "opacity-0"));
|
|
1489
|
+
return el;
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1492
|
+
const instance = sigpro.$mount(ToastComponent, toastHost);
|
|
1493
|
+
|
|
1494
|
+
if (duration > 0) {
|
|
1495
|
+
timeoutId = setTimeout(close, duration);
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
return close;
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1501
|
+
var ToastModule = /*#__PURE__*/Object.freeze({
|
|
1502
|
+
__proto__: null,
|
|
1503
|
+
Toast: Toast
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
/** TOOLTIP */
|
|
1507
|
+
const Tooltip = (props, children) =>
|
|
1508
|
+
sigpro.$html("div", { ...props, class: joinClass("tooltip", props.class), "data-tip": props.tip }, children);
|
|
1509
|
+
|
|
1510
|
+
var TooltipModule = /*#__PURE__*/Object.freeze({
|
|
1511
|
+
__proto__: null,
|
|
1512
|
+
Tooltip: Tooltip
|
|
1513
|
+
});
|
|
1514
|
+
|
|
1515
|
+
const Components = {
|
|
1516
|
+
...AccordionModule,
|
|
1517
|
+
...AlertModule,
|
|
1518
|
+
...AutocompleteModule,
|
|
1519
|
+
...BadgeModule,
|
|
1520
|
+
...ButtonModule,
|
|
1521
|
+
...CheckboxModule,
|
|
1522
|
+
...ColorpickerModule,
|
|
1523
|
+
...DatepickerModule,
|
|
1524
|
+
...DrawerModule,
|
|
1525
|
+
...DropdownModule,
|
|
1526
|
+
...FabModule,
|
|
1527
|
+
...FieldsetModule,
|
|
1528
|
+
...FileinputModule,
|
|
1529
|
+
...IndicatorModule,
|
|
1530
|
+
...InputModule,
|
|
1531
|
+
...ListModule,
|
|
1532
|
+
...LoadingModule,
|
|
1533
|
+
...MenuModule,
|
|
1534
|
+
...ModalModule,
|
|
1535
|
+
...NavbarModule,
|
|
1536
|
+
...RadioModule,
|
|
1537
|
+
...RangeModule,
|
|
1538
|
+
...RatingModule,
|
|
1539
|
+
...SelectModule,
|
|
1540
|
+
...StackModule,
|
|
1541
|
+
...StatModule,
|
|
1542
|
+
...SwapModule,
|
|
1543
|
+
...TableModule,
|
|
1544
|
+
...TabsModule,
|
|
1545
|
+
...TimelineModule,
|
|
1546
|
+
...ToastModule,
|
|
1547
|
+
...TooltipModule
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
var index = {
|
|
1551
|
+
...Components,
|
|
1552
|
+
install: (target = window) => {
|
|
1553
|
+
Object.entries(Components).forEach(([name, component]) => {
|
|
1554
|
+
target[name] = component;
|
|
1555
|
+
});
|
|
1556
|
+
console.log("🚀 SigproUI");
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
var Components$1 = /*#__PURE__*/Object.freeze({
|
|
1561
|
+
__proto__: null,
|
|
1562
|
+
Accordion: Accordion,
|
|
1563
|
+
Alert: Alert,
|
|
1564
|
+
Autocomplete: Autocomplete,
|
|
1565
|
+
Badge: Badge,
|
|
1566
|
+
Button: Button,
|
|
1567
|
+
Checkbox: Checkbox,
|
|
1568
|
+
Colorpicker: Colorpicker,
|
|
1569
|
+
Datepicker: Datepicker,
|
|
1570
|
+
Drawer: Drawer,
|
|
1571
|
+
Dropdown: Dropdown,
|
|
1572
|
+
Fab: Fab,
|
|
1573
|
+
Fieldset: Fieldset,
|
|
1574
|
+
Fileinput: Fileinput,
|
|
1575
|
+
Indicator: Indicator,
|
|
1576
|
+
Input: Input,
|
|
1577
|
+
List: List,
|
|
1578
|
+
Loading: Loading,
|
|
1579
|
+
Menu: Menu,
|
|
1580
|
+
Modal: Modal,
|
|
1581
|
+
Navbar: Navbar,
|
|
1582
|
+
Radio: Radio,
|
|
1583
|
+
Range: Range,
|
|
1584
|
+
Rating: Rating,
|
|
1585
|
+
Select: Select,
|
|
1586
|
+
Stack: Stack,
|
|
1587
|
+
Stat: Stat,
|
|
1588
|
+
Swap: Swap,
|
|
1589
|
+
Table: Table,
|
|
1590
|
+
Tabs: Tabs,
|
|
1591
|
+
Timeline: Timeline,
|
|
1592
|
+
Toast: Toast,
|
|
1593
|
+
Tooltip: Tooltip,
|
|
1594
|
+
default: index
|
|
1595
|
+
});
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* SigproUI - Entry Point
|
|
1599
|
+
*/
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
const SigproUI = {
|
|
1603
|
+
...Components$1,
|
|
1604
|
+
Icons,
|
|
1605
|
+
Utils,
|
|
1606
|
+
tt,
|
|
1607
|
+
|
|
1608
|
+
install: (target = (typeof window !== 'undefined' ? window : {})) => {
|
|
1609
|
+
Object.entries(Components$1).forEach(([name, component]) => {
|
|
1610
|
+
target[name] = component;
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
target.Icons = Icons;
|
|
1614
|
+
target.Utils = Utils;
|
|
1615
|
+
target.tt = tt;
|
|
1616
|
+
|
|
1617
|
+
console.log("🌟 SigproUI");
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
|
|
1621
|
+
if (typeof window !== 'undefined') {
|
|
1622
|
+
SigproUI.install(window);
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
exports.Accordion = Accordion;
|
|
1626
|
+
exports.Alert = Alert;
|
|
1627
|
+
exports.Autocomplete = Autocomplete;
|
|
1628
|
+
exports.Badge = Badge;
|
|
1629
|
+
exports.Button = Button;
|
|
1630
|
+
exports.Checkbox = Checkbox;
|
|
1631
|
+
exports.Colorpicker = Colorpicker;
|
|
1632
|
+
exports.Datepicker = Datepicker;
|
|
1633
|
+
exports.Drawer = Drawer;
|
|
1634
|
+
exports.Dropdown = Dropdown;
|
|
1635
|
+
exports.Fab = Fab;
|
|
1636
|
+
exports.Fieldset = Fieldset;
|
|
1637
|
+
exports.Fileinput = Fileinput;
|
|
1638
|
+
exports.Indicator = Indicator;
|
|
1639
|
+
exports.Input = Input;
|
|
1640
|
+
exports.List = List;
|
|
1641
|
+
exports.Loading = Loading;
|
|
1642
|
+
exports.Menu = Menu;
|
|
1643
|
+
exports.Modal = Modal;
|
|
1644
|
+
exports.Navbar = Navbar;
|
|
1645
|
+
exports.Radio = Radio;
|
|
1646
|
+
exports.Range = Range;
|
|
1647
|
+
exports.Rating = Rating;
|
|
1648
|
+
exports.Select = Select;
|
|
1649
|
+
exports.Stack = Stack;
|
|
1650
|
+
exports.Stat = Stat;
|
|
1651
|
+
exports.Swap = Swap;
|
|
1652
|
+
exports.Table = Table;
|
|
1653
|
+
exports.Tabs = Tabs;
|
|
1654
|
+
exports.Timeline = Timeline;
|
|
1655
|
+
exports.Toast = Toast;
|
|
1656
|
+
exports.Tooltip = Tooltip;
|
|
1657
|
+
exports.default = SigproUI;
|
|
1658
|
+
exports.icon123 = icon123;
|
|
1659
|
+
exports.iconAbc = iconAbc;
|
|
1660
|
+
exports.iconCalendar = iconCalendar;
|
|
1661
|
+
exports.iconClose = iconClose;
|
|
1662
|
+
exports.iconError = iconError;
|
|
1663
|
+
exports.iconHide = iconHide;
|
|
1664
|
+
exports.iconInfo = iconInfo;
|
|
1665
|
+
exports.iconLLeft = iconLLeft;
|
|
1666
|
+
exports.iconLeft = iconLeft;
|
|
1667
|
+
exports.iconLock = iconLock;
|
|
1668
|
+
exports.iconMail = iconMail;
|
|
1669
|
+
exports.iconRRight = iconRRight;
|
|
1670
|
+
exports.iconRight = iconRight;
|
|
1671
|
+
exports.iconShow = iconShow;
|
|
1672
|
+
exports.iconSuccess = iconSuccess;
|
|
1673
|
+
exports.iconUpload = iconUpload;
|
|
1674
|
+
exports.iconWarning = iconWarning;
|
|
1675
|
+
exports.joinClass = joinClass;
|
|
1676
|
+
exports.tt = tt;
|
|
1677
|
+
exports.val = val;
|