smoothly 1.0.0-alpha.21 → 1.0.0-alpha.211

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 (549) hide show
  1. package/dist/cjs/{Listenable-63ea2d90.js → Data-ae713814.js} +523 -6
  2. package/dist/cjs/Data-ae713814.js.map +1 -0
  3. package/dist/cjs/Observers-6450f075.js +25 -0
  4. package/dist/cjs/Observers-6450f075.js.map +1 -0
  5. package/dist/cjs/TimeZone-016ac7b0.js +6181 -0
  6. package/dist/cjs/TimeZone-016ac7b0.js.map +1 -0
  7. package/dist/cjs/getLanguage-49a534df.js +6118 -0
  8. package/dist/cjs/getLanguage-49a534df.js.map +1 -0
  9. package/dist/cjs/{index-8adc5c1b.js → index-43af753b.js} +55 -2
  10. package/dist/cjs/index-43af753b.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +22 -17
  12. package/dist/cjs/index.cjs.js.map +1 -1
  13. package/dist/cjs/loader.cjs.js +4 -3
  14. package/dist/cjs/loader.cjs.js.map +1 -1
  15. package/dist/cjs/{Notice-88ba4c70.js → redirect-2e5d4524.js} +11 -2
  16. package/dist/cjs/redirect-2e5d4524.js.map +1 -0
  17. package/dist/cjs/smoothly-accordion-item.cjs.entry.js +61 -0
  18. package/dist/cjs/smoothly-accordion-item.cjs.entry.js.map +1 -0
  19. package/dist/cjs/smoothly-accordion.cjs.entry.js +58 -0
  20. package/dist/cjs/smoothly-accordion.cjs.entry.js.map +1 -0
  21. package/dist/cjs/smoothly-address-display.cjs.entry.js +1 -1
  22. package/dist/cjs/smoothly-address.cjs.entry.js +1 -1
  23. package/dist/cjs/smoothly-addresses.cjs.entry.js +1 -1
  24. package/dist/cjs/smoothly-app_80.cjs.entry.js +10897 -0
  25. package/dist/cjs/smoothly-app_80.cjs.entry.js.map +1 -0
  26. package/dist/cjs/smoothly-checkbox.cjs.entry.js +102 -0
  27. package/dist/cjs/smoothly-checkbox.cjs.entry.js.map +1 -0
  28. package/dist/cjs/smoothly-color.cjs.entry.js +1 -1
  29. package/dist/cjs/smoothly-country.cjs.entry.js +56 -55
  30. package/dist/cjs/smoothly-country.cjs.entry.js.map +1 -1
  31. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +26 -0
  32. package/dist/cjs/smoothly-display-date-time.cjs.entry.js.map +1 -0
  33. package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
  34. package/dist/cjs/smoothly-reorder.cjs.entry.js +1 -1
  35. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +4 -4
  36. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js.map +1 -1
  37. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +6 -6
  38. package/dist/cjs/smoothly-trigger-source.cjs.entry.js.map +1 -1
  39. package/dist/cjs/smoothly.cjs.js +4 -3
  40. package/dist/cjs/smoothly.cjs.js.map +1 -1
  41. package/dist/collection/collection-manifest.json +37 -15
  42. package/dist/collection/components/Button.js +16 -2
  43. package/dist/collection/components/Button.js.map +1 -1
  44. package/dist/collection/components/accordion/index.js +32 -12
  45. package/dist/collection/components/accordion/index.js.map +1 -1
  46. package/dist/collection/components/accordion-item/index.js +18 -25
  47. package/dist/collection/components/accordion-item/index.js.map +1 -1
  48. package/dist/collection/components/app/index.js +99 -29
  49. package/dist/collection/components/app/index.js.map +1 -1
  50. package/dist/collection/components/app/room/index.js +134 -25
  51. package/dist/collection/components/app/room/index.js.map +1 -1
  52. package/dist/collection/components/app/room/style.css +39 -10
  53. package/dist/collection/components/app/style.css +104 -39
  54. package/dist/collection/components/app-demo/index.js +1 -1
  55. package/dist/collection/components/app-demo/index.js.map +1 -1
  56. package/dist/collection/components/backtotop/index.js +3 -3
  57. package/dist/collection/components/backtotop/index.js.map +1 -1
  58. package/dist/collection/components/burger/index.js +60 -14
  59. package/dist/collection/components/burger/index.js.map +1 -1
  60. package/dist/collection/components/burger/style.css +2 -2
  61. package/dist/collection/components/button/index.js +10 -23
  62. package/dist/collection/components/button/index.js.map +1 -1
  63. package/dist/collection/components/button/style.css +33 -35
  64. package/dist/collection/components/button-demo/index.js +4 -2
  65. package/dist/collection/components/button-demo/index.js.map +1 -1
  66. package/dist/collection/components/button-demo/style.css +1 -0
  67. package/dist/collection/components/calendar/generate.js +1 -1
  68. package/dist/collection/components/calendar/generate.js.map +1 -1
  69. package/dist/collection/components/calendar/index.js +16 -16
  70. package/dist/collection/components/calendar/index.js.map +1 -1
  71. package/dist/collection/components/checkbox/index.js +82 -29
  72. package/dist/collection/components/checkbox/index.js.map +1 -1
  73. package/dist/collection/components/checkbox/style.css +39 -42
  74. package/dist/collection/components/confirm/index.js +261 -0
  75. package/dist/collection/components/confirm/index.js.map +1 -0
  76. package/dist/collection/components/confirm/style.css +15 -0
  77. package/dist/collection/components/country/index.js +1 -1
  78. package/dist/collection/components/display/index.js +6 -3
  79. package/dist/collection/components/display/index.js.map +1 -1
  80. package/dist/collection/components/display-amount/index.js +1 -1
  81. package/dist/collection/components/display-demo/index.js +16 -1
  82. package/dist/collection/components/display-demo/index.js.map +1 -1
  83. package/dist/collection/components/filter/Filter.js +17 -0
  84. package/dist/collection/components/filter/Filter.js.map +1 -0
  85. package/dist/collection/components/filter/field/index.js +105 -0
  86. package/dist/collection/components/filter/field/index.js.map +1 -0
  87. package/dist/collection/components/filter/field/style.css +4 -0
  88. package/dist/collection/components/filter/index.js +55 -132
  89. package/dist/collection/components/filter/index.js.map +1 -1
  90. package/dist/collection/components/filter/input/index.js +64 -302
  91. package/dist/collection/components/filter/input/index.js.map +1 -1
  92. package/dist/collection/components/filter/picker/index.js +209 -0
  93. package/dist/collection/components/filter/picker/index.js.map +1 -0
  94. package/dist/collection/components/filter/picker/style.css +8 -0
  95. package/dist/collection/components/filter/style.css +56 -71
  96. package/dist/collection/components/filter/toggle/index.js +248 -0
  97. package/dist/collection/components/filter/toggle/index.js.map +1 -0
  98. package/dist/collection/components/filter/toggle/style.css +8 -0
  99. package/dist/collection/components/form/index.js +302 -35
  100. package/dist/collection/components/form/index.js.map +1 -1
  101. package/dist/collection/components/form/style.css +11 -17
  102. package/dist/collection/components/icon/index.js +29 -38
  103. package/dist/collection/components/icon/index.js.map +1 -1
  104. package/dist/collection/components/icon-demo/index.js +1 -1
  105. package/dist/collection/components/icon-demo/index.js.map +1 -1
  106. package/dist/collection/components/icon-demo/style.css +5 -6
  107. package/dist/collection/components/input/Clearable.js.map +1 -0
  108. package/dist/collection/components/input/Editable.js +18 -0
  109. package/dist/collection/components/input/Editable.js.map +1 -0
  110. package/dist/collection/components/input/Input.js +23 -0
  111. package/dist/collection/components/input/Input.js.map +1 -0
  112. package/dist/collection/components/input/Looks.js +8 -0
  113. package/dist/collection/components/input/Looks.js.map +1 -0
  114. package/dist/collection/components/input/Submittable.js +8 -0
  115. package/dist/collection/components/input/Submittable.js.map +1 -0
  116. package/dist/collection/components/input/checkbox/index.js +235 -0
  117. package/dist/collection/components/input/checkbox/index.js.map +1 -0
  118. package/dist/collection/components/input/checkbox/style.css +31 -0
  119. package/dist/collection/components/input/clear/index.js +242 -0
  120. package/dist/collection/components/input/clear/index.js.map +1 -0
  121. package/dist/collection/components/input/clear/style.css +256 -0
  122. package/dist/collection/components/input/color/index.js +226 -0
  123. package/dist/collection/components/input/color/index.js.map +1 -0
  124. package/dist/collection/components/input/color/style.css +15 -0
  125. package/dist/collection/components/{input-date-range → input/date}/index.js +153 -99
  126. package/dist/collection/components/input/date/index.js.map +1 -0
  127. package/dist/collection/components/input/date/range/index.js +443 -0
  128. package/dist/collection/components/input/date/range/index.js.map +1 -0
  129. package/dist/collection/components/input/date/range/style.css +94 -0
  130. package/dist/collection/components/input/date/style.css +83 -0
  131. package/dist/collection/components/input/demo/index.js +47 -0
  132. package/dist/collection/components/input/demo/index.js.map +1 -0
  133. package/dist/collection/components/input/demo/style.css +15 -0
  134. package/dist/collection/components/input/edit/index.js +231 -0
  135. package/dist/collection/components/input/edit/index.js.map +1 -0
  136. package/dist/collection/components/input/edit/style.css +239 -0
  137. package/dist/collection/components/input/file/index.js +305 -0
  138. package/dist/collection/components/input/file/index.js.map +1 -0
  139. package/dist/collection/components/input/file/style.css +107 -0
  140. package/dist/collection/components/input/index.js +329 -104
  141. package/dist/collection/components/input/index.js.map +1 -1
  142. package/dist/collection/components/{input-month → input/month}/index.js +8 -8
  143. package/dist/collection/components/input/month/index.js.map +1 -0
  144. package/dist/collection/components/input/radio/Selected.js +11 -0
  145. package/dist/collection/components/input/radio/Selected.js.map +1 -0
  146. package/dist/collection/components/input/radio/index.js +404 -0
  147. package/dist/collection/components/input/radio/index.js.map +1 -0
  148. package/dist/collection/components/input/radio/item/index.js +150 -0
  149. package/dist/collection/components/input/radio/item/index.js.map +1 -0
  150. package/dist/collection/components/input/radio/item/style.css +28 -0
  151. package/dist/collection/components/input/radio/style.css +66 -0
  152. package/dist/collection/components/input/range/index.js +305 -0
  153. package/dist/collection/components/input/range/index.js.map +1 -0
  154. package/dist/collection/components/input/range/style.css +154 -0
  155. package/dist/collection/components/input/reset/index.js +241 -0
  156. package/dist/collection/components/input/reset/index.js.map +1 -0
  157. package/dist/collection/components/input/reset/style.css +259 -0
  158. package/dist/collection/components/input/select/index.js +452 -0
  159. package/dist/collection/components/input/select/index.js.map +1 -0
  160. package/dist/collection/components/input/select/style.css +104 -0
  161. package/dist/collection/components/input/style.css +47 -10
  162. package/dist/collection/components/input/submit/index.js +232 -0
  163. package/dist/collection/components/input/submit/index.js.map +1 -0
  164. package/dist/collection/components/input/submit/style.css +236 -0
  165. package/dist/collection/components/item/index.js +5 -5
  166. package/dist/collection/components/item/index.js.map +1 -1
  167. package/dist/collection/components/label/index.js +81 -0
  168. package/dist/collection/components/label/index.js.map +1 -0
  169. package/dist/collection/components/label/style.css +15 -0
  170. package/dist/collection/components/lazy/index.js +73 -0
  171. package/dist/collection/components/lazy/index.js.map +1 -0
  172. package/dist/collection/components/{radio → load-more}/index.js +35 -46
  173. package/dist/collection/components/load-more/index.js.map +1 -0
  174. package/dist/collection/components/load-more/style.css +5 -0
  175. package/dist/collection/components/notification/index.js +45 -8
  176. package/dist/collection/components/notification/index.js.map +1 -1
  177. package/dist/collection/components/notification/style.css +25 -1
  178. package/dist/collection/components/notifier/style.css +1 -3
  179. package/dist/collection/components/picker/demo/index.js +91 -0
  180. package/dist/collection/components/picker/demo/index.js.map +1 -0
  181. package/dist/collection/components/picker/demo/style.css +30 -0
  182. package/dist/collection/components/picker/index.js +197 -396
  183. package/dist/collection/components/picker/index.js.map +1 -1
  184. package/dist/collection/components/picker/menu/index.js +429 -0
  185. package/dist/collection/components/picker/menu/index.js.map +1 -0
  186. package/dist/collection/components/picker/menu/style.css +44 -0
  187. package/dist/collection/components/picker/option/index.js +298 -0
  188. package/dist/collection/components/picker/option/index.js.map +1 -0
  189. package/dist/collection/components/picker/option/style.css +30 -0
  190. package/dist/collection/components/picker/slot-elements/index.js +109 -0
  191. package/dist/collection/components/picker/slot-elements/index.js.map +1 -0
  192. package/dist/collection/components/picker/slot-elements/style.css +3 -0
  193. package/dist/collection/components/picker/slotted-elements/index.js +84 -0
  194. package/dist/collection/components/picker/slotted-elements/index.js.map +1 -0
  195. package/dist/collection/components/picker/slotted-elements/style.css +3 -0
  196. package/dist/collection/components/picker/style.css +76 -136
  197. package/dist/collection/components/popup/index.js +5 -5
  198. package/dist/collection/components/popup/index.js.map +1 -1
  199. package/dist/collection/components/popup/style.css +4 -4
  200. package/dist/collection/components/select-demo/index.js +0 -87
  201. package/dist/collection/components/select-demo/index.js.map +1 -1
  202. package/dist/collection/components/spinner/style.css +1 -0
  203. package/dist/collection/components/submit/index.js +64 -5
  204. package/dist/collection/components/submit/index.js.map +1 -1
  205. package/dist/collection/components/submit/style.css +226 -0
  206. package/dist/collection/components/summary/index.js +46 -4
  207. package/dist/collection/components/summary/index.js.map +1 -1
  208. package/dist/collection/components/summary/style.css +25 -16
  209. package/dist/collection/components/svg/style.css +2 -2
  210. package/dist/collection/components/table/cell/index.js +1 -1
  211. package/dist/collection/components/table/cell/index.js.map +1 -1
  212. package/dist/collection/components/table/cell/style.css +18 -11
  213. package/dist/collection/components/table/demo/filtered/Root.js.map +1 -1
  214. package/dist/collection/components/table/demo/filtered/index.js +25 -18
  215. package/dist/collection/components/table/demo/filtered/index.js.map +1 -1
  216. package/dist/collection/components/table/demo/filtered/style.css +9 -0
  217. package/dist/collection/components/table/demo/index.js +2 -9
  218. package/dist/collection/components/table/demo/index.js.map +1 -1
  219. package/dist/collection/components/table/demo/style.css +7 -0
  220. package/dist/collection/components/table/demo/testing/data.js +28 -0
  221. package/dist/collection/components/table/demo/testing/data.js.map +1 -0
  222. package/dist/collection/components/table/demo/testing/index.js +28 -0
  223. package/dist/collection/components/table/demo/testing/index.js.map +1 -0
  224. package/dist/collection/components/table/demo/testing/style.css +32 -0
  225. package/dist/collection/components/table/expandable/cell/index.js +14 -33
  226. package/dist/collection/components/table/expandable/cell/index.js.map +1 -1
  227. package/dist/collection/components/table/expandable/cell/style.css +32 -25
  228. package/dist/collection/components/table/expandable/row/index.js +9 -51
  229. package/dist/collection/components/table/expandable/row/index.js.map +1 -1
  230. package/dist/collection/components/table/expandable/row/style.css +32 -29
  231. package/dist/collection/components/table/footer/index.js +19 -0
  232. package/dist/collection/components/table/footer/index.js.map +1 -0
  233. package/dist/collection/components/table/footer/style.css +10 -0
  234. package/dist/collection/components/table/header/style.css +2 -3
  235. package/dist/collection/components/table/index.js +55 -12
  236. package/dist/collection/components/table/index.js.map +1 -1
  237. package/dist/collection/components/table/row/index.js +37 -5
  238. package/dist/collection/components/table/row/index.js.map +1 -1
  239. package/dist/collection/components/table/row/style.css +4 -1
  240. package/dist/collection/components/table/style.css +0 -2
  241. package/dist/collection/components/theme/color/index.js +48 -0
  242. package/dist/collection/components/theme/color/index.js.map +1 -0
  243. package/dist/collection/components/theme/color/style.css +8 -0
  244. package/dist/collection/components/theme/color/variant/index.js +66 -0
  245. package/dist/collection/components/theme/color/variant/index.js.map +1 -0
  246. package/dist/collection/components/theme/color/variant/style.css +18 -0
  247. package/dist/collection/components/theme/colors/index.js +30 -0
  248. package/dist/collection/components/theme/colors/index.js.map +1 -0
  249. package/dist/collection/components/theme/colors/style.css +7 -0
  250. package/dist/collection/components/theme/picker/index.js +48 -0
  251. package/dist/collection/components/theme/picker/index.js.map +1 -0
  252. package/dist/collection/components/theme/picker/style.css +0 -0
  253. package/dist/collection/components/toggle-switch/index.js +69 -17
  254. package/dist/collection/components/toggle-switch/index.js.map +1 -1
  255. package/dist/collection/components/toggle-switch/style.css +19 -12
  256. package/dist/collection/components/trigger-source/index.js +3 -3
  257. package/dist/collection/components/trigger-source/index.js.map +1 -1
  258. package/dist/collection/global/Observers.js +22 -0
  259. package/dist/collection/global/Observers.js.map +1 -0
  260. package/dist/collection/global/index.js +5 -0
  261. package/dist/collection/global/index.js.map +1 -0
  262. package/dist/collection/index.js +2 -2
  263. package/dist/collection/index.js.map +1 -1
  264. package/dist/collection/model/Color.js +18 -1
  265. package/dist/collection/model/Color.js.map +1 -1
  266. package/dist/collection/{components/form → model}/Data.js +8 -1
  267. package/dist/collection/model/Data.js.map +1 -0
  268. package/dist/collection/model/Icon.js +23 -0
  269. package/dist/collection/model/Icon.js.map +1 -0
  270. package/dist/collection/model/Listenable.js +17 -4
  271. package/dist/collection/model/Listenable.js.map +1 -1
  272. package/dist/collection/model/Notice.js +1 -1
  273. package/dist/collection/model/Notice.js.map +1 -1
  274. package/dist/collection/model/Option.js.map +1 -1
  275. package/dist/collection/model/index.js +4 -0
  276. package/dist/collection/model/index.js.map +1 -1
  277. package/dist/collection/model/redirect.js +8 -0
  278. package/dist/collection/model/redirect.js.map +1 -0
  279. package/dist/collection/smoothly.js +3 -0
  280. package/dist/collection/smoothly.js.map +1 -0
  281. package/dist/custom-elements/index.d.ts +176 -50
  282. package/dist/custom-elements/index.js +13394 -29834
  283. package/dist/custom-elements/index.js.map +1 -1
  284. package/dist/esm/{Listenable-fb6f4723.js → Data-0390d600.js} +518 -7
  285. package/dist/esm/Data-0390d600.js.map +1 -0
  286. package/dist/esm/Observers-5f08e828.js +25 -0
  287. package/dist/esm/Observers-5f08e828.js.map +1 -0
  288. package/dist/esm/TimeZone-c8df4905.js +6181 -0
  289. package/dist/esm/TimeZone-c8df4905.js.map +1 -0
  290. package/dist/esm/getLanguage-1e9ec036.js +6116 -0
  291. package/dist/esm/getLanguage-1e9ec036.js.map +1 -0
  292. package/dist/esm/{index-6ac4212d.js → index-258984d3.js} +55 -2
  293. package/dist/esm/index-258984d3.js.map +1 -0
  294. package/dist/esm/index.js +20 -5
  295. package/dist/esm/index.js.map +1 -1
  296. package/dist/esm/loader.js +5 -4
  297. package/dist/esm/loader.js.map +1 -1
  298. package/dist/esm/{Notice-1fa17794.js → redirect-b0f87e88.js} +11 -3
  299. package/dist/esm/redirect-b0f87e88.js.map +1 -0
  300. package/dist/esm/smoothly-accordion-item.entry.js +57 -0
  301. package/dist/esm/smoothly-accordion-item.entry.js.map +1 -0
  302. package/dist/esm/smoothly-accordion.entry.js +54 -0
  303. package/dist/esm/smoothly-accordion.entry.js.map +1 -0
  304. package/dist/esm/smoothly-address-display.entry.js +1 -1
  305. package/dist/esm/smoothly-address.entry.js +1 -1
  306. package/dist/esm/smoothly-addresses.entry.js +1 -1
  307. package/dist/esm/smoothly-app_80.entry.js +10814 -0
  308. package/dist/esm/smoothly-app_80.entry.js.map +1 -0
  309. package/dist/esm/smoothly-checkbox.entry.js +98 -0
  310. package/dist/esm/smoothly-checkbox.entry.js.map +1 -0
  311. package/dist/esm/smoothly-color.entry.js +1 -1
  312. package/dist/esm/smoothly-country.entry.js +10 -9
  313. package/dist/esm/smoothly-country.entry.js.map +1 -1
  314. package/dist/esm/smoothly-display-date-time.entry.js +22 -0
  315. package/dist/esm/smoothly-display-date-time.entry.js.map +1 -0
  316. package/dist/esm/smoothly-google-font.entry.js +1 -1
  317. package/dist/esm/smoothly-reorder.entry.js +1 -1
  318. package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
  319. package/dist/esm/smoothly-trigger-source.entry.js +4 -4
  320. package/dist/esm/smoothly-trigger-source.entry.js.map +1 -1
  321. package/dist/esm/smoothly.js +5 -4
  322. package/dist/esm/smoothly.js.map +1 -1
  323. package/dist/smoothly/index.esm.js +1 -1
  324. package/dist/smoothly/index.esm.js.map +1 -1
  325. package/dist/smoothly/{p-04fb45e1.entry.js → p-12182a73.entry.js} +2 -2
  326. package/dist/smoothly/{p-5629e452.entry.js → p-127dcc56.entry.js} +2 -2
  327. package/dist/smoothly/p-21905b32.entry.js +2 -0
  328. package/dist/smoothly/p-21905b32.entry.js.map +1 -0
  329. package/dist/smoothly/p-312ef066.js +2 -0
  330. package/dist/smoothly/p-312ef066.js.map +1 -0
  331. package/dist/smoothly/p-47151a53.entry.js +2 -0
  332. package/dist/smoothly/p-5e387578.js +3 -0
  333. package/dist/smoothly/p-5e387578.js.map +1 -0
  334. package/dist/smoothly/{p-0fec28cc.entry.js → p-6aebb818.entry.js} +2 -2
  335. package/dist/smoothly/p-6e9aca2e.entry.js +2 -0
  336. package/dist/smoothly/p-6e9aca2e.entry.js.map +1 -0
  337. package/dist/smoothly/{p-ae467192.entry.js → p-7bf147bf.entry.js} +2 -2
  338. package/dist/smoothly/p-823e02b0.entry.js +2 -0
  339. package/dist/smoothly/p-823e02b0.entry.js.map +1 -0
  340. package/dist/smoothly/p-9b828bde.js +2 -0
  341. package/dist/smoothly/p-9b828bde.js.map +1 -0
  342. package/dist/smoothly/p-a0ebd646.entry.js +2 -0
  343. package/dist/smoothly/p-a0ebd646.entry.js.map +1 -0
  344. package/dist/smoothly/{p-b3eef141.entry.js → p-b3eac6af.entry.js} +2 -2
  345. package/dist/smoothly/p-b9165e1d.entry.js +2 -0
  346. package/dist/smoothly/p-b9165e1d.entry.js.map +1 -0
  347. package/dist/smoothly/p-c833c402.js +2 -0
  348. package/dist/smoothly/p-c833c402.js.map +1 -0
  349. package/dist/smoothly/{p-3a6873ed.entry.js → p-cb493516.entry.js} +2 -2
  350. package/dist/smoothly/p-ede93d69.js +2 -0
  351. package/dist/smoothly/p-ede93d69.js.map +1 -0
  352. package/dist/smoothly/p-eef1c80b.entry.js +2 -0
  353. package/dist/smoothly/p-eef1c80b.entry.js.map +1 -0
  354. package/dist/smoothly/p-f125610c.entry.js +2 -0
  355. package/dist/smoothly/p-f125610c.entry.js.map +1 -0
  356. package/dist/smoothly/p-fa664317.js +2 -0
  357. package/dist/smoothly/p-fa664317.js.map +1 -0
  358. package/dist/smoothly/smoothly.esm.js +1 -1
  359. package/dist/smoothly/smoothly.esm.js.map +1 -1
  360. package/dist/types/components/Button.d.ts +1 -2
  361. package/dist/types/components/accordion/index.d.ts +1 -1
  362. package/dist/types/components/accordion-item/index.d.ts +5 -4
  363. package/dist/types/components/app/index.d.ts +23 -10
  364. package/dist/types/components/app/room/index.d.ts +21 -7
  365. package/dist/types/components/app-demo/index.d.ts +1 -0
  366. package/dist/types/components/backtotop/index.d.ts +1 -1
  367. package/dist/types/components/burger/index.d.ts +7 -2
  368. package/dist/types/components/button/index.d.ts +2 -2
  369. package/dist/types/components/calendar/index.d.ts +5 -5
  370. package/dist/types/components/checkbox/index.d.ts +7 -3
  371. package/dist/types/components/confirm/index.d.ts +19 -0
  372. package/dist/types/components/filter/Filter.d.ts +21 -0
  373. package/dist/types/components/filter/field/index.d.ts +10 -0
  374. package/dist/types/components/filter/index.d.ts +13 -12
  375. package/dist/types/components/filter/input/index.d.ts +15 -23
  376. package/dist/types/components/filter/picker/index.d.ts +24 -0
  377. package/dist/types/components/filter/toggle/index.d.ts +22 -0
  378. package/dist/types/components/form/index.d.ts +23 -7
  379. package/dist/types/components/icon/index.d.ts +3 -9
  380. package/dist/types/components/input/Editable.d.ts +20 -0
  381. package/dist/types/components/input/Input.d.ts +22 -0
  382. package/dist/types/components/input/Looks.d.ts +7 -0
  383. package/dist/types/components/input/Submittable.d.ts +6 -0
  384. package/dist/types/components/input/checkbox/index.d.ts +20 -0
  385. package/dist/types/components/input/clear/index.d.ts +17 -0
  386. package/dist/types/components/input/color/index.d.ts +24 -0
  387. package/dist/types/components/input/date/index.d.ts +28 -0
  388. package/dist/types/components/input/date/range/index.d.ts +33 -0
  389. package/dist/types/components/input/demo/index.d.ts +6 -0
  390. package/dist/types/components/input/edit/index.d.ts +17 -0
  391. package/dist/types/components/input/file/index.d.ts +24 -0
  392. package/dist/types/components/input/index.d.ts +30 -11
  393. package/dist/types/components/{input-month → input/month}/index.d.ts +2 -2
  394. package/dist/types/components/input/radio/Selected.d.ts +10 -0
  395. package/dist/types/components/input/radio/index.d.ts +35 -0
  396. package/dist/types/components/input/radio/item/index.d.ts +15 -0
  397. package/dist/types/components/input/range/index.d.ts +24 -0
  398. package/dist/types/components/input/reset/index.d.ts +18 -0
  399. package/dist/types/components/input/select/index.d.ts +36 -0
  400. package/dist/types/components/input/submit/index.d.ts +17 -0
  401. package/dist/types/components/item/index.d.ts +1 -1
  402. package/dist/types/components/label/index.d.ts +6 -0
  403. package/dist/types/components/lazy/index.d.ts +7 -0
  404. package/dist/types/components/load-more/index.d.ts +11 -0
  405. package/dist/types/components/notification/index.d.ts +3 -1
  406. package/dist/types/components/picker/demo/index.d.ts +22 -0
  407. package/dist/types/components/picker/index.d.ts +33 -45
  408. package/dist/types/components/picker/menu/index.d.ts +54 -0
  409. package/dist/types/components/picker/option/index.d.ts +23 -0
  410. package/dist/types/components/picker/slot-elements/index.d.ts +15 -0
  411. package/dist/types/components/picker/slotted-elements/index.d.ts +8 -0
  412. package/dist/types/components/popup/index.d.ts +1 -1
  413. package/dist/types/components/select-demo/index.d.ts +0 -9
  414. package/dist/types/components/submit/index.d.ts +6 -1
  415. package/dist/types/components/summary/index.d.ts +4 -0
  416. package/dist/types/components/table/demo/filtered/Root.d.ts +2 -0
  417. package/dist/types/components/table/demo/filtered/index.d.ts +7 -7
  418. package/dist/types/components/table/demo/index.d.ts +1 -1
  419. package/dist/types/components/table/demo/testing/data.d.ts +5 -0
  420. package/dist/types/components/table/demo/testing/index.d.ts +4 -0
  421. package/dist/types/components/table/expandable/cell/index.d.ts +4 -5
  422. package/dist/types/components/table/expandable/row/index.d.ts +3 -8
  423. package/dist/types/components/table/footer/index.d.ts +3 -0
  424. package/dist/types/components/table/index.d.ts +6 -3
  425. package/dist/types/components/table/row/index.d.ts +3 -1
  426. package/dist/types/components/theme/color/index.d.ts +5 -0
  427. package/dist/types/components/theme/color/variant/index.d.ts +6 -0
  428. package/dist/types/components/theme/colors/index.d.ts +3 -0
  429. package/dist/types/components/theme/picker/index.d.ts +4 -0
  430. package/dist/types/components/toggle-switch/index.d.ts +7 -2
  431. package/dist/types/components/trigger-source/index.d.ts +1 -1
  432. package/dist/types/components.d.ts +914 -347
  433. package/dist/types/global/Observers.d.ts +8 -0
  434. package/dist/types/global/index.d.ts +4 -0
  435. package/dist/types/index.d.ts +1 -3
  436. package/dist/types/model/Color.d.ts +7 -1
  437. package/dist/types/{components/form → model}/Data.d.ts +4 -0
  438. package/dist/types/model/Icon.d.ts +8 -0
  439. package/dist/types/model/Listenable.d.ts +10 -1
  440. package/dist/types/model/Notice.d.ts +1 -1
  441. package/dist/types/model/Option.d.ts +24 -6
  442. package/dist/types/model/index.d.ts +3 -0
  443. package/dist/types/model/redirect.d.ts +1 -0
  444. package/dist/types/smoothly.d.ts +3 -0
  445. package/package.json +7 -6
  446. package/dist/cjs/Listenable-63ea2d90.js.map +0 -1
  447. package/dist/cjs/Notice-88ba4c70.js.map +0 -1
  448. package/dist/cjs/getLanguage-4f0a45d5.js +0 -12227
  449. package/dist/cjs/getLanguage-4f0a45d5.js.map +0 -1
  450. package/dist/cjs/index-8adc5c1b.js.map +0 -1
  451. package/dist/cjs/index-d16d46f4.js +0 -1224
  452. package/dist/cjs/index-d16d46f4.js.map +0 -1
  453. package/dist/cjs/smoothly-accordion_62.cjs.entry.js +0 -28199
  454. package/dist/cjs/smoothly-accordion_62.cjs.entry.js.map +0 -1
  455. package/dist/cjs/smoothly-radio-group.cjs.entry.js +0 -22
  456. package/dist/cjs/smoothly-radio-group.cjs.entry.js.map +0 -1
  457. package/dist/collection/components/filter/Clearable.js.map +0 -1
  458. package/dist/collection/components/form/Clearable.js +0 -8
  459. package/dist/collection/components/form/Clearable.js.map +0 -1
  460. package/dist/collection/components/form/Data.js.map +0 -1
  461. package/dist/collection/components/input-date/index.js +0 -206
  462. package/dist/collection/components/input-date/index.js.map +0 -1
  463. package/dist/collection/components/input-date/style.css +0 -40
  464. package/dist/collection/components/input-date-range/index.js.map +0 -1
  465. package/dist/collection/components/input-date-range/style.css +0 -51
  466. package/dist/collection/components/input-demo/index.js +0 -45
  467. package/dist/collection/components/input-demo/index.js.map +0 -1
  468. package/dist/collection/components/input-demo/style.css +0 -4
  469. package/dist/collection/components/input-month/index.js.map +0 -1
  470. package/dist/collection/components/menu-options/index.js +0 -413
  471. package/dist/collection/components/menu-options/index.js.map +0 -1
  472. package/dist/collection/components/menu-options/style.css +0 -18
  473. package/dist/collection/components/option/index.js +0 -270
  474. package/dist/collection/components/option/index.js.map +0 -1
  475. package/dist/collection/components/option/style.css +0 -42
  476. package/dist/collection/components/radio/index.js.map +0 -1
  477. package/dist/collection/components/radio/style.css +0 -31
  478. package/dist/collection/components/radio-button/Selected.js +0 -2
  479. package/dist/collection/components/radio-button/Selected.js.map +0 -1
  480. package/dist/collection/components/radio-button/index.js +0 -137
  481. package/dist/collection/components/radio-button/index.js.map +0 -1
  482. package/dist/collection/components/radio-button/item/index.js +0 -117
  483. package/dist/collection/components/radio-button/item/index.js.map +0 -1
  484. package/dist/collection/components/radio-button/item/style.css +0 -85
  485. package/dist/collection/components/radio-group/index.js +0 -43
  486. package/dist/collection/components/radio-group/index.js.map +0 -1
  487. package/dist/collection/components/radio-group/style.css +0 -36
  488. package/dist/collection/components/select/index.js +0 -108
  489. package/dist/collection/components/select/index.js.map +0 -1
  490. package/dist/collection/components/select/style.css +0 -20
  491. package/dist/collection/components/selector/index.js +0 -234
  492. package/dist/collection/components/selector/index.js.map +0 -1
  493. package/dist/collection/components/selector/style.css +0 -46
  494. package/dist/custom-elements/index2.js +0 -1222
  495. package/dist/custom-elements/index2.js.map +0 -1
  496. package/dist/esm/Listenable-fb6f4723.js.map +0 -1
  497. package/dist/esm/Notice-1fa17794.js.map +0 -1
  498. package/dist/esm/getLanguage-ffacd7b7.js +0 -12225
  499. package/dist/esm/getLanguage-ffacd7b7.js.map +0 -1
  500. package/dist/esm/index-6ac4212d.js.map +0 -1
  501. package/dist/esm/index-d5330059.js +0 -1222
  502. package/dist/esm/index-d5330059.js.map +0 -1
  503. package/dist/esm/smoothly-accordion_62.entry.js +0 -28134
  504. package/dist/esm/smoothly-accordion_62.entry.js.map +0 -1
  505. package/dist/esm/smoothly-radio-group.entry.js +0 -18
  506. package/dist/esm/smoothly-radio-group.entry.js.map +0 -1
  507. package/dist/smoothly/p-06337b89.js +0 -2
  508. package/dist/smoothly/p-06337b89.js.map +0 -1
  509. package/dist/smoothly/p-16cba662.entry.js +0 -2
  510. package/dist/smoothly/p-16cba662.entry.js.map +0 -1
  511. package/dist/smoothly/p-3ad51805.entry.js +0 -2
  512. package/dist/smoothly/p-3ad51805.entry.js.map +0 -1
  513. package/dist/smoothly/p-5e34795b.js +0 -2
  514. package/dist/smoothly/p-5e34795b.js.map +0 -1
  515. package/dist/smoothly/p-75373584.js +0 -2
  516. package/dist/smoothly/p-75373584.js.map +0 -1
  517. package/dist/smoothly/p-75452eb8.js +0 -2
  518. package/dist/smoothly/p-75452eb8.js.map +0 -1
  519. package/dist/smoothly/p-ae33d7e1.entry.js +0 -2
  520. package/dist/smoothly/p-ae33d7e1.entry.js.map +0 -1
  521. package/dist/smoothly/p-b98cd447.js +0 -3
  522. package/dist/smoothly/p-b98cd447.js.map +0 -1
  523. package/dist/smoothly/p-c109fc66.entry.js +0 -2
  524. package/dist/smoothly/p-c109fc66.entry.js.map +0 -1
  525. package/dist/smoothly/p-f29cc9ff.entry.js +0 -2
  526. package/dist/types/components/form/Clearable.d.ts +0 -6
  527. package/dist/types/components/input-date/index.d.ts +0 -14
  528. package/dist/types/components/input-date-range/index.d.ts +0 -23
  529. package/dist/types/components/input-demo/index.d.ts +0 -3
  530. package/dist/types/components/menu-options/index.d.ts +0 -35
  531. package/dist/types/components/option/index.d.ts +0 -32
  532. package/dist/types/components/radio/index.d.ts +0 -13
  533. package/dist/types/components/radio-button/Selected.d.ts +0 -5
  534. package/dist/types/components/radio-button/index.d.ts +0 -15
  535. package/dist/types/components/radio-button/item/index.d.ts +0 -12
  536. package/dist/types/components/radio-group/index.d.ts +0 -4
  537. package/dist/types/components/select/index.d.ts +0 -14
  538. package/dist/types/components/selector/index.d.ts +0 -23
  539. /package/dist/collection/components/{filter → input}/Clearable.js +0 -0
  540. /package/dist/collection/components/{input-month → input/month}/style.css +0 -0
  541. /package/dist/collection/components/{radio-button → lazy}/style.css +0 -0
  542. /package/dist/smoothly/{p-04fb45e1.entry.js.map → p-12182a73.entry.js.map} +0 -0
  543. /package/dist/smoothly/{p-5629e452.entry.js.map → p-127dcc56.entry.js.map} +0 -0
  544. /package/dist/smoothly/{p-f29cc9ff.entry.js.map → p-47151a53.entry.js.map} +0 -0
  545. /package/dist/smoothly/{p-0fec28cc.entry.js.map → p-6aebb818.entry.js.map} +0 -0
  546. /package/dist/smoothly/{p-ae467192.entry.js.map → p-7bf147bf.entry.js.map} +0 -0
  547. /package/dist/smoothly/{p-b3eef141.entry.js.map → p-b3eac6af.entry.js.map} +0 -0
  548. /package/dist/smoothly/{p-3a6873ed.entry.js.map → p-cb493516.entry.js.map} +0 -0
  549. /package/dist/types/components/{filter → input}/Clearable.d.ts +0 -0
@@ -1,51 +1,110 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { http } from "cloudly-http";
3
- import { Notice } from "../../model/Notice";
4
- import { Clearable } from "./Clearable";
5
- import { Data } from "./Data";
3
+ import { Data, Notice } from "../../model";
4
+ import { Clearable } from "../input/Clearable";
5
+ import { Editable } from "../input/Editable";
6
+ import { Input } from "../input/Input";
6
7
  export class SmoothlyForm {
7
8
  constructor() {
9
+ this.inputs = new Map();
10
+ this.listeners = {};
11
+ this.color = undefined;
8
12
  this.value = {};
9
- this.clearables = new Map();
13
+ this.readonly = false;
10
14
  this.looks = "plain";
11
15
  this.name = undefined;
12
16
  this.method = undefined;
13
17
  this.action = undefined;
14
18
  this.processing = undefined;
15
- this.notice = undefined;
19
+ this.prevent = true;
20
+ this.changed = false;
21
+ }
22
+ async listen(property, listener) {
23
+ var _a;
24
+ var _b;
25
+ ;
26
+ ((_a = (_b = this.listeners)[property]) !== null && _a !== void 0 ? _a : (_b[property] = [])).push(listener);
27
+ listener(this);
28
+ }
29
+ watchValue() {
30
+ var _a;
31
+ this.changed = [...this.inputs.values()].some(input => (Editable.type.is(input) ? input.changed : true));
32
+ (_a = this.listeners.changed) === null || _a === void 0 ? void 0 : _a.forEach(l => l(this));
33
+ }
34
+ watchReadonly() {
35
+ var _a;
36
+ (_a = this.listeners.changed) === null || _a === void 0 ? void 0 : _a.forEach(l => l(this));
37
+ }
38
+ smoothlyInputLooksHandler(event) {
39
+ event.stopPropagation();
40
+ event.detail(this.looks, this.color);
16
41
  }
17
42
  async smoothlyInputHandler(event) {
18
- this.notice = undefined;
19
- this.smoothlyFormInput.emit((this.value = Object.entries(event.detail).reduce((r, [name, value]) => Data.set(r, name.split("."), value), this.value)));
20
- if (Clearable.is(event.target)) {
21
- const clearable = event.target;
22
- Object.keys(event.detail).forEach(key => this.clearables.set(key, clearable));
23
- }
43
+ this.smoothlyFormInput.emit((this.value = Data.merge(this.value, event.detail)));
24
44
  }
25
45
  async smoothlySubmitHandler(event) {
26
46
  this.processing = true;
27
- this.submit();
47
+ await this.submit();
28
48
  this.processing = false;
29
49
  }
50
+ async smoothlyInputLoadHandler(event) {
51
+ event.stopPropagation();
52
+ event.detail(this);
53
+ if (Input.Element.is(event.target)) {
54
+ this.value = Data.merge(this.value, { [event.target.name]: event.target.value });
55
+ this.inputs.set(event.target.name, event.target);
56
+ }
57
+ }
58
+ async smoothlyFormDisableHandler(event) {
59
+ event.stopPropagation();
60
+ event.detail(this.readonly);
61
+ }
30
62
  async submit() {
63
+ var _a;
31
64
  this.smoothlyFormSubmit.emit(this.value);
32
65
  if (this.action) {
33
- const response = await http.fetch(this.method == "POST"
34
- ? { method: "POST", url: this.action, body: this.value }
35
- : { url: `${this.action}?${http.Search.stringify(this.value)}` });
36
- if (response.status >= 200 && response.status < 300) {
37
- this.notice = Notice.succeded("Form sucessfully submitted.");
38
- await this.clear();
39
- }
40
- else
41
- this.notice = Notice.failed("Failed to submit form.");
66
+ const action = this.action;
67
+ (_a = this.notice) === null || _a === void 0 ? void 0 : _a.emit(Notice.execute("Submitting form", async () => {
68
+ const response = await http
69
+ .fetch(this.method == "POST"
70
+ ? http.Request.create({
71
+ method: "POST",
72
+ url: action,
73
+ header: { contentType: "application/json" },
74
+ body: this.value,
75
+ })
76
+ : { url: `${action}?${http.Search.stringify(this.value)}` })
77
+ .catch(() => undefined);
78
+ let result;
79
+ if (!response || (response === null || response === void 0 ? void 0 : response.status) < 200 || response.status >= 300)
80
+ result = [false, "Failed to submit form."];
81
+ else {
82
+ result = [true, "Form successfully submitted."];
83
+ this.clear();
84
+ }
85
+ return result;
86
+ }));
42
87
  }
43
88
  }
44
89
  async clear() {
45
- new Set(this.clearables.values()).forEach(clearable => clearable.clear());
90
+ this.inputs.forEach(input => {
91
+ Clearable.is(input) && input.clear();
92
+ });
93
+ }
94
+ async edit(editable) {
95
+ this.inputs.forEach(input => {
96
+ Editable.Element.type.is(input) && input.edit(editable);
97
+ });
98
+ this.readonly = !editable;
99
+ }
100
+ async reset() {
101
+ this.inputs.forEach(input => {
102
+ Editable.Element.type.is(input) && input.reset();
103
+ });
104
+ this.changed = [...this.inputs.values()].some(input => (Editable.type.is(input) ? input.changed : true));
46
105
  }
47
106
  render() {
48
- return (h(Host, null, this.notice ? h("smoothly-notification", { notice: this.notice }) : [], h("smoothly-spinner", { active: this.processing }), h("form", { name: this.name }, h("fieldset", null, h("slot", null)), h("slot", { name: "submit" }))));
107
+ return (h(Host, null, h("smoothly-spinner", { active: this.processing }), h("form", { onSubmit: !this.prevent ? undefined : e => e.preventDefault(), name: this.name }, h("fieldset", null, h("slot", null)), h("div", null, h("slot", { name: "edit" }), h("slot", { name: "reset" }), h("slot", { name: "clear" }), h("slot", { name: "submit" })))));
49
108
  }
50
109
  static get is() { return "smoothly-form"; }
51
110
  static get originalStyleUrls() {
@@ -60,13 +119,82 @@ export class SmoothlyForm {
60
119
  }
61
120
  static get properties() {
62
121
  return {
122
+ "color": {
123
+ "type": "string",
124
+ "mutable": true,
125
+ "complexType": {
126
+ "original": "Color",
127
+ "resolved": "\"danger\" | \"dark\" | \"default\" | \"light\" | \"medium\" | \"primary\" | \"secondary\" | \"success\" | \"tertiary\" | \"warning\" | undefined",
128
+ "references": {
129
+ "Color": {
130
+ "location": "import",
131
+ "path": "../../model"
132
+ }
133
+ }
134
+ },
135
+ "required": false,
136
+ "optional": true,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": ""
140
+ },
141
+ "attribute": "color",
142
+ "reflect": true
143
+ },
144
+ "value": {
145
+ "type": "unknown",
146
+ "mutable": true,
147
+ "complexType": {
148
+ "original": "Readonly<Data>",
149
+ "resolved": "{ readonly [x: string]: Value | Data; }",
150
+ "references": {
151
+ "Readonly": {
152
+ "location": "global"
153
+ },
154
+ "Data": {
155
+ "location": "import",
156
+ "path": "../../model"
157
+ }
158
+ }
159
+ },
160
+ "required": false,
161
+ "optional": false,
162
+ "docs": {
163
+ "tags": [],
164
+ "text": ""
165
+ },
166
+ "defaultValue": "{}"
167
+ },
168
+ "readonly": {
169
+ "type": "boolean",
170
+ "mutable": true,
171
+ "complexType": {
172
+ "original": "boolean",
173
+ "resolved": "boolean",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": ""
181
+ },
182
+ "attribute": "readonly",
183
+ "reflect": true,
184
+ "defaultValue": "false"
185
+ },
63
186
  "looks": {
64
187
  "type": "string",
65
188
  "mutable": false,
66
189
  "complexType": {
67
- "original": "\"plain\" | \"grid\" | \"border\" | \"line\"",
68
- "resolved": "\"border\" | \"grid\" | \"line\" | \"plain\"",
69
- "references": {}
190
+ "original": "Looks",
191
+ "resolved": "\"border\" | \"grid\" | \"line\" | \"plain\" | \"transparent\"",
192
+ "references": {
193
+ "Looks": {
194
+ "location": "import",
195
+ "path": "../input/Looks"
196
+ }
197
+ }
70
198
  },
71
199
  "required": false,
72
200
  "optional": false,
@@ -145,14 +273,45 @@ export class SmoothlyForm {
145
273
  },
146
274
  "attribute": "processing",
147
275
  "reflect": true
276
+ },
277
+ "prevent": {
278
+ "type": "boolean",
279
+ "mutable": false,
280
+ "complexType": {
281
+ "original": "boolean",
282
+ "resolved": "boolean",
283
+ "references": {}
284
+ },
285
+ "required": false,
286
+ "optional": false,
287
+ "docs": {
288
+ "tags": [],
289
+ "text": ""
290
+ },
291
+ "attribute": "prevent",
292
+ "reflect": false,
293
+ "defaultValue": "true"
294
+ },
295
+ "changed": {
296
+ "type": "boolean",
297
+ "mutable": true,
298
+ "complexType": {
299
+ "original": "boolean",
300
+ "resolved": "boolean",
301
+ "references": {}
302
+ },
303
+ "required": false,
304
+ "optional": false,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": ""
308
+ },
309
+ "attribute": "changed",
310
+ "reflect": false,
311
+ "defaultValue": "false"
148
312
  }
149
313
  };
150
314
  }
151
- static get states() {
152
- return {
153
- "notice": {}
154
- };
155
- }
156
315
  static get events() {
157
316
  return [{
158
317
  "method": "smoothlyFormInput",
@@ -170,7 +329,7 @@ export class SmoothlyForm {
170
329
  "references": {
171
330
  "Data": {
172
331
  "location": "import",
173
- "path": "./Data"
332
+ "path": "../../model"
174
333
  }
175
334
  }
176
335
  }
@@ -190,7 +349,27 @@ export class SmoothlyForm {
190
349
  "references": {
191
350
  "Data": {
192
351
  "location": "import",
193
- "path": "./Data"
352
+ "path": "../../model"
353
+ }
354
+ }
355
+ }
356
+ }, {
357
+ "method": "notice",
358
+ "name": "notice",
359
+ "bubbles": true,
360
+ "cancelable": true,
361
+ "composed": true,
362
+ "docs": {
363
+ "tags": [],
364
+ "text": ""
365
+ },
366
+ "complexType": {
367
+ "original": "Notice",
368
+ "resolved": "Notice",
369
+ "references": {
370
+ "Notice": {
371
+ "location": "import",
372
+ "path": "../../model"
194
373
  }
195
374
  }
196
375
  }
@@ -198,6 +377,32 @@ export class SmoothlyForm {
198
377
  }
199
378
  static get methods() {
200
379
  return {
380
+ "listen": {
381
+ "complexType": {
382
+ "signature": "(property: \"changed\", listener: (parent: Editable) => Promise<void>) => Promise<void>",
383
+ "parameters": [{
384
+ "tags": [],
385
+ "text": ""
386
+ }, {
387
+ "tags": [],
388
+ "text": ""
389
+ }],
390
+ "references": {
391
+ "Promise": {
392
+ "location": "global"
393
+ },
394
+ "Editable": {
395
+ "location": "import",
396
+ "path": "../input/Editable"
397
+ }
398
+ },
399
+ "return": "Promise<void>"
400
+ },
401
+ "docs": {
402
+ "text": "",
403
+ "tags": []
404
+ }
405
+ },
201
406
  "submit": {
202
407
  "complexType": {
203
408
  "signature": "() => Promise<void>",
@@ -229,21 +434,83 @@ export class SmoothlyForm {
229
434
  "text": "",
230
435
  "tags": []
231
436
  }
437
+ },
438
+ "edit": {
439
+ "complexType": {
440
+ "signature": "(editable: boolean) => Promise<void>",
441
+ "parameters": [{
442
+ "tags": [],
443
+ "text": ""
444
+ }],
445
+ "references": {
446
+ "Promise": {
447
+ "location": "global"
448
+ }
449
+ },
450
+ "return": "Promise<void>"
451
+ },
452
+ "docs": {
453
+ "text": "",
454
+ "tags": []
455
+ }
456
+ },
457
+ "reset": {
458
+ "complexType": {
459
+ "signature": "() => Promise<void>",
460
+ "parameters": [],
461
+ "references": {
462
+ "Promise": {
463
+ "location": "global"
464
+ }
465
+ },
466
+ "return": "Promise<void>"
467
+ },
468
+ "docs": {
469
+ "text": "",
470
+ "tags": []
471
+ }
232
472
  }
233
473
  };
234
474
  }
475
+ static get watchers() {
476
+ return [{
477
+ "propName": "value",
478
+ "methodName": "watchValue"
479
+ }, {
480
+ "propName": "readonly",
481
+ "methodName": "watchReadonly"
482
+ }];
483
+ }
235
484
  static get listeners() {
236
485
  return [{
486
+ "name": "smoothlyInputLooks",
487
+ "method": "smoothlyInputLooksHandler",
488
+ "target": undefined,
489
+ "capture": false,
490
+ "passive": false
491
+ }, {
237
492
  "name": "smoothlyInput",
238
493
  "method": "smoothlyInputHandler",
239
494
  "target": undefined,
240
- "capture": true,
495
+ "capture": false,
241
496
  "passive": false
242
497
  }, {
243
498
  "name": "smoothlySubmit",
244
499
  "method": "smoothlySubmitHandler",
245
500
  "target": undefined,
246
- "capture": true,
501
+ "capture": false,
502
+ "passive": false
503
+ }, {
504
+ "name": "smoothlyInputLoad",
505
+ "method": "smoothlyInputLoadHandler",
506
+ "target": undefined,
507
+ "capture": false,
508
+ "passive": false
509
+ }, {
510
+ "name": "smoothlyFormDisable",
511
+ "method": "smoothlyFormDisableHandler",
512
+ "target": undefined,
513
+ "capture": false,
247
514
  "passive": false
248
515
  }];
249
516
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACpG,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAM7B,MAAM,OAAO,YAAY;;IAChB,UAAK,GAAS,EAAE,CAAA;IAChB,eAAU,GAAG,IAAI,GAAG,EAAqB,CAAA;iBAC0C,OAAO;;;;;;;EAUlG,KAAK,C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op, State } from \"@stencil/core\"\nimport { http } from \"cloudly-http\"\nimport { Notice } from \"../../model/Notice\"\nimport { Clearable } from \"./Clearable\"\nimport { Data } from \"./Data\"\n\n@Component({\n\ttag: \"smoothly-form\",\n\tstyleUrl: \"style.css\",\n})\nexport class SmoothlyForm {\n\tprivate value: Data = {}\n\tprivate clearables = new Map<string, Clearable>()\n\t@Prop({ reflect: true, attribute: \"looks\" }) looks: \"plain\" | \"grid\" | \"border\" | \"line\" = \"plain\"\n\t@Prop() name?: string\n\t@Prop() method?: \"GET\" | \"POST\"\n\t@Prop() action?: string\n\t@Prop({ mutable: true, reflect: true }) processing: boolean\n\t@Event() smoothlyFormInput: EventEmitter<Data>\n\t@Event() smoothlyFormSubmit: EventEmitter<Data>\n\t@State() notice?: Notice\n\n\t@Listen(\"smoothlyInput\", { capture: true })\n\tasync smoothlyInputHandler(event: CustomEvent<Record<string, any>>): Promise<void> {\n\t\tthis.notice = undefined\n\t\tthis.smoothlyFormInput.emit(\n\t\t\t(this.value = Object.entries(event.detail).reduce(\n\t\t\t\t(r, [name, value]) => Data.set(r, name.split(\".\"), value),\n\t\t\t\tthis.value\n\t\t\t))\n\t\t)\n\t\tif (Clearable.is(event.target)) {\n\t\t\tconst clearable = event.target\n\t\t\tObject.keys(event.detail).forEach(key => this.clearables.set(key, clearable))\n\t\t}\n\t}\n\t@Listen(\"smoothlySubmit\", { capture: true })\n\tasync smoothlySubmitHandler(event: CustomEvent): Promise<void> {\n\t\tthis.processing = true\n\t\tthis.submit()\n\t\tthis.processing = false\n\t}\n\t@Method()\n\tasync submit(): Promise<void> {\n\t\tthis.smoothlyFormSubmit.emit(this.value)\n\t\tif (this.action) {\n\t\t\tconst response = await http.fetch(\n\t\t\t\tthis.method == \"POST\"\n\t\t\t\t\t? { method: \"POST\", url: this.action, body: this.value }\n\t\t\t\t\t: { url: `${this.action}?${http.Search.stringify(this.value)}` }\n\t\t\t)\n\t\t\tif (response.status >= 200 && response.status < 300) {\n\t\t\t\tthis.notice = Notice.succeded(\"Form sucessfully submitted.\")\n\t\t\t\tawait this.clear()\n\t\t\t} else\n\t\t\t\tthis.notice = Notice.failed(\"Failed to submit form.\")\n\t\t}\n\t}\n\t@Method()\n\tasync clear(): Promise<void> {\n\t\tnew Set(this.clearables.values()).forEach(clearable => clearable.clear())\n\t}\n\trender() {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t{this.notice ? <smoothly-notification notice={this.notice}></smoothly-notification> : []}\n\t\t\t\t<smoothly-spinner active={this.processing}></smoothly-spinner>\n\t\t\t\t<form name={this.name}>\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<slot name=\"submit\"></slot>\n\t\t\t\t</form>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACpG,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAS,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAQtC,MAAM,OAAO,YAAY;;IAChB,WAAM,GAAG,IAAI,GAAG,EAAyB,CAAA;IAczC,cAAS,GAEb,EAAE,CAAA;;iBAd2C,EAAE;oBACA,KAAK;iBACI,OAAO;;;;;mBAKjD,IAAI;mBACa,KAAK;;EASxC,KAAK,CAAC,MAAM,CAAC,QAAmB,EAAE,QAA6C;;;IAC9E,CAAC;IAAA,aAAC,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Event, EventEmitter, h, Host, Listen, Method, Prop, Watch } from \"@stencil/core\"\nimport { http } from \"cloudly-http\"\nimport { Color, Data, Notice } from \"../../model\"\nimport { Clearable } from \"../input/Clearable\"\nimport { Editable } from \"../input/Editable\"\nimport { Input } from \"../input/Input\"\nimport { Looks } from \"../input/Looks\"\nimport { Submittable } from \"../input/Submittable\"\n\n@Component({\n\ttag: \"smoothly-form\",\n\tstyleUrl: \"style.css\",\n})\nexport class SmoothlyForm implements Clearable, Submittable, Editable {\n\tprivate inputs = new Map<string, Input.Element>()\n\t@Prop({ reflect: true, mutable: true }) color?: Color\n\t@Prop({ mutable: true }) value: Readonly<Data> = {}\n\t@Prop({ mutable: true, reflect: true }) readonly = false\n\t@Prop({ reflect: true, attribute: \"looks\" }) looks: Looks = \"plain\"\n\t@Prop() name?: string\n\t@Prop() method?: \"GET\" | \"POST\"\n\t@Prop() action?: string\n\t@Prop({ mutable: true, reflect: true }) processing: boolean\n\t@Prop() prevent = true\n\t@Prop({ mutable: true }) changed = false\n\t@Event() smoothlyFormInput: EventEmitter<Data>\n\t@Event() smoothlyFormSubmit: EventEmitter<Data>\n\t@Event() notice: EventEmitter<Notice>\n\tprivate listeners: {\n\t\tchanged?: ((parent: Editable) => Promise<void>)[]\n\t} = {}\n\n\t@Method()\n\tasync listen(property: \"changed\", listener: (parent: Editable) => Promise<void>): Promise<void> {\n\t\t;(this.listeners[property] ??= []).push(listener)\n\t\tlistener(this)\n\t}\n\t@Watch(\"value\")\n\twatchValue() {\n\t\tthis.changed = [...this.inputs.values()].some(input => (Editable.type.is(input) ? input.changed : true))\n\t\tthis.listeners.changed?.forEach(l => l(this))\n\t}\n\t@Watch(\"readonly\")\n\twatchReadonly() {\n\t\tthis.listeners.changed?.forEach(l => l(this))\n\t}\n\t@Listen(\"smoothlyInputLooks\")\n\tsmoothlyInputLooksHandler(event: CustomEvent<(looks: Looks, color: Color | undefined) => void>) {\n\t\tevent.stopPropagation()\n\t\tevent.detail(this.looks, this.color)\n\t}\n\t@Listen(\"smoothlyInput\")\n\tasync smoothlyInputHandler(event: CustomEvent<Record<string, any>>): Promise<void> {\n\t\tthis.smoothlyFormInput.emit((this.value = Data.merge(this.value, event.detail)))\n\t}\n\t@Listen(\"smoothlySubmit\")\n\tasync smoothlySubmitHandler(event: CustomEvent): Promise<void> {\n\t\tthis.processing = true\n\t\tawait this.submit()\n\t\tthis.processing = false\n\t}\n\t@Listen(\"smoothlyInputLoad\")\n\tasync smoothlyInputLoadHandler(event: CustomEvent): Promise<void> {\n\t\tevent.stopPropagation()\n\t\tevent.detail(this)\n\t\tif (Input.Element.is(event.target)) {\n\t\t\tthis.value = Data.merge(this.value, { [event.target.name]: event.target.value })\n\t\t\tthis.inputs.set(event.target.name, event.target)\n\t\t}\n\t}\n\t@Listen(\"smoothlyFormDisable\")\n\tasync smoothlyFormDisableHandler(event: CustomEvent): Promise<void> {\n\t\tevent.stopPropagation()\n\t\tevent.detail(this.readonly)\n\t}\n\t@Method()\n\tasync submit(): Promise<void> {\n\t\tthis.smoothlyFormSubmit.emit(this.value)\n\t\tif (this.action) {\n\t\t\tconst action = this.action\n\t\t\tthis.notice?.emit(\n\t\t\t\tNotice.execute(\"Submitting form\", async () => {\n\t\t\t\t\tconst response = await http\n\t\t\t\t\t\t.fetch(\n\t\t\t\t\t\t\tthis.method == \"POST\"\n\t\t\t\t\t\t\t\t? http.Request.create({\n\t\t\t\t\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\t\t\t\t\turl: action,\n\t\t\t\t\t\t\t\t\t\theader: { contentType: \"application/json\" },\n\t\t\t\t\t\t\t\t\t\tbody: this.value,\n\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t: { url: `${action}?${http.Search.stringify(this.value)}` }\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.catch(() => undefined)\n\t\t\t\t\tlet result: [boolean, string]\n\t\t\t\t\tif (!response || response?.status < 200 || response.status >= 300)\n\t\t\t\t\t\tresult = [false, \"Failed to submit form.\"]\n\t\t\t\t\telse {\n\t\t\t\t\t\tresult = [true, \"Form successfully submitted.\"]\n\t\t\t\t\t\tthis.clear()\n\t\t\t\t\t}\n\t\t\t\t\treturn result\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\t}\n\t@Method()\n\tasync clear(): Promise<void> {\n\t\tthis.inputs.forEach(input => {\n\t\t\tClearable.is(input) && input.clear()\n\t\t})\n\t}\n\t@Method()\n\tasync edit(editable: boolean): Promise<void> {\n\t\tthis.inputs.forEach(input => {\n\t\t\tEditable.Element.type.is(input) && input.edit(editable)\n\t\t})\n\t\tthis.readonly = !editable\n\t}\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.inputs.forEach(input => {\n\t\t\tEditable.Element.type.is(input) && input.reset()\n\t\t})\n\t\tthis.changed = [...this.inputs.values()].some(input => (Editable.type.is(input) ? input.changed : true))\n\t}\n\trender() {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t<smoothly-spinner active={this.processing}></smoothly-spinner>\n\t\t\t\t<form onSubmit={!this.prevent ? undefined : e => e.preventDefault()} name={this.name}>\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<slot name=\"edit\" />\n\t\t\t\t\t\t<slot name=\"reset\" />\n\t\t\t\t\t\t<slot name=\"clear\" />\n\t\t\t\t\t\t<slot name=\"submit\" />\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
@@ -1,5 +1,8 @@
1
1
  smoothly-form {
2
2
  display: block;
3
+ position: relative;
4
+ --background-color: var(--smoothly-color-shade);
5
+ --text-color: var(--smoothly-color-contrast)
3
6
  }
4
7
  smoothly-form > form {
5
8
  position: relative;
@@ -8,7 +11,6 @@ smoothly-form > form {
8
11
  smoothly-form > form > fieldset {
9
12
  display: flex;
10
13
  flex-flow: row wrap;
11
-
12
14
  margin-inline-start: unset;
13
15
  margin-inline-end: unset;
14
16
  padding-block-start: unset;
@@ -24,27 +26,19 @@ smoothly-form > form > fieldset {
24
26
  smoothly-form > form > fieldset > * {
25
27
  flex-grow: 1;
26
28
  min-width: 10em;
27
- width: 40%;
28
- }
29
- smoothly-form[looks="border"] > form > fieldset > *,
30
- smoothly-form[looks="grid"] > form > fieldset > * {
31
- border: rgb(var(--smoothly-default-contrast)) solid 1px;
32
- }
33
- smoothly-form[looks="line"] > form > fieldset > * {
34
- border-bottom: rgb(var(--smoothly-default-contrast)) solid 1px;
29
+ flex-basis: 40%;
35
30
  }
36
31
  smoothly-form[looks="grid"] > form > fieldset {
37
- border: rgba(var(--smoothly-default-contrast), .5) solid .5px;
38
- }
39
- smoothly-form[looks="grid"] > form > fieldset > * {
40
- border: rgba(var(--smoothly-default-contrast), .5) solid .5px;
32
+ border: rgba(var(--text-color), .5) solid .5px;
41
33
  }
42
34
  smoothly-form[looks="line"] > form > fieldset,
43
- smoothly-form[looks="border"] > form > fieldset {
35
+ smoothly-form[looks="border"] > form > fieldset,
36
+ smoothly-form[looks="transparent"] > form > fieldset {
44
37
  gap: 2em
45
38
  }
46
39
 
47
- smoothly-form > form > [slot=submit] {
48
- margin: .5em auto;
49
- max-width: 10em;
40
+ smoothly-form > form > div {
41
+ display: flex;
42
+ justify-content: end;
43
+ gap: 1em;
50
44
  }
@@ -1,45 +1,31 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { Icon } from "../../model";
1
3
  export class SmoothlyIcon {
2
4
  constructor() {
3
5
  this.color = undefined;
4
6
  this.fill = "solid";
5
- this.name = undefined;
7
+ this.name = "empty";
6
8
  this.size = "medium";
7
9
  this.toolTip = undefined;
8
10
  this.document = undefined;
9
11
  }
10
- async loadDocument() {
11
- if (this.name)
12
- this.document =
13
- this.name != "empty"
14
- ? await SmoothlyIcon.load(this.name)
15
- : `<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512">
16
- <title>Empty</title>
17
- </svg>`;
18
- }
19
12
  async componentWillLoad() {
20
- await this.loadDocument();
21
- }
22
- hostData() {
23
- return {
24
- innerHTML: this.document
25
- ? this.document
26
- .replace(` width="512" height="512"`, "")
27
- .replace(/(<title>)[\w\d\s-]*(<\/title>)/, `<title>${this.toolTip || ""}</title>`)
28
- .replace(/stroke:#000;/gi, "")
29
- : undefined,
30
- };
13
+ let result;
14
+ if (this.name != "empty") {
15
+ result = await Icon.load(this.name);
16
+ result = result === null || result === void 0 ? void 0 : result.replace(/(?<=^<svg\s?)/, `$& role="img"`).replace(` width="512" height="512"`, "").replace(/stroke:#000;/gi, "");
17
+ if (result === null || result === void 0 ? void 0 : result.includes("<title>"))
18
+ result = result.replace(/(<title>)[\w\d\s-]*(<\/title>)/, `<title>${this.toolTip || ""}</title>`);
19
+ else
20
+ result = result === null || result === void 0 ? void 0 : result.replace(/(.*>)(<\/svg>$)/, `$1<title>${this.toolTip || ""}</title>$2`);
21
+ }
22
+ this.document =
23
+ result !== null && result !== void 0 ? result : `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
24
+ <title>Empty</title>
25
+ </svg>`;
31
26
  }
32
27
  render() {
33
- return [];
34
- }
35
- static async fetch(url) {
36
- const response = await fetch(url);
37
- return response.ok ? response.text() : undefined;
38
- }
39
- static async load(name) {
40
- var _a;
41
- const url = `https://site-icons.pages.dev/ionicons@5.0.0/dist/svg/${name}.svg`;
42
- return (_a = SmoothlyIcon.cache[url]) !== null && _a !== void 0 ? _a : (SmoothlyIcon.cache[url] = SmoothlyIcon.fetch(url));
28
+ return h(Host, { innerHTML: this.document });
43
29
  }
44
30
  static get is() { return "smoothly-icon"; }
45
31
  static get encapsulation() { return "scoped"; }
@@ -104,18 +90,24 @@ export class SmoothlyIcon {
104
90
  "type": "string",
105
91
  "mutable": false,
106
92
  "complexType": {
107
- "original": "string",
108
- "resolved": "string | undefined",
109
- "references": {}
93
+ "original": "Icon | \"empty\"",
94
+ "resolved": "Icon | \"empty\"",
95
+ "references": {
96
+ "Icon": {
97
+ "location": "import",
98
+ "path": "../../model"
99
+ }
100
+ }
110
101
  },
111
102
  "required": false,
112
- "optional": true,
103
+ "optional": false,
113
104
  "docs": {
114
105
  "tags": [],
115
106
  "text": ""
116
107
  },
117
108
  "attribute": "name",
118
- "reflect": false
109
+ "reflect": true,
110
+ "defaultValue": "\"empty\""
119
111
  },
120
112
  "size": {
121
113
  "type": "string",
@@ -162,9 +154,8 @@ export class SmoothlyIcon {
162
154
  static get watchers() {
163
155
  return [{
164
156
  "propName": "name",
165
- "methodName": "loadDocument"
157
+ "methodName": "componentWillLoad"
166
158
  }];
167
159
  }
168
160
  }
169
- SmoothlyIcon.cache = {};
170
161
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAQ7D,MAAM,OAAO,YAAY;;;gBAEc,OAAO;;gBAE0B,QAAQ;;;;EAI/E,KAAK,CAAC,YAAY;IACjB,IAAI,IAAI,CAAC,IAAI;MACZ,IAAI,CAAC,QAAQ;QACZ,IAAI,CAAC,IAAI,IAAI,OAAO;UACnB,CAAC,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;UACpC,CAAC,CAAC;;UAEG,CAAA;EACT,CAAC;EACD,KAAK,CAAC,iBAAiB;IACtB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;EAC1B,CAAC;EACD,QAAQ;IACP,OAAO;MACN,SAAS,EAAE,IAAI,CAAC,QAAQ;QACvB,CAAC,CAAC,IAAI,CAAC,QAAQ;WACZ,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC;WACxC,OAAO,CAAC,gCAAgC,EAAE,UAAU,IAAI,CAAC,OAAO,IAAI,EAAE,UAAU,CAAC;WACjF,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC,SAAS;KACZ,CAAA;EACF,CAAC;EACD,MAAM;IACL,OAAO,EAAE,CAAA;EACV,CAAC;EACO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;IACjC,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;EACjD,CAAC;EAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY;;IAC7B,MAAM,GAAG,GAAG,wDAAwD,IAAI,MAAM,CAAA;IAC9E,OAAO,MAAA,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,mCAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;EACtF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAJc,kBAAK,GAA+D,EAAE,CAAA","sourcesContent":["import { Component, Prop, State, Watch } from \"@stencil/core\"\nimport { Color, Fill } from \"../../model\"\n\n@Component({\n\ttag: \"smoothly-icon\",\n\tstyleUrl: \"style.css\",\n\tscoped: true,\n})\nexport class SmoothlyIcon {\n\t@Prop({ reflect: true }) color: Color\n\t@Prop({ reflect: true }) fill: Fill = \"solid\"\n\t@Prop() name?: string\n\t@Prop({ reflect: true }) size: \"tiny\" | \"small\" | \"medium\" | \"large\" = \"medium\"\n\t@Prop() toolTip?: string\n\t@State() document?: string\n\t@Watch(\"name\")\n\tasync loadDocument() {\n\t\tif (this.name)\n\t\t\tthis.document =\n\t\t\t\tthis.name != \"empty\"\n\t\t\t\t\t? await SmoothlyIcon.load(this.name)\n\t\t\t\t\t: `<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"ionicon\" viewBox=\"0 0 512 512\">\n\t\t\t<title>Empty</title>\n\t\t\t</svg>`\n\t}\n\tasync componentWillLoad() {\n\t\tawait this.loadDocument()\n\t}\n\thostData() {\n\t\treturn {\n\t\t\tinnerHTML: this.document\n\t\t\t\t? this.document\n\t\t\t\t\t\t.replace(` width=\"512\" height=\"512\"`, \"\")\n\t\t\t\t\t\t.replace(/(<title>)[\\w\\d\\s-]*(<\\/title>)/, `<title>${this.toolTip || \"\"}</title>`)\n\t\t\t\t\t\t.replace(/stroke:#000;/gi, \"\")\n\t\t\t\t: undefined,\n\t\t}\n\t}\n\trender() {\n\t\treturn []\n\t}\n\tprivate static async fetch(url: string): Promise<string | undefined> {\n\t\tconst response = await fetch(url)\n\t\treturn response.ok ? response.text() : undefined\n\t}\n\tprivate static cache: { [url: string]: Promise<string | undefined> | undefined } = {}\n\tstatic async load(name: string): Promise<string | undefined> {\n\t\tconst url = `https://site-icons.pages.dev/ionicons@5.0.0/dist/svg/${name}.svg`\n\t\treturn SmoothlyIcon.cache[url] ?? (SmoothlyIcon.cache[url] = SmoothlyIcon.fetch(url))\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAOlC,MAAM,OAAO,YAAY;;;gBAEc,OAAO;gBACG,OAAO;gBACgB,QAAQ;;;;EAI/E,KAAK,CAAC,iBAAiB;IACtB,IAAI,MAA0B,CAAA;IAC9B,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,EAAE;MACzB,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;MACnC,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CACZ,OAAO,CAAC,eAAe,EAAE,eAAe,EACzC,OAAO,CAAC,2BAA2B,EAAE,EAAE,EACvC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;MAC/B,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,SAAS,CAAC;QAC9B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gCAAgC,EAAE,UAAU,IAAI,CAAC,OAAO,IAAI,EAAE,UAAU,CAAC,CAAA;;QAEjG,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,iBAAiB,EAAE,YAAY,IAAI,CAAC,OAAO,IAAI,EAAE,YAAY,CAAC,CAAA;KACxF;IACD,IAAI,CAAC,QAAQ;MACZ,MAAM,aAAN,MAAM,cAAN,MAAM,GACN;;SAEM,CAAA;EACR,CAAC;EACD,MAAM;IACL,OAAO,EAAC,IAAI,IAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAI,CAAA;EAC1C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop, State, Watch } from \"@stencil/core\"\nimport { Color, Fill } from \"../../model\"\nimport { Icon } from \"../../model\"\n\n@Component({\n\ttag: \"smoothly-icon\",\n\tstyleUrl: \"style.css\",\n\tscoped: true,\n})\nexport class SmoothlyIcon {\n\t@Prop({ reflect: true }) color: Color\n\t@Prop({ reflect: true }) fill: Fill = \"solid\"\n\t@Prop({ reflect: true }) name: Icon | \"empty\" = \"empty\"\n\t@Prop({ reflect: true }) size: \"tiny\" | \"small\" | \"medium\" | \"large\" = \"medium\"\n\t@Prop() toolTip?: string\n\t@State() document?: string\n\t@Watch(\"name\")\n\tasync componentWillLoad() {\n\t\tlet result: string | undefined\n\t\tif (this.name != \"empty\") {\n\t\t\tresult = await Icon.load(this.name)\n\t\t\tresult = result\n\t\t\t\t?.replace(/(?<=^<svg\\s?)/, `$& role=\"img\"`)\n\t\t\t\t.replace(` width=\"512\" height=\"512\"`, \"\")\n\t\t\t\t.replace(/stroke:#000;/gi, \"\")\n\t\t\tif (result?.includes(\"<title>\"))\n\t\t\t\tresult = result.replace(/(<title>)[\\w\\d\\s-]*(<\\/title>)/, `<title>${this.toolTip || \"\"}</title>`)\n\t\t\telse\n\t\t\t\tresult = result?.replace(/(.*>)(<\\/svg>$)/, `$1<title>${this.toolTip || \"\"}</title>$2`)\n\t\t}\n\t\tthis.document =\n\t\t\tresult ??\n\t\t\t`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n\t\t<title>Empty</title>\n\t\t</svg>`\n\t}\n\trender() {\n\t\treturn <Host innerHTML={this.document} />\n\t}\n}\n"]}
@@ -6,7 +6,7 @@ export class SmoothlyIconDemo {
6
6
  render() {
7
7
  return [
8
8
  h("h1", null, "Icons"),
9
- h("content", null, [
9
+ h("div", null, [
10
10
  "add-circle",
11
11
  "add",
12
12
  "airplane",