smoothly 0.1.114 → 0.1.115

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 (245) hide show
  1. package/dist/cjs/{Notice-9c2b52b7.js → Notice-839702d8.js} +34 -26
  2. package/dist/cjs/{Trigger-74bd1ee8.js → Trigger-cf376531.js} +55 -146
  3. package/dist/cjs/{index-41a36ce2.js → index-1c61bdd3.js} +27 -1
  4. package/dist/cjs/index.cjs.js +20 -8
  5. package/dist/cjs/loader.cjs.js +3 -19
  6. package/dist/cjs/{smoothly-accordion_50.cjs.entry.js → smoothly-accordion_51.cjs.entry.js} +7689 -1483
  7. package/dist/cjs/smoothly-google-font.cjs.entry.js +2 -2
  8. package/dist/cjs/smoothly-radio-group.cjs.entry.js +2 -2
  9. package/dist/cjs/smoothly-reorder.cjs.entry.js +2 -2
  10. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +5 -5
  11. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +5 -5
  12. package/dist/cjs/smoothly.cjs.js +5 -113
  13. package/dist/collection/collection-manifest.json +3 -2
  14. package/dist/collection/components/app-demo/index.js +6 -1
  15. package/dist/collection/components/button/index.js +168 -0
  16. package/dist/collection/components/button/style.css +49 -0
  17. package/dist/collection/components/picker/index.js +10 -6
  18. package/dist/collection/components/trigger/style.css +3 -3
  19. package/dist/custom-elements/index.d.ts +6 -0
  20. package/dist/custom-elements/index.js +7776 -2966
  21. package/dist/esm/{Notice-4131b4e0.js → Notice-608b552c.js} +34 -26
  22. package/dist/esm/{Trigger-d7b181ec.js → Trigger-365408f0.js} +55 -146
  23. package/dist/esm/{index-dcb2b612.js → index-a3737440.js} +27 -1
  24. package/dist/esm/index.js +17 -4
  25. package/dist/esm/loader.js +3 -19
  26. package/dist/esm/polyfills/css-shim.js +1 -1
  27. package/dist/esm/{smoothly-accordion_50.entry.js → smoothly-accordion_51.entry.js} +7689 -1484
  28. package/dist/esm/smoothly-google-font.entry.js +2 -2
  29. package/dist/esm/smoothly-radio-group.entry.js +2 -2
  30. package/dist/esm/smoothly-reorder.entry.js +2 -2
  31. package/dist/esm/smoothly-trigger-sink.entry.js +3 -3
  32. package/dist/esm/smoothly-trigger-source.entry.js +3 -3
  33. package/dist/esm/smoothly.js +5 -113
  34. package/dist/smoothly/index.esm.js +1 -376
  35. package/dist/smoothly/p-0215b4da.entry.js +1 -0
  36. package/dist/smoothly/{p-074a0448.js → p-0cba3e3d.js} +1 -1
  37. package/dist/smoothly/p-18a1063c.entry.js +1 -0
  38. package/dist/smoothly/p-6ca0d36c.js +1 -0
  39. package/dist/smoothly/p-6f009ac9.entry.js +1 -0
  40. package/dist/smoothly/p-7a30d9b8.js +1 -0
  41. package/dist/smoothly/p-8ae38136.entry.js +1 -0
  42. package/dist/smoothly/p-993534fa.entry.js +1 -0
  43. package/dist/smoothly/p-eec1c703.entry.js +1 -0
  44. package/dist/smoothly/smoothly.esm.js +1 -125
  45. package/dist/types/components/button/index.d.ts +11 -0
  46. package/dist/types/components.d.ts +27 -0
  47. package/dist/types/stencil-public-runtime.d.ts +6 -4
  48. package/package.json +17 -17
  49. package/dist/cjs/App-339acc9b.js +0 -647
  50. package/dist/cjs/_commonjsHelpers-10109b76.js +0 -48
  51. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  52. package/dist/cjs/css-shim-88cc6900.js +0 -6
  53. package/dist/cjs/dom-95afd968.js +0 -75
  54. package/dist/cjs/generate-f9a36f25.js +0 -66
  55. package/dist/cjs/index-138c41c2.js +0 -3066
  56. package/dist/cjs/index-36da3c23.js +0 -1673
  57. package/dist/cjs/index-40d009d5.js +0 -1354
  58. package/dist/cjs/index-ac32385c.js +0 -18850
  59. package/dist/cjs/shadow-css-71d0f821.js +0 -391
  60. package/dist/cjs/smoothly-accordion-item.cjs.entry.js +0 -54
  61. package/dist/cjs/smoothly-accordion.cjs.entry.js +0 -55
  62. package/dist/cjs/smoothly-app-demo.cjs.entry.js +0 -29
  63. package/dist/cjs/smoothly-app.cjs.entry.js +0 -19
  64. package/dist/cjs/smoothly-backtotop.cjs.entry.js +0 -37
  65. package/dist/cjs/smoothly-calendar.cjs.entry.js +0 -95
  66. package/dist/cjs/smoothly-checkbox.cjs.entry.js +0 -18671
  67. package/dist/cjs/smoothly-dialog-demo.cjs.entry.js +0 -16
  68. package/dist/cjs/smoothly-dialog.cjs.entry.js +0 -38
  69. package/dist/cjs/smoothly-display-amount.cjs.entry.js +0 -59
  70. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +0 -20
  71. package/dist/cjs/smoothly-display-demo.cjs.entry.js +0 -25
  72. package/dist/cjs/smoothly-display.cjs.entry.js +0 -41
  73. package/dist/cjs/smoothly-frame.cjs.entry.js +0 -50
  74. package/dist/cjs/smoothly-icon-demo.cjs.entry.js +0 -491
  75. package/dist/cjs/smoothly-icon.cjs.entry.js +0 -52
  76. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +0 -50
  77. package/dist/cjs/smoothly-input-date.cjs.entry.js +0 -44
  78. package/dist/cjs/smoothly-input-demo.cjs.entry.js +0 -19
  79. package/dist/cjs/smoothly-input-month.cjs.entry.js +0 -41
  80. package/dist/cjs/smoothly-input.cjs.entry.js +0 -202
  81. package/dist/cjs/smoothly-item.cjs.entry.js +0 -43
  82. package/dist/cjs/smoothly-menu-options.cjs.entry.js +0 -108
  83. package/dist/cjs/smoothly-notification.cjs.entry.js +0 -67
  84. package/dist/cjs/smoothly-notifier.cjs.entry.js +0 -29
  85. package/dist/cjs/smoothly-option.cjs.entry.js +0 -33
  86. package/dist/cjs/smoothly-picker.cjs.entry.js +0 -151
  87. package/dist/cjs/smoothly-popup.cjs.entry.js +0 -38
  88. package/dist/cjs/smoothly-quiet.cjs.entry.js +0 -19
  89. package/dist/cjs/smoothly-radio.cjs.entry.js +0 -28
  90. package/dist/cjs/smoothly-room.cjs.entry.js +0 -16
  91. package/dist/cjs/smoothly-select-demo.cjs.entry.js +0 -86
  92. package/dist/cjs/smoothly-select.cjs.entry.js +0 -31
  93. package/dist/cjs/smoothly-selector.cjs.entry.js +0 -119
  94. package/dist/cjs/smoothly-skeleton.cjs.entry.js +0 -27
  95. package/dist/cjs/smoothly-spinner.cjs.entry.js +0 -24
  96. package/dist/cjs/smoothly-submit.cjs.entry.js +0 -60
  97. package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
  98. package/dist/cjs/smoothly-tab-switch.cjs.entry.js +0 -32
  99. package/dist/cjs/smoothly-tab.cjs.entry.js +0 -37
  100. package/dist/cjs/smoothly-table-cell.cjs.entry.js +0 -19
  101. package/dist/cjs/smoothly-table-demo.cjs.entry.js +0 -22
  102. package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +0 -45
  103. package/dist/cjs/smoothly-table-expandable-row.cjs.entry.js +0 -32
  104. package/dist/cjs/smoothly-table-header.cjs.entry.js +0 -41
  105. package/dist/cjs/smoothly-table-row.cjs.entry.js +0 -38
  106. package/dist/cjs/smoothly-table.cjs.entry.js +0 -26
  107. package/dist/cjs/smoothly-trigger.cjs.entry.js +0 -36
  108. package/dist/cjs/smoothly-tuple.cjs.entry.js +0 -16
  109. package/dist/cjs/smoothly-urlencoded.cjs.entry.js +0 -19
  110. package/dist/esm/App-22187759.js +0 -645
  111. package/dist/esm/_commonjsHelpers-8fe71198.js +0 -44
  112. package/dist/esm/app-globals-0f993ce5.js +0 -3
  113. package/dist/esm/css-shim-c64026cd.js +0 -4
  114. package/dist/esm/dom-a712b575.js +0 -73
  115. package/dist/esm/generate-50b98474.js +0 -61
  116. package/dist/esm/index-02a70ac1.js +0 -3027
  117. package/dist/esm/index-a5a08f46.js +0 -18848
  118. package/dist/esm/index-c8b5d468.js +0 -1349
  119. package/dist/esm/index-d1360bcf.js +0 -1671
  120. package/dist/esm/shadow-css-1e16431b.js +0 -389
  121. package/dist/esm/smoothly-accordion-item.entry.js +0 -50
  122. package/dist/esm/smoothly-accordion.entry.js +0 -51
  123. package/dist/esm/smoothly-app-demo.entry.js +0 -25
  124. package/dist/esm/smoothly-app.entry.js +0 -15
  125. package/dist/esm/smoothly-backtotop.entry.js +0 -33
  126. package/dist/esm/smoothly-calendar.entry.js +0 -91
  127. package/dist/esm/smoothly-checkbox.entry.js +0 -18667
  128. package/dist/esm/smoothly-dialog-demo.entry.js +0 -12
  129. package/dist/esm/smoothly-dialog.entry.js +0 -34
  130. package/dist/esm/smoothly-display-amount.entry.js +0 -55
  131. package/dist/esm/smoothly-display-date-time.entry.js +0 -16
  132. package/dist/esm/smoothly-display-demo.entry.js +0 -21
  133. package/dist/esm/smoothly-display.entry.js +0 -37
  134. package/dist/esm/smoothly-frame.entry.js +0 -46
  135. package/dist/esm/smoothly-icon-demo.entry.js +0 -487
  136. package/dist/esm/smoothly-icon.entry.js +0 -48
  137. package/dist/esm/smoothly-input-date-range.entry.js +0 -46
  138. package/dist/esm/smoothly-input-date.entry.js +0 -40
  139. package/dist/esm/smoothly-input-demo.entry.js +0 -15
  140. package/dist/esm/smoothly-input-month.entry.js +0 -37
  141. package/dist/esm/smoothly-input.entry.js +0 -198
  142. package/dist/esm/smoothly-item.entry.js +0 -39
  143. package/dist/esm/smoothly-menu-options.entry.js +0 -104
  144. package/dist/esm/smoothly-notification.entry.js +0 -63
  145. package/dist/esm/smoothly-notifier.entry.js +0 -25
  146. package/dist/esm/smoothly-option.entry.js +0 -29
  147. package/dist/esm/smoothly-picker.entry.js +0 -147
  148. package/dist/esm/smoothly-popup.entry.js +0 -34
  149. package/dist/esm/smoothly-quiet.entry.js +0 -15
  150. package/dist/esm/smoothly-radio.entry.js +0 -24
  151. package/dist/esm/smoothly-room.entry.js +0 -12
  152. package/dist/esm/smoothly-select-demo.entry.js +0 -82
  153. package/dist/esm/smoothly-select.entry.js +0 -27
  154. package/dist/esm/smoothly-selector.entry.js +0 -115
  155. package/dist/esm/smoothly-skeleton.entry.js +0 -23
  156. package/dist/esm/smoothly-spinner.entry.js +0 -20
  157. package/dist/esm/smoothly-submit.entry.js +0 -56
  158. package/dist/esm/smoothly-svg.entry.js +0 -37
  159. package/dist/esm/smoothly-tab-switch.entry.js +0 -28
  160. package/dist/esm/smoothly-tab.entry.js +0 -33
  161. package/dist/esm/smoothly-table-cell.entry.js +0 -15
  162. package/dist/esm/smoothly-table-demo.entry.js +0 -18
  163. package/dist/esm/smoothly-table-expandable-cell.entry.js +0 -41
  164. package/dist/esm/smoothly-table-expandable-row.entry.js +0 -28
  165. package/dist/esm/smoothly-table-header.entry.js +0 -37
  166. package/dist/esm/smoothly-table-row.entry.js +0 -34
  167. package/dist/esm/smoothly-table.entry.js +0 -22
  168. package/dist/esm/smoothly-trigger.entry.js +0 -32
  169. package/dist/esm/smoothly-tuple.entry.js +0 -12
  170. package/dist/esm/smoothly-urlencoded.entry.js +0 -15
  171. package/dist/smoothly/App-22187759.js +0 -645
  172. package/dist/smoothly/GoogleFont-8474516b.js +0 -21
  173. package/dist/smoothly/_commonjsHelpers-8fe71198.js +0 -44
  174. package/dist/smoothly/app-globals-0f993ce5.js +0 -3
  175. package/dist/smoothly/css-shim-c64026cd.js +0 -4
  176. package/dist/smoothly/dom-a712b575.js +0 -73
  177. package/dist/smoothly/generate-50b98474.js +0 -61
  178. package/dist/smoothly/index-02a70ac1.js +0 -3027
  179. package/dist/smoothly/index-a5a08f46.js +0 -18848
  180. package/dist/smoothly/index-c8b5d468.js +0 -1349
  181. package/dist/smoothly/index-d1360bcf.js +0 -1671
  182. package/dist/smoothly/p-0bad2c46.entry.js +0 -1
  183. package/dist/smoothly/p-0c1e9588.entry.js +0 -1
  184. package/dist/smoothly/p-14232157.entry.js +0 -1
  185. package/dist/smoothly/p-19518931.js +0 -1
  186. package/dist/smoothly/p-22d4d5a7.entry.js +0 -1
  187. package/dist/smoothly/p-2cda1784.js +0 -1
  188. package/dist/smoothly/p-9fa3ab06.entry.js +0 -1
  189. package/dist/smoothly/p-b8a3e273.entry.js +0 -1
  190. package/dist/smoothly/shadow-css-1e16431b.js +0 -389
  191. package/dist/smoothly/smoothly-accordion-item.entry.js +0 -50
  192. package/dist/smoothly/smoothly-accordion.entry.js +0 -51
  193. package/dist/smoothly/smoothly-app-demo.entry.js +0 -25
  194. package/dist/smoothly/smoothly-app.entry.js +0 -15
  195. package/dist/smoothly/smoothly-backtotop.entry.js +0 -33
  196. package/dist/smoothly/smoothly-calendar.entry.js +0 -91
  197. package/dist/smoothly/smoothly-checkbox.entry.js +0 -18667
  198. package/dist/smoothly/smoothly-dialog-demo.entry.js +0 -12
  199. package/dist/smoothly/smoothly-dialog.entry.js +0 -34
  200. package/dist/smoothly/smoothly-display-amount.entry.js +0 -55
  201. package/dist/smoothly/smoothly-display-date-time.entry.js +0 -16
  202. package/dist/smoothly/smoothly-display-demo.entry.js +0 -21
  203. package/dist/smoothly/smoothly-display.entry.js +0 -37
  204. package/dist/smoothly/smoothly-frame.entry.js +0 -46
  205. package/dist/smoothly/smoothly-google-font.entry.js +0 -13
  206. package/dist/smoothly/smoothly-icon-demo.entry.js +0 -487
  207. package/dist/smoothly/smoothly-icon.entry.js +0 -48
  208. package/dist/smoothly/smoothly-input-date-range.entry.js +0 -46
  209. package/dist/smoothly/smoothly-input-date.entry.js +0 -40
  210. package/dist/smoothly/smoothly-input-demo.entry.js +0 -15
  211. package/dist/smoothly/smoothly-input-month.entry.js +0 -37
  212. package/dist/smoothly/smoothly-input.entry.js +0 -198
  213. package/dist/smoothly/smoothly-item.entry.js +0 -39
  214. package/dist/smoothly/smoothly-menu-options.entry.js +0 -104
  215. package/dist/smoothly/smoothly-notification.entry.js +0 -63
  216. package/dist/smoothly/smoothly-notifier.entry.js +0 -25
  217. package/dist/smoothly/smoothly-option.entry.js +0 -29
  218. package/dist/smoothly/smoothly-picker.entry.js +0 -147
  219. package/dist/smoothly/smoothly-popup.entry.js +0 -34
  220. package/dist/smoothly/smoothly-quiet.entry.js +0 -15
  221. package/dist/smoothly/smoothly-radio-group.entry.js +0 -16
  222. package/dist/smoothly/smoothly-radio.entry.js +0 -24
  223. package/dist/smoothly/smoothly-reorder.entry.js +0 -99
  224. package/dist/smoothly/smoothly-room.entry.js +0 -12
  225. package/dist/smoothly/smoothly-select-demo.entry.js +0 -82
  226. package/dist/smoothly/smoothly-select.entry.js +0 -27
  227. package/dist/smoothly/smoothly-selector.entry.js +0 -115
  228. package/dist/smoothly/smoothly-skeleton.entry.js +0 -23
  229. package/dist/smoothly/smoothly-spinner.entry.js +0 -20
  230. package/dist/smoothly/smoothly-submit.entry.js +0 -56
  231. package/dist/smoothly/smoothly-svg.entry.js +0 -37
  232. package/dist/smoothly/smoothly-tab-switch.entry.js +0 -28
  233. package/dist/smoothly/smoothly-tab.entry.js +0 -33
  234. package/dist/smoothly/smoothly-table-cell.entry.js +0 -15
  235. package/dist/smoothly/smoothly-table-demo.entry.js +0 -18
  236. package/dist/smoothly/smoothly-table-expandable-cell.entry.js +0 -41
  237. package/dist/smoothly/smoothly-table-expandable-row.entry.js +0 -28
  238. package/dist/smoothly/smoothly-table-header.entry.js +0 -37
  239. package/dist/smoothly/smoothly-table-row.entry.js +0 -34
  240. package/dist/smoothly/smoothly-table.entry.js +0 -22
  241. package/dist/smoothly/smoothly-trigger-sink.entry.js +0 -29
  242. package/dist/smoothly/smoothly-trigger-source.entry.js +0 -28
  243. package/dist/smoothly/smoothly-trigger.entry.js +0 -32
  244. package/dist/smoothly/smoothly-tuple.entry.js +0 -12
  245. package/dist/smoothly/smoothly-urlencoded.entry.js +0 -15
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
- const index$1 = require('./index-ac32385c.js');
7
- const generate = require('./generate-f9a36f25.js');
8
- require('./_commonjsHelpers-10109b76.js');
9
-
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
-
12
- let MonthSelector = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.valueChanged = index.createEvent(this, "valueChanged", 7);
16
- }
17
- onValueChanged(next) {
18
- this.valueChanged.emit(next);
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
- }
26
- render() {
27
- var _a, _b;
28
- return [
29
- index.h("div", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
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)))),
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)))),
32
- index.h("div", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
33
- ];
34
- }
35
- static get watchers() { return {
36
- "value": ["onValueChanged"]
37
- }; }
38
- };
39
- MonthSelector.style = styleCss;
40
-
41
- exports.smoothly_input_month = MonthSelector;
@@ -1,202 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
- const index$2 = require('./index-ac32385c.js');
7
- const index$1 = require('./index-36da3c23.js');
8
- require('./_commonjsHelpers-10109b76.js');
9
-
10
- const styleCss = ".sc-smoothly-input-h{display:block;position:relative;font-weight:var(--smoothly-font-weight);padding:var(--padding);overflow:hidden;background-color:rgb(var(--background-color));color:rgb(var(--text-color, var(--smoothly-default-contrast)))}[hidden].sc-smoothly-input-h{display:none}.sc-smoothly-input-h>div.sc-smoothly-input{position:relative;width:100%;height:100%}label.sc-smoothly-input{position:absolute;left:0.4em;top:0.6em;color:rgb(var(--text-color, var(--smoothly-default-contrast)));opacity:0.8;user-select:none;cursor:inherit;transition:transform 0.1s;transform-origin:top left;transition-timing-function:ease}.sc-smoothly-input-h:not([show-label]) label.sc-smoothly-input{display:none}.sc-smoothly-input-h:not([show-label]) input.sc-smoothly-input{padding:0.7em 0.3em 0.7em 0.4em}input.sc-smoothly-input{padding:1.2em 0.3em 0.2em 0.4em;box-sizing:border-box;width:100%;height:100%;background:none;border:0;z-index:1;position:relative;font-size:1rem;font-family:var(--smoothly-font-family);background-color:rgb(var(--background-color))}smoothly-icon.sc-smoothly-input{display:none;position:absolute;right:0.2em;top:0.6em}input.sc-smoothly-input:invalid+label.sc-smoothly-input+smoothly-icon.sc-smoothly-input{display:block}.sc-smoothly-input-h>div.sc-smoothly-input>label.sc-smoothly-input{z-index:1;pointer-events:none}.has-value.sc-smoothly-input-h>div.sc-smoothly-input>label.sc-smoothly-input,.sc-smoothly-input-h:focus-within>div.sc-smoothly-input>label.sc-smoothly-input{top:0.4em;transform:scale(0.6)}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 40em rgb(var(--background-color)) inset;-webkit-box-shadow:0 0 0 40em rgb(var(--background-color)) inset}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill+label.sc-smoothly-input{-webkit-text-fill-color:rgb(var(--text-color, var(--smoothly-default-contrast)))}";
11
-
12
- let SmoothlyInput = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.smoothlyChanged = index.createEvent(this, "smoothlyChanged", 7);
16
- this.keepFocusOnReRender = false;
17
- this.type = "text";
18
- this.required = false;
19
- this.minLength = 0;
20
- this.showLabel = true;
21
- this.maxLength = Number.POSITIVE_INFINITY;
22
- this.autocomplete = true;
23
- this.disabled = false;
24
- }
25
- get formatter() {
26
- let result;
27
- switch (this.type) {
28
- case "price":
29
- result = index$1.dist.get("price", this.currency);
30
- break;
31
- default:
32
- result = index$1.dist.get(this.type, getLocale());
33
- break;
34
- }
35
- return result || index$1.dist.get("text");
36
- }
37
- newState(state) {
38
- const formatter = this.formatter;
39
- return formatter.format(index$1.dist.StateEditor.copy(formatter.unformat(index$1.dist.StateEditor.copy(state))));
40
- }
41
- valueWatcher(value, before) {
42
- if (this.lastValue != value) {
43
- this.lastValue = value;
44
- this.state = Object.assign(Object.assign({}, this.state), { value: this.newState({ value: this.formatter.toString(value), selection: this.state.selection }).value });
45
- }
46
- if (value != before)
47
- this.smoothlyChanged.emit({ name: this.name, value });
48
- }
49
- onCurrency() {
50
- this.state = Object.assign(Object.assign({}, this.state), { value: this.newState({ value: this.formatter.toString(this.value), selection: this.state.selection }).value, pattern: this.newState({ value: this.formatter.toString(this.value), selection: this.state.selection }).pattern });
51
- }
52
- componentWillLoad() {
53
- const value = this.formatter.toString(this.value) || "";
54
- const start = value.length;
55
- this.state = this.newState({
56
- value,
57
- selection: { start, end: start, direction: "none" },
58
- });
59
- }
60
- componentDidRender() {
61
- if (this.keepFocusOnReRender) {
62
- this.inputElement.focus();
63
- this.keepFocusOnReRender = false;
64
- }
65
- }
66
- async getFormData(name) {
67
- const result = {};
68
- const form = document.forms.namedItem(name);
69
- if (form) {
70
- const elements = form.elements;
71
- for (let i = 0; i < elements.length; i++) {
72
- const element = elements.item(i);
73
- if (this.hasNameAndValue(element) && element.name)
74
- result[element.name] = element.value;
75
- }
76
- const smoothlyInputs = form.getElementsByTagName("smoothly-input");
77
- for (let i = 0; i < smoothlyInputs.length; i++) {
78
- const element = smoothlyInputs.item(i);
79
- if (this.hasNameAndValue(element) && element.name)
80
- result[element.name] = element.value;
81
- }
82
- }
83
- return result;
84
- }
85
- hasNameAndValue(element) {
86
- return (typeof element.name == "string" && typeof element.value == "string");
87
- }
88
- async setKeepFocusOnReRender(keepFocus) {
89
- this.keepFocusOnReRender = keepFocus;
90
- }
91
- async setSelectionRange(start, end, direction) {
92
- this.state = this.newState(Object.assign(Object.assign({}, this.state), { selection: { start, end, direction: direction != undefined ? direction : this.state.selection.direction } }));
93
- const after = this.formatter.format(index$1.dist.StateEditor.copy(this.formatter.unformat(index$1.dist.StateEditor.copy(Object.assign({}, this.state)))));
94
- this.updateBackend(after, this.inputElement);
95
- }
96
- onBlur(event) { }
97
- onFocus(event) {
98
- const after = this.formatter.format(index$1.dist.StateEditor.copy(this.formatter.unformat(index$1.dist.StateEditor.copy(Object.assign({}, this.state)))));
99
- if (event.target)
100
- this.updateBackend(after, event.target);
101
- }
102
- onClick(event) {
103
- const backend = event.target;
104
- this.state = Object.assign(Object.assign({}, this.state), { value: backend.value, selection: {
105
- start: backend.selectionStart != undefined ? backend.selectionStart : backend.value.length,
106
- end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
107
- direction: backend.selectionDirection ? backend.selectionDirection : "none",
108
- } });
109
- const after = this.newState(Object.assign({}, this.state));
110
- this.updateBackend(after, backend);
111
- }
112
- onKeyDown(event) {
113
- if (event.key && !(event.key == "Unidentified")) {
114
- const backend = event.target;
115
- this.state = Object.assign(Object.assign({}, this.state), { value: backend.value, selection: {
116
- start: backend.selectionStart != undefined ? backend.selectionStart : backend.value.length,
117
- end: backend.selectionEnd != undefined ? backend.selectionEnd : backend.value.length,
118
- direction: backend.selectionDirection ? backend.selectionDirection : "none",
119
- } });
120
- if ((!((event.ctrlKey || event.metaKey) && (event.key == "v" || event.key == "c")) && event.key.length == 1) ||
121
- event.key == "ArrowLeft" ||
122
- event.key == "ArrowRight" ||
123
- event.key == "Delete" ||
124
- event.key == "Backspace" ||
125
- event.key == "Home" ||
126
- event.key == "End") {
127
- event.preventDefault();
128
- this.processKey(event, backend);
129
- }
130
- else if (event.key == "ArrowUp" || event.key == "ArrowDown")
131
- event.preventDefault();
132
- }
133
- }
134
- onPaste(event) {
135
- event.preventDefault();
136
- let pasted = event.clipboardData ? event.clipboardData.getData("text") : "";
137
- const backend = event.target;
138
- pasted = this.expiresAutocompleteFix(backend, pasted);
139
- for (const letter of pasted)
140
- this.processKey({ key: letter }, backend);
141
- }
142
- onInput(event) {
143
- var _a;
144
- if (event.inputType == "insertReplacementText") {
145
- this.processKey({ key: "a", ctrlKey: true }, event.target);
146
- [...((_a = event.data) !== null && _a !== void 0 ? _a : "")].forEach(c => this.processKey({ key: c }, event.target));
147
- }
148
- else {
149
- const backend = event.target;
150
- let data = backend.value;
151
- if (data) {
152
- event.preventDefault();
153
- this.processKey({ key: "a", ctrlKey: true }, backend);
154
- data = this.expiresAutocompleteFix(backend, data);
155
- for (const letter of data)
156
- this.processKey({ key: letter }, backend);
157
- }
158
- }
159
- }
160
- expiresAutocompleteFix(backend, value) {
161
- var _a;
162
- if (((_a = backend.attributes.getNamedItem("autocomplete")) === null || _a === void 0 ? void 0 : _a.value) == "cc-exp")
163
- value = value.match(/^20\d\d[.\D]*\d\d$/)
164
- ? value.substring(value.length - 2, value.length) + value.substring(2, 4)
165
- : value.match(/^(1[3-9]|[2-9]\d)[.\D]*\d\d$/)
166
- ? value.substring(value.length - 2, value.length) + value.substring(0, 2)
167
- : value.match(/^\d\d[.\D]*20\d\d$/)
168
- ? value.substring(0, 2) + value.substring(value.length - 2, value.length)
169
- : value;
170
- return value;
171
- }
172
- processKey(event, backend) {
173
- const after = index$1.dist.Action.apply(this.formatter, this.state, event);
174
- this.updateBackend(after, backend);
175
- }
176
- updateBackend(after, backend) {
177
- if (after.value != backend.value)
178
- backend.value = after.value;
179
- if (backend.selectionStart != undefined && after.selection.start != backend.selectionStart)
180
- backend.selectionStart = after.selection.start;
181
- if (backend.selectionEnd != undefined && after.selection.end != backend.selectionEnd)
182
- backend.selectionEnd = after.selection.end;
183
- backend.selectionDirection = after.selection.direction ? after.selection.direction : backend.selectionDirection;
184
- this.state = after;
185
- this.value = this.lastValue = this.formatter.fromString(this.formatter.unformat(index$1.dist.StateEditor.copy(Object.assign({}, this.state))).value);
186
- }
187
- render() {
188
- var _a, _b, _c, _d, _e, _f, _g;
189
- 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) != "" }, onclick: () => { var _a; return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus(); } }, index.h("div", null, 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("label", { htmlFor: this.name }, index.h("slot", null)), index.h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }))));
190
- }
191
- static get watchers() { return {
192
- "value": ["valueWatcher"],
193
- "currency": ["onCurrency"]
194
- }; }
195
- };
196
- function getLocale() {
197
- const result = navigator.language;
198
- return index$2.dist.Locale.is(result) ? result : index$2.dist.Language.is(result) ? index$2.dist.Locale.toLocale(result) : undefined;
199
- }
200
- SmoothlyInput.style = styleCss;
201
-
202
- exports.smoothly_input = SmoothlyInput;
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
-
7
- const styleCss = "[selected].sc-smoothly-item-h{background-color:rgb(var(--smoothly-primary-shade));color:rgb(var(--smoothly-primary-contrast))}.sc-smoothly-item-h{padding:.5em;cursor:pointer;background-color:rgb(var(--smoothly-default-shade));color:rgb(var(--smoothly-default-contrast));border:rgb(var(--smoothly-default-shade) solid 1px)}.sc-smoothly-item-h:hover{background-color:rgb(var(--smoothly-primary-color));color:rgb(var(--smoothly-primary-contrast))}";
8
-
9
- let Item = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.itemSelected = index.createEvent(this, "itemSelected", 7);
13
- }
14
- onSelectedChanged(value, old) {
15
- if (value && !old)
16
- this.itemSelected.emit();
17
- }
18
- onClick() {
19
- this.selected = true;
20
- this.itemSelected.emit();
21
- }
22
- componentDidLoad() {
23
- if (this.selected)
24
- this.itemSelected.emit();
25
- }
26
- async filter(filter) {
27
- const result = !(this.element.hidden = filter
28
- ? !((typeof this.value === "string" ? this.value : JSON.stringify(this.value)).toLowerCase().includes(filter) ||
29
- this.element.innerText.toLowerCase().includes(filter))
30
- : false);
31
- return result;
32
- }
33
- render() {
34
- return index.h("slot", null);
35
- }
36
- get element() { return index.getElement(this); }
37
- static get watchers() { return {
38
- "selected": ["onSelectedChanged"]
39
- }; }
40
- };
41
- Item.style = styleCss;
42
-
43
- exports.smoothly_item = Item;
@@ -1,108 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
-
7
- const styleCss = ":host{max-height:300px;width:85%;max-height:var(--max-menu-height);box-sizing:border-box;background-color:rgb(var(--smoothly-default-color));border-radius:0.25em;color:rgb(var(--smoothly-primary-color));stroke:rgb(var(--smoothly-primary-color));fill:rgb(var(--smoothly-primary-color));box-shadow:0px 2px 24px rgba(64, 60, 57, 0.08), inset 0px 0px 1px rgba(64, 60, 57, 0.4);overflow-y:auto;cursor:pointer}:host:first-child{margin:10em}";
8
-
9
- let SmoothlyMenuOptions = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.filteredOptions = [];
13
- this.highlightIndex = 0;
14
- this.emptyMenuLabel = "No Options";
15
- this.order = false;
16
- this.options = [];
17
- this.resetHighlightOnOptionsChange = true;
18
- }
19
- optionsChangeHandler(newOptions) {
20
- this.highlightIndex = this.resetHighlightOnOptionsChange ? 0 : this.highlightIndex;
21
- }
22
- optionHoverHandler(event) {
23
- if (event.detail.value)
24
- this.setHighlight(event.detail.value);
25
- event.stopPropagation();
26
- }
27
- async moveHighlight(step) {
28
- if (this.filteredOptions.length > 0)
29
- this.setHighlight((this.highlightIndex + step + this.filteredOptions.length) % this.filteredOptions.length, true);
30
- }
31
- async setHighlight(newIndex, scrollToHighlight = false) {
32
- if (typeof newIndex == "number") {
33
- this.highlightIndex = newIndex;
34
- scrollToHighlight && this.scrollTo(this.highlightIndex);
35
- }
36
- else {
37
- const value = newIndex;
38
- let isHighlightSet = false;
39
- this.filteredOptions.forEach((option, index) => {
40
- const highlight = option.value == value;
41
- this.highlightIndex = highlight ? index : this.highlightIndex;
42
- highlight && scrollToHighlight && this.scrollTo(index);
43
- isHighlightSet = highlight ? true : isHighlightSet;
44
- });
45
- if (!isHighlightSet)
46
- this.setHighlight(0, true);
47
- }
48
- }
49
- async getHighlighted() {
50
- let result = undefined;
51
- if (this.highlightIndex != undefined && this.filteredOptions.length > 0)
52
- result = this.filteredOptions[this.highlightIndex];
53
- return result;
54
- }
55
- async filterOptions(keyword, excludeValues = []) {
56
- const keywordLowercase = keyword.toLowerCase();
57
- this.filteredOptions = [];
58
- for (const option of this.options) {
59
- const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
60
- const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
61
- isVisible && this.filteredOptions.push(option);
62
- }
63
- this.order && this.sortOptions(keyword);
64
- }
65
- sortOptions(keyword) {
66
- const keywordLowercase = keyword.toLowerCase();
67
- this.filteredOptions.sort((a, b) => {
68
- return this.getPriorityScore(a, keywordLowercase) - this.getPriorityScore(b, keywordLowercase);
69
- });
70
- }
71
- getPriorityScore(option, keywordLowercase) {
72
- let result = Number.MAX_SAFE_INTEGER;
73
- const name = option.name;
74
- const aliases = option.aliases ? option.aliases.join(" ") : "";
75
- const names = `${name ? name : ""} ${aliases ? aliases : ""}`.toLowerCase();
76
- if (name) {
77
- result = names.split(" ").reduce((minIndex, word) => {
78
- const index = word.indexOf(keywordLowercase);
79
- return index != -1 && index < minIndex ? index : minIndex;
80
- }, Number.MAX_SAFE_INTEGER);
81
- }
82
- return result;
83
- }
84
- scrollTo(optionIndex) {
85
- var _a;
86
- const optionHeight = (_a = this.firstOptionsElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
87
- if (optionHeight) {
88
- const menuHeight = this.element.getBoundingClientRect().height;
89
- const scrollPosition = this.element.scrollTop;
90
- const optionPosition = optionIndex * optionHeight;
91
- const numOptionsInMenu = Math.floor(menuHeight / optionHeight);
92
- if (optionPosition - optionHeight / 2 < scrollPosition)
93
- this.element.scrollTo({ top: (optionIndex - 1) * optionHeight });
94
- else if (scrollPosition < optionPosition + optionHeight - menuHeight)
95
- this.element.scrollTo({ top: (optionIndex + 1 - numOptionsInMenu) * optionHeight });
96
- }
97
- }
98
- render() {
99
- return (index.h(index.Host, { style: { "--max-menu-height": this.maxMenuHeight } }, this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index$1) => (index.h("smoothly-option", { style: this.optionStyle, ref: el => index$1 == 0 && (this.firstOptionsElement = el !== null && el !== void 0 ? el : this.firstOptionsElement), value: option.value, name: option.name, divider: option.divider, "data-highlight": this.highlightIndex == index$1 }, option.left ? index.h("div", { slot: "left" }, option.left) : undefined, option.right ? index.h("div", { slot: "right" }, option.right) : undefined)))) : (index.h("div", null, this.emptyMenuLabel))));
100
- }
101
- get element() { return index.getElement(this); }
102
- static get watchers() { return {
103
- "options": ["optionsChangeHandler"]
104
- }; }
105
- };
106
- SmoothlyMenuOptions.style = styleCss;
107
-
108
- exports.smoothly_menu_options = SmoothlyMenuOptions;
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
-
7
- const styleCss = ".sc-smoothly-notification-h{display:block;min-width:32.6%;min-height:3em;border-radius:5px;margin:0.5em}[hidden].sc-smoothly-notification-h{display:none}smoothly-trigger.sc-smoothly-notification{float:right;text-align:right;margin-right:0.2em}";
8
-
9
- let Notification = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.remove = index.createEvent(this, "remove", 7);
13
- this.tick = {};
14
- this.listener = notice => {
15
- console.log("changed: ", notice);
16
- if (notice.state == "closed")
17
- this.remove.emit(notice);
18
- else
19
- this.tick = {};
20
- };
21
- }
22
- get color() {
23
- let result;
24
- switch (this.notice.state) {
25
- case "delayed":
26
- case "warning":
27
- result = "warning";
28
- break;
29
- case "success":
30
- result = "success";
31
- break;
32
- case "executing":
33
- result = "light";
34
- break;
35
- case "failed":
36
- result = "danger";
37
- break;
38
- default:
39
- result = "light";
40
- break;
41
- }
42
- return result;
43
- }
44
- onTrigger(event) {
45
- if (event.detail.name == "close") {
46
- event.stopPropagation();
47
- this.notice.close();
48
- }
49
- }
50
- onUpdatedNotice(newValue, oldValue) {
51
- if (oldValue)
52
- oldValue.unlisten(this.listener);
53
- newValue.listen(this.listener);
54
- }
55
- componentDidLoad() {
56
- this.onUpdatedNotice(this.notice);
57
- }
58
- render() {
59
- return (index.h(index.Host, { color: this.color, fill: "solid" }, index.h("smoothly-trigger", { fill: "clear", name: "close" }, index.h("smoothly-icon", { name: "close-circle-outline" })), index.h("p", null, this.notice.message)));
60
- }
61
- static get watchers() { return {
62
- "notice": ["onUpdatedNotice"]
63
- }; }
64
- };
65
- Notification.style = styleCss;
66
-
67
- exports.smoothly_notification = Notification;
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
-
7
- const styleCss = ".sc-smoothly-notifier-h{display:block}[hidden].sc-smoothly-notifier-h{display:none}.sc-smoothly-notifier-h>aside.sc-smoothly-notifier{display:flex;flex-wrap:wrap-reverse;align-content:stretch;justify-content:flex-start;position:fixed;bottom:3em;left:0;text-align:center;width:100%;z-index:100}";
8
-
9
- let Notifier = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.notices = [];
13
- }
14
- onNotice(event) {
15
- this.notices = [...this.notices, event.detail];
16
- }
17
- onRemove(event) {
18
- this.notices = [...this.notices.filter(n => n != event.detail)];
19
- }
20
- render() {
21
- return [
22
- index.h("slot", null),
23
- index.h("aside", null, this.notices.map(n => (index.h("smoothly-notification", { notice: n })))),
24
- ];
25
- }
26
- };
27
- Notifier.style = styleCss;
28
-
29
- exports.smoothly_notifier = Notifier;
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-138c41c2.js');
6
-
7
- const styleCss = ":host{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.7em 1em;margin-left:1px;margin-right:1px;background-color:transparent;position:relative}:host([data-highlight]){background-color:rgb(var(--smoothly-default-shade))}:host>div.middle{padding-left:0.5em;flex-shrink:1;width:100%}:host([divider]){margin-bottom:0.5em}::slotted([slot=right]){font-style:italic;white-space:nowrap}:host([divider])::after{position:absolute;height:1px;width:100%;left:0;bottom:-0.25em;content:\"\";background-color:rgba(var(--smoothly-dark-color))}";
8
-
9
- let SmoothlyOption = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.optionHover = index.createEvent(this, "optionHover", 7);
13
- this.optionSelect = index.createEvent(this, "optionSelect", 7);
14
- this.dataHighlight = false;
15
- this.divider = false;
16
- }
17
- onHover(event) {
18
- this.optionHover.emit({ name: this.name, value: this.value });
19
- }
20
- onSelect(event) {
21
- if (this.value)
22
- this.optionSelect.emit({ name: this.name, value: this.value });
23
- else
24
- throw `smoothly-option ${this.element.innerHTML} lacks value-property and can therefore not be selected`;
25
- }
26
- render() {
27
- return (index.h(index.Host, { onMouseDown: (e) => this.onSelect(e), onMouseOver: (e) => this.onHover(e) }, index.h("slot", { name: "left" }), index.h("div", { class: "middle" }, this.name), index.h("slot", { name: "right" })));
28
- }
29
- get element() { return index.getElement(this); }
30
- };
31
- SmoothlyOption.style = styleCss;
32
-
33
- exports.smoothly_option = SmoothlyOption;