smoothly 0.1.86 → 0.1.90

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 (102) hide show
  1. package/dist/cjs/GoogleFont-47aed323.js +21 -0
  2. package/dist/cjs/{generate-a6821b82.js → generate-f9a36f25.js} +1 -1
  3. package/dist/cjs/{index-fc82954f.js → index-ac32385c.js} +230 -184
  4. package/dist/cjs/{index-de5d1ee1.js → index-b5fcdcf9.js} +2 -0
  5. package/dist/cjs/index-bc3845e8.js +1670 -0
  6. package/dist/cjs/index.cjs.js +8 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/smoothly-accordion_47.cjs.entry.js +1166 -19144
  9. package/dist/cjs/smoothly-calendar.cjs.entry.js +40 -12
  10. package/dist/cjs/smoothly-dialog.cjs.entry.js +2 -1
  11. package/dist/cjs/smoothly-display-amount.cjs.entry.js +1 -1
  12. package/dist/cjs/smoothly-display-demo.cjs.entry.js +2 -1
  13. package/dist/cjs/smoothly-display.cjs.entry.js +2 -1
  14. package/dist/cjs/smoothly-frame.cjs.entry.js +2 -1
  15. package/dist/cjs/smoothly-google-font.cjs.entry.js +17 -0
  16. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +9 -10
  17. package/dist/cjs/smoothly-input-date.cjs.entry.js +5 -1
  18. package/dist/cjs/smoothly-input-month.cjs.entry.js +2 -2
  19. package/dist/cjs/smoothly-input.cjs.entry.js +20 -13
  20. package/dist/cjs/smoothly-select-demo.cjs.entry.js +3 -2
  21. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -1
  22. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -1
  23. package/dist/cjs/smoothly.cjs.js +1 -1
  24. package/dist/collection/collection-manifest.json +1 -0
  25. package/dist/collection/components/calendar/index.js +80 -11
  26. package/dist/collection/components/display/index.js +1 -1
  27. package/dist/collection/components/google-font/index.js +33 -0
  28. package/dist/collection/components/input/index.js +20 -13
  29. package/dist/collection/components/input/style.css +1 -0
  30. package/dist/collection/components/input-date/index.js +12 -1
  31. package/dist/collection/components/input-date-range/index.js +14 -15
  32. package/dist/collection/components/select-demo/index.js +3 -2
  33. package/dist/collection/index.js +1 -1
  34. package/dist/collection/model/GoogleFont.js +19 -0
  35. package/dist/collection/model/index.js +1 -0
  36. package/dist/custom-elements/index.d.ts +6 -0
  37. package/dist/custom-elements/index.js +1367 -19513
  38. package/dist/esm/GoogleFont-31de060f.js +21 -0
  39. package/dist/esm/{generate-776b3b0f.js → generate-50b98474.js} +1 -1
  40. package/dist/esm/index-37a67c97.js +1668 -0
  41. package/dist/esm/{index-68492ed9.js → index-53434aca.js} +2 -0
  42. package/dist/{smoothly/index-a28d88cf.js → esm/index-a5a08f46.js} +230 -184
  43. package/dist/esm/index.js +2 -1
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/smoothly-accordion_47.entry.js +1166 -19144
  46. package/dist/esm/smoothly-calendar.entry.js +40 -12
  47. package/dist/esm/smoothly-dialog.entry.js +2 -1
  48. package/dist/esm/smoothly-display-amount.entry.js +1 -1
  49. package/dist/esm/smoothly-display-demo.entry.js +2 -1
  50. package/dist/esm/smoothly-display.entry.js +2 -1
  51. package/dist/esm/smoothly-frame.entry.js +2 -1
  52. package/dist/esm/smoothly-google-font.entry.js +13 -0
  53. package/dist/esm/smoothly-input-date-range.entry.js +9 -10
  54. package/dist/esm/smoothly-input-date.entry.js +5 -1
  55. package/dist/esm/smoothly-input-month.entry.js +2 -2
  56. package/dist/esm/smoothly-input.entry.js +20 -13
  57. package/dist/esm/smoothly-select-demo.entry.js +3 -2
  58. package/dist/esm/smoothly-trigger-sink.entry.js +2 -1
  59. package/dist/esm/smoothly-trigger-source.entry.js +2 -1
  60. package/dist/esm/smoothly.js +1 -1
  61. package/dist/smoothly/GoogleFont-31de060f.js +21 -0
  62. package/dist/smoothly/{generate-776b3b0f.js → generate-50b98474.js} +1 -1
  63. package/dist/smoothly/index-37a67c97.js +1668 -0
  64. package/dist/smoothly/{index-68492ed9.js → index-53434aca.js} +2 -0
  65. package/dist/{esm/index-a28d88cf.js → smoothly/index-a5a08f46.js} +230 -184
  66. package/dist/smoothly/index.esm.js +2 -1
  67. package/dist/smoothly/p-07653599.entry.js +1 -0
  68. package/dist/smoothly/p-2191d2d2.entry.js +1 -0
  69. package/dist/smoothly/p-82f56327.js +1 -0
  70. package/dist/smoothly/p-d2cfda26.entry.js +1 -0
  71. package/dist/smoothly/p-f6cbbcf3.entry.js +1 -0
  72. package/dist/smoothly/smoothly-calendar.entry.js +40 -12
  73. package/dist/smoothly/smoothly-dialog.entry.js +2 -1
  74. package/dist/smoothly/smoothly-display-amount.entry.js +1 -1
  75. package/dist/smoothly/smoothly-display-demo.entry.js +2 -1
  76. package/dist/smoothly/smoothly-display.entry.js +2 -1
  77. package/dist/smoothly/smoothly-frame.entry.js +2 -1
  78. package/dist/smoothly/smoothly-google-font.entry.js +13 -0
  79. package/dist/smoothly/smoothly-input-date-range.entry.js +9 -10
  80. package/dist/smoothly/smoothly-input-date.entry.js +5 -1
  81. package/dist/smoothly/smoothly-input-month.entry.js +2 -2
  82. package/dist/smoothly/smoothly-input.entry.js +20 -13
  83. package/dist/smoothly/smoothly-select-demo.entry.js +3 -2
  84. package/dist/smoothly/smoothly-trigger-sink.entry.js +2 -1
  85. package/dist/smoothly/smoothly-trigger-source.entry.js +2 -1
  86. package/dist/smoothly/smoothly.esm.js +1 -1
  87. package/dist/types/components/calendar/index.d.ts +6 -1
  88. package/dist/types/components/google-font/index.d.ts +5 -0
  89. package/dist/types/components/input/index.d.ts +1 -0
  90. package/dist/types/components/input-date/index.d.ts +1 -0
  91. package/dist/types/components/input-date-range/index.d.ts +2 -2
  92. package/dist/types/components.d.ts +19 -1
  93. package/dist/types/index.d.ts +1 -1
  94. package/dist/types/model/GoogleFont.d.ts +6 -0
  95. package/dist/types/model/index.d.ts +1 -0
  96. package/package.json +3 -3
  97. package/dist/cjs/index-42db74b3.js +0 -19931
  98. package/dist/esm/index-36a04e8c.js +0 -19929
  99. package/dist/smoothly/index-36a04e8c.js +0 -19929
  100. package/dist/smoothly/p-09d633f8.entry.js +0 -1
  101. package/dist/smoothly/p-1a81597b.entry.js +0 -1
  102. package/dist/smoothly/p-375a8d94.entry.js +0 -1
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-fc82954f.js');
7
- const generate = require('./generate-a6821b82.js');
6
+ const index$1 = require('./index-ac32385c.js');
7
+ const generate = require('./generate-f9a36f25.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)}";
@@ -15,6 +15,8 @@ let Calendar = class {
15
15
  this.valueChanged = index.createEvent(this, "valueChanged", 7);
16
16
  this.startChanged = index.createEvent(this, "startChanged", 7);
17
17
  this.endChanged = index.createEvent(this, "endChanged", 7);
18
+ this.dateSet = index.createEvent(this, "dateSet", 7);
19
+ this.dateRangeSet = index.createEvent(this, "dateRangeSet", 7);
18
20
  this.value = index$1.dist.Date.now();
19
21
  this.clickCounter = 0;
20
22
  }
@@ -27,13 +29,33 @@ let Calendar = class {
27
29
  onClick(date) {
28
30
  this.valueChanged.emit((this.value = date));
29
31
  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
32
+ if (this.doubleInput) {
33
+ if (this.clickCounter % 2 == 1)
34
+ this.start = this.end = this.frozenDate = date;
35
+ else {
36
+ if (this.start && date > this.start)
37
+ this.end = date;
38
+ else
39
+ this.start = date;
40
+ }
41
+ }
42
+ !this.doubleInput && this.dateSet.emit(this.value);
43
+ this.doubleInput &&
44
+ this.clickCounter % 2 == 0 &&
45
+ this.start &&
46
+ this.end &&
47
+ this.dateRangeSet.emit({ start: this.start, end: this.end });
48
+ }
49
+ onHover(date) {
50
+ if (this.doubleInput && this.clickCounter % 2 == 1) {
51
+ if (date < this.frozenDate) {
36
52
  this.start = date;
53
+ this.end = this.frozenDate;
54
+ }
55
+ else {
56
+ this.start = this.frozenDate;
57
+ this.end = date;
58
+ }
37
59
  }
38
60
  }
39
61
  render() {
@@ -45,11 +67,17 @@ let Calendar = class {
45
67
  } }),
46
68
  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
69
  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"] : [])
70
+ return (index.h("td", { tabindex: 1, onMouseOver: () => {
71
+ !this.doubleInput && (this.min || this.max) && (date < this.min || date > this.max)
72
+ ? undefined
73
+ : this.onHover(date);
74
+ }, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
49
75
  .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 : "")
51
- ? ["dateRange"]
52
- : []
76
+ ? this.start == date || this.end == date
77
+ ? ["selected"]
78
+ : date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
79
+ ? ["dateRange"]
80
+ : []
53
81
  : "")
54
82
  .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
55
83
  .join(" ") }, date.substring(8, 10)));
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-de5d1ee1.js');
6
+ const index$1 = require('./index-b5fcdcf9.js');
7
+ require('./GoogleFont-47aed323.js');
7
8
 
8
9
  const styleCss = ".sc-smoothly-dialog-h{display:block;position:fixed;left:0;top:0;width:100%;height:100%;z-index:1;background:rgba(var(--smoothly-default-color), var(--smoothly-semitransparent)) !important}[hidden].sc-smoothly-dialog-h{display:none}.sc-smoothly-dialog-h>header.sc-smoothly-dialog{border-top-left-radius:8px;border-top-right-radius:8px;margin-top:2em;color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color));border-color:rgb(var(--smoothly-primary-color))}.sc-smoothly-dialog-h:not([header]) header.sc-smoothly-dialog{border:none}.sc-smoothly-dialog-h>*.sc-smoothly-dialog{position:relative;color:rgb(var(--smoothly-default-contrast));background-color:rgb(var(--smoothly-default-color));border-color:rgb(var(--smoothly-color));border-width:1px;border-style:solid;max-width:40em;width:calc(100vw - 4em - 2px);max-height:calc(100vh - 6em - 2px);height:auto;margin-left:auto;margin-right:auto;border-collapse:collapse}.sc-smoothly-dialog-h>main.sc-smoothly-dialog{border-bottom-left-radius:8px;border-bottom-right-radius:8px;margin-bottom:2em;border:1px solid rgb(var(--smoothly-default-contrast));box-sizing:border-box;overflow:hidden}.sc-smoothly-dialog-h:not([header]) main.sc-smoothly-dialog{border-radius:8px}.sc-smoothly-dialog-h>*.sc-smoothly-dialog>smoothly-trigger.sc-smoothly-dialog{position:absolute;right:-2em;top:-2em;z-index:1;border-color:transparent}.sc-smoothly-dialog-h>*.sc-smoothly-dialog>smoothly-trigger.sc-smoothly-dialog:hover{border-color:transparent}.sc-smoothly-dialog-h smoothly-icon.sc-smoothly-dialog{background-color:rgb(var(--smoothly-color));border-radius:50%}.sc-smoothly-dialog-h>*.sc-smoothly-dialog>*.sc-smoothly-dialog{margin:10px}";
9
10
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-fc82954f.js');
6
+ const index$1 = require('./index-ac32385c.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-display-amount-h{display:block}[hidden].sc-smoothly-display-amount-h{display:none}";
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-de5d1ee1.js');
6
+ const index$1 = require('./index-b5fcdcf9.js');
7
+ require('./GoogleFont-47aed323.js');
7
8
 
8
9
  let SmoothlyDisplayDemo = class {
9
10
  constructor(hostRef) {
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-42db74b3.js');
6
+ const index$1 = require('./index-bc3845e8.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
+ require('./index-ac32385c.js');
8
9
 
9
10
  const styleCss = ".sc-smoothly-display-h{display:block}[hidden].sc-smoothly-display-h{display:none}";
10
11
 
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-de5d1ee1.js');
6
+ const index$1 = require('./index-b5fcdcf9.js');
7
+ require('./GoogleFont-47aed323.js');
7
8
 
8
9
  const styleCss = ".sc-smoothly-frame-h{display:block;width:100%;height:100%}[hidden].sc-smoothly-frame-h{display:none}.sc-smoothly-frame-h>iframe.sc-smoothly-frame{border:none;padding:none;margin:none}";
9
10
 
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-138c41c2.js');
6
+ const GoogleFont = require('./GoogleFont-47aed323.js');
7
+
8
+ let SmoothlyGoogleFont = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ }
12
+ render() {
13
+ return GoogleFont.GoogleFont.is(this.value) ? index.h("style", null, GoogleFont.GoogleFont.styleImportString(this.value)) : "";
14
+ }
15
+ };
16
+
17
+ exports.smoothly_google_font = SmoothlyGoogleFont;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-fc82954f.js');
6
+ const index$1 = require('./index-ac32385c.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
8
 
9
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}";
@@ -17,16 +17,18 @@ let InputDateRange = class {
17
17
  onValue(next) {
18
18
  this.valueChanged.emit(next);
19
19
  }
20
- onClose(open) {
21
- if (open == false && index$1.dist.Date.is(this.start) && index$1.dist.Date.is(this.end))
22
- this.dateRangeSelected.emit({ start: this.start, end: this.end });
23
- }
24
20
  onStartChanged(event) {
25
21
  this.start = event.detail;
26
22
  }
27
23
  onEndChanged(event) {
28
24
  this.end = event.detail;
29
25
  }
26
+ onDateRangeSet(event) {
27
+ console.log("dateRangeSet", event.detail);
28
+ this.open = false;
29
+ event.stopPropagation();
30
+ index$1.dist.DateRange.is(event.detail) && this.dateRangeSelected.emit(event.detail);
31
+ }
30
32
  render() {
31
33
  var _a;
32
34
  return [
@@ -35,14 +37,11 @@ let InputDateRange = class {
35
37
  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
38
  this.value = event.detail;
37
39
  event.stopPropagation();
38
- }, max: this.max, min: this.min }))) : ([]),
40
+ }, start: this.start, end: this.end, max: this.max, min: this.min }))) : ([]),
39
41
  ];
40
42
  }
41
43
  static get watchers() { return {
42
- "value": ["onValue"],
43
- "open": ["onClose"],
44
- "start": ["onClose"],
45
- "end": ["onClose"]
44
+ "value": ["onValue"]
46
45
  }; }
47
46
  };
48
47
  InputDateRange.style = styleCss;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-fc82954f.js');
6
+ const index$1 = require('./index-ac32385c.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
8
 
9
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))}";
@@ -16,6 +16,10 @@ let InputDate = class {
16
16
  onStart(next) {
17
17
  this.valueChanged.emit(next);
18
18
  }
19
+ dateSetHandler(e) {
20
+ this.open = false;
21
+ e.stopPropagation();
22
+ }
19
23
  render() {
20
24
  var _a;
21
25
  return [
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-fc82954f.js');
7
- const generate = require('./generate-a6821b82.js');
6
+ const index$1 = require('./index-ac32385c.js');
7
+ const generate = require('./generate-f9a36f25.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}";
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-42db74b3.js');
6
+ const index$2 = require('./index-ac32385c.js');
7
+ const index$1 = require('./index-bc3845e8.js');
7
8
  require('./_commonjsHelpers-10109b76.js');
8
9
 
9
- const styleCss = ".sc-smoothly-input-h{display:block;position:relative}[hidden].sc-smoothly-input-h{display:none}label.sc-smoothly-input{position:absolute;left:0.4em;top:0.6em;color:rgb(var(--smoothly-text-tint));opacity:0.8;user-select:none;cursor:inherit;transition:font-size 0.1s;transition-timing-function:ease}input.sc-smoothly-input{padding:1em 0.2em 0.2em 0.2em;width:calc(100% - 0.4em);background:none;border:0;z-index:1;position:relative;font-size:1rem;font-family:var(--smoothly-font-family)}smoothly-icon.sc-smoothly-input{display:none;position:absolute;right:0.2em;top:0.6em}input.sc-smoothly-input:invalid+smoothly-icon.sc-smoothly-input{display:block}.has-value.sc-smoothly-input-h>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}.sc-smoothly-input-h:focus-within>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}input.sc-smoothly-input:focus{outline:none}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill:hover,input.sc-smoothly-input:-webkit-autofill:focus,input.sc-smoothly-input:-webkit-autofill:active{box-shadow:0 0 0 30px unset inset !important;-webkit-box-shadow:0 0 0 30px unset inset !important}input.sc-smoothly-input:-webkit-autofill{-webkit-text-fill-color:unset !important}input.sc-smoothly-input:-internal-autofill-previewed,input.sc-smoothly-input:-internal-autofill-selected,textarea.sc-smoothly-input:-internal-autofill-previewed,textarea.sc-smoothly-input:-internal-autofill-selected,select.sc-smoothly-input:-internal-autofill-previewed,select.sc-smoothly-input:-internal-autofill-selected{background-color:none !important;background-image:none !important;color:unset !important}";
10
+ const styleCss = ".sc-smoothly-input-h{display:block;position:relative;font-weight:var(--smoothly-font-weight)}[hidden].sc-smoothly-input-h{display:none}label.sc-smoothly-input{position:absolute;left:0.4em;top:0.6em;color:rgb(var(--smoothly-text-tint));opacity:0.8;user-select:none;cursor:inherit;transition:font-size 0.1s;transition-timing-function:ease}input.sc-smoothly-input{padding:1em 0.2em 0.2em 0.2em;width:calc(100% - 0.4em);background:none;border:0;z-index:1;position:relative;font-size:1rem;font-family:var(--smoothly-font-family)}smoothly-icon.sc-smoothly-input{display:none;position:absolute;right:0.2em;top:0.6em}input.sc-smoothly-input:invalid+smoothly-icon.sc-smoothly-input{display:block}.has-value.sc-smoothly-input-h>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}.sc-smoothly-input-h:focus-within>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}input.sc-smoothly-input:focus{outline:none}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill:hover,input.sc-smoothly-input:-webkit-autofill:focus,input.sc-smoothly-input:-webkit-autofill:active{box-shadow:0 0 0 30px unset inset !important;-webkit-box-shadow:0 0 0 30px unset inset !important}input.sc-smoothly-input:-webkit-autofill{-webkit-text-fill-color:unset !important}input.sc-smoothly-input:-internal-autofill-previewed,input.sc-smoothly-input:-internal-autofill-selected,textarea.sc-smoothly-input:-internal-autofill-previewed,textarea.sc-smoothly-input:-internal-autofill-selected,select.sc-smoothly-input:-internal-autofill-previewed,select.sc-smoothly-input:-internal-autofill-selected{background-color:none !important;background-image:none !important;color:unset !important}";
10
11
 
11
12
  let SmoothlyInput = class {
12
13
  constructor(hostRef) {
@@ -27,27 +28,30 @@ let SmoothlyInput = class {
27
28
  result = index$1.dist.get("price", this.currency);
28
29
  break;
29
30
  default:
30
- result = index$1.dist.get(this.type);
31
+ result = index$1.dist.get(this.type, getLocale());
31
32
  break;
32
33
  }
33
34
  return result || index$1.dist.get("text");
34
35
  }
36
+ newState(state) {
37
+ const formatter = this.formatter;
38
+ return formatter.format(index$1.dist.StateEditor.copy(formatter.unformat(index$1.dist.StateEditor.copy(state))));
39
+ }
35
40
  valueWatcher(value, before) {
36
41
  if (this.lastValue != value) {
37
42
  this.lastValue = value;
38
- this.state = Object.assign(Object.assign({}, this.state), { value: this.formatter.format(index$1.dist.StateEditor.copy(this.formatter.unformat(index$1.dist.StateEditor.copy({ value, selection: this.state.selection })))).value });
43
+ this.state = Object.assign(Object.assign({}, this.state), { value: this.newState({ value: this.formatter.toString(value), selection: this.state.selection }).value });
39
44
  }
40
45
  if (value != before)
41
46
  this.smoothlyChanged.emit({ name: this.name, value });
42
47
  }
43
48
  componentWillLoad() {
44
- const formatter = this.formatter;
45
- const value = formatter.toString(this.value) || "";
49
+ const value = this.formatter.toString(this.value) || "";
46
50
  const start = value.length;
47
- this.state = formatter.format(index$1.dist.StateEditor.copy(formatter.unformat(index$1.dist.StateEditor.copy({
51
+ this.state = this.newState({
48
52
  value,
49
53
  selection: { start, end: start, direction: "none" },
50
- }))));
54
+ });
51
55
  }
52
56
  componentDidRender() {
53
57
  if (this.keepFocusOnReRender) {
@@ -59,8 +63,7 @@ let SmoothlyInput = class {
59
63
  this.keepFocusOnReRender = keepFocus;
60
64
  }
61
65
  async setSelectionRange(start, end, direction) {
62
- const formatter = this.formatter;
63
- this.state = formatter.format(index$1.dist.StateEditor.copy(formatter.unformat(index$1.dist.StateEditor.copy(Object.assign(Object.assign({}, this.state), { selection: { start, end, direction: direction != undefined ? direction : this.state.selection.direction } })))));
66
+ this.state = this.newState(Object.assign(Object.assign({}, this.state), { selection: { start, end, direction: direction != undefined ? direction : this.state.selection.direction } }));
64
67
  const after = this.formatter.format(index$1.dist.StateEditor.copy(this.formatter.unformat(index$1.dist.StateEditor.copy(Object.assign({}, this.state)))));
65
68
  this.updateBackend(after, this.inputElement);
66
69
  }
@@ -77,7 +80,7 @@ let SmoothlyInput = class {
77
80
  end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
78
81
  direction: backend.selectionDirection ? backend.selectionDirection : "none",
79
82
  } });
80
- const after = this.formatter.format(index$1.dist.StateEditor.copy(this.formatter.unformat(index$1.dist.StateEditor.copy(Object.assign({}, this.state)))));
83
+ const after = this.newState(Object.assign({}, this.state));
81
84
  this.updateBackend(after, backend);
82
85
  }
83
86
  onKeyDown(event) {
@@ -156,13 +159,17 @@ let SmoothlyInput = class {
156
159
  this.value = this.lastValue = this.formatter.fromString(this.formatter.unformat(index$1.dist.StateEditor.copy(Object.assign({}, this.state))).value);
157
160
  }
158
161
  render() {
159
- var _a;
160
- return (index.h(index.Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != "" } }, index.h("input", { name: this.name, type: this.state.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? this.state.autocomplete : "off", disabled: this.disabled, pattern: this.state.pattern && this.state.pattern.source, value: this.state.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), index.h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }), index.h("label", { htmlFor: this.name }, index.h("slot", null))));
162
+ var _a, _b, _c, _d, _e, _f, _g;
163
+ return (index.h(index.Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" } }, index.h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), index.h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }), index.h("label", { htmlFor: this.name }, index.h("slot", null))));
161
164
  }
162
165
  static get watchers() { return {
163
166
  "value": ["valueWatcher"]
164
167
  }; }
165
168
  };
169
+ function getLocale() {
170
+ const result = navigator.language;
171
+ return index$2.dist.Locale.is(result) ? result : index$2.dist.Language.is(result) ? index$2.dist.Locale.toLocale(result) : undefined;
172
+ }
166
173
  SmoothlyInput.style = styleCss;
167
174
 
168
175
  exports.smoothly_input = SmoothlyInput;
@@ -25,8 +25,9 @@ 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", { max: "2021-12-30", min: "2021-10-10" }, "Date"),
29
- index.h("smoothly-input-date-range", { max: "2021-12-30", min: "2021-10-10" }),
28
+ index.h("smoothly-input-date", null, "Date"),
29
+ index.h("smoothly-input-date", { value: "2021-10-28", max: "2021-12-30", min: "2021-10-10" }, "Date"),
30
+ index.h("smoothly-input-date-range", { start: "2021-10-28", end: "2021-11-27", min: "2021-10-10", max: "2021-12-30" }),
30
31
  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
32
  index.h("button", { onClick: () => this.alertf() }, "press here"),
32
33
  index.h("smoothly-picker", { label: "Filter", "empty-menu-label": "Sorry, we're out of options.", "max-height": "58px", multiple: true, options: [
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-de5d1ee1.js');
6
+ const index$1 = require('./index-b5fcdcf9.js');
7
+ require('./GoogleFont-47aed323.js');
7
8
 
8
9
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
9
10
 
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-de5d1ee1.js');
6
+ const index$1 = require('./index-b5fcdcf9.js');
7
+ require('./GoogleFont-47aed323.js');
7
8
 
8
9
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
9
10
 
@@ -123,5 +123,5 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
123
123
 
124
124
  patchBrowser().then(options => {
125
125
  appGlobals.globalScripts();
126
- 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);
126
+ return index.bootstrapLazy([["smoothly-app-demo.cjs",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}]]],["smoothly-google-font.cjs",[[2,"smoothly-google-font",{"value":[1]}]]],["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-notifier.cjs",[[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]]]],["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"],[0,"dateRangeSet","onDateRangeSet"]]]]],["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]},[[0,"dateSet","dateSetHandler"]]]]],["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-calendar.cjs",[[2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"doubleInput":[516,"double-input"],"firstSelected":[32]}]]],["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-input-month.cjs",[[2,"smoothly-input-month",{"value":[1025]}]]],["smoothly-trigger.cjs",[[6,"smoothly-trigger",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"name":[1],"value":[8]},[[0,"click","onClick"]]]]]], options);
127
127
  });
@@ -13,6 +13,7 @@
13
13
  "./components/display-date-time/index.js",
14
14
  "./components/display-demo/index.js",
15
15
  "./components/frame/index.js",
16
+ "./components/google-font/index.js",
16
17
  "./components/icon/index.js",
17
18
  "./components/icon-demo/index.js",
18
19
  "./components/input/index.js",
@@ -1,4 +1,4 @@
1
- import { Component, Element, Event, h, Prop, Watch } from "@stencil/core";
1
+ import { Component, Element, Event, h, Prop, State, Watch } from "@stencil/core";
2
2
  import { Date } from "isoly";
3
3
  import * as generate from "./generate";
4
4
  export class Calendar {
@@ -15,13 +15,33 @@ export class Calendar {
15
15
  onClick(date) {
16
16
  this.valueChanged.emit((this.value = date));
17
17
  this.clickCounter += 1;
18
- if (this.clickCounter % 2 == 1)
19
- this.start = this.end = date;
20
- else {
21
- if (this.start && date > this.start)
22
- this.end = date;
23
- else
18
+ if (this.doubleInput) {
19
+ if (this.clickCounter % 2 == 1)
20
+ this.start = this.end = this.frozenDate = date;
21
+ else {
22
+ if (this.start && date > this.start)
23
+ this.end = date;
24
+ else
25
+ this.start = date;
26
+ }
27
+ }
28
+ !this.doubleInput && this.dateSet.emit(this.value);
29
+ this.doubleInput &&
30
+ this.clickCounter % 2 == 0 &&
31
+ this.start &&
32
+ this.end &&
33
+ this.dateRangeSet.emit({ start: this.start, end: this.end });
34
+ }
35
+ onHover(date) {
36
+ if (this.doubleInput && this.clickCounter % 2 == 1) {
37
+ if (date < this.frozenDate) {
24
38
  this.start = date;
39
+ this.end = this.frozenDate;
40
+ }
41
+ else {
42
+ this.start = this.frozenDate;
43
+ this.end = date;
44
+ }
25
45
  }
26
46
  }
27
47
  render() {
@@ -36,11 +56,17 @@ export class Calendar {
36
56
  h("tr", null, generate.weekdays().map(day => (h("th", null, day))))),
37
57
  generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
38
58
  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"] : [])
59
+ return (h("td", { tabindex: 1, onMouseOver: () => {
60
+ !this.doubleInput && (this.min || this.max) && (date < this.min || date > this.max)
61
+ ? undefined
62
+ : this.onHover(date);
63
+ }, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
40
64
  .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 : "")
42
- ? ["dateRange"]
43
- : []
65
+ ? this.start == date || this.end == date
66
+ ? ["selected"]
67
+ : date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
68
+ ? ["dateRange"]
69
+ : []
44
70
  : "")
45
71
  .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
46
72
  .join(" ") }, date.substring(8, 10)));
@@ -207,6 +233,9 @@ export class Calendar {
207
233
  "reflect": true
208
234
  }
209
235
  }; }
236
+ static get states() { return {
237
+ "firstSelected": {}
238
+ }; }
210
239
  static get events() { return [{
211
240
  "method": "valueChanged",
212
241
  "name": "valueChanged",
@@ -267,6 +296,46 @@ export class Calendar {
267
296
  }
268
297
  }
269
298
  }
299
+ }, {
300
+ "method": "dateSet",
301
+ "name": "dateSet",
302
+ "bubbles": true,
303
+ "cancelable": true,
304
+ "composed": true,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": ""
308
+ },
309
+ "complexType": {
310
+ "original": "Date",
311
+ "resolved": "string",
312
+ "references": {
313
+ "Date": {
314
+ "location": "import",
315
+ "path": "isoly"
316
+ }
317
+ }
318
+ }
319
+ }, {
320
+ "method": "dateRangeSet",
321
+ "name": "dateRangeSet",
322
+ "bubbles": true,
323
+ "cancelable": true,
324
+ "composed": true,
325
+ "docs": {
326
+ "tags": [],
327
+ "text": ""
328
+ },
329
+ "complexType": {
330
+ "original": "DateRange",
331
+ "resolved": "DateRange",
332
+ "references": {
333
+ "DateRange": {
334
+ "location": "import",
335
+ "path": "isoly"
336
+ }
337
+ }
338
+ }
270
339
  }]; }
271
340
  static get elementRef() { return "element"; }
272
341
  static get watchers() { return [{
@@ -76,7 +76,7 @@ export class SmoothlyDisplay {
76
76
  "mutable": false,
77
77
  "complexType": {
78
78
  "original": "Currency",
79
- "resolved": "Currency | undefined",
79
+ "resolved": "\"AED\" | \"AFN\" | \"ALL\" | \"AMD\" | \"ANG\" | \"AOA\" | \"ARS\" | \"AUD\" | \"AWG\" | \"AZN\" | \"BAM\" | \"BBD\" | \"BDT\" | \"BGN\" | \"BHD\" | \"BIF\" | \"BMD\" | \"BND\" | \"BOB\" | \"BOV\" | \"BRL\" | \"BSD\" | \"BTN\" | \"BWP\" | \"BYN\" | \"BZD\" | \"CAD\" | \"CDF\" | \"CHE\" | \"CHF\" | \"CHW\" | \"CLF\" | \"CLP\" | \"CNY\" | \"COP\" | \"COU\" | \"CRC\" | \"CUC\" | \"CUP\" | \"CVE\" | \"CZK\" | \"DJF\" | \"DKK\" | \"DOP\" | \"DZD\" | \"EGP\" | \"ERN\" | \"ETB\" | \"EUR\" | \"FJD\" | \"FKP\" | \"GBP\" | \"GEL\" | \"GHS\" | \"GIP\" | \"GMD\" | \"GNF\" | \"GTQ\" | \"GYD\" | \"HKD\" | \"HNL\" | \"HRK\" | \"HTG\" | \"HUF\" | \"IDR\" | \"ILS\" | \"INR\" | \"IQD\" | \"IRR\" | \"ISK\" | \"JMD\" | \"JOD\" | \"JPY\" | \"KES\" | \"KGS\" | \"KHR\" | \"KMF\" | \"KPW\" | \"KRW\" | \"KWD\" | \"KYD\" | \"KZT\" | \"LAK\" | \"LBP\" | \"LKR\" | \"LRD\" | \"LSL\" | \"LYD\" | \"MAD\" | \"MDL\" | \"MGA\" | \"MKD\" | \"MMK\" | \"MNT\" | \"MOP\" | \"MRU\" | \"MUR\" | \"MVR\" | \"MWK\" | \"MXN\" | \"MXV\" | \"MYR\" | \"MZN\" | \"NAD\" | \"NGN\" | \"NIO\" | \"NOK\" | \"NPR\" | \"NZD\" | \"OMR\" | \"PAB\" | \"PEN\" | \"PGK\" | \"PHP\" | \"PKR\" | \"PLN\" | \"PYG\" | \"QAR\" | \"RON\" | \"RSD\" | \"RUB\" | \"RWF\" | \"SAR\" | \"SBD\" | \"SCR\" | \"SDG\" | \"SEK\" | \"SGD\" | \"SHP\" | \"SLL\" | \"SOS\" | \"SRD\" | \"SSP\" | \"STN\" | \"SVC\" | \"SYP\" | \"SZL\" | \"THB\" | \"TJS\" | \"TMT\" | \"TND\" | \"TOP\" | \"TRY\" | \"TTD\" | \"TWD\" | \"TZS\" | \"UAH\" | \"UGX\" | \"USD\" | \"USN\" | \"UYI\" | \"UYU\" | \"UYW\" | \"UZS\" | \"VES\" | \"VND\" | \"VUV\" | \"WST\" | \"XAF\" | \"XAG\" | \"XAU\" | \"XBA\" | \"XBB\" | \"XBC\" | \"XBD\" | \"XCD\" | \"XDR\" | \"XOF\" | \"XPD\" | \"XPF\" | \"XPT\" | \"XSU\" | \"XTS\" | \"XUA\" | \"XXX\" | \"YER\" | \"ZAR\" | \"ZMW\" | \"ZWL\" | undefined",
80
80
  "references": {
81
81
  "Currency": {
82
82
  "location": "import",
@@ -0,0 +1,33 @@
1
+ import { Component, h, Prop } from "@stencil/core";
2
+ import { GoogleFont } from "../../model/GoogleFont";
3
+ export class SmoothlyGoogleFont {
4
+ render() {
5
+ return GoogleFont.is(this.value) ? h("style", null, GoogleFont.styleImportString(this.value)) : "";
6
+ }
7
+ static get is() { return "smoothly-google-font"; }
8
+ static get encapsulation() { return "scoped"; }
9
+ static get properties() { return {
10
+ "value": {
11
+ "type": "string",
12
+ "mutable": false,
13
+ "complexType": {
14
+ "original": "GoogleFont",
15
+ "resolved": "string | undefined",
16
+ "references": {
17
+ "GoogleFont": {
18
+ "location": "import",
19
+ "path": "../../model/GoogleFont"
20
+ }
21
+ }
22
+ },
23
+ "required": false,
24
+ "optional": true,
25
+ "docs": {
26
+ "tags": [],
27
+ "text": ""
28
+ },
29
+ "attribute": "value",
30
+ "reflect": false
31
+ }
32
+ }; }
33
+ }