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
@@ -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],"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);
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);
127
127
  });
@@ -30,12 +30,12 @@ export function months(current) {
30
30
  const day = new globalThis.Date(current);
31
31
  const result = [];
32
32
  for (let i = 0; i < 12; i++) {
33
- day.setMonth(i);
33
+ day.setMonth(i, 28);
34
34
  const date = isoly.Date.create(day);
35
35
  result.push({
36
36
  date,
37
37
  name: day.toLocaleString(undefined, { month: "long" }),
38
- selected: date == current,
38
+ selected: date.substr(0, 7) == current.substr(0, 7),
39
39
  });
40
40
  }
41
41
  return result;
@@ -12,6 +12,18 @@ export class Calendar {
12
12
  onEnd(next) {
13
13
  this.endChanged.emit(next);
14
14
  }
15
+ onClick(date) {
16
+ this.valueChanged.emit((this.value = date));
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
24
+ this.start = date;
25
+ }
26
+ }
15
27
  render() {
16
28
  var _a, _b;
17
29
  return [
@@ -24,24 +36,13 @@ export class Calendar {
24
36
  h("tr", null, generate.weekdays().map(day => (h("th", null, day))))),
25
37
  generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
26
38
  var _a, _b, _c;
27
- return (h("td", { tabindex: 1, onClick: () => {
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
- }, class: (date == this.value ? ["selected"] : [])
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"] : [])
39
40
  .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 : "")
41
+ ? date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
42
42
  ? ["dateRange"]
43
43
  : []
44
44
  : "")
45
+ .concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
45
46
  .join(" ") }, date.substring(8, 10)));
46
47
  }))))),
47
48
  ];
@@ -144,6 +145,50 @@ export class Calendar {
144
145
  "attribute": "end",
145
146
  "reflect": false
146
147
  },
148
+ "max": {
149
+ "type": "string",
150
+ "mutable": true,
151
+ "complexType": {
152
+ "original": "Date",
153
+ "resolved": "string",
154
+ "references": {
155
+ "Date": {
156
+ "location": "import",
157
+ "path": "isoly"
158
+ }
159
+ }
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": ""
166
+ },
167
+ "attribute": "max",
168
+ "reflect": false
169
+ },
170
+ "min": {
171
+ "type": "string",
172
+ "mutable": true,
173
+ "complexType": {
174
+ "original": "Date",
175
+ "resolved": "string",
176
+ "references": {
177
+ "Date": {
178
+ "location": "import",
179
+ "path": "isoly"
180
+ }
181
+ }
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": ""
188
+ },
189
+ "attribute": "min",
190
+ "reflect": false
191
+ },
147
192
  "doubleInput": {
148
193
  "type": "boolean",
149
194
  "mutable": false,
@@ -35,7 +35,7 @@ td:nth-child(6):not(.currentMonth),
35
35
  td:nth-child(7):not(.currentMonth) {
36
36
  color: rgba(var(--smoothly-danger-tint), var(--other-month-opacity));
37
37
  }
38
- td:not(.selected):hover {
38
+ td:not(.selected,.disable):hover {
39
39
  color: rgb(var(--smoothly-primary-contrast));
40
40
  background: rgb(var(--smoothly-primary-tint));
41
41
  }
@@ -51,3 +51,9 @@ td.dateRange {
51
51
  color: rgb(var(--smoothly-primary-contrast));
52
52
  background: rgb(var(--smoothly-primary-tint));
53
53
  }
54
+ td.disable {
55
+ cursor: not-allowed;
56
+ background-color: rgb(var(--smoothly-default-tint), 0.5);
57
+ color: rgb(var(--smoothly-default-contrast), 0.5);
58
+ }
59
+
@@ -15,7 +15,7 @@ export class InputDate {
15
15
  h("smoothly-calendar", { doubleInput: false, value: (_a = this.value) !== null && _a !== void 0 ? _a : Date.now(), onValueChanged: event => {
16
16
  this.value = event.detail;
17
17
  event.stopPropagation();
18
- } }))) : ([]),
18
+ }, max: this.max, min: this.min }))) : ([]),
19
19
  ];
20
20
  }
21
21
  static get is() { return "smoothly-input-date"; }
@@ -65,6 +65,50 @@ export class InputDate {
65
65
  },
66
66
  "attribute": "open",
67
67
  "reflect": false
68
+ },
69
+ "max": {
70
+ "type": "string",
71
+ "mutable": true,
72
+ "complexType": {
73
+ "original": "Date",
74
+ "resolved": "string",
75
+ "references": {
76
+ "Date": {
77
+ "location": "import",
78
+ "path": "isoly"
79
+ }
80
+ }
81
+ },
82
+ "required": false,
83
+ "optional": false,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": ""
87
+ },
88
+ "attribute": "max",
89
+ "reflect": false
90
+ },
91
+ "min": {
92
+ "type": "string",
93
+ "mutable": true,
94
+ "complexType": {
95
+ "original": "Date",
96
+ "resolved": "string",
97
+ "references": {
98
+ "Date": {
99
+ "location": "import",
100
+ "path": "isoly"
101
+ }
102
+ }
103
+ },
104
+ "required": false,
105
+ "optional": false,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": ""
109
+ },
110
+ "attribute": "min",
111
+ "reflect": false
68
112
  }
69
113
  }; }
70
114
  static get events() { return [{
@@ -26,7 +26,7 @@ export class InputDateRange {
26
26
  h("smoothly-calendar", { doubleInput: true, value: (_a = this.value) !== null && _a !== void 0 ? _a : Date.now(), onValueChanged: event => {
27
27
  this.value = event.detail;
28
28
  event.stopPropagation();
29
- } }))) : ([]),
29
+ }, max: this.max, min: this.min }))) : ([]),
30
30
  ];
31
31
  }
32
32
  static get is() { return "smoothly-input-date-range"; }
@@ -104,6 +104,50 @@ export class InputDateRange {
104
104
  "attribute": "end",
105
105
  "reflect": false
106
106
  },
107
+ "max": {
108
+ "type": "string",
109
+ "mutable": true,
110
+ "complexType": {
111
+ "original": "Date",
112
+ "resolved": "string",
113
+ "references": {
114
+ "Date": {
115
+ "location": "import",
116
+ "path": "isoly"
117
+ }
118
+ }
119
+ },
120
+ "required": false,
121
+ "optional": false,
122
+ "docs": {
123
+ "tags": [],
124
+ "text": ""
125
+ },
126
+ "attribute": "max",
127
+ "reflect": false
128
+ },
129
+ "min": {
130
+ "type": "string",
131
+ "mutable": true,
132
+ "complexType": {
133
+ "original": "Date",
134
+ "resolved": "string",
135
+ "references": {
136
+ "Date": {
137
+ "location": "import",
138
+ "path": "isoly"
139
+ }
140
+ }
141
+ },
142
+ "required": false,
143
+ "optional": false,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": ""
147
+ },
148
+ "attribute": "min",
149
+ "reflect": false
150
+ },
107
151
  "open": {
108
152
  "type": "boolean",
109
153
  "mutable": true,
@@ -26,8 +26,8 @@ export class SmoothlySelectDemo {
26
26
  h("option", { value: "1" }, "1"),
27
27
  h("option", { value: "2" }, "2"),
28
28
  h("option", { value: "3" }, "3")),
29
- h("smoothly-input-date", null, "Date"),
30
- h("smoothly-input-date-range", null),
29
+ h("smoothly-input-date", { max: "2021-12-30", min: "2021-10-10" }, "Date"),
30
+ h("smoothly-input-date-range", { max: "2021-12-30", min: "2021-10-10" }),
31
31
  h("smoothly-selector", null,
32
32
  h("smoothly-item", { value: "1" }, "January"),
33
33
  h("smoothly-item", { value: "2" }, "February"),
@@ -1,3 +1,3 @@
1
1
  export { App } from "./components/App";
2
2
  export { ClientIdentifier, Message, Notice, Trigger } from "./model";
3
- export { toCommaRgb } from "./utilities";
3
+ export { Cosmetic } from "./utilities";
@@ -0,0 +1,90 @@
1
+ import { Hex } from "./Hex";
2
+ import { Hsl } from "./Hsl";
3
+ import { Name as ColorName, Names } from "./Name";
4
+ import { Rgb } from "./Rgb";
5
+ export var CommaRgb;
6
+ (function (CommaRgb) {
7
+ function is(value) {
8
+ const values = typeof value == "string" ? value.split(",") : [];
9
+ return (values.length == 3 &&
10
+ values.every((value) => {
11
+ var _a;
12
+ return !Number.isNaN(value) &&
13
+ ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
14
+ Number(value) >= 0 &&
15
+ Number(value) <= 255;
16
+ }));
17
+ }
18
+ CommaRgb.is = is;
19
+ function from(color) {
20
+ let result;
21
+ const colorWithoutSpace = typeof color == "string" ? color.replace(/ /g, "").toLowerCase() : undefined;
22
+ if (!colorWithoutSpace)
23
+ result = undefined;
24
+ else if (CommaRgb.is(colorWithoutSpace))
25
+ result = colorWithoutSpace;
26
+ else if (Hex.is(colorWithoutSpace))
27
+ result = fromHex(colorWithoutSpace);
28
+ else if (Rgb.is(colorWithoutSpace))
29
+ result = fromRgb(colorWithoutSpace);
30
+ else if (ColorName.is(colorWithoutSpace))
31
+ result = fromHex(Names[colorWithoutSpace]);
32
+ else if (Hsl.is(colorWithoutSpace))
33
+ result = fromHsl(colorWithoutSpace);
34
+ return result;
35
+ }
36
+ CommaRgb.from = from;
37
+ function fromHex(hex) {
38
+ let result = "0,0,0";
39
+ if (hex.length == 7)
40
+ result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
41
+ else if (hex.length == 4)
42
+ result = fromHex(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
43
+ return result;
44
+ }
45
+ CommaRgb.fromHex = fromHex;
46
+ function fromRgb(rgb) {
47
+ return rgb.substring(4, rgb.length - 1);
48
+ }
49
+ CommaRgb.fromRgb = fromRgb;
50
+ function fromHsl(hsl) {
51
+ let result = "";
52
+ let h, s, l;
53
+ let r, g, b;
54
+ const HSL = hsl
55
+ .substring(4, hsl.length - 1)
56
+ .split(",")
57
+ .map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
58
+ if (HSL.length == 3) {
59
+ h = HSL[0] / 360;
60
+ s = HSL[1] / 100;
61
+ l = HSL[2] / 100;
62
+ if (s == 0)
63
+ r = g = b = l;
64
+ else {
65
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
66
+ const p = 2 * l - q;
67
+ r = hue2rgb(p, q, h + 1 / 3);
68
+ g = hue2rgb(p, q, h);
69
+ b = hue2rgb(p, q, h - 1 / 3);
70
+ }
71
+ result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
72
+ }
73
+ return result;
74
+ }
75
+ CommaRgb.fromHsl = fromHsl;
76
+ function hue2rgb(p, q, t) {
77
+ let result = p;
78
+ if (t < 0)
79
+ t += 1;
80
+ if (t > 1)
81
+ t -= 1;
82
+ if (t < 1 / 6)
83
+ result = p + (q - p) * 6 * t;
84
+ else if (t < 1 / 2)
85
+ result = q;
86
+ else if (t < 2 / 3)
87
+ result = p + (q - p) * (2 / 3 - t) * 6;
88
+ return result;
89
+ }
90
+ })(CommaRgb || (CommaRgb = {}));
@@ -0,0 +1,11 @@
1
+ export var Hex;
2
+ (function (Hex) {
3
+ function is(value) {
4
+ const matchArray = (typeof value == "string" && value.match(/[0-9a-fA-F]/g)) || undefined;
5
+ return (typeof value == "string" &&
6
+ value.length > 3 &&
7
+ value[0] == "#" &&
8
+ ((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6));
9
+ }
10
+ Hex.is = is;
11
+ })(Hex || (Hex = {}));
@@ -0,0 +1,32 @@
1
+ export var Hsl;
2
+ (function (Hsl) {
3
+ function is(value) {
4
+ const values = typeof value == "string" && value.length > 11 ? value.substring(4, value.length - 1).split(",") : [];
5
+ return (typeof value == "string" &&
6
+ value.length > 11 &&
7
+ value.substr(0, 4) == "hsl(" &&
8
+ value.substr(value.length - 1, 1) == ")" &&
9
+ values.length == 3 &&
10
+ values.every((single, index) => {
11
+ var _a, _b;
12
+ let result = false;
13
+ if (index == 0)
14
+ result =
15
+ !Number.isNaN(single) &&
16
+ ((_a = single.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == single.length &&
17
+ Number(single) >= 0 &&
18
+ Number(single) <= 360;
19
+ else {
20
+ const number = single.substr(0, single.length - 1);
21
+ result =
22
+ single[single.length - 1] == "%" &&
23
+ !Number.isNaN(number) &&
24
+ ((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
25
+ Number(number) >= 0 &&
26
+ Number(number) <= 100;
27
+ }
28
+ return result;
29
+ }));
30
+ }
31
+ Hsl.is = is;
32
+ })(Hsl || (Hsl = {}));
@@ -1,4 +1,4 @@
1
- export const colorNames = {
1
+ export const Names = {
2
2
  aliceblue: "#f0f8ff",
3
3
  antiquewhite: "#faebd7",
4
4
  aqua: "#00ffff",
@@ -148,3 +148,11 @@ export const colorNames = {
148
148
  yellow: "#ffff00",
149
149
  yellowgreen: "#9acd32",
150
150
  };
151
+ export var Name;
152
+ (function (Name) {
153
+ Name.types = () => Object.keys(Names);
154
+ function is(value) {
155
+ return typeof value == "string" && Name.types().includes(value.toLowerCase());
156
+ }
157
+ Name.is = is;
158
+ })(Name || (Name = {}));
@@ -0,0 +1,19 @@
1
+ export var Rgb;
2
+ (function (Rgb) {
3
+ function is(value) {
4
+ const values = typeof value == "string" && value.length > 9 ? value.substring(4, value.length - 1).split(",") : [];
5
+ return (typeof value == "string" &&
6
+ value.length > 9 &&
7
+ value.substr(0, 4) == "rgb(" &&
8
+ value.substr(value.length - 1, 1) == ")" &&
9
+ values.length == 3 &&
10
+ values.every((value) => {
11
+ var _a;
12
+ return !Number.isNaN(value) &&
13
+ ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
14
+ Number(value) >= 0 &&
15
+ Number(value) <= 255;
16
+ }));
17
+ }
18
+ Rgb.is = is;
19
+ })(Rgb || (Rgb = {}));
@@ -0,0 +1,23 @@
1
+ import { CommaRgb as ColorCommaRgb } from "./CommaRgb";
2
+ import { Hex as ColorHex } from "./Hex";
3
+ import { Hsl as ColorHsl } from "./Hsl";
4
+ import { Name as ColorName, Names as ColorNames } from "./Name";
5
+ import { Rgb as ColorRgb } from "./Rgb";
6
+ export var Color;
7
+ (function (Color) {
8
+ function is(value) {
9
+ return (typeof value == "string" &&
10
+ (ColorCommaRgb.is(value) || ColorHex.is(value) || ColorHsl.is(value) || ColorName.is(value) || ColorRgb.is(value)));
11
+ }
12
+ Color.is = is;
13
+ function from(value) {
14
+ return is(value) ? value : undefined;
15
+ }
16
+ Color.from = from;
17
+ Color.Names = ColorNames;
18
+ Color.Name = ColorName;
19
+ Color.CommaRgb = ColorCommaRgb;
20
+ Color.Rgb = ColorRgb;
21
+ Color.Hex = ColorHex;
22
+ Color.Hsl = ColorHsl;
23
+ })(Color || (Color = {}));
@@ -0,0 +1,40 @@
1
+ import { Color as CosmeticColor } from "./Color";
2
+ function reduce(types, value) {
3
+ return types.reduce((r, c) => typeof value == "object" && value != null && typeof value[c] == "string"
4
+ ? Object.assign(Object.assign({}, r), { [c]: value[c] }) : r, {});
5
+ }
6
+ export var Cosmetic;
7
+ (function (Cosmetic) {
8
+ Cosmetic.types = Cosmetic;
9
+ function from(value) {
10
+ let result = {};
11
+ if (typeof value == "object" && value) {
12
+ result = {
13
+ text: reduce(["background", "color"], value.text),
14
+ border: reduce(["background", "color", "style", "radius", "width"], value.border),
15
+ gap: typeof value.gap == "string" ? value.gap : undefined,
16
+ dangerColor: typeof value.dangerColor == "string"
17
+ ? value.dangerColor
18
+ : typeof value.danger_color == "string"
19
+ ? value.danger_color
20
+ : undefined,
21
+ fontFamily: typeof value.fontFamily == "string"
22
+ ? value.fontFamily
23
+ : typeof value.font_family == "string"
24
+ ? value.font_family
25
+ : undefined,
26
+ background: typeof value.background == "string" ? value.background : undefined,
27
+ };
28
+ Object.keys(result).forEach((key) => {
29
+ var _a;
30
+ if (result[key] == undefined ||
31
+ (typeof result[key] == "object" && result[key] && Object.keys((_a = result[key]) !== null && _a !== void 0 ? _a : {}).length == 0)) {
32
+ delete result[key];
33
+ }
34
+ });
35
+ }
36
+ return result;
37
+ }
38
+ Cosmetic.from = from;
39
+ Cosmetic.Color = CosmeticColor;
40
+ })(Cosmetic || (Cosmetic = {}));
@@ -1 +1 @@
1
- export { toCommaRgb } from "./colorTransform";
1
+ export { Cosmetic } from "./Cosmetic";