smoothly 0.1.82 → 0.1.86
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/smoothly-accordion_47.cjs.entry.js +9 -17
- package/dist/cjs/smoothly-calendar.cjs.entry.js +6 -14
- 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/collection/components/calendar/generate.js +2 -2
- package/dist/collection/components/calendar/index.js +9 -17
- package/dist/collection/components/input-date/style.css +4 -0
- package/dist/collection/components/input-date-range/style.css +4 -0
- 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 +230 -139
- package/dist/{smoothly/generate-be25a8d1.js → esm/generate-776b3b0f.js} +2 -2
- package/dist/esm/index.js +215 -116
- package/dist/esm/smoothly-accordion_47.entry.js +9 -17
- package/dist/esm/smoothly-calendar.entry.js +6 -14
- 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/generate-be25a8d1.js → smoothly/generate-776b3b0f.js} +2 -2
- package/dist/smoothly/index.esm.js +215 -116
- package/dist/smoothly/p-375a8d94.entry.js +1 -0
- package/dist/smoothly/smoothly-calendar.entry.js +6 -14
- 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/types/components/calendar/index.d.ts +2 -2
- package/dist/types/components.d.ts +2 -2
- 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-e3ae8b97.entry.js +0 -1
- package/dist/types/utilities/colorNames.d.ts +0 -3
- package/dist/types/utilities/colorTransform.d.ts +0 -8
|
@@ -33,12 +33,12 @@ function months(current) {
|
|
|
33
33
|
const day = new globalThis.Date(current);
|
|
34
34
|
const result = [];
|
|
35
35
|
for (let i = 0; i < 12; i++) {
|
|
36
|
-
day.setMonth(i);
|
|
36
|
+
day.setMonth(i, 28);
|
|
37
37
|
const date = index.dist.Date.create(day);
|
|
38
38
|
result.push({
|
|
39
39
|
date,
|
|
40
40
|
name: day.toLocaleString(undefined, { month: "long" }),
|
|
41
|
-
selected: date == current,
|
|
41
|
+
selected: date.substr(0, 7) == current.substr(0, 7),
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
return result;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -6,7 +6,52 @@ const App = require('./App-ffc56e72.js');
|
|
|
6
6
|
const index = require('./index-de5d1ee1.js');
|
|
7
7
|
require('./index-138c41c2.js');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
var Hex;
|
|
10
|
+
(function (Hex) {
|
|
11
|
+
function is(value) {
|
|
12
|
+
const matchArray = (typeof value == "string" && value.match(/[0-9a-fA-F]/g)) || undefined;
|
|
13
|
+
return (typeof value == "string" &&
|
|
14
|
+
value.length > 3 &&
|
|
15
|
+
value[0] == "#" &&
|
|
16
|
+
((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6));
|
|
17
|
+
}
|
|
18
|
+
Hex.is = is;
|
|
19
|
+
})(Hex || (Hex = {}));
|
|
20
|
+
|
|
21
|
+
var Hsl;
|
|
22
|
+
(function (Hsl) {
|
|
23
|
+
function is(value) {
|
|
24
|
+
const values = typeof value == "string" && value.length > 11 ? value.substring(4, value.length - 1).split(",") : [];
|
|
25
|
+
return (typeof value == "string" &&
|
|
26
|
+
value.length > 11 &&
|
|
27
|
+
value.substr(0, 4) == "hsl(" &&
|
|
28
|
+
value.substr(value.length - 1, 1) == ")" &&
|
|
29
|
+
values.length == 3 &&
|
|
30
|
+
values.every((single, index) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
let result = false;
|
|
33
|
+
if (index == 0)
|
|
34
|
+
result =
|
|
35
|
+
!Number.isNaN(single) &&
|
|
36
|
+
((_a = single.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == single.length &&
|
|
37
|
+
Number(single) >= 0 &&
|
|
38
|
+
Number(single) <= 360;
|
|
39
|
+
else {
|
|
40
|
+
const number = single.substr(0, single.length - 1);
|
|
41
|
+
result =
|
|
42
|
+
single[single.length - 1] == "%" &&
|
|
43
|
+
!Number.isNaN(number) &&
|
|
44
|
+
((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
|
|
45
|
+
Number(number) >= 0 &&
|
|
46
|
+
Number(number) <= 100;
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
Hsl.is = is;
|
|
52
|
+
})(Hsl || (Hsl = {}));
|
|
53
|
+
|
|
54
|
+
const Names = {
|
|
10
55
|
aliceblue: "#f0f8ff",
|
|
11
56
|
antiquewhite: "#faebd7",
|
|
12
57
|
aqua: "#00ffff",
|
|
@@ -156,130 +201,183 @@ const colorNames = {
|
|
|
156
201
|
yellow: "#ffff00",
|
|
157
202
|
yellowgreen: "#9acd32",
|
|
158
203
|
};
|
|
204
|
+
var Name;
|
|
205
|
+
(function (Name) {
|
|
206
|
+
Name.types = () => Object.keys(Names);
|
|
207
|
+
function is(value) {
|
|
208
|
+
return typeof value == "string" && Name.types().includes(value.toLowerCase());
|
|
209
|
+
}
|
|
210
|
+
Name.is = is;
|
|
211
|
+
})(Name || (Name = {}));
|
|
159
212
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
result
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
213
|
+
var Rgb;
|
|
214
|
+
(function (Rgb) {
|
|
215
|
+
function is(value) {
|
|
216
|
+
const values = typeof value == "string" && value.length > 9 ? value.substring(4, value.length - 1).split(",") : [];
|
|
217
|
+
return (typeof value == "string" &&
|
|
218
|
+
value.length > 9 &&
|
|
219
|
+
value.substr(0, 4) == "rgb(" &&
|
|
220
|
+
value.substr(value.length - 1, 1) == ")" &&
|
|
221
|
+
values.length == 3 &&
|
|
222
|
+
values.every((value) => {
|
|
223
|
+
var _a;
|
|
224
|
+
return !Number.isNaN(value) &&
|
|
225
|
+
((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
|
|
226
|
+
Number(value) >= 0 &&
|
|
227
|
+
Number(value) <= 255;
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
Rgb.is = is;
|
|
231
|
+
})(Rgb || (Rgb = {}));
|
|
232
|
+
|
|
233
|
+
var CommaRgb;
|
|
234
|
+
(function (CommaRgb) {
|
|
235
|
+
function is(value) {
|
|
236
|
+
const values = typeof value == "string" ? value.split(",") : [];
|
|
237
|
+
return (values.length == 3 &&
|
|
238
|
+
values.every((value) => {
|
|
239
|
+
var _a;
|
|
240
|
+
return !Number.isNaN(value) &&
|
|
241
|
+
((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
|
|
242
|
+
Number(value) >= 0 &&
|
|
243
|
+
Number(value) <= 255;
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
CommaRgb.is = is;
|
|
247
|
+
function from(color) {
|
|
248
|
+
let result;
|
|
249
|
+
const colorWithoutSpace = typeof color == "string" ? color.replace(/ /g, "").toLowerCase() : undefined;
|
|
250
|
+
if (!colorWithoutSpace)
|
|
251
|
+
result = undefined;
|
|
252
|
+
else if (CommaRgb.is(colorWithoutSpace))
|
|
253
|
+
result = colorWithoutSpace;
|
|
254
|
+
else if (Hex.is(colorWithoutSpace))
|
|
255
|
+
result = fromHex(colorWithoutSpace);
|
|
256
|
+
else if (Rgb.is(colorWithoutSpace))
|
|
257
|
+
result = fromRgb(colorWithoutSpace);
|
|
258
|
+
else if (Name.is(colorWithoutSpace))
|
|
259
|
+
result = fromHex(Names[colorWithoutSpace]);
|
|
260
|
+
else if (Hsl.is(colorWithoutSpace))
|
|
261
|
+
result = fromHsl(colorWithoutSpace);
|
|
262
|
+
return result;
|
|
263
|
+
}
|
|
264
|
+
CommaRgb.from = from;
|
|
265
|
+
function fromHex(hex) {
|
|
266
|
+
let result = "0,0,0";
|
|
267
|
+
if (hex.length == 7)
|
|
268
|
+
result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
|
|
269
|
+
else if (hex.length == 4)
|
|
270
|
+
result = fromHex(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
|
|
271
|
+
return result;
|
|
272
|
+
}
|
|
273
|
+
CommaRgb.fromHex = fromHex;
|
|
274
|
+
function fromRgb(rgb) {
|
|
275
|
+
return rgb.substring(4, rgb.length - 1);
|
|
276
|
+
}
|
|
277
|
+
CommaRgb.fromRgb = fromRgb;
|
|
278
|
+
function fromHsl(hsl) {
|
|
279
|
+
let result = "";
|
|
280
|
+
let h, s, l;
|
|
281
|
+
let r, g, b;
|
|
282
|
+
const HSL = hsl
|
|
283
|
+
.substring(4, hsl.length - 1)
|
|
284
|
+
.split(",")
|
|
285
|
+
.map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
|
|
286
|
+
if (HSL.length == 3) {
|
|
287
|
+
h = HSL[0] / 360;
|
|
288
|
+
s = HSL[1] / 100;
|
|
289
|
+
l = HSL[2] / 100;
|
|
290
|
+
if (s == 0)
|
|
291
|
+
r = g = b = l;
|
|
228
292
|
else {
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Number(number) >= 0 &&
|
|
235
|
-
Number(number) <= 100;
|
|
293
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
294
|
+
const p = 2 * l - q;
|
|
295
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
296
|
+
g = hue2rgb(p, q, h);
|
|
297
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
236
298
|
}
|
|
237
|
-
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
function hue2rgb(p, q, t) {
|
|
241
|
-
let result = p;
|
|
242
|
-
if (t < 0)
|
|
243
|
-
t += 1;
|
|
244
|
-
if (t > 1)
|
|
245
|
-
t -= 1;
|
|
246
|
-
if (t < 1 / 6)
|
|
247
|
-
result = p + (q - p) * 6 * t;
|
|
248
|
-
else if (t < 1 / 2)
|
|
249
|
-
result = q;
|
|
250
|
-
else if (t < 2 / 3)
|
|
251
|
-
result = p + (q - p) * (2 / 3 - t) * 6;
|
|
252
|
-
return result;
|
|
253
|
-
}
|
|
254
|
-
function hslToCommaRgb(hsl) {
|
|
255
|
-
let result;
|
|
256
|
-
let h, s, l;
|
|
257
|
-
let r, g, b;
|
|
258
|
-
const HSL = hsl
|
|
259
|
-
.substring(4, hsl.length - 1)
|
|
260
|
-
.split(",")
|
|
261
|
-
.map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
|
|
262
|
-
if (HSL.length == 3) {
|
|
263
|
-
h = HSL[0] / 360;
|
|
264
|
-
s = HSL[1] / 100;
|
|
265
|
-
l = HSL[2] / 100;
|
|
266
|
-
if (s == 0)
|
|
267
|
-
r = g = b = l;
|
|
268
|
-
else {
|
|
269
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
270
|
-
const p = 2 * l - q;
|
|
271
|
-
r = hue2rgb(p, q, h + 1 / 3);
|
|
272
|
-
g = hue2rgb(p, q, h);
|
|
273
|
-
b = hue2rgb(p, q, h - 1 / 3);
|
|
299
|
+
result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
|
|
274
300
|
}
|
|
275
|
-
result
|
|
301
|
+
return result;
|
|
302
|
+
}
|
|
303
|
+
CommaRgb.fromHsl = fromHsl;
|
|
304
|
+
function hue2rgb(p, q, t) {
|
|
305
|
+
let result = p;
|
|
306
|
+
if (t < 0)
|
|
307
|
+
t += 1;
|
|
308
|
+
if (t > 1)
|
|
309
|
+
t -= 1;
|
|
310
|
+
if (t < 1 / 6)
|
|
311
|
+
result = p + (q - p) * 6 * t;
|
|
312
|
+
else if (t < 1 / 2)
|
|
313
|
+
result = q;
|
|
314
|
+
else if (t < 2 / 3)
|
|
315
|
+
result = p + (q - p) * (2 / 3 - t) * 6;
|
|
316
|
+
return result;
|
|
276
317
|
}
|
|
277
|
-
|
|
318
|
+
})(CommaRgb || (CommaRgb = {}));
|
|
319
|
+
|
|
320
|
+
var Color;
|
|
321
|
+
(function (Color) {
|
|
322
|
+
function is(value) {
|
|
323
|
+
return (typeof value == "string" &&
|
|
324
|
+
(CommaRgb.is(value) || Hex.is(value) || Hsl.is(value) || Name.is(value) || Rgb.is(value)));
|
|
325
|
+
}
|
|
326
|
+
Color.is = is;
|
|
327
|
+
function from(value) {
|
|
328
|
+
return is(value) ? value : undefined;
|
|
329
|
+
}
|
|
330
|
+
Color.from = from;
|
|
331
|
+
Color.Names = Names;
|
|
332
|
+
Color.Name = Name;
|
|
333
|
+
Color.CommaRgb = CommaRgb;
|
|
334
|
+
Color.Rgb = Rgb;
|
|
335
|
+
Color.Hex = Hex;
|
|
336
|
+
Color.Hsl = Hsl;
|
|
337
|
+
})(Color || (Color = {}));
|
|
338
|
+
|
|
339
|
+
function reduce(types, value) {
|
|
340
|
+
return types.reduce((r, c) => typeof value == "object" && value != null && typeof value[c] == "string"
|
|
341
|
+
? Object.assign(Object.assign({}, r), { [c]: value[c] }) : r, {});
|
|
278
342
|
}
|
|
343
|
+
exports.Cosmetic = void 0;
|
|
344
|
+
(function (Cosmetic) {
|
|
345
|
+
Cosmetic.types = Cosmetic;
|
|
346
|
+
function from(value) {
|
|
347
|
+
let result = {};
|
|
348
|
+
if (typeof value == "object" && value) {
|
|
349
|
+
result = {
|
|
350
|
+
text: reduce(["background", "color"], value.text),
|
|
351
|
+
border: reduce(["background", "color", "style", "radius", "width"], value.border),
|
|
352
|
+
gap: typeof value.gap == "string" ? value.gap : undefined,
|
|
353
|
+
dangerColor: typeof value.dangerColor == "string"
|
|
354
|
+
? value.dangerColor
|
|
355
|
+
: typeof value.danger_color == "string"
|
|
356
|
+
? value.danger_color
|
|
357
|
+
: undefined,
|
|
358
|
+
fontFamily: typeof value.fontFamily == "string"
|
|
359
|
+
? value.fontFamily
|
|
360
|
+
: typeof value.font_family == "string"
|
|
361
|
+
? value.font_family
|
|
362
|
+
: undefined,
|
|
363
|
+
background: typeof value.background == "string" ? value.background : undefined,
|
|
364
|
+
};
|
|
365
|
+
Object.keys(result).forEach((key) => {
|
|
366
|
+
var _a;
|
|
367
|
+
if (result[key] == undefined ||
|
|
368
|
+
(typeof result[key] == "object" && result[key] && Object.keys((_a = result[key]) !== null && _a !== void 0 ? _a : {}).length == 0)) {
|
|
369
|
+
delete result[key];
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
return result;
|
|
374
|
+
}
|
|
375
|
+
Cosmetic.from = from;
|
|
376
|
+
Cosmetic.Color = Color;
|
|
377
|
+
})(exports.Cosmetic || (exports.Cosmetic = {}));
|
|
279
378
|
|
|
280
379
|
exports.App = App.App;
|
|
281
380
|
exports.ClientIdentifier = index.ClientIdentifier;
|
|
282
381
|
exports.Message = index.Message;
|
|
283
382
|
exports.Notice = index.Notice;
|
|
284
383
|
exports.Trigger = index.Trigger;
|
|
285
|
-
exports.toCommaRgb = toCommaRgb;
|
|
@@ -18754,12 +18754,12 @@ function months(current) {
|
|
|
18754
18754
|
const day = new globalThis.Date(current);
|
|
18755
18755
|
const result = [];
|
|
18756
18756
|
for (let i = 0; i < 12; i++) {
|
|
18757
|
-
day.setMonth(i);
|
|
18757
|
+
day.setMonth(i, 28);
|
|
18758
18758
|
const date = dist$4.Date.create(day);
|
|
18759
18759
|
result.push({
|
|
18760
18760
|
date,
|
|
18761
18761
|
name: day.toLocaleString(undefined, { month: "long" }),
|
|
18762
|
-
selected: date == current,
|
|
18762
|
+
selected: date.substr(0, 7) == current.substr(0, 7),
|
|
18763
18763
|
});
|
|
18764
18764
|
}
|
|
18765
18765
|
return result;
|
|
@@ -18818,22 +18818,14 @@ let Calendar = class {
|
|
|
18818
18818
|
event.stopPropagation();
|
|
18819
18819
|
} }),
|
|
18820
18820
|
index.h("table", null, index.h("thead", null, index.h("tr", null, weekdays().map(day => (index.h("th", null, day))))), month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (index.h("tr", null, week.map(date => {
|
|
18821
|
-
var _a, _b, _c
|
|
18822
|
-
return (index.h("td", { tabindex: 1, onClick: this.min || this.max
|
|
18823
|
-
|
|
18824
|
-
|
|
18825
|
-
: undefined
|
|
18826
|
-
: () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
18827
|
-
.concat(...(date == dist$4.Date.now() ? ["today"] : []), dist$4.Date.firstOfMonth((_c = this.month) !== null && _c !== void 0 ? _c : this.value) == dist$4.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
18828
|
-
? date >= ((_d = this.start) !== null && _d !== void 0 ? _d : "") && date <= ((_e = this.end) !== null && _e !== void 0 ? _e : "")
|
|
18821
|
+
var _a, _b, _c;
|
|
18822
|
+
return (index.h("td", { tabindex: 1, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
18823
|
+
.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
|
|
18824
|
+
? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
18829
18825
|
? ["dateRange"]
|
|
18830
18826
|
: []
|
|
18831
18827
|
: "")
|
|
18832
|
-
.concat(...(this.min || this.max
|
|
18833
|
-
? date < ((_f = this.min) !== null && _f !== void 0 ? _f : "") || date > ((_g = this.max) !== null && _g !== void 0 ? _g : "")
|
|
18834
|
-
? ["disable"]
|
|
18835
|
-
: []
|
|
18836
|
-
: ""))
|
|
18828
|
+
.concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
|
|
18837
18829
|
.join(" ") }, date.substring(8, 10)));
|
|
18838
18830
|
}))))),
|
|
18839
18831
|
];
|
|
@@ -57796,7 +57788,7 @@ let SmoothlyInput = class {
|
|
|
57796
57788
|
};
|
|
57797
57789
|
SmoothlyInput.style = styleCss$r;
|
|
57798
57790
|
|
|
57799
|
-
const styleCss$q = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}";
|
|
57791
|
+
const styleCss$q = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;top:0px;left:0px;right:0px;bottom:0px;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}";
|
|
57800
57792
|
|
|
57801
57793
|
let InputDate = class {
|
|
57802
57794
|
constructor(hostRef) {
|
|
@@ -57823,7 +57815,7 @@ let InputDate = class {
|
|
|
57823
57815
|
};
|
|
57824
57816
|
InputDate.style = styleCss$q;
|
|
57825
57817
|
|
|
57826
|
-
const styleCss$p = ".sc-smoothly-input-date-range-h{position:relative;display:block}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-range-h>div.sc-smoothly-input-date-range{position:fixed;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range>.arrow.sc-smoothly-input-date-range{position:absolute;z-index:9;transform:translate(10em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}.sc-smoothly-input-date-range-h>section.sc-smoothly-input-date-range{display:flex;flex-direction:row;align-items:center}.sc-smoothly-input-date-range-h>smoothly-input.sc-smoothly-input-date-range{padding:0}";
|
|
57818
|
+
const styleCss$p = ".sc-smoothly-input-date-range-h{position:relative;display:block}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-range-h>div.sc-smoothly-input-date-range{position:fixed;top:0px;left:0px;right:0px;bottom:0px;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range>.arrow.sc-smoothly-input-date-range{position:absolute;z-index:9;transform:translate(10em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}.sc-smoothly-input-date-range-h>section.sc-smoothly-input-date-range{display:flex;flex-direction:row;align-items:center}.sc-smoothly-input-date-range-h>smoothly-input.sc-smoothly-input-date-range{padding:0}";
|
|
57827
57819
|
|
|
57828
57820
|
let InputDateRange = class {
|
|
57829
57821
|
constructor(hostRef) {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-138c41c2.js');
|
|
6
6
|
const index$1 = require('./index-fc82954f.js');
|
|
7
|
-
const generate = require('./generate-
|
|
7
|
+
const generate = require('./generate-a6821b82.js');
|
|
8
8
|
require('./_commonjsHelpers-10109b76.js');
|
|
9
9
|
|
|
10
10
|
const styleCss = ".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)}";
|
|
@@ -44,22 +44,14 @@ let Calendar = class {
|
|
|
44
44
|
event.stopPropagation();
|
|
45
45
|
} }),
|
|
46
46
|
index.h("table", null, index.h("thead", null, index.h("tr", null, generate.weekdays().map(day => (index.h("th", null, day))))), generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (index.h("tr", null, week.map(date => {
|
|
47
|
-
var _a, _b, _c
|
|
48
|
-
return (index.h("td", { tabindex: 1, onClick: this.min || this.max
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: undefined
|
|
52
|
-
: () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
53
|
-
.concat(...(date == index$1.dist.Date.now() ? ["today"] : []), index$1.dist.Date.firstOfMonth((_c = this.month) !== null && _c !== void 0 ? _c : this.value) == index$1.dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
54
|
-
? date >= ((_d = this.start) !== null && _d !== void 0 ? _d : "") && date <= ((_e = this.end) !== null && _e !== void 0 ? _e : "")
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
return (index.h("td", { tabindex: 1, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
49
|
+
.concat(...(date == index$1.dist.Date.now() ? ["today"] : []), index$1.dist.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == index$1.dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
50
|
+
? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
55
51
|
? ["dateRange"]
|
|
56
52
|
: []
|
|
57
53
|
: "")
|
|
58
|
-
.concat(...(this.min || this.max
|
|
59
|
-
? date < ((_f = this.min) !== null && _f !== void 0 ? _f : "") || date > ((_g = this.max) !== null && _g !== void 0 ? _g : "")
|
|
60
|
-
? ["disable"]
|
|
61
|
-
: []
|
|
62
|
-
: ""))
|
|
54
|
+
.concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
|
|
63
55
|
.join(" ") }, date.substring(8, 10)));
|
|
64
56
|
}))))),
|
|
65
57
|
];
|
|
@@ -6,7 +6,7 @@ const index = require('./index-138c41c2.js');
|
|
|
6
6
|
const index$1 = require('./index-fc82954f.js');
|
|
7
7
|
require('./_commonjsHelpers-10109b76.js');
|
|
8
8
|
|
|
9
|
-
const styleCss = ".sc-smoothly-input-date-range-h{position:relative;display:block}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-range-h>div.sc-smoothly-input-date-range{position:fixed;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range>.arrow.sc-smoothly-input-date-range{position:absolute;z-index:9;transform:translate(10em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}.sc-smoothly-input-date-range-h>section.sc-smoothly-input-date-range{display:flex;flex-direction:row;align-items:center}.sc-smoothly-input-date-range-h>smoothly-input.sc-smoothly-input-date-range{padding:0}";
|
|
9
|
+
const styleCss = ".sc-smoothly-input-date-range-h{position:relative;display:block}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-range-h>div.sc-smoothly-input-date-range{position:fixed;top:0px;left:0px;right:0px;bottom:0px;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range>.arrow.sc-smoothly-input-date-range{position:absolute;z-index:9;transform:translate(10em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}.sc-smoothly-input-date-range-h>section.sc-smoothly-input-date-range{display:flex;flex-direction:row;align-items:center}.sc-smoothly-input-date-range-h>smoothly-input.sc-smoothly-input-date-range{padding:0}";
|
|
10
10
|
|
|
11
11
|
let InputDateRange = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -6,7 +6,7 @@ const index = require('./index-138c41c2.js');
|
|
|
6
6
|
const index$1 = require('./index-fc82954f.js');
|
|
7
7
|
require('./_commonjsHelpers-10109b76.js');
|
|
8
8
|
|
|
9
|
-
const styleCss = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}";
|
|
9
|
+
const styleCss = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;top:0px;left:0px;right:0px;bottom:0px;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}";
|
|
10
10
|
|
|
11
11
|
let InputDate = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-138c41c2.js');
|
|
6
6
|
const index$1 = require('./index-fc82954f.js');
|
|
7
|
-
const generate = require('./generate-
|
|
7
|
+
const generate = require('./generate-a6821b82.js');
|
|
8
8
|
require('./_commonjsHelpers-10109b76.js');
|
|
9
9
|
|
|
10
10
|
const styleCss = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}smoothly-icon.sc-smoothly-input-month{font-size:smaller}";
|
|
@@ -30,12 +30,12 @@ export function months(current) {
|
|
|
30
30
|
const day = new globalThis.Date(current);
|
|
31
31
|
const result = [];
|
|
32
32
|
for (let i = 0; i < 12; i++) {
|
|
33
|
-
day.setMonth(i);
|
|
33
|
+
day.setMonth(i, 28);
|
|
34
34
|
const date = isoly.Date.create(day);
|
|
35
35
|
result.push({
|
|
36
36
|
date,
|
|
37
37
|
name: day.toLocaleString(undefined, { month: "long" }),
|
|
38
|
-
selected: date == current,
|
|
38
|
+
selected: date.substr(0, 7) == current.substr(0, 7),
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return result;
|
|
@@ -35,22 +35,14 @@ export class Calendar {
|
|
|
35
35
|
h("thead", null,
|
|
36
36
|
h("tr", null, generate.weekdays().map(day => (h("th", null, day))))),
|
|
37
37
|
generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
|
|
38
|
-
var _a, _b, _c
|
|
39
|
-
return (h("td", { tabindex: 1, onClick: this.min || this.max
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
: undefined
|
|
43
|
-
: () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
44
|
-
.concat(...(date == Date.now() ? ["today"] : []), Date.firstOfMonth((_c = this.month) !== null && _c !== void 0 ? _c : this.value) == Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
45
|
-
? date >= ((_d = this.start) !== null && _d !== void 0 ? _d : "") && date <= ((_e = this.end) !== null && _e !== void 0 ? _e : "")
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
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"] : [])
|
|
40
|
+
.concat(...(date == Date.now() ? ["today"] : []), Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
41
|
+
? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
46
42
|
? ["dateRange"]
|
|
47
43
|
: []
|
|
48
44
|
: "")
|
|
49
|
-
.concat(...(this.min || this.max
|
|
50
|
-
? date < ((_f = this.min) !== null && _f !== void 0 ? _f : "") || date > ((_g = this.max) !== null && _g !== void 0 ? _g : "")
|
|
51
|
-
? ["disable"]
|
|
52
|
-
: []
|
|
53
|
-
: ""))
|
|
45
|
+
.concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
|
|
54
46
|
.join(" ") }, date.substring(8, 10)));
|
|
55
47
|
}))))),
|
|
56
48
|
];
|
|
@@ -158,7 +150,7 @@ export class Calendar {
|
|
|
158
150
|
"mutable": true,
|
|
159
151
|
"complexType": {
|
|
160
152
|
"original": "Date",
|
|
161
|
-
"resolved": "string
|
|
153
|
+
"resolved": "string",
|
|
162
154
|
"references": {
|
|
163
155
|
"Date": {
|
|
164
156
|
"location": "import",
|
|
@@ -167,7 +159,7 @@ export class Calendar {
|
|
|
167
159
|
}
|
|
168
160
|
},
|
|
169
161
|
"required": false,
|
|
170
|
-
"optional":
|
|
162
|
+
"optional": false,
|
|
171
163
|
"docs": {
|
|
172
164
|
"tags": [],
|
|
173
165
|
"text": ""
|
|
@@ -180,7 +172,7 @@ export class Calendar {
|
|
|
180
172
|
"mutable": true,
|
|
181
173
|
"complexType": {
|
|
182
174
|
"original": "Date",
|
|
183
|
-
"resolved": "string
|
|
175
|
+
"resolved": "string",
|
|
184
176
|
"references": {
|
|
185
177
|
"Date": {
|
|
186
178
|
"location": "import",
|
|
@@ -189,7 +181,7 @@ export class Calendar {
|
|
|
189
181
|
}
|
|
190
182
|
},
|
|
191
183
|
"required": false,
|
|
192
|
-
"optional":
|
|
184
|
+
"optional": false,
|
|
193
185
|
"docs": {
|
|
194
186
|
"tags": [],
|
|
195
187
|
"text": ""
|
package/dist/collection/index.js
CHANGED