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.
Files changed (63) 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/loader.cjs.js +1 -1
  4. package/dist/cjs/smoothly-accordion_47.cjs.entry.js +22 -21
  5. package/dist/cjs/smoothly-calendar.cjs.entry.js +17 -16
  6. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
  7. package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
  8. package/dist/cjs/smoothly-input-month.cjs.entry.js +1 -1
  9. package/dist/cjs/smoothly-select-demo.cjs.entry.js +2 -2
  10. package/dist/cjs/smoothly.cjs.js +1 -1
  11. package/dist/collection/components/calendar/generate.js +2 -2
  12. package/dist/collection/components/calendar/index.js +59 -14
  13. package/dist/collection/components/calendar/style.css +7 -1
  14. package/dist/collection/components/input-date/index.js +45 -1
  15. package/dist/collection/components/input-date-range/index.js +45 -1
  16. package/dist/collection/components/select-demo/index.js +2 -2
  17. package/dist/collection/index.js +1 -1
  18. package/dist/collection/utilities/Cosmetic/Color/CommaRgb.js +90 -0
  19. package/dist/collection/utilities/Cosmetic/Color/Hex.js +11 -0
  20. package/dist/collection/utilities/Cosmetic/Color/Hsl.js +32 -0
  21. package/dist/collection/utilities/{colorNames.js → Cosmetic/Color/Name.js} +9 -1
  22. package/dist/collection/utilities/Cosmetic/Color/Rgb.js +19 -0
  23. package/dist/collection/utilities/Cosmetic/Color/index.js +23 -0
  24. package/dist/collection/utilities/Cosmetic/index.js +40 -0
  25. package/dist/collection/utilities/index.js +1 -1
  26. package/dist/custom-elements/index.js +246 -146
  27. package/dist/{smoothly/generate-be25a8d1.js → esm/generate-776b3b0f.js} +2 -2
  28. package/dist/esm/index.js +215 -116
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/smoothly-accordion_47.entry.js +22 -21
  31. package/dist/esm/smoothly-calendar.entry.js +17 -16
  32. package/dist/esm/smoothly-input-date-range.entry.js +1 -1
  33. package/dist/esm/smoothly-input-date.entry.js +1 -1
  34. package/dist/esm/smoothly-input-month.entry.js +1 -1
  35. package/dist/esm/smoothly-select-demo.entry.js +2 -2
  36. package/dist/esm/smoothly.js +1 -1
  37. package/dist/{esm/generate-be25a8d1.js → smoothly/generate-776b3b0f.js} +2 -2
  38. package/dist/smoothly/index.esm.js +215 -116
  39. package/dist/smoothly/p-5ca32c49.entry.js +1 -0
  40. package/dist/smoothly/smoothly-calendar.entry.js +17 -16
  41. package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
  42. package/dist/smoothly/smoothly-input-date.entry.js +1 -1
  43. package/dist/smoothly/smoothly-input-month.entry.js +1 -1
  44. package/dist/smoothly/smoothly-select-demo.entry.js +2 -2
  45. package/dist/smoothly/smoothly.esm.js +1 -1
  46. package/dist/types/components/calendar/index.d.ts +3 -0
  47. package/dist/types/components/input-date/index.d.ts +2 -0
  48. package/dist/types/components/input-date-range/index.d.ts +2 -0
  49. package/dist/types/components.d.ts +12 -0
  50. package/dist/types/index.d.ts +1 -1
  51. package/dist/types/utilities/Cosmetic/Color/CommaRgb.d.ts +11 -0
  52. package/dist/types/utilities/Cosmetic/Color/Hex.d.ts +4 -0
  53. package/dist/types/utilities/Cosmetic/Color/Hsl.d.ts +4 -0
  54. package/dist/types/utilities/Cosmetic/Color/Name.d.ts +155 -0
  55. package/dist/types/utilities/Cosmetic/Color/Rgb.d.ts +4 -0
  56. package/dist/types/utilities/Cosmetic/Color/index.d.ts +170 -0
  57. package/dist/types/utilities/Cosmetic/index.d.ts +23 -0
  58. package/dist/types/utilities/index.d.ts +1 -1
  59. package/package.json +1 -1
  60. package/dist/collection/utilities/colorTransform.js +0 -120
  61. package/dist/smoothly/p-c9d01e9b.entry.js +0 -1
  62. package/dist/types/utilities/colorNames.d.ts +0 -3
  63. 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;
@@ -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
- const colorNames = {
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
- function toCommaRgb(color) {
161
- let result;
162
- const colorWithoutSpace = color.replace(/ /g, "").toLowerCase();
163
- if (isCommaRgb(colorWithoutSpace))
164
- result = colorWithoutSpace;
165
- else if (isHex(colorWithoutSpace))
166
- result = hexToCommaRgb(colorWithoutSpace);
167
- else if (isRgb(colorWithoutSpace))
168
- result = rgbToCommaRgb(colorWithoutSpace);
169
- else if (colorWithoutSpace in colorNames)
170
- result = hexToCommaRgb(colorNames[colorWithoutSpace]);
171
- else if (isHsl(colorWithoutSpace))
172
- result = hslToCommaRgb(colorWithoutSpace);
173
- return result;
174
- }
175
- function isCommaRgb(commaRgb) {
176
- const values = commaRgb.split(",");
177
- return (values.length == 3 &&
178
- values.every(value => {
179
- var _a;
180
- return !Number.isNaN(value) &&
181
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
182
- Number(value) >= 0 &&
183
- Number(value) <= 255;
184
- }));
185
- }
186
- function isHex(hex) {
187
- const matchArray = hex.match(/[0-9a-fA-F]/g);
188
- return hex[0] == "#" && ((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6);
189
- }
190
- function hexToCommaRgb(hex) {
191
- let result = "0,0,0";
192
- if (hex.length == 7)
193
- result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
194
- else if (hex.length == 4)
195
- result = hexToCommaRgb(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
196
- return result;
197
- }
198
- function isRgb(rgb) {
199
- const values = rgb.substring(4, rgb.length - 1).split(",");
200
- return (rgb.substr(0, 4) == "rgb(" &&
201
- rgb.substr(rgb.length - 1, 1) == ")" &&
202
- values.length == 3 &&
203
- values.every(value => {
204
- var _a;
205
- return !Number.isNaN(value) &&
206
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
207
- Number(value) >= 0 &&
208
- Number(value) <= 255;
209
- }));
210
- }
211
- function rgbToCommaRgb(rgb) {
212
- return rgb.substring(4, rgb.length - 1);
213
- }
214
- function isHsl(hsl) {
215
- const values = hsl.substring(4, hsl.length - 1).split(",");
216
- return (hsl.substr(0, 4) == "hsl(" &&
217
- hsl.substr(hsl.length - 1, 1) == ")" &&
218
- values.length == 3 &&
219
- values.every((value, index) => {
220
- var _a, _b;
221
- let result = false;
222
- if (index == 0)
223
- result =
224
- !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) <= 360;
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 number = value.substr(0, value.length - 1);
230
- result =
231
- value[value.length - 1] == "%" &&
232
- !Number.isNaN(number) &&
233
- ((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
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
- return result;
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 = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
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
- return result;
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;
@@ -30,7 +30,7 @@ const defineCustomElements = (win, options) => {
30
30
  if (typeof window === 'undefined') return Promise.resolve();
31
31
  return patchEsm().then(() => {
32
32
  appGlobals.globalScripts();
33
- return index.bootstrapLazy([["smoothly-app-demo.cjs",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-input-demo.cjs",[[0,"smoothly-input-demo"]]],["smoothly-select-demo.cjs",[[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]]]],["smoothly-table-demo.cjs",[[2,"smoothly-table-demo"]]],["smoothly-display-demo.cjs",[[0,"smoothly-display-demo"]]],["smoothly-app.cjs",[[4,"smoothly-app",{"color":[1]}]]],["smoothly-dialog-demo.cjs",[[0,"smoothly-dialog-demo"]]],["smoothly-icon-demo.cjs",[[2,"smoothly-icon-demo"]]],["smoothly-room.cjs",[[4,"smoothly-room",{"label":[1],"icon":[1],"path":[1],"to":[1]}]]],["smoothly-input-date-range.cjs",[[2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"open":[1028]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"]]]]],["smoothly-notifier.cjs",[[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]]]],["smoothly-picker.cjs",[[1,"smoothly-picker",{"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"optionStyle":[8,"option-style"],"options":[16],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"isOpen":[32]},[[0,"optionSelect","optionSelectHander"]]]]],["smoothly-dialog.cjs",[[6,"smoothly-dialog",{"color":[513],"open":[1540],"closable":[516],"header":[513]},[[0,"trigger","TriggerListener"]]]]],["smoothly-checkbox.cjs",[[2,"smoothly-checkbox",{"selectAll":[4,"select-all"],"selected":[1540],"disabled":[1540],"t":[32]}]]],["smoothly-submit.cjs",[[6,"smoothly-submit",{"processing":[1540],"color":[513],"expand":[513],"fill":[513],"disabled":[516],"prevent":[4],"submit":[64]},[[0,"click","handleSubmit"]]]]],["smoothly-urlencoded.cjs",[[0,"smoothly-urlencoded",{"data":[1]}]]],["smoothly-accordion.cjs",[[6,"smoothly-accordion",{"value":[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]]]],["smoothly-accordion-item.cjs",[[6,"smoothly-accordion-item",{"name":[1],"brand":[1],"open":[1540]}]]],["smoothly-display-amount.cjs",[[2,"smoothly-display-amount",{"amount":[8],"currency":[1]}]]],["smoothly-frame.cjs",[[2,"smoothly-frame",{"url":[1],"name":[1],"origin":[1],"send":[64]}]]],["smoothly-popup.cjs",[[6,"smoothly-popup",{"visible":[1540],"direction":[1537],"cssVariables":[32]}]]],["smoothly-quiet.cjs",[[6,"smoothly-quiet",{"color":[1]}]]],["smoothly-radio.cjs",[[6,"smoothly-radio",{"name":[1],"value":[1],"checked":[1540],"tabIndex":[2,"tab-index"]}]]],["smoothly-select.cjs",[[6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}]]],["smoothly-tab.cjs",[[6,"smoothly-tab",{"label":[1],"open":[1540]},[[0,"click","onClick"]]]]],["smoothly-tab-switch.cjs",[[6,"smoothly-tab-switch",{"selectedElement":[32]},[[0,"expansionOpen","openChanged"]]]]],["smoothly-table.cjs",[[6,"smoothly-table",null,[[0,"sort","onSort"]]]]],["smoothly-table-cell.cjs",[[6,"smoothly-table-cell"]]],["smoothly-table-expandable-cell.cjs",[[6,"smoothly-table-expandable-cell",{"align":[1],"open":[1540],"beginOpen":[32]},[[0,"click","onClick"]]]]],["smoothly-table-expandable-row.cjs",[[6,"smoothly-table-expandable-row",null,[[0,"expansionLoaded","onExpansionLoaded"],[0,"expansionOpen","onDetailsLoaded"]]]]],["smoothly-table-header.cjs",[[6,"smoothly-table-header",{"name":[1],"sortDirection":[1025,"sort-direction"]},[[0,"click","onClick"]]]]],["smoothly-table-row.cjs",[[6,"smoothly-table-row",{"align":[1],"open":[1540],"beginOpen":[32]},[[0,"click","onClick"]]]]],["smoothly-icon.cjs",[[2,"smoothly-icon",{"color":[513],"fill":[513],"name":[1],"size":[513],"toolTip":[1,"tool-tip"],"document":[32]}]]],["smoothly-selector.cjs",[[6,"smoothly-selector",{"opened":[32],"selectedElement":[32],"missing":[32],"filter":[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]]]],["smoothly-input-date.cjs",[[6,"smoothly-input-date",{"value":[1025],"open":[1028]}]]],["smoothly-notification.cjs",[[2,"smoothly-notification",{"notice":[16],"tick":[32]},[[0,"trigger","onTrigger"]]]]],["smoothly-option.cjs",[[1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537]}]]],["smoothly-menu-options.cjs",[[1,"smoothly-menu-options",{"emptyMenuLabel":[1025,"empty-menu-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"filteredOptions":[32],"highlightIndex":[32],"moveHighlight":[64],"setHighlight":[64],"getHighlighted":[64],"filterOptions":[64]},[[0,"optionHover","optionHoverHandler"]]]]],["smoothly-display.cjs",[[2,"smoothly-display",{"type":[1],"value":[8],"currency":[1],"country":[1]}]]],["smoothly-display-date-time.cjs",[[2,"smoothly-display-date-time",{"datetime":[1]}]]],["smoothly-spinner.cjs",[[2,"smoothly-spinner",{"active":[516]}]]],["smoothly-tuple.cjs",[[0,"smoothly-tuple",{"tuple":[16]}]]],["smoothly-item.cjs",[[6,"smoothly-item",{"value":[8],"selected":[1540],"filter":[64]},[[0,"click","onClick"]]]]],["smoothly-input-month.cjs",[[2,"smoothly-input-month",{"value":[1025]}]]],["smoothly-calendar.cjs",[[2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"doubleInput":[516,"double-input"]}]]],["smoothly-input.cjs",[[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],"setKeepFocusOnReRender":[64],"setSelectionRange":[64]}]]],["smoothly-trigger.cjs",[[6,"smoothly-trigger",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"name":[1],"value":[8]},[[0,"click","onClick"]]]]]], options);
33
+ return index.bootstrapLazy([["smoothly-app-demo.cjs",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-input-demo.cjs",[[0,"smoothly-input-demo"]]],["smoothly-select-demo.cjs",[[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]]]],["smoothly-table-demo.cjs",[[2,"smoothly-table-demo"]]],["smoothly-display-demo.cjs",[[0,"smoothly-display-demo"]]],["smoothly-app.cjs",[[4,"smoothly-app",{"color":[1]}]]],["smoothly-dialog-demo.cjs",[[0,"smoothly-dialog-demo"]]],["smoothly-icon-demo.cjs",[[2,"smoothly-icon-demo"]]],["smoothly-room.cjs",[[4,"smoothly-room",{"label":[1],"icon":[1],"path":[1],"to":[1]}]]],["smoothly-input-date-range.cjs",[[2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"open":[1028]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"]]]]],["smoothly-notifier.cjs",[[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]]]],["smoothly-picker.cjs",[[1,"smoothly-picker",{"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"optionStyle":[8,"option-style"],"options":[16],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"isOpen":[32]},[[0,"optionSelect","optionSelectHander"]]]]],["smoothly-dialog.cjs",[[6,"smoothly-dialog",{"color":[513],"open":[1540],"closable":[516],"header":[513]},[[0,"trigger","TriggerListener"]]]]],["smoothly-checkbox.cjs",[[2,"smoothly-checkbox",{"selectAll":[4,"select-all"],"selected":[1540],"disabled":[1540],"t":[32]}]]],["smoothly-submit.cjs",[[6,"smoothly-submit",{"processing":[1540],"color":[513],"expand":[513],"fill":[513],"disabled":[516],"prevent":[4],"submit":[64]},[[0,"click","handleSubmit"]]]]],["smoothly-urlencoded.cjs",[[0,"smoothly-urlencoded",{"data":[1]}]]],["smoothly-accordion.cjs",[[6,"smoothly-accordion",{"value":[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]]]],["smoothly-accordion-item.cjs",[[6,"smoothly-accordion-item",{"name":[1],"brand":[1],"open":[1540]}]]],["smoothly-display-amount.cjs",[[2,"smoothly-display-amount",{"amount":[8],"currency":[1]}]]],["smoothly-frame.cjs",[[2,"smoothly-frame",{"url":[1],"name":[1],"origin":[1],"send":[64]}]]],["smoothly-popup.cjs",[[6,"smoothly-popup",{"visible":[1540],"direction":[1537],"cssVariables":[32]}]]],["smoothly-quiet.cjs",[[6,"smoothly-quiet",{"color":[1]}]]],["smoothly-radio.cjs",[[6,"smoothly-radio",{"name":[1],"value":[1],"checked":[1540],"tabIndex":[2,"tab-index"]}]]],["smoothly-select.cjs",[[6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}]]],["smoothly-tab.cjs",[[6,"smoothly-tab",{"label":[1],"open":[1540]},[[0,"click","onClick"]]]]],["smoothly-tab-switch.cjs",[[6,"smoothly-tab-switch",{"selectedElement":[32]},[[0,"expansionOpen","openChanged"]]]]],["smoothly-table.cjs",[[6,"smoothly-table",null,[[0,"sort","onSort"]]]]],["smoothly-table-cell.cjs",[[6,"smoothly-table-cell"]]],["smoothly-table-expandable-cell.cjs",[[6,"smoothly-table-expandable-cell",{"align":[1],"open":[1540],"beginOpen":[32]},[[0,"click","onClick"]]]]],["smoothly-table-expandable-row.cjs",[[6,"smoothly-table-expandable-row",null,[[0,"expansionLoaded","onExpansionLoaded"],[0,"expansionOpen","onDetailsLoaded"]]]]],["smoothly-table-header.cjs",[[6,"smoothly-table-header",{"name":[1],"sortDirection":[1025,"sort-direction"]},[[0,"click","onClick"]]]]],["smoothly-table-row.cjs",[[6,"smoothly-table-row",{"align":[1],"open":[1540],"beginOpen":[32]},[[0,"click","onClick"]]]]],["smoothly-icon.cjs",[[2,"smoothly-icon",{"color":[513],"fill":[513],"name":[1],"size":[513],"toolTip":[1,"tool-tip"],"document":[32]}]]],["smoothly-selector.cjs",[[6,"smoothly-selector",{"opened":[32],"selectedElement":[32],"missing":[32],"filter":[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]]]],["smoothly-input-date.cjs",[[6,"smoothly-input-date",{"value":[1025],"open":[1028],"max":[1025],"min":[1025]}]]],["smoothly-notification.cjs",[[2,"smoothly-notification",{"notice":[16],"tick":[32]},[[0,"trigger","onTrigger"]]]]],["smoothly-option.cjs",[[1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537]}]]],["smoothly-menu-options.cjs",[[1,"smoothly-menu-options",{"emptyMenuLabel":[1025,"empty-menu-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"filteredOptions":[32],"highlightIndex":[32],"moveHighlight":[64],"setHighlight":[64],"getHighlighted":[64],"filterOptions":[64]},[[0,"optionHover","optionHoverHandler"]]]]],["smoothly-display.cjs",[[2,"smoothly-display",{"type":[1],"value":[8],"currency":[1],"country":[1]}]]],["smoothly-display-date-time.cjs",[[2,"smoothly-display-date-time",{"datetime":[1]}]]],["smoothly-spinner.cjs",[[2,"smoothly-spinner",{"active":[516]}]]],["smoothly-tuple.cjs",[[0,"smoothly-tuple",{"tuple":[16]}]]],["smoothly-item.cjs",[[6,"smoothly-item",{"value":[8],"selected":[1540],"filter":[64]},[[0,"click","onClick"]]]]],["smoothly-input-month.cjs",[[2,"smoothly-input-month",{"value":[1025]}]]],["smoothly-calendar.cjs",[[2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"doubleInput":[516,"double-input"]}]]],["smoothly-input.cjs",[[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],"setKeepFocusOnReRender":[64],"setSelectionRange":[64]}]]],["smoothly-trigger.cjs",[[6,"smoothly-trigger",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"name":[1],"value":[8]},[[0,"click","onClick"]]]]]], options);
34
34
  });
35
35
  };
36
36
 
@@ -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;
@@ -18781,7 +18781,7 @@ function years(current) {
18781
18781
  return result;
18782
18782
  }
18783
18783
 
18784
- const styleCss$A = ".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))}";
18784
+ const styleCss$A = ".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)}";
18785
18785
 
18786
18786
  let Calendar = class {
18787
18787
  constructor(hostRef) {
@@ -18798,6 +18798,18 @@ let Calendar = class {
18798
18798
  onEnd(next) {
18799
18799
  this.endChanged.emit(next);
18800
18800
  }
18801
+ onClick(date) {
18802
+ this.valueChanged.emit((this.value = date));
18803
+ this.clickCounter += 1;
18804
+ if (this.clickCounter % 2 == 1)
18805
+ this.start = this.end = date;
18806
+ else {
18807
+ if (this.start && date > this.start)
18808
+ this.end = date;
18809
+ else
18810
+ this.start = date;
18811
+ }
18812
+ }
18801
18813
  render() {
18802
18814
  var _a, _b;
18803
18815
  return [
@@ -18807,24 +18819,13 @@ let Calendar = class {
18807
18819
  } }),
18808
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 => {
18809
18821
  var _a, _b, _c;
18810
- return (index.h("td", { tabindex: 1, onClick: () => {
18811
- this.valueChanged.emit((this.value = date));
18812
- this.clickCounter += 1;
18813
- if (this.clickCounter % 2 == 1)
18814
- this.start = this.end = date;
18815
- else {
18816
- if (this.start && date > this.start)
18817
- this.end = date;
18818
- else
18819
- this.start = date;
18820
- }
18821
- }, class: (date == this.value ? ["selected"] : [])
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"] : [])
18822
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
18823
- ? dist$4.Date.parse(date) >= dist$4.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
18824
- dist$4.Date.parse(date) <= dist$4.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
18824
+ ? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
18825
18825
  ? ["dateRange"]
18826
18826
  : []
18827
18827
  : "")
18828
+ .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
18828
18829
  .join(" ") }, date.substring(8, 10)));
18829
18830
  }))))),
18830
18831
  ];
@@ -57805,7 +57806,7 @@ let InputDate = class {
57805
57806
  this.open ? (index.h("nav", null, index.h("div", { class: "arrow" }), index.h("smoothly-calendar", { doubleInput: false, value: (_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now(), onValueChanged: event => {
57806
57807
  this.value = event.detail;
57807
57808
  event.stopPropagation();
57808
- } }))) : ([]),
57809
+ }, max: this.max, min: this.min }))) : ([]),
57809
57810
  ];
57810
57811
  }
57811
57812
  static get watchers() { return {
@@ -57843,7 +57844,7 @@ let InputDateRange = class {
57843
57844
  this.open ? (index.h("nav", null, index.h("div", { class: "arrow" }), index.h("smoothly-calendar", { doubleInput: true, value: (_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now(), onValueChanged: event => {
57844
57845
  this.value = event.detail;
57845
57846
  event.stopPropagation();
57846
- } }))) : ([]),
57847
+ }, max: this.max, min: this.min }))) : ([]),
57847
57848
  ];
57848
57849
  }
57849
57850
  static get watchers() { return {
@@ -58395,8 +58396,8 @@ let SmoothlySelectDemo = class {
58395
58396
  index.h("smoothly-select", { identifier: "currency" }, this.currencies.map(option => this.currency == option ? (index.h("option", { value: option, selected: true }, option)) : (index.h("option", { value: option }, option)))),
58396
58397
  index.h("smoothly-select", { identifier: "language" }, index.h("optgroup", { label: "Nordic" }, index.h("option", { value: "sv" }, "Swedish"), index.h("option", { value: "da", selected: true }, "Danish"), index.h("option", { value: "no" }, "Norwegian")), index.h("optgroup", { label: "Other" }, index.h("option", { value: "en" }, "English"))),
58397
58398
  index.h("smoothly-select", { identifier: "quantity", ref: e => (this.quantityElement = e) }, index.h("option", { value: "1" }, "1"), index.h("option", { value: "2" }, "2"), index.h("option", { value: "3" }, "3")),
58398
- index.h("smoothly-input-date", null, "Date"),
58399
- index.h("smoothly-input-date-range", null),
58399
+ index.h("smoothly-input-date", { max: "2021-12-30", min: "2021-10-10" }, "Date"),
58400
+ index.h("smoothly-input-date-range", { max: "2021-12-30", min: "2021-10-10" }),
58400
58401
  index.h("smoothly-selector", null, index.h("smoothly-item", { value: "1" }, "January"), index.h("smoothly-item", { value: "2" }, "February"), index.h("smoothly-item", { value: "3" }, "March"), index.h("smoothly-item", { value: "4" }, "April"), index.h("smoothly-item", { value: "5" }, "May"), index.h("smoothly-item", { value: "6" }, "June"), index.h("smoothly-item", { value: "7" }, "July"), index.h("smoothly-item", { value: "8" }, "August"), index.h("smoothly-item", { value: "9" }, "September"), index.h("smoothly-item", { value: "10" }, "October"), index.h("smoothly-item", { value: "11" }, "November"), index.h("smoothly-item", { value: "12" }, "December")),
58401
58402
  index.h("button", { onClick: () => this.alertf() }, "press here"),
58402
58403
  index.h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
@@ -4,10 +4,10 @@ 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-14aca5d2.js');
7
+ const generate = require('./generate-a6821b82.js');
8
8
  require('./_commonjsHelpers-10109b76.js');
9
9
 
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):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))}";
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)}";
11
11
 
12
12
  let Calendar = class {
13
13
  constructor(hostRef) {
@@ -24,6 +24,18 @@ let Calendar = class {
24
24
  onEnd(next) {
25
25
  this.endChanged.emit(next);
26
26
  }
27
+ onClick(date) {
28
+ this.valueChanged.emit((this.value = date));
29
+ this.clickCounter += 1;
30
+ if (this.clickCounter % 2 == 1)
31
+ this.start = this.end = date;
32
+ else {
33
+ if (this.start && date > this.start)
34
+ this.end = date;
35
+ else
36
+ this.start = date;
37
+ }
38
+ }
27
39
  render() {
28
40
  var _a, _b;
29
41
  return [
@@ -33,24 +45,13 @@ let Calendar = class {
33
45
  } }),
34
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 => {
35
47
  var _a, _b, _c;
36
- return (index.h("td", { tabindex: 1, onClick: () => {
37
- this.valueChanged.emit((this.value = date));
38
- this.clickCounter += 1;
39
- if (this.clickCounter % 2 == 1)
40
- this.start = this.end = date;
41
- else {
42
- if (this.start && date > this.start)
43
- this.end = date;
44
- else
45
- this.start = date;
46
- }
47
- }, class: (date == this.value ? ["selected"] : [])
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"] : [])
48
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
49
- ? index$1.dist.Date.parse(date) >= index$1.dist.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
50
- index$1.dist.Date.parse(date) <= index$1.dist.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
50
+ ? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
51
51
  ? ["dateRange"]
52
52
  : []
53
53
  : "")
54
+ .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
54
55
  .join(" ") }, date.substring(8, 10)));
55
56
  }))))),
56
57
  ];
@@ -35,7 +35,7 @@ let InputDateRange = class {
35
35
  this.open ? (index.h("nav", null, index.h("div", { class: "arrow" }), index.h("smoothly-calendar", { doubleInput: true, value: (_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now(), onValueChanged: event => {
36
36
  this.value = event.detail;
37
37
  event.stopPropagation();
38
- } }))) : ([]),
38
+ }, max: this.max, min: this.min }))) : ([]),
39
39
  ];
40
40
  }
41
41
  static get watchers() { return {
@@ -24,7 +24,7 @@ let InputDate = class {
24
24
  this.open ? (index.h("nav", null, index.h("div", { class: "arrow" }), index.h("smoothly-calendar", { doubleInput: false, value: (_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now(), onValueChanged: event => {
25
25
  this.value = event.detail;
26
26
  event.stopPropagation();
27
- } }))) : ([]),
27
+ }, max: this.max, min: this.min }))) : ([]),
28
28
  ];
29
29
  }
30
30
  static get watchers() { return {
@@ -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-14aca5d2.js');
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}";
@@ -25,8 +25,8 @@ let SmoothlySelectDemo = class {
25
25
  index.h("smoothly-select", { identifier: "currency" }, this.currencies.map(option => this.currency == option ? (index.h("option", { value: option, selected: true }, option)) : (index.h("option", { value: option }, option)))),
26
26
  index.h("smoothly-select", { identifier: "language" }, index.h("optgroup", { label: "Nordic" }, index.h("option", { value: "sv" }, "Swedish"), index.h("option", { value: "da", selected: true }, "Danish"), index.h("option", { value: "no" }, "Norwegian")), index.h("optgroup", { label: "Other" }, index.h("option", { value: "en" }, "English"))),
27
27
  index.h("smoothly-select", { identifier: "quantity", ref: e => (this.quantityElement = e) }, index.h("option", { value: "1" }, "1"), index.h("option", { value: "2" }, "2"), index.h("option", { value: "3" }, "3")),
28
- index.h("smoothly-input-date", null, "Date"),
29
- index.h("smoothly-input-date-range", null),
28
+ index.h("smoothly-input-date", { max: "2021-12-30", min: "2021-10-10" }, "Date"),
29
+ index.h("smoothly-input-date-range", { max: "2021-12-30", min: "2021-10-10" }),
30
30
  index.h("smoothly-selector", null, index.h("smoothly-item", { value: "1" }, "January"), index.h("smoothly-item", { value: "2" }, "February"), index.h("smoothly-item", { value: "3" }, "March"), index.h("smoothly-item", { value: "4" }, "April"), index.h("smoothly-item", { value: "5" }, "May"), index.h("smoothly-item", { value: "6" }, "June"), index.h("smoothly-item", { value: "7" }, "July"), index.h("smoothly-item", { value: "8" }, "August"), index.h("smoothly-item", { value: "9" }, "September"), index.h("smoothly-item", { value: "10" }, "October"), index.h("smoothly-item", { value: "11" }, "November"), index.h("smoothly-item", { value: "12" }, "December")),
31
31
  index.h("button", { onClick: () => this.alertf() }, "press here"),
32
32
  index.h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [