smoothly 0.1.66 → 0.1.70

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 (73) hide show
  1. package/dist/cjs/{Trigger-ea33b682.js → Trigger-74bd1ee8.js} +16 -0
  2. package/dist/cjs/{generate-5e7cd3f7.js → generate-7f7f7d99.js} +3 -2
  3. package/dist/cjs/{index-2a5f8661.js → index-c973259c.js} +16 -0
  4. package/dist/cjs/{index-b8688617.js → index-e37f73fe.js} +89 -19
  5. package/dist/cjs/index.cjs.js +1 -1
  6. package/dist/cjs/smoothly-accordion_43.cjs.entry.js +120 -54
  7. package/dist/cjs/smoothly-calendar.cjs.entry.js +7 -7
  8. package/dist/cjs/smoothly-dialog.cjs.entry.js +1 -1
  9. package/dist/cjs/smoothly-display-amount.cjs.entry.js +1 -1
  10. package/dist/cjs/smoothly-display-demo.cjs.entry.js +1 -1
  11. package/dist/cjs/smoothly-frame.cjs.entry.js +1 -1
  12. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
  13. package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
  14. package/dist/cjs/smoothly-input-month.cjs.entry.js +11 -11
  15. package/dist/cjs/smoothly-input.cjs.entry.js +1 -1
  16. package/dist/cjs/smoothly-picker.cjs.entry.js +12 -17
  17. package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +2 -2
  18. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +1 -1
  19. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +1 -1
  20. package/dist/collection/components/calendar/generate.js +2 -1
  21. package/dist/collection/components/calendar/index.js +4 -4
  22. package/dist/collection/components/calendar/style.css +29 -11
  23. package/dist/collection/components/input/index.js +1 -1
  24. package/dist/collection/components/input-month/index.js +8 -8
  25. package/dist/collection/components/input-month/style.css +0 -6
  26. package/dist/collection/components/picker/index.js +12 -17
  27. package/dist/collection/components/table/exandable/cell/index.js +3 -2
  28. package/dist/collection/components/table/exandable/cell/style.css +1 -1
  29. package/dist/custom-elements/index.js +136 -54
  30. package/dist/esm/{Trigger-c637fedf.js → Trigger-d7b181ec.js} +16 -0
  31. package/dist/esm/{generate-fc812e0f.js → generate-7090dc14.js} +3 -2
  32. package/dist/esm/{index-046ba252.js → index-13251390.js} +89 -19
  33. package/dist/{smoothly/index-71e3ce99.js → esm/index-531e2f06.js} +16 -0
  34. package/dist/esm/index.js +1 -1
  35. package/dist/esm/smoothly-accordion_43.entry.js +120 -54
  36. package/dist/esm/smoothly-calendar.entry.js +7 -7
  37. package/dist/esm/smoothly-dialog.entry.js +1 -1
  38. package/dist/esm/smoothly-display-amount.entry.js +1 -1
  39. package/dist/esm/smoothly-display-demo.entry.js +1 -1
  40. package/dist/esm/smoothly-frame.entry.js +1 -1
  41. package/dist/esm/smoothly-input-date-range.entry.js +1 -1
  42. package/dist/esm/smoothly-input-date.entry.js +1 -1
  43. package/dist/esm/smoothly-input-month.entry.js +11 -11
  44. package/dist/esm/smoothly-input.entry.js +1 -1
  45. package/dist/esm/smoothly-picker.entry.js +12 -17
  46. package/dist/esm/smoothly-table-expandable-cell.entry.js +2 -2
  47. package/dist/esm/smoothly-trigger-sink.entry.js +1 -1
  48. package/dist/esm/smoothly-trigger-source.entry.js +1 -1
  49. package/dist/smoothly/{generate-fc812e0f.js → generate-7090dc14.js} +3 -2
  50. package/dist/smoothly/{index-046ba252.js → index-13251390.js} +89 -19
  51. package/dist/{esm/index-71e3ce99.js → smoothly/index-531e2f06.js} +16 -0
  52. package/dist/smoothly/index.esm.js +1 -1
  53. package/dist/smoothly/p-2cda1784.js +1 -0
  54. package/dist/smoothly/p-2e35abfc.entry.js +1 -0
  55. package/dist/smoothly/{p-24d838b1.entry.js → p-89fe12b0.entry.js} +1 -1
  56. package/dist/smoothly/{p-77f6d4bf.entry.js → p-e79800d9.entry.js} +1 -1
  57. package/dist/smoothly/smoothly-calendar.entry.js +7 -7
  58. package/dist/smoothly/smoothly-dialog.entry.js +1 -1
  59. package/dist/smoothly/smoothly-display-amount.entry.js +1 -1
  60. package/dist/smoothly/smoothly-display-demo.entry.js +1 -1
  61. package/dist/smoothly/smoothly-frame.entry.js +1 -1
  62. package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
  63. package/dist/smoothly/smoothly-input-date.entry.js +1 -1
  64. package/dist/smoothly/smoothly-input-month.entry.js +11 -11
  65. package/dist/smoothly/smoothly-input.entry.js +1 -1
  66. package/dist/smoothly/smoothly-picker.entry.js +12 -17
  67. package/dist/smoothly/smoothly-table-expandable-cell.entry.js +2 -2
  68. package/dist/smoothly/smoothly-trigger-sink.entry.js +1 -1
  69. package/dist/smoothly/smoothly-trigger-source.entry.js +1 -1
  70. package/dist/types/components/input-month/index.d.ts +1 -1
  71. package/package.json +2 -2
  72. package/dist/smoothly/p-08ef34d4.js +0 -1
  73. package/dist/smoothly/p-8ff541af.entry.js +0 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
6
+ const index$1 = require('./index-e37f73fe.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;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}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
6
+ const index$1 = require('./index-e37f73fe.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;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))}";
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
7
- const generate = require('./generate-5e7cd3f7.js');
6
+ const index$1 = require('./index-e37f73fe.js');
7
+ const generate = require('./generate-7f7f7d99.js');
8
8
  require('./_commonjsHelpers-10109b76.js');
9
9
 
10
- const styleCss = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}button.sc-smoothly-input-month{border:none;background:none;cursor:pointer;font-size:large}smoothly-icon.sc-smoothly-input-month{font-size:smaller}";
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}";
11
11
 
12
12
  const MonthSelector = class {
13
13
  constructor(hostRef) {
@@ -17,21 +17,21 @@ const MonthSelector = class {
17
17
  onValueChanged(next) {
18
18
  this.valueChanged.emit(next);
19
19
  }
20
+ adjustMonth(delta) {
21
+ var _a;
22
+ const date = index$1.dist.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now());
23
+ date.setMonth(date.getMonth() + delta);
24
+ this.value = index$1.dist.Date.create(date);
25
+ }
20
26
  render() {
21
27
  var _a, _b;
22
28
  return [
23
- index.h("button", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
29
+ index.h("div", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
24
30
  index.h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.years((_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now()).map(year => (index.h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
25
31
  index.h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.months((_b = this.value) !== null && _b !== void 0 ? _b : index$1.dist.Date.now()).map(month => (index.h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
26
- index.h("button", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
32
+ index.h("div", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
27
33
  ];
28
34
  }
29
- adjustMonth(delta) {
30
- var _a;
31
- const date = index$1.dist.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now());
32
- date.setMonth(date.getMonth() + delta);
33
- this.value = index$1.dist.Date.create(date);
34
- }
35
35
  static get watchers() { return {
36
36
  "value": ["onValueChanged"]
37
37
  }; }
@@ -88,7 +88,7 @@ const SmoothlyInput = class {
88
88
  end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
89
89
  direction: backend.selectionDirection ? backend.selectionDirection : "none",
90
90
  } });
91
- if ((!(event.ctrlKey && event.key == "v") && event.key.length == 1) ||
91
+ if ((!((event.ctrlKey || event.metaKey) && event.key == "v") && event.key.length == 1) ||
92
92
  event.key == "ArrowLeft" ||
93
93
  event.key == "ArrowRight" ||
94
94
  event.key == "Delete" ||
@@ -40,14 +40,11 @@ const SmoothlyPicker = class {
40
40
  : this.select(option);
41
41
  }
42
42
  clearSelection() {
43
- var _a;
44
43
  this.selections = [];
45
44
  this.inputElement.focus();
46
45
  this.keepFocusOnReRender = true;
47
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(option => (option.description = ""));
48
46
  }
49
47
  unselect(selection) {
50
- var _a;
51
48
  const index = this.selections.map(selection => selection.value).indexOf(selection.value);
52
49
  if (index != -1) {
53
50
  this.selections = [
@@ -56,12 +53,8 @@ const SmoothlyPicker = class {
56
53
  ];
57
54
  this.keepFocusOnReRender = true;
58
55
  }
59
- const optionIndex = (_a = this.options) === null || _a === void 0 ? void 0 : _a.map(s => s.value).indexOf(selection.value);
60
- if (optionIndex != -1)
61
- this.options[optionIndex].description = "";
62
56
  }
63
57
  select(selection) {
64
- var _a;
65
58
  const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
66
59
  if (isNewSelection)
67
60
  this.selections = this.multiple ? [...this.selections, selection] : [selection];
@@ -69,8 +62,6 @@ const SmoothlyPicker = class {
69
62
  this.filterOptions();
70
63
  this.keepFocusOnReRender = true;
71
64
  this.isOpen = this.multiple;
72
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(option => (option.description =
73
- option.value == selection.value ? this.getCheckHtml() : this.multiple ? option.description : ""));
74
65
  }
75
66
  toggleHighlighted() {
76
67
  var _a;
@@ -130,14 +121,18 @@ const SmoothlyPicker = class {
130
121
  "--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
131
122
  "--label-display": this.labelSetting == "hide" ? "none" : "absolute",
132
123
  };
133
- return (index.h(index.Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, index.h("div", null, index.h("label", null, this.label), index.h("input", { type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) })), index.h("smoothly-menu-options", { style: { width: "100%" }, optionStyle: Object.assign({ padding: "0 1em", height: "2.5em" }, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, "max-menu-height": this.maxMenuHeight, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: [
134
- {
135
- value: "select-none",
136
- name: this.selectNoneName,
137
- description: this.selections.length == 0 ? this.getCheckHtml() : "",
138
- },
139
- ...((_b = this.options) !== null && _b !== void 0 ? _b : []),
140
- ] })));
124
+ this.options.forEach(o => {
125
+ o.description = this.selections.map(s => s.value).includes(o.value) ? this.getCheckHtml() : "";
126
+ });
127
+ const options = [
128
+ {
129
+ value: "select-none",
130
+ name: this.selectNoneName,
131
+ description: this.selections.length == 0 ? this.getCheckHtml() : "",
132
+ },
133
+ ...((_b = this.options) !== null && _b !== void 0 ? _b : []),
134
+ ];
135
+ return (index.h(index.Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, index.h("div", null, index.h("label", null, this.label), index.h("input", { type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) })), index.h("smoothly-menu-options", { style: { width: "100%" }, optionStyle: Object.assign({ padding: "0 1em", height: "2.5em" }, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, "max-menu-height": this.maxMenuHeight, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
141
136
  }
142
137
  get element() { return index.getElement(this); }
143
138
  static get watchers() { return {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
6
 
7
- const styleCss = ".sc-smoothly-table-expandable-cell-h{display:table-cell;padding:0.5em}.sc-smoothly-table-expandable-cell-h>tr.sc-smoothly-table-expandable-cell{display:none}";
7
+ const styleCss = ".sc-smoothly-table-expandable-cell-h{display:table-cell;padding:0.5em}.hide.sc-smoothly-table-expandable-cell{display:none}";
8
8
 
9
9
  const TableExpandableCell = class {
10
10
  constructor(hostRef) {
@@ -33,7 +33,7 @@ const TableExpandableCell = class {
33
33
  }
34
34
  }
35
35
  render() {
36
- return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("tr", { ref: e => (this.expansionElement = e) }, this.open ? (index.h("td", { colSpan: 500 }, index.h("slot", { name: "detail" }))) : ([]))));
36
+ return (index.h(index.Host, { style: { textAlign: this.align } }, index.h("slot", null), index.h("tr", { ref: e => (this.expansionElement = e) }, index.h("td", { colSpan: 500, class: !this.open ? "hide" : "" }, index.h("slot", { name: "detail" })))));
37
37
  }
38
38
  get element() { return index.getElement(this); }
39
39
  static get watchers() { return {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-2a5f8661.js');
6
+ const index$1 = require('./index-c973259c.js');
7
7
 
8
8
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-2a5f8661.js');
6
+ const index$1 = require('./index-c973259c.js');
7
7
 
8
8
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
9
9
 
@@ -11,7 +11,8 @@ export function month(date) {
11
11
  d.setDate(day++);
12
12
  r.push(isoly.Date.create(d));
13
13
  }
14
- result.push(r);
14
+ if (row < 5 || isoly.Date.firstOfMonth(r[0]) == isoly.Date.firstOfMonth(date))
15
+ result.push(r);
15
16
  }
16
17
  return result;
17
18
  }
@@ -23,7 +23,7 @@ export class Calendar {
23
23
  h("thead", null,
24
24
  h("tr", null, generate.weekdays().map(day => (h("th", null, day))))),
25
25
  generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
26
- var _a, _b;
26
+ var _a, _b, _c;
27
27
  return (h("td", { tabindex: 1, onClick: () => {
28
28
  this.valueChanged.emit((this.value = date));
29
29
  this.clickCounter += 1;
@@ -36,9 +36,9 @@ export class Calendar {
36
36
  this.start = date;
37
37
  }
38
38
  }, class: (date == this.value ? ["selected"] : [])
39
- .concat(...(date == Date.now() ? ["today"] : []), date == this.value ? ["selected"] : [], this.doubleInput
40
- ? Date.parse(date) >= Date.parse((_a = this.start) !== null && _a !== void 0 ? _a : "") &&
41
- Date.parse(date) <= Date.parse((_b = this.end) !== null && _b !== void 0 ? _b : "")
39
+ .concat(...(date == Date.now() ? ["today"] : []), Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
40
+ ? Date.parse(date) >= Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
41
+ Date.parse(date) <= Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
42
42
  ? ["dateRange"]
43
43
  : []
44
44
  : "")
@@ -1,35 +1,53 @@
1
1
  :host {
2
- display: block;
2
+ display: block;
3
+ --other-month-opacity: 0.5;
3
4
  }
4
5
  :host > smoothly-input-month {
5
6
  width: calc(100% - 1em);
6
- padding: .5em .5em 0 .5em;
7
+ padding: 0.5em 0.5em 0 0.5em;
7
8
  }
8
9
  th,
9
10
  td {
10
11
  text-align: center;
11
- padding: .5em;
12
+ padding: 0.5em;
12
13
  min-width: 2em;
13
14
  background-color: rgb(var(--smoothly-default-shade));
15
+ cursor: pointer;
16
+ user-select: none;
17
+ }
18
+ td.currentMonth {
19
+ color: rgb(var(--smoothly-default-contrast));
20
+ }
21
+ td:not(.currentMonth) {
22
+ color: rgba(var(--smoothly-default-contrast), var(--other-month-opacity));
23
+ }
24
+ td:nth-child(6):not(.currentMonth).selected,
25
+ td:nth-child(6):not(.currentMonth).dateRange,
26
+ td:nth-child(7):not(.currentMonth).selected,
27
+ td:nth-child(7):not(.currentMonth).dateRange {
28
+ color: rgba(var(--smoothly-default-contrast));
14
29
  }
15
-
16
30
  td:nth-child(6),
17
31
  td:nth-child(7) {
18
- color: rgb(var(--smoothly-light-shade));
32
+ color: rgb(var(--smoothly-danger-tint));
33
+ }
34
+ td:nth-child(6):not(.currentMonth),
35
+ td:nth-child(7):not(.currentMonth) {
36
+ color: rgba(var(--smoothly-danger-tint), var(--other-month-opacity));
19
37
  }
20
38
  td:not(.selected):hover {
21
- color: rgb(var(--smoothly-primary-contrast));
22
- background: rgb(var(--smoothly-primary-tint));
39
+ color: rgb(var(--smoothly-primary-contrast));
40
+ background: rgb(var(--smoothly-primary-tint));
23
41
  }
24
42
  td.selected {
25
- color: rgb(var(--smoothly-primary-contrast));
26
- background: rgb(var(--smoothly-primary-color));
43
+ color: rgb(var(--smoothly-primary-contrast));
44
+ background: rgb(var(--smoothly-primary-color));
27
45
  }
28
46
  td:not(.selected,.dateRange):not(:hover).today {
29
- background: rgb(var(--smoothly-dark-tint));
47
+ background: rgb(var(--smoothly-dark-tint));
30
48
  color: rgb(var(--smoothly-dark-contrast));
31
49
  }
32
50
  td.dateRange {
33
51
  color: rgb(var(--smoothly-primary-contrast));
34
- background: rgb(var(--smoothly-primary-tint));
52
+ background: rgb(var(--smoothly-primary-tint));
35
53
  }
@@ -78,7 +78,7 @@ export class SmoothlyInput {
78
78
  end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
79
79
  direction: backend.selectionDirection ? backend.selectionDirection : "none",
80
80
  } });
81
- if ((!(event.ctrlKey && event.key == "v") && event.key.length == 1) ||
81
+ if ((!((event.ctrlKey || event.metaKey) && event.key == "v") && event.key.length == 1) ||
82
82
  event.key == "ArrowLeft" ||
83
83
  event.key == "ArrowRight" ||
84
84
  event.key == "Delete" ||
@@ -5,23 +5,23 @@ export class MonthSelector {
5
5
  onValueChanged(next) {
6
6
  this.valueChanged.emit(next);
7
7
  }
8
+ adjustMonth(delta) {
9
+ var _a;
10
+ const date = Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : Date.now());
11
+ date.setMonth(date.getMonth() + delta);
12
+ this.value = Date.create(date);
13
+ }
8
14
  render() {
9
15
  var _a, _b;
10
16
  return [
11
- h("button", { onClick: () => this.adjustMonth(-1) },
17
+ h("div", { onClick: () => this.adjustMonth(-1) },
12
18
  h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
13
19
  h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.years((_a = this.value) !== null && _a !== void 0 ? _a : Date.now()).map(year => (h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
14
20
  h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.months((_b = this.value) !== null && _b !== void 0 ? _b : Date.now()).map(month => (h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
15
- h("button", { onClick: () => this.adjustMonth(1) },
21
+ h("div", { onClick: () => this.adjustMonth(1) },
16
22
  h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
17
23
  ];
18
24
  }
19
- adjustMonth(delta) {
20
- var _a;
21
- const date = Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : Date.now());
22
- date.setMonth(date.getMonth() + delta);
23
- this.value = Date.create(date);
24
- }
25
25
  static get is() { return "smoothly-input-month"; }
26
26
  static get encapsulation() { return "scoped"; }
27
27
  static get originalStyleUrls() { return {
@@ -3,12 +3,6 @@
3
3
  justify-content: space-between;
4
4
  font-size: large;
5
5
  }
6
- button {
7
- border: none;
8
- background: none;
9
- cursor: pointer;
10
- font-size: large;
11
- }
12
6
  smoothly-icon {
13
7
  font-size: smaller;
14
8
  }
@@ -31,14 +31,11 @@ export class SmoothlyPicker {
31
31
  : this.select(option);
32
32
  }
33
33
  clearSelection() {
34
- var _a;
35
34
  this.selections = [];
36
35
  this.inputElement.focus();
37
36
  this.keepFocusOnReRender = true;
38
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(option => (option.description = ""));
39
37
  }
40
38
  unselect(selection) {
41
- var _a;
42
39
  const index = this.selections.map(selection => selection.value).indexOf(selection.value);
43
40
  if (index != -1) {
44
41
  this.selections = [
@@ -47,12 +44,8 @@ export class SmoothlyPicker {
47
44
  ];
48
45
  this.keepFocusOnReRender = true;
49
46
  }
50
- const optionIndex = (_a = this.options) === null || _a === void 0 ? void 0 : _a.map(s => s.value).indexOf(selection.value);
51
- if (optionIndex != -1)
52
- this.options[optionIndex].description = "";
53
47
  }
54
48
  select(selection) {
55
- var _a;
56
49
  const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
57
50
  if (isNewSelection)
58
51
  this.selections = this.multiple ? [...this.selections, selection] : [selection];
@@ -60,8 +53,6 @@ export class SmoothlyPicker {
60
53
  this.filterOptions();
61
54
  this.keepFocusOnReRender = true;
62
55
  this.isOpen = this.multiple;
63
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(option => (option.description =
64
- option.value == selection.value ? this.getCheckHtml() : this.multiple ? option.description : ""));
65
56
  }
66
57
  toggleHighlighted() {
67
58
  var _a;
@@ -121,18 +112,22 @@ export class SmoothlyPicker {
121
112
  "--max-height": (_a = this.maxHeight) !== null && _a !== void 0 ? _a : "inherit",
122
113
  "--label-display": this.labelSetting == "hide" ? "none" : "absolute",
123
114
  };
115
+ this.options.forEach(o => {
116
+ o.description = this.selections.map(s => s.value).includes(o.value) ? this.getCheckHtml() : "";
117
+ });
118
+ const options = [
119
+ {
120
+ value: "select-none",
121
+ name: this.selectNoneName,
122
+ description: this.selections.length == 0 ? this.getCheckHtml() : "",
123
+ },
124
+ ...((_b = this.options) !== null && _b !== void 0 ? _b : []),
125
+ ];
124
126
  return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() },
125
127
  h("div", null,
126
128
  h("label", null, this.label),
127
129
  h("input", { type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) })),
128
- h("smoothly-menu-options", { style: { width: "100%" }, optionStyle: Object.assign({ padding: "0 1em", height: "2.5em" }, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, "max-menu-height": this.maxMenuHeight, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: [
129
- {
130
- value: "select-none",
131
- name: this.selectNoneName,
132
- description: this.selections.length == 0 ? this.getCheckHtml() : "",
133
- },
134
- ...((_b = this.options) !== null && _b !== void 0 ? _b : []),
135
- ] })));
130
+ h("smoothly-menu-options", { style: { width: "100%" }, optionStyle: Object.assign({ padding: "0 1em", height: "2.5em" }, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, "max-menu-height": this.maxMenuHeight, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
136
131
  }
137
132
  static get is() { return "smoothly-picker"; }
138
133
  static get encapsulation() { return "shadow"; }
@@ -25,8 +25,9 @@ export class TableExpandableCell {
25
25
  render() {
26
26
  return (h(Host, { style: { textAlign: this.align } },
27
27
  h("slot", null),
28
- h("tr", { ref: e => (this.expansionElement = e) }, this.open ? (h("td", { colSpan: 500 },
29
- h("slot", { name: "detail" }))) : ([]))));
28
+ h("tr", { ref: e => (this.expansionElement = e) },
29
+ h("td", { colSpan: 500, class: !this.open ? "hide" : "" },
30
+ h("slot", { name: "detail" })))));
30
31
  }
31
32
  static get is() { return "smoothly-table-expandable-cell"; }
32
33
  static get encapsulation() { return "scoped"; }
@@ -2,6 +2,6 @@
2
2
  display: table-cell;
3
3
  padding: 0.5em;
4
4
  }
5
- :host > tr {
5
+ .hide {
6
6
  display: none;
7
7
  }