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.
Files changed (51) hide show
  1. package/dist/cjs/{generate-14aca5d2.js → generate-a6821b82.js} +2 -2
  2. package/dist/cjs/index.cjs.js +214 -116
  3. package/dist/cjs/smoothly-accordion_47.cjs.entry.js +9 -17
  4. package/dist/cjs/smoothly-calendar.cjs.entry.js +6 -14
  5. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
  6. package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
  7. package/dist/cjs/smoothly-input-month.cjs.entry.js +1 -1
  8. package/dist/collection/components/calendar/generate.js +2 -2
  9. package/dist/collection/components/calendar/index.js +9 -17
  10. package/dist/collection/components/input-date/style.css +4 -0
  11. package/dist/collection/components/input-date-range/style.css +4 -0
  12. package/dist/collection/index.js +1 -1
  13. package/dist/collection/utilities/Cosmetic/Color/CommaRgb.js +90 -0
  14. package/dist/collection/utilities/Cosmetic/Color/Hex.js +11 -0
  15. package/dist/collection/utilities/Cosmetic/Color/Hsl.js +32 -0
  16. package/dist/collection/utilities/{colorNames.js → Cosmetic/Color/Name.js} +9 -1
  17. package/dist/collection/utilities/Cosmetic/Color/Rgb.js +19 -0
  18. package/dist/collection/utilities/Cosmetic/Color/index.js +23 -0
  19. package/dist/collection/utilities/Cosmetic/index.js +40 -0
  20. package/dist/collection/utilities/index.js +1 -1
  21. package/dist/custom-elements/index.js +230 -139
  22. package/dist/{smoothly/generate-be25a8d1.js → esm/generate-776b3b0f.js} +2 -2
  23. package/dist/esm/index.js +215 -116
  24. package/dist/esm/smoothly-accordion_47.entry.js +9 -17
  25. package/dist/esm/smoothly-calendar.entry.js +6 -14
  26. package/dist/esm/smoothly-input-date-range.entry.js +1 -1
  27. package/dist/esm/smoothly-input-date.entry.js +1 -1
  28. package/dist/esm/smoothly-input-month.entry.js +1 -1
  29. package/dist/{esm/generate-be25a8d1.js → smoothly/generate-776b3b0f.js} +2 -2
  30. package/dist/smoothly/index.esm.js +215 -116
  31. package/dist/smoothly/p-375a8d94.entry.js +1 -0
  32. package/dist/smoothly/smoothly-calendar.entry.js +6 -14
  33. package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
  34. package/dist/smoothly/smoothly-input-date.entry.js +1 -1
  35. package/dist/smoothly/smoothly-input-month.entry.js +1 -1
  36. package/dist/types/components/calendar/index.d.ts +2 -2
  37. package/dist/types/components.d.ts +2 -2
  38. package/dist/types/index.d.ts +1 -1
  39. package/dist/types/utilities/Cosmetic/Color/CommaRgb.d.ts +11 -0
  40. package/dist/types/utilities/Cosmetic/Color/Hex.d.ts +4 -0
  41. package/dist/types/utilities/Cosmetic/Color/Hsl.d.ts +4 -0
  42. package/dist/types/utilities/Cosmetic/Color/Name.d.ts +155 -0
  43. package/dist/types/utilities/Cosmetic/Color/Rgb.d.ts +4 -0
  44. package/dist/types/utilities/Cosmetic/Color/index.d.ts +170 -0
  45. package/dist/types/utilities/Cosmetic/index.d.ts +23 -0
  46. package/dist/types/utilities/index.d.ts +1 -1
  47. package/package.json +1 -1
  48. package/dist/collection/utilities/colorTransform.js +0 -120
  49. package/dist/smoothly/p-e3ae8b97.entry.js +0 -1
  50. package/dist/types/utilities/colorNames.d.ts +0 -3
  51. package/dist/types/utilities/colorTransform.d.ts +0 -8
package/dist/esm/index.js CHANGED
@@ -2,7 +2,52 @@ export { A as App } from './App-c5f6000f.js';
2
2
  export { C as ClientIdentifier, M as Message, N as Notice, T as Trigger } from './index-68492ed9.js';
3
3
  import './index-02a70ac1.js';
4
4
 
5
- const colorNames = {
5
+ var Hex;
6
+ (function (Hex) {
7
+ function is(value) {
8
+ const matchArray = (typeof value == "string" && value.match(/[0-9a-fA-F]/g)) || undefined;
9
+ return (typeof value == "string" &&
10
+ value.length > 3 &&
11
+ value[0] == "#" &&
12
+ ((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6));
13
+ }
14
+ Hex.is = is;
15
+ })(Hex || (Hex = {}));
16
+
17
+ var Hsl;
18
+ (function (Hsl) {
19
+ function is(value) {
20
+ const values = typeof value == "string" && value.length > 11 ? value.substring(4, value.length - 1).split(",") : [];
21
+ return (typeof value == "string" &&
22
+ value.length > 11 &&
23
+ value.substr(0, 4) == "hsl(" &&
24
+ value.substr(value.length - 1, 1) == ")" &&
25
+ values.length == 3 &&
26
+ values.every((single, index) => {
27
+ var _a, _b;
28
+ let result = false;
29
+ if (index == 0)
30
+ result =
31
+ !Number.isNaN(single) &&
32
+ ((_a = single.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == single.length &&
33
+ Number(single) >= 0 &&
34
+ Number(single) <= 360;
35
+ else {
36
+ const number = single.substr(0, single.length - 1);
37
+ result =
38
+ single[single.length - 1] == "%" &&
39
+ !Number.isNaN(number) &&
40
+ ((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
41
+ Number(number) >= 0 &&
42
+ Number(number) <= 100;
43
+ }
44
+ return result;
45
+ }));
46
+ }
47
+ Hsl.is = is;
48
+ })(Hsl || (Hsl = {}));
49
+
50
+ const Names = {
6
51
  aliceblue: "#f0f8ff",
7
52
  antiquewhite: "#faebd7",
8
53
  aqua: "#00ffff",
@@ -152,125 +197,179 @@ const colorNames = {
152
197
  yellow: "#ffff00",
153
198
  yellowgreen: "#9acd32",
154
199
  };
200
+ var Name;
201
+ (function (Name) {
202
+ Name.types = () => Object.keys(Names);
203
+ function is(value) {
204
+ return typeof value == "string" && Name.types().includes(value.toLowerCase());
205
+ }
206
+ Name.is = is;
207
+ })(Name || (Name = {}));
155
208
 
156
- function toCommaRgb(color) {
157
- let result;
158
- const colorWithoutSpace = color.replace(/ /g, "").toLowerCase();
159
- if (isCommaRgb(colorWithoutSpace))
160
- result = colorWithoutSpace;
161
- else if (isHex(colorWithoutSpace))
162
- result = hexToCommaRgb(colorWithoutSpace);
163
- else if (isRgb(colorWithoutSpace))
164
- result = rgbToCommaRgb(colorWithoutSpace);
165
- else if (colorWithoutSpace in colorNames)
166
- result = hexToCommaRgb(colorNames[colorWithoutSpace]);
167
- else if (isHsl(colorWithoutSpace))
168
- result = hslToCommaRgb(colorWithoutSpace);
169
- return result;
170
- }
171
- function isCommaRgb(commaRgb) {
172
- const values = commaRgb.split(",");
173
- return (values.length == 3 &&
174
- values.every(value => {
175
- var _a;
176
- return !Number.isNaN(value) &&
177
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
178
- Number(value) >= 0 &&
179
- Number(value) <= 255;
180
- }));
181
- }
182
- function isHex(hex) {
183
- const matchArray = hex.match(/[0-9a-fA-F]/g);
184
- return hex[0] == "#" && ((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6);
185
- }
186
- function hexToCommaRgb(hex) {
187
- let result = "0,0,0";
188
- if (hex.length == 7)
189
- result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
190
- else if (hex.length == 4)
191
- result = hexToCommaRgb(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
192
- return result;
193
- }
194
- function isRgb(rgb) {
195
- const values = rgb.substring(4, rgb.length - 1).split(",");
196
- return (rgb.substr(0, 4) == "rgb(" &&
197
- rgb.substr(rgb.length - 1, 1) == ")" &&
198
- values.length == 3 &&
199
- values.every(value => {
200
- var _a;
201
- return !Number.isNaN(value) &&
202
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
203
- Number(value) >= 0 &&
204
- Number(value) <= 255;
205
- }));
206
- }
207
- function rgbToCommaRgb(rgb) {
208
- return rgb.substring(4, rgb.length - 1);
209
- }
210
- function isHsl(hsl) {
211
- const values = hsl.substring(4, hsl.length - 1).split(",");
212
- return (hsl.substr(0, 4) == "hsl(" &&
213
- hsl.substr(hsl.length - 1, 1) == ")" &&
214
- values.length == 3 &&
215
- values.every((value, index) => {
216
- var _a, _b;
217
- let result = false;
218
- if (index == 0)
219
- result =
220
- !Number.isNaN(value) &&
221
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
222
- Number(value) >= 0 &&
223
- Number(value) <= 360;
209
+ var Rgb;
210
+ (function (Rgb) {
211
+ function is(value) {
212
+ const values = typeof value == "string" && value.length > 9 ? value.substring(4, value.length - 1).split(",") : [];
213
+ return (typeof value == "string" &&
214
+ value.length > 9 &&
215
+ value.substr(0, 4) == "rgb(" &&
216
+ value.substr(value.length - 1, 1) == ")" &&
217
+ values.length == 3 &&
218
+ values.every((value) => {
219
+ var _a;
220
+ return !Number.isNaN(value) &&
221
+ ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
222
+ Number(value) >= 0 &&
223
+ Number(value) <= 255;
224
+ }));
225
+ }
226
+ Rgb.is = is;
227
+ })(Rgb || (Rgb = {}));
228
+
229
+ var CommaRgb;
230
+ (function (CommaRgb) {
231
+ function is(value) {
232
+ const values = typeof value == "string" ? value.split(",") : [];
233
+ return (values.length == 3 &&
234
+ values.every((value) => {
235
+ var _a;
236
+ return !Number.isNaN(value) &&
237
+ ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
238
+ Number(value) >= 0 &&
239
+ Number(value) <= 255;
240
+ }));
241
+ }
242
+ CommaRgb.is = is;
243
+ function from(color) {
244
+ let result;
245
+ const colorWithoutSpace = typeof color == "string" ? color.replace(/ /g, "").toLowerCase() : undefined;
246
+ if (!colorWithoutSpace)
247
+ result = undefined;
248
+ else if (CommaRgb.is(colorWithoutSpace))
249
+ result = colorWithoutSpace;
250
+ else if (Hex.is(colorWithoutSpace))
251
+ result = fromHex(colorWithoutSpace);
252
+ else if (Rgb.is(colorWithoutSpace))
253
+ result = fromRgb(colorWithoutSpace);
254
+ else if (Name.is(colorWithoutSpace))
255
+ result = fromHex(Names[colorWithoutSpace]);
256
+ else if (Hsl.is(colorWithoutSpace))
257
+ result = fromHsl(colorWithoutSpace);
258
+ return result;
259
+ }
260
+ CommaRgb.from = from;
261
+ function fromHex(hex) {
262
+ let result = "0,0,0";
263
+ if (hex.length == 7)
264
+ result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
265
+ else if (hex.length == 4)
266
+ result = fromHex(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
267
+ return result;
268
+ }
269
+ CommaRgb.fromHex = fromHex;
270
+ function fromRgb(rgb) {
271
+ return rgb.substring(4, rgb.length - 1);
272
+ }
273
+ CommaRgb.fromRgb = fromRgb;
274
+ function fromHsl(hsl) {
275
+ let result = "";
276
+ let h, s, l;
277
+ let r, g, b;
278
+ const HSL = hsl
279
+ .substring(4, hsl.length - 1)
280
+ .split(",")
281
+ .map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
282
+ if (HSL.length == 3) {
283
+ h = HSL[0] / 360;
284
+ s = HSL[1] / 100;
285
+ l = HSL[2] / 100;
286
+ if (s == 0)
287
+ r = g = b = l;
224
288
  else {
225
- const number = value.substr(0, value.length - 1);
226
- result =
227
- value[value.length - 1] == "%" &&
228
- !Number.isNaN(number) &&
229
- ((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
230
- Number(number) >= 0 &&
231
- Number(number) <= 100;
289
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
290
+ const p = 2 * l - q;
291
+ r = hue2rgb(p, q, h + 1 / 3);
292
+ g = hue2rgb(p, q, h);
293
+ b = hue2rgb(p, q, h - 1 / 3);
232
294
  }
233
- return result;
234
- }));
235
- }
236
- function hue2rgb(p, q, t) {
237
- let result = p;
238
- if (t < 0)
239
- t += 1;
240
- if (t > 1)
241
- t -= 1;
242
- if (t < 1 / 6)
243
- result = p + (q - p) * 6 * t;
244
- else if (t < 1 / 2)
245
- result = q;
246
- else if (t < 2 / 3)
247
- result = p + (q - p) * (2 / 3 - t) * 6;
248
- return result;
249
- }
250
- function hslToCommaRgb(hsl) {
251
- let result;
252
- let h, s, l;
253
- let r, g, b;
254
- const HSL = hsl
255
- .substring(4, hsl.length - 1)
256
- .split(",")
257
- .map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
258
- if (HSL.length == 3) {
259
- h = HSL[0] / 360;
260
- s = HSL[1] / 100;
261
- l = HSL[2] / 100;
262
- if (s == 0)
263
- r = g = b = l;
264
- else {
265
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
266
- const p = 2 * l - q;
267
- r = hue2rgb(p, q, h + 1 / 3);
268
- g = hue2rgb(p, q, h);
269
- b = hue2rgb(p, q, h - 1 / 3);
295
+ result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
270
296
  }
271
- result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
297
+ return result;
298
+ }
299
+ CommaRgb.fromHsl = fromHsl;
300
+ function hue2rgb(p, q, t) {
301
+ let result = p;
302
+ if (t < 0)
303
+ t += 1;
304
+ if (t > 1)
305
+ t -= 1;
306
+ if (t < 1 / 6)
307
+ result = p + (q - p) * 6 * t;
308
+ else if (t < 1 / 2)
309
+ result = q;
310
+ else if (t < 2 / 3)
311
+ result = p + (q - p) * (2 / 3 - t) * 6;
312
+ return result;
272
313
  }
273
- return result;
314
+ })(CommaRgb || (CommaRgb = {}));
315
+
316
+ var Color;
317
+ (function (Color) {
318
+ function is(value) {
319
+ return (typeof value == "string" &&
320
+ (CommaRgb.is(value) || Hex.is(value) || Hsl.is(value) || Name.is(value) || Rgb.is(value)));
321
+ }
322
+ Color.is = is;
323
+ function from(value) {
324
+ return is(value) ? value : undefined;
325
+ }
326
+ Color.from = from;
327
+ Color.Names = Names;
328
+ Color.Name = Name;
329
+ Color.CommaRgb = CommaRgb;
330
+ Color.Rgb = Rgb;
331
+ Color.Hex = Hex;
332
+ Color.Hsl = Hsl;
333
+ })(Color || (Color = {}));
334
+
335
+ function reduce(types, value) {
336
+ return types.reduce((r, c) => typeof value == "object" && value != null && typeof value[c] == "string"
337
+ ? Object.assign(Object.assign({}, r), { [c]: value[c] }) : r, {});
274
338
  }
339
+ var Cosmetic;
340
+ (function (Cosmetic) {
341
+ Cosmetic.types = Cosmetic;
342
+ function from(value) {
343
+ let result = {};
344
+ if (typeof value == "object" && value) {
345
+ result = {
346
+ text: reduce(["background", "color"], value.text),
347
+ border: reduce(["background", "color", "style", "radius", "width"], value.border),
348
+ gap: typeof value.gap == "string" ? value.gap : undefined,
349
+ dangerColor: typeof value.dangerColor == "string"
350
+ ? value.dangerColor
351
+ : typeof value.danger_color == "string"
352
+ ? value.danger_color
353
+ : undefined,
354
+ fontFamily: typeof value.fontFamily == "string"
355
+ ? value.fontFamily
356
+ : typeof value.font_family == "string"
357
+ ? value.font_family
358
+ : undefined,
359
+ background: typeof value.background == "string" ? value.background : undefined,
360
+ };
361
+ Object.keys(result).forEach((key) => {
362
+ var _a;
363
+ if (result[key] == undefined ||
364
+ (typeof result[key] == "object" && result[key] && Object.keys((_a = result[key]) !== null && _a !== void 0 ? _a : {}).length == 0)) {
365
+ delete result[key];
366
+ }
367
+ });
368
+ }
369
+ return result;
370
+ }
371
+ Cosmetic.from = from;
372
+ Cosmetic.Color = Color;
373
+ })(Cosmetic || (Cosmetic = {}));
275
374
 
276
- export { toCommaRgb };
375
+ export { Cosmetic };
@@ -18750,12 +18750,12 @@ function months(current) {
18750
18750
  const day = new globalThis.Date(current);
18751
18751
  const result = [];
18752
18752
  for (let i = 0; i < 12; i++) {
18753
- day.setMonth(i);
18753
+ day.setMonth(i, 28);
18754
18754
  const date = dist$4.Date.create(day);
18755
18755
  result.push({
18756
18756
  date,
18757
18757
  name: day.toLocaleString(undefined, { month: "long" }),
18758
- selected: date == current,
18758
+ selected: date.substr(0, 7) == current.substr(0, 7),
18759
18759
  });
18760
18760
  }
18761
18761
  return result;
@@ -18814,22 +18814,14 @@ let Calendar = class {
18814
18814
  event.stopPropagation();
18815
18815
  } }),
18816
18816
  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 => {
18817
- var _a, _b, _c, _d, _e, _f, _g;
18818
- return (h("td", { tabindex: 1, onClick: this.min || this.max
18819
- ? !(date < ((_a = this.min) !== null && _a !== void 0 ? _a : "") || date > ((_b = this.max) !== null && _b !== void 0 ? _b : ""))
18820
- ? () => this.onClick(date)
18821
- : undefined
18822
- : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
18823
- .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
18824
- ? date >= ((_d = this.start) !== null && _d !== void 0 ? _d : "") && date <= ((_e = this.end) !== null && _e !== void 0 ? _e : "")
18817
+ var _a, _b, _c;
18818
+ 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"] : [])
18819
+ .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
18820
+ ? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
18825
18821
  ? ["dateRange"]
18826
18822
  : []
18827
18823
  : "")
18828
- .concat(...(this.min || this.max
18829
- ? date < ((_f = this.min) !== null && _f !== void 0 ? _f : "") || date > ((_g = this.max) !== null && _g !== void 0 ? _g : "")
18830
- ? ["disable"]
18831
- : []
18832
- : ""))
18824
+ .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
18833
18825
  .join(" ") }, date.substring(8, 10)));
18834
18826
  }))))),
18835
18827
  ];
@@ -57792,7 +57784,7 @@ let SmoothlyInput = class {
57792
57784
  };
57793
57785
  SmoothlyInput.style = styleCss$r;
57794
57786
 
57795
- 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))}";
57787
+ 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))}";
57796
57788
 
57797
57789
  let InputDate = class {
57798
57790
  constructor(hostRef) {
@@ -57819,7 +57811,7 @@ let InputDate = class {
57819
57811
  };
57820
57812
  InputDate.style = styleCss$q;
57821
57813
 
57822
- 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}";
57814
+ 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}";
57823
57815
 
57824
57816
  let InputDateRange = class {
57825
57817
  constructor(hostRef) {
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, i as createEvent, h, j as getElement } from './index-02a70ac1.js';
2
2
  import { d as dist } from './index-a28d88cf.js';
3
- import { w as weekdays, m as month } from './generate-be25a8d1.js';
3
+ import { w as weekdays, m as month } from './generate-776b3b0f.js';
4
4
  import './_commonjsHelpers-8fe71198.js';
5
5
 
6
6
  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)}";
@@ -40,22 +40,14 @@ let Calendar = class {
40
40
  event.stopPropagation();
41
41
  } }),
42
42
  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 => {
43
- var _a, _b, _c, _d, _e, _f, _g;
44
- return (h("td", { tabindex: 1, onClick: this.min || this.max
45
- ? !(date < ((_a = this.min) !== null && _a !== void 0 ? _a : "") || date > ((_b = this.max) !== null && _b !== void 0 ? _b : ""))
46
- ? () => this.onClick(date)
47
- : undefined
48
- : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
49
- .concat(...(date == dist.Date.now() ? ["today"] : []), dist.Date.firstOfMonth((_c = this.month) !== null && _c !== void 0 ? _c : this.value) == dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
50
- ? date >= ((_d = this.start) !== null && _d !== void 0 ? _d : "") && date <= ((_e = this.end) !== null && _e !== void 0 ? _e : "")
43
+ var _a, _b, _c;
44
+ 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"] : [])
45
+ .concat(...(date == dist.Date.now() ? ["today"] : []), dist.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
46
+ ? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
51
47
  ? ["dateRange"]
52
48
  : []
53
49
  : "")
54
- .concat(...(this.min || this.max
55
- ? date < ((_f = this.min) !== null && _f !== void 0 ? _f : "") || date > ((_g = this.max) !== null && _g !== void 0 ? _g : "")
56
- ? ["disable"]
57
- : []
58
- : ""))
50
+ .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
59
51
  .join(" ") }, date.substring(8, 10)));
60
52
  }))))),
61
53
  ];
@@ -2,7 +2,7 @@ import { r as registerInstance, i as createEvent, h } from './index-02a70ac1.js'
2
2
  import { d as dist } from './index-a28d88cf.js';
3
3
  import './_commonjsHelpers-8fe71198.js';
4
4
 
5
- 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}";
5
+ 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}";
6
6
 
7
7
  let InputDateRange = class {
8
8
  constructor(hostRef) {
@@ -2,7 +2,7 @@ import { r as registerInstance, i as createEvent, h } from './index-02a70ac1.js'
2
2
  import { d as dist } from './index-a28d88cf.js';
3
3
  import './_commonjsHelpers-8fe71198.js';
4
4
 
5
- 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))}";
5
+ 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))}";
6
6
 
7
7
  let InputDate = class {
8
8
  constructor(hostRef) {
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, i as createEvent, h } from './index-02a70ac1.js';
2
2
  import { d as dist } from './index-a28d88cf.js';
3
- import { y as years, a as months } from './generate-be25a8d1.js';
3
+ import { y as years, a as months } from './generate-776b3b0f.js';
4
4
  import './_commonjsHelpers-8fe71198.js';
5
5
 
6
6
  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}";
@@ -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;