smoothly 0.1.81 → 0.1.85
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/cjs/{generate-14aca5d2.js → generate-a6821b82.js} +2 -2
- package/dist/cjs/index.cjs.js +214 -116
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/smoothly-accordion_47.cjs.entry.js +22 -21
- package/dist/cjs/smoothly-calendar.cjs.entry.js +17 -16
- package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-input-month.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-select-demo.cjs.entry.js +2 -2
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/calendar/generate.js +2 -2
- package/dist/collection/components/calendar/index.js +59 -14
- package/dist/collection/components/calendar/style.css +7 -1
- package/dist/collection/components/input-date/index.js +45 -1
- package/dist/collection/components/input-date-range/index.js +45 -1
- package/dist/collection/components/select-demo/index.js +2 -2
- package/dist/collection/index.js +1 -1
- package/dist/collection/utilities/Cosmetic/Color/CommaRgb.js +90 -0
- package/dist/collection/utilities/Cosmetic/Color/Hex.js +11 -0
- package/dist/collection/utilities/Cosmetic/Color/Hsl.js +32 -0
- package/dist/collection/utilities/{colorNames.js → Cosmetic/Color/Name.js} +9 -1
- package/dist/collection/utilities/Cosmetic/Color/Rgb.js +19 -0
- package/dist/collection/utilities/Cosmetic/Color/index.js +23 -0
- package/dist/collection/utilities/Cosmetic/index.js +40 -0
- package/dist/collection/utilities/index.js +1 -1
- package/dist/custom-elements/index.js +246 -146
- package/dist/{smoothly/generate-be25a8d1.js → esm/generate-776b3b0f.js} +2 -2
- package/dist/esm/index.js +215 -116
- package/dist/esm/loader.js +1 -1
- package/dist/esm/smoothly-accordion_47.entry.js +22 -21
- package/dist/esm/smoothly-calendar.entry.js +17 -16
- package/dist/esm/smoothly-input-date-range.entry.js +1 -1
- package/dist/esm/smoothly-input-date.entry.js +1 -1
- package/dist/esm/smoothly-input-month.entry.js +1 -1
- package/dist/esm/smoothly-select-demo.entry.js +2 -2
- package/dist/esm/smoothly.js +1 -1
- package/dist/{esm/generate-be25a8d1.js → smoothly/generate-776b3b0f.js} +2 -2
- package/dist/smoothly/index.esm.js +215 -116
- package/dist/smoothly/p-5ca32c49.entry.js +1 -0
- package/dist/smoothly/smoothly-calendar.entry.js +17 -16
- package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
- package/dist/smoothly/smoothly-input-date.entry.js +1 -1
- package/dist/smoothly/smoothly-input-month.entry.js +1 -1
- package/dist/smoothly/smoothly-select-demo.entry.js +2 -2
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/calendar/index.d.ts +3 -0
- package/dist/types/components/input-date/index.d.ts +2 -0
- package/dist/types/components/input-date-range/index.d.ts +2 -0
- package/dist/types/components.d.ts +12 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utilities/Cosmetic/Color/CommaRgb.d.ts +11 -0
- package/dist/types/utilities/Cosmetic/Color/Hex.d.ts +4 -0
- package/dist/types/utilities/Cosmetic/Color/Hsl.d.ts +4 -0
- package/dist/types/utilities/Cosmetic/Color/Name.d.ts +155 -0
- package/dist/types/utilities/Cosmetic/Color/Rgb.d.ts +4 -0
- package/dist/types/utilities/Cosmetic/Color/index.d.ts +170 -0
- package/dist/types/utilities/Cosmetic/index.d.ts +23 -0
- package/dist/types/utilities/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/collection/utilities/colorTransform.js +0 -120
- package/dist/smoothly/p-c9d01e9b.entry.js +0 -1
- package/dist/types/utilities/colorNames.d.ts +0 -3
- package/dist/types/utilities/colorTransform.d.ts +0 -8
|
@@ -1555,7 +1555,7 @@ var Symmetric;
|
|
|
1555
1555
|
Symmetric.is = is;
|
|
1556
1556
|
})(Symmetric || (Symmetric = {}));
|
|
1557
1557
|
|
|
1558
|
-
var Name$
|
|
1558
|
+
var Name$4;
|
|
1559
1559
|
(function (Name) {
|
|
1560
1560
|
function is(value) {
|
|
1561
1561
|
return value == "none" || Symmetric.is(value) || Asymmetric.is(value);
|
|
@@ -1569,7 +1569,7 @@ var Name$3;
|
|
|
1569
1569
|
(function (Asymmetric$1) {
|
|
1570
1570
|
Asymmetric$1.is = Asymmetric.is;
|
|
1571
1571
|
})(Asymmetric$1 = Name.Asymmetric || (Name.Asymmetric = {}));
|
|
1572
|
-
})(Name$
|
|
1572
|
+
})(Name$4 || (Name$4 = {}));
|
|
1573
1573
|
|
|
1574
1574
|
var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1575
1575
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -1681,14 +1681,14 @@ class Algorithm {
|
|
|
1681
1681
|
(function (Algorithm) {
|
|
1682
1682
|
let Name;
|
|
1683
1683
|
(function (Name) {
|
|
1684
|
-
Name.is = Name$
|
|
1684
|
+
Name.is = Name$4.is;
|
|
1685
1685
|
let Symmetric;
|
|
1686
1686
|
(function (Symmetric) {
|
|
1687
|
-
Symmetric.is = Name$
|
|
1687
|
+
Symmetric.is = Name$4.Symmetric.is;
|
|
1688
1688
|
})(Symmetric = Name.Symmetric || (Name.Symmetric = {}));
|
|
1689
1689
|
let Asymmetric;
|
|
1690
1690
|
(function (Asymmetric) {
|
|
1691
|
-
Asymmetric.is = Name$
|
|
1691
|
+
Asymmetric.is = Name$4.Asymmetric.is;
|
|
1692
1692
|
})(Asymmetric = Name.Asymmetric || (Name.Asymmetric = {}));
|
|
1693
1693
|
})(Name = Algorithm.Name || (Algorithm.Name = {}));
|
|
1694
1694
|
})(Algorithm || (Algorithm = {}));
|
|
@@ -1989,7 +1989,52 @@ class Trigger {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
1991
|
|
|
1992
|
-
|
|
1992
|
+
var Hex;
|
|
1993
|
+
(function (Hex) {
|
|
1994
|
+
function is(value) {
|
|
1995
|
+
const matchArray = (typeof value == "string" && value.match(/[0-9a-fA-F]/g)) || undefined;
|
|
1996
|
+
return (typeof value == "string" &&
|
|
1997
|
+
value.length > 3 &&
|
|
1998
|
+
value[0] == "#" &&
|
|
1999
|
+
((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6));
|
|
2000
|
+
}
|
|
2001
|
+
Hex.is = is;
|
|
2002
|
+
})(Hex || (Hex = {}));
|
|
2003
|
+
|
|
2004
|
+
var Hsl;
|
|
2005
|
+
(function (Hsl) {
|
|
2006
|
+
function is(value) {
|
|
2007
|
+
const values = typeof value == "string" && value.length > 11 ? value.substring(4, value.length - 1).split(",") : [];
|
|
2008
|
+
return (typeof value == "string" &&
|
|
2009
|
+
value.length > 11 &&
|
|
2010
|
+
value.substr(0, 4) == "hsl(" &&
|
|
2011
|
+
value.substr(value.length - 1, 1) == ")" &&
|
|
2012
|
+
values.length == 3 &&
|
|
2013
|
+
values.every((single, index) => {
|
|
2014
|
+
var _a, _b;
|
|
2015
|
+
let result = false;
|
|
2016
|
+
if (index == 0)
|
|
2017
|
+
result =
|
|
2018
|
+
!Number.isNaN(single) &&
|
|
2019
|
+
((_a = single.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == single.length &&
|
|
2020
|
+
Number(single) >= 0 &&
|
|
2021
|
+
Number(single) <= 360;
|
|
2022
|
+
else {
|
|
2023
|
+
const number = single.substr(0, single.length - 1);
|
|
2024
|
+
result =
|
|
2025
|
+
single[single.length - 1] == "%" &&
|
|
2026
|
+
!Number.isNaN(number) &&
|
|
2027
|
+
((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
|
|
2028
|
+
Number(number) >= 0 &&
|
|
2029
|
+
Number(number) <= 100;
|
|
2030
|
+
}
|
|
2031
|
+
return result;
|
|
2032
|
+
}));
|
|
2033
|
+
}
|
|
2034
|
+
Hsl.is = is;
|
|
2035
|
+
})(Hsl || (Hsl = {}));
|
|
2036
|
+
|
|
2037
|
+
const Names = {
|
|
1993
2038
|
aliceblue: "#f0f8ff",
|
|
1994
2039
|
antiquewhite: "#faebd7",
|
|
1995
2040
|
aqua: "#00ffff",
|
|
@@ -2139,126 +2184,180 @@ const colorNames = {
|
|
|
2139
2184
|
yellow: "#ffff00",
|
|
2140
2185
|
yellowgreen: "#9acd32",
|
|
2141
2186
|
};
|
|
2187
|
+
var Name$3;
|
|
2188
|
+
(function (Name) {
|
|
2189
|
+
Name.types = () => Object.keys(Names);
|
|
2190
|
+
function is(value) {
|
|
2191
|
+
return typeof value == "string" && Name.types().includes(value.toLowerCase());
|
|
2192
|
+
}
|
|
2193
|
+
Name.is = is;
|
|
2194
|
+
})(Name$3 || (Name$3 = {}));
|
|
2142
2195
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
result
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2196
|
+
var Rgb;
|
|
2197
|
+
(function (Rgb) {
|
|
2198
|
+
function is(value) {
|
|
2199
|
+
const values = typeof value == "string" && value.length > 9 ? value.substring(4, value.length - 1).split(",") : [];
|
|
2200
|
+
return (typeof value == "string" &&
|
|
2201
|
+
value.length > 9 &&
|
|
2202
|
+
value.substr(0, 4) == "rgb(" &&
|
|
2203
|
+
value.substr(value.length - 1, 1) == ")" &&
|
|
2204
|
+
values.length == 3 &&
|
|
2205
|
+
values.every((value) => {
|
|
2206
|
+
var _a;
|
|
2207
|
+
return !Number.isNaN(value) &&
|
|
2208
|
+
((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
|
|
2209
|
+
Number(value) >= 0 &&
|
|
2210
|
+
Number(value) <= 255;
|
|
2211
|
+
}));
|
|
2212
|
+
}
|
|
2213
|
+
Rgb.is = is;
|
|
2214
|
+
})(Rgb || (Rgb = {}));
|
|
2215
|
+
|
|
2216
|
+
var CommaRgb;
|
|
2217
|
+
(function (CommaRgb) {
|
|
2218
|
+
function is(value) {
|
|
2219
|
+
const values = typeof value == "string" ? value.split(",") : [];
|
|
2220
|
+
return (values.length == 3 &&
|
|
2221
|
+
values.every((value) => {
|
|
2222
|
+
var _a;
|
|
2223
|
+
return !Number.isNaN(value) &&
|
|
2224
|
+
((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
|
|
2225
|
+
Number(value) >= 0 &&
|
|
2226
|
+
Number(value) <= 255;
|
|
2227
|
+
}));
|
|
2228
|
+
}
|
|
2229
|
+
CommaRgb.is = is;
|
|
2230
|
+
function from(color) {
|
|
2231
|
+
let result;
|
|
2232
|
+
const colorWithoutSpace = typeof color == "string" ? color.replace(/ /g, "").toLowerCase() : undefined;
|
|
2233
|
+
if (!colorWithoutSpace)
|
|
2234
|
+
result = undefined;
|
|
2235
|
+
else if (CommaRgb.is(colorWithoutSpace))
|
|
2236
|
+
result = colorWithoutSpace;
|
|
2237
|
+
else if (Hex.is(colorWithoutSpace))
|
|
2238
|
+
result = fromHex(colorWithoutSpace);
|
|
2239
|
+
else if (Rgb.is(colorWithoutSpace))
|
|
2240
|
+
result = fromRgb(colorWithoutSpace);
|
|
2241
|
+
else if (Name$3.is(colorWithoutSpace))
|
|
2242
|
+
result = fromHex(Names[colorWithoutSpace]);
|
|
2243
|
+
else if (Hsl.is(colorWithoutSpace))
|
|
2244
|
+
result = fromHsl(colorWithoutSpace);
|
|
2245
|
+
return result;
|
|
2246
|
+
}
|
|
2247
|
+
CommaRgb.from = from;
|
|
2248
|
+
function fromHex(hex) {
|
|
2249
|
+
let result = "0,0,0";
|
|
2250
|
+
if (hex.length == 7)
|
|
2251
|
+
result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
|
|
2252
|
+
else if (hex.length == 4)
|
|
2253
|
+
result = fromHex(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
|
|
2254
|
+
return result;
|
|
2255
|
+
}
|
|
2256
|
+
CommaRgb.fromHex = fromHex;
|
|
2257
|
+
function fromRgb(rgb) {
|
|
2258
|
+
return rgb.substring(4, rgb.length - 1);
|
|
2259
|
+
}
|
|
2260
|
+
CommaRgb.fromRgb = fromRgb;
|
|
2261
|
+
function fromHsl(hsl) {
|
|
2262
|
+
let result = "";
|
|
2263
|
+
let h, s, l;
|
|
2264
|
+
let r, g, b;
|
|
2265
|
+
const HSL = hsl
|
|
2266
|
+
.substring(4, hsl.length - 1)
|
|
2267
|
+
.split(",")
|
|
2268
|
+
.map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
|
|
2269
|
+
if (HSL.length == 3) {
|
|
2270
|
+
h = HSL[0] / 360;
|
|
2271
|
+
s = HSL[1] / 100;
|
|
2272
|
+
l = HSL[2] / 100;
|
|
2273
|
+
if (s == 0)
|
|
2274
|
+
r = g = b = l;
|
|
2211
2275
|
else {
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
Number(number) >= 0 &&
|
|
2218
|
-
Number(number) <= 100;
|
|
2276
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
2277
|
+
const p = 2 * l - q;
|
|
2278
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
2279
|
+
g = hue2rgb(p, q, h);
|
|
2280
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
2219
2281
|
}
|
|
2220
|
-
|
|
2221
|
-
}));
|
|
2222
|
-
}
|
|
2223
|
-
function hue2rgb(p, q, t) {
|
|
2224
|
-
let result = p;
|
|
2225
|
-
if (t < 0)
|
|
2226
|
-
t += 1;
|
|
2227
|
-
if (t > 1)
|
|
2228
|
-
t -= 1;
|
|
2229
|
-
if (t < 1 / 6)
|
|
2230
|
-
result = p + (q - p) * 6 * t;
|
|
2231
|
-
else if (t < 1 / 2)
|
|
2232
|
-
result = q;
|
|
2233
|
-
else if (t < 2 / 3)
|
|
2234
|
-
result = p + (q - p) * (2 / 3 - t) * 6;
|
|
2235
|
-
return result;
|
|
2236
|
-
}
|
|
2237
|
-
function hslToCommaRgb(hsl) {
|
|
2238
|
-
let result;
|
|
2239
|
-
let h, s, l;
|
|
2240
|
-
let r, g, b;
|
|
2241
|
-
const HSL = hsl
|
|
2242
|
-
.substring(4, hsl.length - 1)
|
|
2243
|
-
.split(",")
|
|
2244
|
-
.map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
|
|
2245
|
-
if (HSL.length == 3) {
|
|
2246
|
-
h = HSL[0] / 360;
|
|
2247
|
-
s = HSL[1] / 100;
|
|
2248
|
-
l = HSL[2] / 100;
|
|
2249
|
-
if (s == 0)
|
|
2250
|
-
r = g = b = l;
|
|
2251
|
-
else {
|
|
2252
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
2253
|
-
const p = 2 * l - q;
|
|
2254
|
-
r = hue2rgb(p, q, h + 1 / 3);
|
|
2255
|
-
g = hue2rgb(p, q, h);
|
|
2256
|
-
b = hue2rgb(p, q, h - 1 / 3);
|
|
2282
|
+
result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
|
|
2257
2283
|
}
|
|
2258
|
-
result
|
|
2284
|
+
return result;
|
|
2259
2285
|
}
|
|
2260
|
-
|
|
2261
|
-
|
|
2286
|
+
CommaRgb.fromHsl = fromHsl;
|
|
2287
|
+
function hue2rgb(p, q, t) {
|
|
2288
|
+
let result = p;
|
|
2289
|
+
if (t < 0)
|
|
2290
|
+
t += 1;
|
|
2291
|
+
if (t > 1)
|
|
2292
|
+
t -= 1;
|
|
2293
|
+
if (t < 1 / 6)
|
|
2294
|
+
result = p + (q - p) * 6 * t;
|
|
2295
|
+
else if (t < 1 / 2)
|
|
2296
|
+
result = q;
|
|
2297
|
+
else if (t < 2 / 3)
|
|
2298
|
+
result = p + (q - p) * (2 / 3 - t) * 6;
|
|
2299
|
+
return result;
|
|
2300
|
+
}
|
|
2301
|
+
})(CommaRgb || (CommaRgb = {}));
|
|
2302
|
+
|
|
2303
|
+
var Color;
|
|
2304
|
+
(function (Color) {
|
|
2305
|
+
function is(value) {
|
|
2306
|
+
return (typeof value == "string" &&
|
|
2307
|
+
(CommaRgb.is(value) || Hex.is(value) || Hsl.is(value) || Name$3.is(value) || Rgb.is(value)));
|
|
2308
|
+
}
|
|
2309
|
+
Color.is = is;
|
|
2310
|
+
function from(value) {
|
|
2311
|
+
return is(value) ? value : undefined;
|
|
2312
|
+
}
|
|
2313
|
+
Color.from = from;
|
|
2314
|
+
Color.Names = Names;
|
|
2315
|
+
Color.Name = Name$3;
|
|
2316
|
+
Color.CommaRgb = CommaRgb;
|
|
2317
|
+
Color.Rgb = Rgb;
|
|
2318
|
+
Color.Hex = Hex;
|
|
2319
|
+
Color.Hsl = Hsl;
|
|
2320
|
+
})(Color || (Color = {}));
|
|
2321
|
+
|
|
2322
|
+
function reduce(types, value) {
|
|
2323
|
+
return types.reduce((r, c) => typeof value == "object" && value != null && typeof value[c] == "string"
|
|
2324
|
+
? Object.assign(Object.assign({}, r), { [c]: value[c] }) : r, {});
|
|
2325
|
+
}
|
|
2326
|
+
var Cosmetic;
|
|
2327
|
+
(function (Cosmetic) {
|
|
2328
|
+
Cosmetic.types = Cosmetic;
|
|
2329
|
+
function from(value) {
|
|
2330
|
+
let result = {};
|
|
2331
|
+
if (typeof value == "object" && value) {
|
|
2332
|
+
result = {
|
|
2333
|
+
text: reduce(["background", "color"], value.text),
|
|
2334
|
+
border: reduce(["background", "color", "style", "radius", "width"], value.border),
|
|
2335
|
+
gap: typeof value.gap == "string" ? value.gap : undefined,
|
|
2336
|
+
dangerColor: typeof value.dangerColor == "string"
|
|
2337
|
+
? value.dangerColor
|
|
2338
|
+
: typeof value.danger_color == "string"
|
|
2339
|
+
? value.danger_color
|
|
2340
|
+
: undefined,
|
|
2341
|
+
fontFamily: typeof value.fontFamily == "string"
|
|
2342
|
+
? value.fontFamily
|
|
2343
|
+
: typeof value.font_family == "string"
|
|
2344
|
+
? value.font_family
|
|
2345
|
+
: undefined,
|
|
2346
|
+
background: typeof value.background == "string" ? value.background : undefined,
|
|
2347
|
+
};
|
|
2348
|
+
Object.keys(result).forEach((key) => {
|
|
2349
|
+
var _a;
|
|
2350
|
+
if (result[key] == undefined ||
|
|
2351
|
+
(typeof result[key] == "object" && result[key] && Object.keys((_a = result[key]) !== null && _a !== void 0 ? _a : {}).length == 0)) {
|
|
2352
|
+
delete result[key];
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
return result;
|
|
2357
|
+
}
|
|
2358
|
+
Cosmetic.from = from;
|
|
2359
|
+
Cosmetic.Color = Color;
|
|
2360
|
+
})(Cosmetic || (Cosmetic = {}));
|
|
2262
2361
|
|
|
2263
2362
|
const globalScripts = () => {};
|
|
2264
2363
|
|
|
@@ -21267,12 +21366,12 @@ function months(current) {
|
|
|
21267
21366
|
const day = new globalThis.Date(current);
|
|
21268
21367
|
const result = [];
|
|
21269
21368
|
for (let i = 0; i < 12; i++) {
|
|
21270
|
-
day.setMonth(i);
|
|
21369
|
+
day.setMonth(i, 28);
|
|
21271
21370
|
const date = dist$4.Date.create(day);
|
|
21272
21371
|
result.push({
|
|
21273
21372
|
date,
|
|
21274
21373
|
name: day.toLocaleString(undefined, { month: "long" }),
|
|
21275
|
-
selected: date == current,
|
|
21374
|
+
selected: date.substr(0, 7) == current.substr(0, 7),
|
|
21276
21375
|
});
|
|
21277
21376
|
}
|
|
21278
21377
|
return result;
|
|
@@ -21294,7 +21393,7 @@ function years(current) {
|
|
|
21294
21393
|
return result;
|
|
21295
21394
|
}
|
|
21296
21395
|
|
|
21297
|
-
const styleCss$E = ".sc-smoothly-calendar-h{display:block;--other-month-opacity:0.5}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding:0.5em 0.5em 0 0.5em}th.sc-smoothly-calendar,td.sc-smoothly-calendar{text-align:center;padding:0.5em;min-width:2em;background-color:rgb(var(--smoothly-default-shade));cursor:pointer;user-select:none}td.currentMonth.sc-smoothly-calendar{color:rgb(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:not(.currentMonth){color:rgba(var(--smoothly-default-contrast), var(--other-month-opacity))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).dateRange,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).dateRange{color:rgba(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:nth-child(6),td.sc-smoothly-calendar:nth-child(7){color:rgb(var(--smoothly-danger-tint))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth),td.sc-smoothly-calendar:nth-child(7):not(.currentMonth){color:rgba(var(--smoothly-danger-tint), var(--other-month-opacity))}td.sc-smoothly-calendar:not(.selected):hover{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.selected.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color))}td.sc-smoothly-calendar:not(.selected,.dateRange).sc-smoothly-calendar:not(:hover).today{background:rgb(var(--smoothly-dark-tint));color:rgb(var(--smoothly-dark-contrast))}td.dateRange.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}";
|
|
21396
|
+
const styleCss$E = ".sc-smoothly-calendar-h{display:block;--other-month-opacity:0.5}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding:0.5em 0.5em 0 0.5em}th.sc-smoothly-calendar,td.sc-smoothly-calendar{text-align:center;padding:0.5em;min-width:2em;background-color:rgb(var(--smoothly-default-shade));cursor:pointer;user-select:none}td.currentMonth.sc-smoothly-calendar{color:rgb(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:not(.currentMonth){color:rgba(var(--smoothly-default-contrast), var(--other-month-opacity))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).dateRange,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).dateRange{color:rgba(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:nth-child(6),td.sc-smoothly-calendar:nth-child(7){color:rgb(var(--smoothly-danger-tint))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth),td.sc-smoothly-calendar:nth-child(7):not(.currentMonth){color:rgba(var(--smoothly-danger-tint), var(--other-month-opacity))}td.sc-smoothly-calendar:not(.selected,.disable).sc-smoothly-calendar:hover{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.selected.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color))}td.sc-smoothly-calendar:not(.selected,.dateRange).sc-smoothly-calendar:not(:hover).today{background:rgb(var(--smoothly-dark-tint));color:rgb(var(--smoothly-dark-contrast))}td.dateRange.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.disable.sc-smoothly-calendar{cursor:not-allowed;background-color:rgb(var(--smoothly-default-tint), 0.5);color:rgb(var(--smoothly-default-contrast), 0.5)}";
|
|
21298
21397
|
|
|
21299
21398
|
let Calendar = class extends HTMLElement {
|
|
21300
21399
|
constructor() {
|
|
@@ -21312,6 +21411,18 @@ let Calendar = class extends HTMLElement {
|
|
|
21312
21411
|
onEnd(next) {
|
|
21313
21412
|
this.endChanged.emit(next);
|
|
21314
21413
|
}
|
|
21414
|
+
onClick(date) {
|
|
21415
|
+
this.valueChanged.emit((this.value = date));
|
|
21416
|
+
this.clickCounter += 1;
|
|
21417
|
+
if (this.clickCounter % 2 == 1)
|
|
21418
|
+
this.start = this.end = date;
|
|
21419
|
+
else {
|
|
21420
|
+
if (this.start && date > this.start)
|
|
21421
|
+
this.end = date;
|
|
21422
|
+
else
|
|
21423
|
+
this.start = date;
|
|
21424
|
+
}
|
|
21425
|
+
}
|
|
21315
21426
|
render() {
|
|
21316
21427
|
var _a, _b;
|
|
21317
21428
|
return [
|
|
@@ -21321,24 +21432,13 @@ let Calendar = class extends HTMLElement {
|
|
|
21321
21432
|
} }),
|
|
21322
21433
|
h("table", null, h("thead", null, h("tr", null, weekdays().map(day => (h("th", null, day))))), month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
|
|
21323
21434
|
var _a, _b, _c;
|
|
21324
|
-
return (h("td", { tabindex: 1, onClick: () =>
|
|
21325
|
-
this.valueChanged.emit((this.value = date));
|
|
21326
|
-
this.clickCounter += 1;
|
|
21327
|
-
if (this.clickCounter % 2 == 1)
|
|
21328
|
-
this.start = this.end = date;
|
|
21329
|
-
else {
|
|
21330
|
-
if (this.start && date > this.start)
|
|
21331
|
-
this.end = date;
|
|
21332
|
-
else
|
|
21333
|
-
this.start = date;
|
|
21334
|
-
}
|
|
21335
|
-
}, class: (date == this.value ? ["selected"] : [])
|
|
21435
|
+
return (h("td", { tabindex: 1, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
21336
21436
|
.concat(...(date == dist$4.Date.now() ? ["today"] : []), dist$4.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == dist$4.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
21337
|
-
?
|
|
21338
|
-
dist$4.Date.parse(date) <= dist$4.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
21437
|
+
? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
21339
21438
|
? ["dateRange"]
|
|
21340
21439
|
: []
|
|
21341
21440
|
: "")
|
|
21441
|
+
.concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
|
|
21342
21442
|
.join(" ") }, date.substring(8, 10)));
|
|
21343
21443
|
}))))),
|
|
21344
21444
|
];
|
|
@@ -60845,7 +60945,7 @@ let InputDate = class extends HTMLElement {
|
|
|
60845
60945
|
this.open ? (h("nav", null, h("div", { class: "arrow" }), h("smoothly-calendar", { doubleInput: false, value: (_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now(), onValueChanged: event => {
|
|
60846
60946
|
this.value = event.detail;
|
|
60847
60947
|
event.stopPropagation();
|
|
60848
|
-
} }))) : ([]),
|
|
60948
|
+
}, max: this.max, min: this.min }))) : ([]),
|
|
60849
60949
|
];
|
|
60850
60950
|
}
|
|
60851
60951
|
static get watchers() { return {
|
|
@@ -60884,7 +60984,7 @@ let InputDateRange = class extends HTMLElement {
|
|
|
60884
60984
|
this.open ? (h("nav", null, h("div", { class: "arrow" }), h("smoothly-calendar", { doubleInput: true, value: (_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now(), onValueChanged: event => {
|
|
60885
60985
|
this.value = event.detail;
|
|
60886
60986
|
event.stopPropagation();
|
|
60887
|
-
} }))) : ([]),
|
|
60987
|
+
}, max: this.max, min: this.min }))) : ([]),
|
|
60888
60988
|
];
|
|
60889
60989
|
}
|
|
60890
60990
|
static get watchers() { return {
|
|
@@ -61564,8 +61664,8 @@ let SmoothlySelectDemo$1 = class extends HTMLElement {
|
|
|
61564
61664
|
h("smoothly-select", { identifier: "currency" }, this.currencies.map(option => this.currency == option ? (h("option", { value: option, selected: true }, option)) : (h("option", { value: option }, option)))),
|
|
61565
61665
|
h("smoothly-select", { identifier: "language" }, h("optgroup", { label: "Nordic" }, h("option", { value: "sv" }, "Swedish"), h("option", { value: "da", selected: true }, "Danish"), h("option", { value: "no" }, "Norwegian")), h("optgroup", { label: "Other" }, h("option", { value: "en" }, "English"))),
|
|
61566
61666
|
h("smoothly-select", { identifier: "quantity", ref: e => (this.quantityElement = e) }, h("option", { value: "1" }, "1"), h("option", { value: "2" }, "2"), h("option", { value: "3" }, "3")),
|
|
61567
|
-
h("smoothly-input-date",
|
|
61568
|
-
h("smoothly-input-date-range",
|
|
61667
|
+
h("smoothly-input-date", { max: "2021-12-30", min: "2021-10-10" }, "Date"),
|
|
61668
|
+
h("smoothly-input-date-range", { max: "2021-12-30", min: "2021-10-10" }),
|
|
61569
61669
|
h("smoothly-selector", null, h("smoothly-item", { value: "1" }, "January"), h("smoothly-item", { value: "2" }, "February"), h("smoothly-item", { value: "3" }, "March"), h("smoothly-item", { value: "4" }, "April"), h("smoothly-item", { value: "5" }, "May"), h("smoothly-item", { value: "6" }, "June"), h("smoothly-item", { value: "7" }, "July"), h("smoothly-item", { value: "8" }, "August"), h("smoothly-item", { value: "9" }, "September"), h("smoothly-item", { value: "10" }, "October"), h("smoothly-item", { value: "11" }, "November"), h("smoothly-item", { value: "12" }, "December")),
|
|
61570
61670
|
h("button", { onClick: () => this.alertf() }, "press here"),
|
|
61571
61671
|
h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
|
|
@@ -62141,7 +62241,7 @@ const SmoothlyAccordion = /*@__PURE__*/proxyCustomElement(SmoothlyAccordion$1, [
|
|
|
62141
62241
|
const SmoothlyAccordionItem = /*@__PURE__*/proxyCustomElement(SmoothlyAccordionItem$1, [6,"smoothly-accordion-item",{"name":[1],"brand":[1],"open":[1540]}]);
|
|
62142
62242
|
const SmoothlyApp = /*@__PURE__*/proxyCustomElement(SmoothlyApp$1, [4,"smoothly-app",{"color":[1]}]);
|
|
62143
62243
|
const SmoothlyAppDemo = /*@__PURE__*/proxyCustomElement(SmoothlyAppDemo$1, [0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}]);
|
|
62144
|
-
const SmoothlyCalendar = /*@__PURE__*/proxyCustomElement(Calendar, [2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"doubleInput":[516,"double-input"]}]);
|
|
62244
|
+
const SmoothlyCalendar = /*@__PURE__*/proxyCustomElement(Calendar, [2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"doubleInput":[516,"double-input"]}]);
|
|
62145
62245
|
const SmoothlyCheckbox = /*@__PURE__*/proxyCustomElement(SmoothlyCheckbox$1, [2,"smoothly-checkbox",{"selectAll":[4,"select-all"],"selected":[1540],"disabled":[1540],"t":[32]}]);
|
|
62146
62246
|
const SmoothlyDialog = /*@__PURE__*/proxyCustomElement(SmoothlyDialog$1, [6,"smoothly-dialog",{"color":[513],"open":[1540],"closable":[516],"header":[513]},[[0,"trigger","TriggerListener"]]]);
|
|
62147
62247
|
const SmoothlyDialogDemo = /*@__PURE__*/proxyCustomElement(SmoothlyDialogDemo$1, [0,"smoothly-dialog-demo"]);
|
|
@@ -62153,8 +62253,8 @@ const SmoothlyFrame = /*@__PURE__*/proxyCustomElement(SmoothlyFrame$1, [2,"smoot
|
|
|
62153
62253
|
const SmoothlyIcon = /*@__PURE__*/proxyCustomElement(SmoothlyIcon$1, [2,"smoothly-icon",{"color":[513],"fill":[513],"name":[1],"size":[513],"toolTip":[1,"tool-tip"],"document":[32]}]);
|
|
62154
62254
|
const SmoothlyIconDemo = /*@__PURE__*/proxyCustomElement(SmoothlyIconDemo$1, [2,"smoothly-icon-demo"]);
|
|
62155
62255
|
const SmoothlyInput = /*@__PURE__*/proxyCustomElement(SmoothlyInput$1, [6,"smoothly-input",{"name":[513],"value":[1032],"type":[513],"required":[1540],"minLength":[1026,"min-length"],"maxLength":[1026,"max-length"],"autocomplete":[1028],"pattern":[1040],"placeholder":[1025],"disabled":[1028],"currency":[513]}]);
|
|
62156
|
-
const SmoothlyInputDate = /*@__PURE__*/proxyCustomElement(InputDate, [6,"smoothly-input-date",{"value":[1025],"open":[1028]}]);
|
|
62157
|
-
const SmoothlyInputDateRange = /*@__PURE__*/proxyCustomElement(InputDateRange, [2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"open":[1028]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"]]]);
|
|
62256
|
+
const SmoothlyInputDate = /*@__PURE__*/proxyCustomElement(InputDate, [6,"smoothly-input-date",{"value":[1025],"open":[1028],"max":[1025],"min":[1025]}]);
|
|
62257
|
+
const SmoothlyInputDateRange = /*@__PURE__*/proxyCustomElement(InputDateRange, [2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"open":[1028]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"]]]);
|
|
62158
62258
|
const SmoothlyInputDemo = /*@__PURE__*/proxyCustomElement(SmoothlyInputDemo$1, [0,"smoothly-input-demo"]);
|
|
62159
62259
|
const SmoothlyInputMonth = /*@__PURE__*/proxyCustomElement(MonthSelector, [2,"smoothly-input-month",{"value":[1025]}]);
|
|
62160
62260
|
const SmoothlyItem = /*@__PURE__*/proxyCustomElement(Item, [6,"smoothly-item",{"value":[8],"selected":[1540]},[[0,"click","onClick"]]]);
|
|
@@ -62250,4 +62350,4 @@ const defineCustomElements = (opts) => {
|
|
|
62250
62350
|
}
|
|
62251
62351
|
};
|
|
62252
62352
|
|
|
62253
|
-
export { App, ClientIdentifier, Message, Notice, SmoothlyAccordion, SmoothlyAccordionItem, SmoothlyApp, SmoothlyAppDemo, SmoothlyCalendar, SmoothlyCheckbox, SmoothlyDialog, SmoothlyDialogDemo, SmoothlyDisplay, SmoothlyDisplayAmount, SmoothlyDisplayDateTime, SmoothlyDisplayDemo, SmoothlyFrame, SmoothlyIcon, SmoothlyIconDemo, SmoothlyInput, SmoothlyInputDate, SmoothlyInputDateRange, SmoothlyInputDemo, SmoothlyInputMonth, SmoothlyItem, SmoothlyMenuOptions, SmoothlyNotification, SmoothlyNotifier, SmoothlyOption, SmoothlyPicker, SmoothlyPopup, SmoothlyQuiet, SmoothlyRadio, SmoothlyRadioGroup, SmoothlyReorder, SmoothlyRoom, SmoothlySelect, SmoothlySelectDemo, SmoothlySelector, SmoothlySpinner, SmoothlySubmit, SmoothlyTab, SmoothlyTabSwitch, SmoothlyTable, SmoothlyTableCell, SmoothlyTableDemo, SmoothlyTableExpandableCell, SmoothlyTableExpandableRow, SmoothlyTableHeader, SmoothlyTableRow, SmoothlyTrigger, SmoothlyTriggerSink, SmoothlyTriggerSource, SmoothlyTuple, SmoothlyUrlencoded, Trigger, defineCustomElements
|
|
62353
|
+
export { App, ClientIdentifier, Cosmetic, Message, Notice, SmoothlyAccordion, SmoothlyAccordionItem, SmoothlyApp, SmoothlyAppDemo, SmoothlyCalendar, SmoothlyCheckbox, SmoothlyDialog, SmoothlyDialogDemo, SmoothlyDisplay, SmoothlyDisplayAmount, SmoothlyDisplayDateTime, SmoothlyDisplayDemo, SmoothlyFrame, SmoothlyIcon, SmoothlyIconDemo, SmoothlyInput, SmoothlyInputDate, SmoothlyInputDateRange, SmoothlyInputDemo, SmoothlyInputMonth, SmoothlyItem, SmoothlyMenuOptions, SmoothlyNotification, SmoothlyNotifier, SmoothlyOption, SmoothlyPicker, SmoothlyPopup, SmoothlyQuiet, SmoothlyRadio, SmoothlyRadioGroup, SmoothlyReorder, SmoothlyRoom, SmoothlySelect, SmoothlySelectDemo, SmoothlySelector, SmoothlySpinner, SmoothlySubmit, SmoothlyTab, SmoothlyTabSwitch, SmoothlyTable, SmoothlyTableCell, SmoothlyTableDemo, SmoothlyTableExpandableCell, SmoothlyTableExpandableRow, SmoothlyTableHeader, SmoothlyTableRow, SmoothlyTrigger, SmoothlyTriggerSink, SmoothlyTriggerSource, SmoothlyTuple, SmoothlyUrlencoded, Trigger, defineCustomElements };
|
|
@@ -31,12 +31,12 @@ function months(current) {
|
|
|
31
31
|
const day = new globalThis.Date(current);
|
|
32
32
|
const result = [];
|
|
33
33
|
for (let i = 0; i < 12; i++) {
|
|
34
|
-
day.setMonth(i);
|
|
34
|
+
day.setMonth(i, 28);
|
|
35
35
|
const date = dist.Date.create(day);
|
|
36
36
|
result.push({
|
|
37
37
|
date,
|
|
38
38
|
name: day.toLocaleString(undefined, { month: "long" }),
|
|
39
|
-
selected: date == current,
|
|
39
|
+
selected: date.substr(0, 7) == current.substr(0, 7),
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
return result;
|