@sigtes/ui 0.2.7 → 0.2.9
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/dist/components.cjs.js +907 -781
- package/dist/components.es.js +41321 -39233
- package/dist/models/date/date.d.ts +5 -0
- package/dist/models.cjs.js +1 -1
- package/dist/models.es.js +115 -87
- package/package.json +1 -1
|
@@ -7,6 +7,10 @@ declare function differenceInDays(date1: Date, date2: Date): number;
|
|
|
7
7
|
declare function addDays(date: Date, days: number): Date;
|
|
8
8
|
declare function format(date: Date, format: string): string;
|
|
9
9
|
declare function toUTCDateString(date: Date): string;
|
|
10
|
+
declare function Intersect(date: Date, interval: {
|
|
11
|
+
start_date: Date;
|
|
12
|
+
end_date: Date;
|
|
13
|
+
}): boolean;
|
|
10
14
|
export declare const date: {
|
|
11
15
|
getLocalDate: typeof getLocalDate;
|
|
12
16
|
getLocalDateTime: typeof getLocalDateTime;
|
|
@@ -17,5 +21,6 @@ export declare const date: {
|
|
|
17
21
|
addDays: typeof addDays;
|
|
18
22
|
format: typeof format;
|
|
19
23
|
toUTCDateString: typeof toUTCDateString;
|
|
24
|
+
Intersect: typeof Intersect;
|
|
20
25
|
};
|
|
21
26
|
export {};
|
package/dist/models.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("dayjs");function L(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D={exports:{}},H=D.exports,C;function j(){return C||(C=1,(function(e,n){(function(f,s){e.exports=s(o)})(H,(function(f){function s(u){return u&&typeof u=="object"&&"default"in u?u:{default:u}}var h=s(f),_={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(u){return u+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return h.default.locale(_,null,!0),_}))})(D)),D.exports}j();var g={exports:{}},q=g.exports,w;function I(){return w||(w=1,(function(e,n){(function(f,s){e.exports=s()})(q,(function(){var f="minute",s=/[+-]\d\d(?::?\d\d)?/g,h=/([+-]|\d\d)/g;return function(_,u,i){var r=u.prototype;i.utc=function(t){var a={date:t,utc:!0,args:arguments};return new u(a)},r.utc=function(t){var a=i(this.toDate(),{locale:this.$L,utc:!0});return t?a.add(this.utcOffset(),f):a},r.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var d=r.parse;r.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),d.call(this,t)};var l=r.init;r.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var p=r.utcOffset;r.utcOffset=function(t,a){var $=this.$utils().u;if($(t))return this.$u?0:$(this.$offset)?p.call(this):this.$offset;if(typeof t=="string"&&(t=(function(M){M===void 0&&(M="");var U=M.match(s);if(!U)return null;var y=(""+U[0]).match(h)||["-",0,0],b=y[0],S=60*+y[1]+ +y[2];return S===0?0:b==="+"?S:-S})(t),t===null))return this;var m=Math.abs(t)<=16?60*t:t;if(m===0)return this.utc(a);var c=this.clone();if(a)return c.$offset=m,c.$u=!1,c;var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(c=this.local().add(m+x,f)).$offset=m,c.$x.$localOffset=x,c};var Y=r.format;r.format=function(t){var a=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return Y.call(this,a)},r.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var O=r.toDate;r.toDate=function(t){return t==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():O.call(this)};var T=r.diff;r.diff=function(t,a,$){if(t&&this.$u===t.$u)return T.call(this,t,a,$);var m=this.local(),c=i(t).local();return T.call(m,c,a,$)}}}))})(g)),g.exports}var z=I();const A=L(z);var v={exports:{}},P=v.exports,B;function k(){return B||(B=1,(function(e,n){(function(f,s){e.exports=s()})(P,(function(){return function(f,s,h){s.prototype.isBetween=function(_,u,i,r){var d=h(_),l=h(u),p=(r=r||"()")[0]==="(",Y=r[1]===")";return(p?this.isAfter(d,i):!this.isBefore(d,i))&&(Y?this.isBefore(l,i):!this.isAfter(l,i))||(p?this.isBefore(d,i):!this.isAfter(d,i))&&(Y?this.isAfter(l,i):!this.isBefore(l,i))}}}))})(v)),v.exports}var E=k();const F=L(E);o.extend(A);o.extend(F);o.locale("pt-br");function R(e){return o(String(e)).format("DD/MM/YYYY")}function W(e){return o(e).utc().add(1,"day").format("YYYY-MM-DD")}function Z(e){return o(String(e)).format("DD/MM/YYYY hh:mm:ss")}function G(e){if(e)return o(String(e)).utc().format("DD/MM/YYYY")}function J(){return o(new Date).format("YYYY-MM-DD")}function K(e,n){return o(e).diff(o(n),"day")}function N(e,n){return o(e).add(n,"day").toDate()}function Q(e,n){return o(new Date(e)).format(n)}function V(e){const n=e.getUTCDate().toString().padStart(2,"0"),f=(e.getUTCMonth()+1).toString().padStart(2,"0"),s=e.getUTCFullYear();return`${n}/${f}/${s}`}function X(e,n){return o(e).isBetween(n.start_date,n.end_date,"day","[]")}const tt={getLocalDate:R,getLocalDateTime:Z,getUTCDate:G,getUTCtoDateMoreOneDay:W,now:J,differenceInDays:K,addDays:N,format:Q,toUTCDateString:V,Intersect:X};exports.date=tt;
|
package/dist/models.es.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import i from "dayjs";
|
|
2
|
+
function L(e) {
|
|
3
3
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
4
|
}
|
|
5
|
-
var
|
|
5
|
+
var D = { exports: {} }, b = D.exports, C;
|
|
6
6
|
function j() {
|
|
7
|
-
return
|
|
7
|
+
return C || (C = 1, (function(e, n) {
|
|
8
8
|
(function(f, s) {
|
|
9
|
-
e.exports = s(
|
|
9
|
+
e.exports = s(i);
|
|
10
10
|
})(b, (function(f) {
|
|
11
|
-
function s(
|
|
12
|
-
return
|
|
11
|
+
function s(u) {
|
|
12
|
+
return u && typeof u == "object" && "default" in u ? u : { default: u };
|
|
13
13
|
}
|
|
14
|
-
var
|
|
15
|
-
return
|
|
14
|
+
var h = s(f), _ = { name: "pt-br", weekdays: "domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_sáb".split("_"), weekdaysMin: "Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"), months: "janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(u) {
|
|
15
|
+
return u + "º";
|
|
16
16
|
}, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [às] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [às] HH:mm" }, relativeTime: { future: "em %s", past: "há %s", s: "poucos segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um mês", MM: "%d meses", y: "um ano", yy: "%d anos" } };
|
|
17
|
-
return
|
|
17
|
+
return h.default.locale(_, null, !0), _;
|
|
18
18
|
}));
|
|
19
|
-
})(
|
|
19
|
+
})(D)), D.exports;
|
|
20
20
|
}
|
|
21
21
|
j();
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
return
|
|
22
|
+
var v = { exports: {} }, q = v.exports, w;
|
|
23
|
+
function I() {
|
|
24
|
+
return w || (w = 1, (function(e, n) {
|
|
25
25
|
(function(f, s) {
|
|
26
26
|
e.exports = s();
|
|
27
27
|
})(q, (function() {
|
|
28
|
-
var f = "minute", s = /[+-]\d\d(?::?\d\d)?/g,
|
|
29
|
-
return function(
|
|
30
|
-
var r =
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
return new
|
|
28
|
+
var f = "minute", s = /[+-]\d\d(?::?\d\d)?/g, h = /([+-]|\d\d)/g;
|
|
29
|
+
return function(_, u, o) {
|
|
30
|
+
var r = u.prototype;
|
|
31
|
+
o.utc = function(t) {
|
|
32
|
+
var a = { date: t, utc: !0, args: arguments };
|
|
33
|
+
return new u(a);
|
|
34
34
|
}, r.utc = function(t) {
|
|
35
|
-
var
|
|
36
|
-
return t ?
|
|
35
|
+
var a = o(this.toDate(), { locale: this.$L, utc: !0 });
|
|
36
|
+
return t ? a.add(this.utcOffset(), f) : a;
|
|
37
37
|
}, r.local = function() {
|
|
38
|
-
return
|
|
38
|
+
return o(this.toDate(), { locale: this.$L, utc: !1 });
|
|
39
39
|
};
|
|
40
|
-
var
|
|
40
|
+
var d = r.parse;
|
|
41
41
|
r.parse = function(t) {
|
|
42
|
-
t.utc && (this.$u = !0), this.$utils().u(t.$offset) || (this.$offset = t.$offset),
|
|
42
|
+
t.utc && (this.$u = !0), this.$utils().u(t.$offset) || (this.$offset = t.$offset), d.call(this, t);
|
|
43
43
|
};
|
|
44
|
-
var
|
|
44
|
+
var l = r.init;
|
|
45
45
|
r.init = function() {
|
|
46
46
|
if (this.$u) {
|
|
47
47
|
var t = this.$d;
|
|
48
48
|
this.$y = t.getUTCFullYear(), this.$M = t.getUTCMonth(), this.$D = t.getUTCDate(), this.$W = t.getUTCDay(), this.$H = t.getUTCHours(), this.$m = t.getUTCMinutes(), this.$s = t.getUTCSeconds(), this.$ms = t.getUTCMilliseconds();
|
|
49
|
-
} else
|
|
49
|
+
} else l.call(this);
|
|
50
50
|
};
|
|
51
|
-
var
|
|
52
|
-
r.utcOffset = function(t,
|
|
53
|
-
var
|
|
54
|
-
if (
|
|
55
|
-
if (typeof t == "string" && (t = (function(
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
if (!
|
|
59
|
-
var
|
|
60
|
-
return
|
|
51
|
+
var $ = r.utcOffset;
|
|
52
|
+
r.utcOffset = function(t, a) {
|
|
53
|
+
var p = this.$utils().u;
|
|
54
|
+
if (p(t)) return this.$u ? 0 : p(this.$offset) ? $.call(this) : this.$offset;
|
|
55
|
+
if (typeof t == "string" && (t = (function(g) {
|
|
56
|
+
g === void 0 && (g = "");
|
|
57
|
+
var U = g.match(s);
|
|
58
|
+
if (!U) return null;
|
|
59
|
+
var x = ("" + U[0]).match(h) || ["-", 0, 0], H = x[0], y = 60 * +x[1] + +x[2];
|
|
60
|
+
return y === 0 ? 0 : H === "+" ? y : -y;
|
|
61
61
|
})(t), t === null)) return this;
|
|
62
|
-
var
|
|
63
|
-
if (
|
|
64
|
-
var
|
|
65
|
-
if (
|
|
66
|
-
var
|
|
67
|
-
return (
|
|
62
|
+
var m = Math.abs(t) <= 16 ? 60 * t : t;
|
|
63
|
+
if (m === 0) return this.utc(a);
|
|
64
|
+
var c = this.clone();
|
|
65
|
+
if (a) return c.$offset = m, c.$u = !1, c;
|
|
66
|
+
var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
67
|
+
return (c = this.local().add(m + S, f)).$offset = m, c.$x.$localOffset = S, c;
|
|
68
68
|
};
|
|
69
|
-
var
|
|
69
|
+
var Y = r.format;
|
|
70
70
|
r.format = function(t) {
|
|
71
|
-
var
|
|
72
|
-
return
|
|
71
|
+
var a = t || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
72
|
+
return Y.call(this, a);
|
|
73
73
|
}, r.valueOf = function() {
|
|
74
74
|
var t = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
75
75
|
return this.$d.valueOf() - 6e4 * t;
|
|
@@ -80,63 +80,91 @@ function w() {
|
|
|
80
80
|
}, r.toString = function() {
|
|
81
81
|
return this.toDate().toUTCString();
|
|
82
82
|
};
|
|
83
|
-
var
|
|
83
|
+
var O = r.toDate;
|
|
84
84
|
r.toDate = function(t) {
|
|
85
|
-
return t === "s" && this.$offset ?
|
|
85
|
+
return t === "s" && this.$offset ? o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : O.call(this);
|
|
86
86
|
};
|
|
87
|
-
var
|
|
88
|
-
r.diff = function(t,
|
|
89
|
-
if (t && this.$u === t.$u) return
|
|
90
|
-
var
|
|
91
|
-
return
|
|
87
|
+
var T = r.diff;
|
|
88
|
+
r.diff = function(t, a, p) {
|
|
89
|
+
if (t && this.$u === t.$u) return T.call(this, t, a, p);
|
|
90
|
+
var m = this.local(), c = o(t).local();
|
|
91
|
+
return T.call(m, c, a, p);
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
}));
|
|
95
|
-
})(
|
|
95
|
+
})(v)), v.exports;
|
|
96
96
|
}
|
|
97
|
-
var z =
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
var z = I();
|
|
98
|
+
const A = /* @__PURE__ */ L(z);
|
|
99
|
+
var M = { exports: {} }, k = M.exports, B;
|
|
100
|
+
function E() {
|
|
101
|
+
return B || (B = 1, (function(e, n) {
|
|
102
|
+
(function(f, s) {
|
|
103
|
+
e.exports = s();
|
|
104
|
+
})(k, (function() {
|
|
105
|
+
return function(f, s, h) {
|
|
106
|
+
s.prototype.isBetween = function(_, u, o, r) {
|
|
107
|
+
var d = h(_), l = h(u), $ = (r = r || "()")[0] === "(", Y = r[1] === ")";
|
|
108
|
+
return ($ ? this.isAfter(d, o) : !this.isBefore(d, o)) && (Y ? this.isBefore(l, o) : !this.isAfter(l, o)) || ($ ? this.isBefore(d, o) : !this.isAfter(d, o)) && (Y ? this.isAfter(l, o) : !this.isBefore(l, o));
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}));
|
|
112
|
+
})(M)), M.exports;
|
|
113
|
+
}
|
|
114
|
+
var F = E();
|
|
115
|
+
const P = /* @__PURE__ */ L(F);
|
|
116
|
+
i.extend(A);
|
|
117
|
+
i.extend(P);
|
|
118
|
+
i.locale("pt-br");
|
|
119
|
+
function R(e) {
|
|
120
|
+
return i(String(e)).format("DD/MM/YYYY");
|
|
103
121
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
122
|
+
function W(e) {
|
|
123
|
+
return i(e).utc().add(1, "day").format("YYYY-MM-DD");
|
|
106
124
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
125
|
+
function Z(e) {
|
|
126
|
+
return i(String(e)).format("DD/MM/YYYY hh:mm:ss");
|
|
109
127
|
}
|
|
110
|
-
function
|
|
128
|
+
function G(e) {
|
|
111
129
|
if (e)
|
|
112
|
-
return
|
|
130
|
+
return i(String(e)).utc().format("DD/MM/YYYY");
|
|
113
131
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
132
|
+
function J() {
|
|
133
|
+
return i(/* @__PURE__ */ new Date()).format("YYYY-MM-DD");
|
|
134
|
+
}
|
|
135
|
+
function K(e, n) {
|
|
136
|
+
return i(e).diff(i(n), "day");
|
|
116
137
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
138
|
+
function N(e, n) {
|
|
139
|
+
return i(e).add(n, "day").toDate();
|
|
119
140
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
141
|
+
function Q(e, n) {
|
|
142
|
+
return i(new Date(e)).format(n);
|
|
122
143
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
144
|
+
function V(e) {
|
|
145
|
+
const n = e.getUTCDate().toString().padStart(2, "0"), f = (e.getUTCMonth() + 1).toString().padStart(2, "0"), s = e.getUTCFullYear();
|
|
146
|
+
return `${n}/${f}/${s}`;
|
|
125
147
|
}
|
|
126
|
-
function
|
|
127
|
-
return
|
|
148
|
+
function X(e, n) {
|
|
149
|
+
return i(e).isBetween(
|
|
150
|
+
n.start_date,
|
|
151
|
+
n.end_date,
|
|
152
|
+
"day",
|
|
153
|
+
"[]"
|
|
154
|
+
);
|
|
128
155
|
}
|
|
129
|
-
const
|
|
130
|
-
getLocalDate:
|
|
131
|
-
getLocalDateTime:
|
|
132
|
-
getUTCDate:
|
|
133
|
-
getUTCtoDateMoreOneDay:
|
|
134
|
-
now:
|
|
135
|
-
differenceInDays:
|
|
136
|
-
addDays:
|
|
137
|
-
format:
|
|
138
|
-
toUTCDateString:
|
|
156
|
+
const et = {
|
|
157
|
+
getLocalDate: R,
|
|
158
|
+
getLocalDateTime: Z,
|
|
159
|
+
getUTCDate: G,
|
|
160
|
+
getUTCtoDateMoreOneDay: W,
|
|
161
|
+
now: J,
|
|
162
|
+
differenceInDays: K,
|
|
163
|
+
addDays: N,
|
|
164
|
+
format: Q,
|
|
165
|
+
toUTCDateString: V,
|
|
166
|
+
Intersect: X
|
|
139
167
|
};
|
|
140
168
|
export {
|
|
141
|
-
|
|
169
|
+
et as date
|
|
142
170
|
};
|