@mhmo91/schmancy 0.2.37 → 0.2.39

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 (252) hide show
  1. package/dist/{animated-text-C5zM-91H.cjs → animated-text-B3UYCBgB.cjs} +2 -2
  2. package/dist/{animated-text-C5zM-91H.cjs.map → animated-text-B3UYCBgB.cjs.map} +1 -1
  3. package/dist/{animated-text-IHZ7LNnc.js → animated-text-D6s-YOrx.js} +3 -3
  4. package/dist/{animated-text-IHZ7LNnc.js.map → animated-text-D6s-YOrx.js.map} +1 -1
  5. package/dist/animated-text.cjs +1 -1
  6. package/dist/animated-text.js +1 -1
  7. package/dist/area.cjs +1 -1
  8. package/dist/{area.component-DCLLi1YA.cjs → area.component-CNHbzqRX.cjs} +2 -2
  9. package/dist/{area.component-DCLLi1YA.cjs.map → area.component-CNHbzqRX.cjs.map} +1 -1
  10. package/dist/{area.component-BrPf_qdG.js → area.component-xeDLv_CE.js} +3 -3
  11. package/dist/{area.component-BrPf_qdG.js.map → area.component-xeDLv_CE.js.map} +1 -1
  12. package/dist/area.js +1 -1
  13. package/dist/autocomplete-Cz4oZQBB.js +225 -0
  14. package/dist/autocomplete-Cz4oZQBB.js.map +1 -0
  15. package/dist/autocomplete-D71XBwSj.cjs +48 -0
  16. package/dist/autocomplete-D71XBwSj.cjs.map +1 -0
  17. package/dist/autocomplete.cjs +1 -1
  18. package/dist/autocomplete.js +1 -1
  19. package/dist/busy.cjs +1 -1
  20. package/dist/busy.js +1 -1
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.js +1 -1
  23. package/dist/card.cjs +1 -1
  24. package/dist/card.js +1 -1
  25. package/dist/{checkbox-BdsGj_z6.cjs → checkbox-CQvBkjyb.cjs} +2 -2
  26. package/dist/{checkbox-BdsGj_z6.cjs.map → checkbox-CQvBkjyb.cjs.map} +1 -1
  27. package/dist/{checkbox-DV8tPYX0.js → checkbox-DCRZj150.js} +2 -2
  28. package/dist/{checkbox-DV8tPYX0.js.map → checkbox-DCRZj150.js.map} +1 -1
  29. package/dist/checkbox.cjs +1 -1
  30. package/dist/checkbox.js +1 -1
  31. package/dist/{chips-Z8e_rQtM.cjs → chips-BUDT0jpL.cjs} +12 -12
  32. package/dist/{chips-Z8e_rQtM.cjs.map → chips-BUDT0jpL.cjs.map} +1 -1
  33. package/dist/{chips-Ca-SY6mg.js → chips-DStbVgUo.js} +36 -36
  34. package/dist/{chips-Ca-SY6mg.js.map → chips-DStbVgUo.js.map} +1 -1
  35. package/dist/chips.cjs +1 -1
  36. package/dist/chips.js +1 -1
  37. package/dist/components.cjs +1 -1
  38. package/dist/components.js +1 -1
  39. package/dist/content-drawer.cjs +1 -1
  40. package/dist/content-drawer.js +1 -1
  41. package/dist/date-range-BjIt4Ocb.cjs +72 -0
  42. package/dist/date-range-BjIt4Ocb.cjs.map +1 -0
  43. package/dist/date-range-D_zg5C9O.js +148 -0
  44. package/dist/date-range-D_zg5C9O.js.map +1 -0
  45. package/dist/date-range.cjs +1 -1
  46. package/dist/date-range.js +1 -1
  47. package/dist/{delay-DsFVHHw2.cjs → delay-D8wCtScV.cjs} +2 -2
  48. package/dist/{delay-DsFVHHw2.cjs.map → delay-D8wCtScV.cjs.map} +1 -1
  49. package/dist/{delay-BWLlCMKV.js → delay-LxXCSBHq.js} +2 -2
  50. package/dist/{delay-BWLlCMKV.js.map → delay-LxXCSBHq.js.map} +1 -1
  51. package/dist/delay.cjs +1 -1
  52. package/dist/delay.js +1 -1
  53. package/dist/{divider-B7kWs-q5.js → divider-BSEoJ09J.js} +3 -3
  54. package/dist/{divider-B7kWs-q5.js.map → divider-BSEoJ09J.js.map} +1 -1
  55. package/dist/{divider-CjgOM462.cjs → divider-lCnFIhkp.cjs} +2 -2
  56. package/dist/{divider-CjgOM462.cjs.map → divider-lCnFIhkp.cjs.map} +1 -1
  57. package/dist/divider.cjs +1 -1
  58. package/dist/divider.js +1 -1
  59. package/dist/{form-DyYGOlOR.cjs → form-Bf2BlAqE.cjs} +2 -2
  60. package/dist/{form-DyYGOlOR.cjs.map → form-Bf2BlAqE.cjs.map} +1 -1
  61. package/dist/{form-BUV1hUzI.js → form-C-1W3Aqc.js} +2 -2
  62. package/dist/{form-BUV1hUzI.js.map → form-C-1W3Aqc.js.map} +1 -1
  63. package/dist/form.cjs +1 -1
  64. package/dist/form.js +1 -1
  65. package/dist/{icon-CWvUTBIP.js → icon-CXD3W__G.js} +3 -3
  66. package/dist/{icon-CWvUTBIP.js.map → icon-CXD3W__G.js.map} +1 -1
  67. package/dist/{icon-DPN7kWO0.cjs → icon-Wj9hmgVr.cjs} +2 -2
  68. package/dist/{icon-DPN7kWO0.cjs.map → icon-Wj9hmgVr.cjs.map} +1 -1
  69. package/dist/{icon-button-DHiO0w8J.cjs → icon-button-C0bTDyZI.cjs} +2 -2
  70. package/dist/{icon-button-DHiO0w8J.cjs.map → icon-button-C0bTDyZI.cjs.map} +1 -1
  71. package/dist/{icon-button-CbEs8eyS.js → icon-button-CRWWdZ-S.js} +3 -3
  72. package/dist/{icon-button-CbEs8eyS.js.map → icon-button-CRWWdZ-S.js.map} +1 -1
  73. package/dist/icons.cjs +1 -1
  74. package/dist/icons.js +1 -1
  75. package/dist/index.cjs +1 -1
  76. package/dist/index.js +98 -97
  77. package/dist/input-BQtGX-Fg.js +137 -0
  78. package/dist/input-BQtGX-Fg.js.map +1 -0
  79. package/dist/input-DRhsCSxi.cjs +53 -0
  80. package/dist/input-DRhsCSxi.cjs.map +1 -0
  81. package/dist/input.cjs +1 -1
  82. package/dist/input.js +1 -1
  83. package/dist/layout.cjs +1 -1
  84. package/dist/layout.js +1 -1
  85. package/dist/{list-D3m-rd6d.js → list-CUpWM7R0.js} +2 -2
  86. package/dist/{list-D3m-rd6d.js.map → list-CUpWM7R0.js.map} +1 -1
  87. package/dist/{list-Cq9RDYF_.cjs → list-bbSGS1sE.cjs} +2 -2
  88. package/dist/{list-Cq9RDYF_.cjs.map → list-bbSGS1sE.cjs.map} +1 -1
  89. package/dist/list.cjs +1 -1
  90. package/dist/list.js +1 -1
  91. package/dist/{litElement.mixin-DWxwPXWQ.cjs → litElement.mixin-CYwiYZyZ.cjs} +2 -2
  92. package/dist/{litElement.mixin-DWxwPXWQ.cjs.map → litElement.mixin-CYwiYZyZ.cjs.map} +1 -1
  93. package/dist/{litElement.mixin-CjxO_zfv.js → litElement.mixin-DoKCdkhO.js} +2 -2
  94. package/dist/{litElement.mixin-CjxO_zfv.js.map → litElement.mixin-DoKCdkhO.js.map} +1 -1
  95. package/dist/menu-CXDFSHgu.cjs +29 -0
  96. package/dist/menu-CXDFSHgu.cjs.map +1 -0
  97. package/dist/{menu-CCQYHiy2.js → menu-DGFcpetb.js} +29 -27
  98. package/dist/menu-DGFcpetb.js.map +1 -0
  99. package/dist/menu.cjs +1 -1
  100. package/dist/menu.js +1 -1
  101. package/dist/nav-drawer.cjs +1 -1
  102. package/dist/nav-drawer.js +1 -1
  103. package/dist/notification.cjs +1 -1
  104. package/dist/notification.js +1 -1
  105. package/dist/option-BKHQU-_I.cjs +18 -0
  106. package/dist/option-BKHQU-_I.cjs.map +1 -0
  107. package/dist/option-Cr7OiYc5.js +45 -0
  108. package/dist/option-Cr7OiYc5.js.map +1 -0
  109. package/dist/option.cjs +1 -1
  110. package/dist/option.js +1 -1
  111. package/dist/{outlet-u1_Qa8Li.cjs → outlet-BZSpbcNh.cjs} +2 -2
  112. package/dist/{outlet-u1_Qa8Li.cjs.map → outlet-BZSpbcNh.cjs.map} +1 -1
  113. package/dist/{outlet-BsrhXTEg.js → outlet-D39IYQgF.js} +2 -2
  114. package/dist/{outlet-BsrhXTEg.js.map → outlet-D39IYQgF.js.map} +1 -1
  115. package/dist/{payment-card-form-CTZsSGOB.js → payment-card-form-MU2rWtCN.js} +3 -3
  116. package/dist/{payment-card-form-CTZsSGOB.js.map → payment-card-form-MU2rWtCN.js.map} +1 -1
  117. package/dist/{payment-card-form-B7tV2ttW.cjs → payment-card-form-jktK4YkR.cjs} +2 -2
  118. package/dist/{payment-card-form-B7tV2ttW.cjs.map → payment-card-form-jktK4YkR.cjs.map} +1 -1
  119. package/dist/{radio-group-dN2lWcFu.js → radio-group-Cbcn7M8H.js} +2 -2
  120. package/dist/{radio-group-dN2lWcFu.js.map → radio-group-Cbcn7M8H.js.map} +1 -1
  121. package/dist/{radio-group-m5Swl5cq.cjs → radio-group-DnpFVpBo.cjs} +2 -2
  122. package/dist/{radio-group-m5Swl5cq.cjs.map → radio-group-DnpFVpBo.cjs.map} +1 -1
  123. package/dist/radio-group.cjs +1 -1
  124. package/dist/radio-group.js +1 -1
  125. package/dist/scroll-DNj5rrzc.cjs +33 -0
  126. package/dist/scroll-DNj5rrzc.cjs.map +1 -0
  127. package/dist/{scroll-CYzhWpN5.js → scroll-moSwU3Ry.js} +29 -29
  128. package/dist/scroll-moSwU3Ry.js.map +1 -0
  129. package/dist/select-DEOnUayG.cjs +52 -0
  130. package/dist/select-DEOnUayG.cjs.map +1 -0
  131. package/dist/select-Dmhiq26e.js +156 -0
  132. package/dist/select-Dmhiq26e.js.map +1 -0
  133. package/dist/select.cjs +1 -1
  134. package/dist/select.js +4 -1
  135. package/dist/{sheet-BGNoewvS.js → sheet-BDPiwpWN.js} +3 -3
  136. package/dist/{sheet-BGNoewvS.js.map → sheet-BDPiwpWN.js.map} +1 -1
  137. package/dist/{sheet-DPHbRnXg.cjs → sheet-CgaQ6pVJ.cjs} +2 -2
  138. package/dist/{sheet-DPHbRnXg.cjs.map → sheet-CgaQ6pVJ.cjs.map} +1 -1
  139. package/dist/sheet.cjs +1 -1
  140. package/dist/sheet.js +1 -1
  141. package/dist/{slider-FTwWTvKi.js → slider-D-cIdjqg.js} +3 -3
  142. package/dist/{slider-FTwWTvKi.js.map → slider-D-cIdjqg.js.map} +1 -1
  143. package/dist/{slider-ds6hnN7n.cjs → slider-Dbz2ehmj.cjs} +2 -2
  144. package/dist/{slider-ds6hnN7n.cjs.map → slider-Dbz2ehmj.cjs.map} +1 -1
  145. package/dist/slider.cjs +1 -1
  146. package/dist/slider.js +1 -1
  147. package/dist/{spinner-8GhT-bLm.cjs → spinner-COoBI2kA.cjs} +2 -2
  148. package/dist/{spinner-8GhT-bLm.cjs.map → spinner-COoBI2kA.cjs.map} +1 -1
  149. package/dist/{spinner-zxOxMm7j.js → spinner-qHgA76_k.js} +3 -3
  150. package/dist/{spinner-zxOxMm7j.js.map → spinner-qHgA76_k.js.map} +1 -1
  151. package/dist/surface-BALOUsnP.js +46 -0
  152. package/dist/surface-BALOUsnP.js.map +1 -0
  153. package/dist/surface-DI4R4vjx.cjs +13 -0
  154. package/dist/surface-DI4R4vjx.cjs.map +1 -0
  155. package/dist/surface.cjs +1 -1
  156. package/dist/surface.js +1 -1
  157. package/dist/{table-6bRKgCJ9.js → table-C3YCvbyA.js} +2 -2
  158. package/dist/{table-6bRKgCJ9.js.map → table-C3YCvbyA.js.map} +1 -1
  159. package/dist/{table-BDIhXdSA.cjs → table-DVqYwon7.cjs} +2 -2
  160. package/dist/{table-BDIhXdSA.cjs.map → table-DVqYwon7.cjs.map} +1 -1
  161. package/dist/table.cjs +1 -1
  162. package/dist/table.js +1 -1
  163. package/dist/{tabs-group-CHAAr7Wl.cjs → tabs-group-CM9Hd80d.cjs} +2 -2
  164. package/dist/{tabs-group-CHAAr7Wl.cjs.map → tabs-group-CM9Hd80d.cjs.map} +1 -1
  165. package/dist/{tabs-group-DBybIi8n.js → tabs-group-DtvVC_nM.js} +2 -2
  166. package/dist/{tabs-group-DBybIi8n.js.map → tabs-group-DtvVC_nM.js.map} +1 -1
  167. package/dist/tabs.cjs +1 -1
  168. package/dist/tabs.js +1 -1
  169. package/dist/{tailwind.mixin-_mD_GeAp.cjs → tailwind.mixin-BmIP1Qzo.cjs} +2 -2
  170. package/dist/{tailwind.mixin-_mD_GeAp.cjs.map → tailwind.mixin-BmIP1Qzo.cjs.map} +1 -1
  171. package/dist/{tailwind.mixin-DtR4DQvn.js → tailwind.mixin-CHPxMV8E.js} +14 -14
  172. package/dist/{tailwind.mixin-DtR4DQvn.js.map → tailwind.mixin-CHPxMV8E.js.map} +1 -1
  173. package/dist/teleport.cjs +1 -1
  174. package/dist/{teleport.component-7icDz3cN.js → teleport.component-BQTFUlsF.js} +35 -35
  175. package/dist/{teleport.component-7icDz3cN.js.map → teleport.component-BQTFUlsF.js.map} +1 -1
  176. package/dist/{teleport.component-D0RU6Zml.cjs → teleport.component-hBN2zB0w.cjs} +2 -2
  177. package/dist/{teleport.component-D0RU6Zml.cjs.map → teleport.component-hBN2zB0w.cjs.map} +1 -1
  178. package/dist/teleport.js +1 -1
  179. package/dist/{textarea-CJhi4hDu.cjs → textarea-C8bsVuSe.cjs} +2 -2
  180. package/dist/{textarea-CJhi4hDu.cjs.map → textarea-C8bsVuSe.cjs.map} +1 -1
  181. package/dist/{textarea-BchwVUAo.js → textarea-D7ZLtbVj.js} +2 -2
  182. package/dist/{textarea-BchwVUAo.js.map → textarea-D7ZLtbVj.js.map} +1 -1
  183. package/dist/textarea.cjs +1 -1
  184. package/dist/textarea.js +1 -1
  185. package/dist/{theme-button-dxTV0k03.js → theme-button-CcHxfORU.js} +2 -2
  186. package/dist/{theme-button-dxTV0k03.js.map → theme-button-CcHxfORU.js.map} +1 -1
  187. package/dist/{theme-button-DoIFEVSv.cjs → theme-button-fUwuhdHz.cjs} +2 -2
  188. package/dist/{theme-button-DoIFEVSv.cjs.map → theme-button-fUwuhdHz.cjs.map} +1 -1
  189. package/dist/theme-button.cjs +1 -1
  190. package/dist/theme-button.js +1 -1
  191. package/dist/theme.cjs +1 -1
  192. package/dist/{theme.component-Dhm3MpVW.cjs → theme.component-ByOov4NR.cjs} +2 -2
  193. package/dist/{theme.component-Dhm3MpVW.cjs.map → theme.component-ByOov4NR.cjs.map} +1 -1
  194. package/dist/{theme.component-DwZx0sdk.js → theme.component-D4gPoycY.js} +2 -2
  195. package/dist/{theme.component-DwZx0sdk.js.map → theme.component-D4gPoycY.js.map} +1 -1
  196. package/dist/theme.js +1 -1
  197. package/dist/{tree-BkhYPaz6.cjs → tree-DJQKaG-K.cjs} +2 -2
  198. package/dist/{tree-BkhYPaz6.cjs.map → tree-DJQKaG-K.cjs.map} +1 -1
  199. package/dist/{tree-C7GnGCWU.js → tree-DW_S-LL9.js} +2 -2
  200. package/dist/{tree-C7GnGCWU.js.map → tree-DW_S-LL9.js.map} +1 -1
  201. package/dist/tree.cjs +1 -1
  202. package/dist/tree.js +1 -1
  203. package/dist/{typewriter-DfOKVMWh.js → typewriter-_3w-aV-9.js} +4 -4
  204. package/dist/{typewriter-DfOKVMWh.js.map → typewriter-_3w-aV-9.js.map} +1 -1
  205. package/dist/{typewriter-DGIW1V_b.cjs → typewriter-jDCMhixI.cjs} +2 -2
  206. package/dist/{typewriter-DGIW1V_b.cjs.map → typewriter-jDCMhixI.cjs.map} +1 -1
  207. package/dist/typewriter.cjs +1 -1
  208. package/dist/typewriter.js +1 -1
  209. package/dist/{typography-DQHpwRFR.cjs → typography-BhqtMVYz.cjs} +2 -2
  210. package/dist/{typography-DQHpwRFR.cjs.map → typography-BhqtMVYz.cjs.map} +1 -1
  211. package/dist/{typography-En0tk2d5.js → typography-GzUb3OWl.js} +2 -2
  212. package/dist/{typography-En0tk2d5.js.map → typography-GzUb3OWl.js.map} +1 -1
  213. package/dist/typography.cjs +1 -1
  214. package/dist/typography.js +1 -1
  215. package/package.json +2 -2
  216. package/types/src/autocomplete/autocomplete.d.ts +16 -93
  217. package/types/src/chips/chip.d.ts +0 -2
  218. package/types/src/date-range/date-range.d.ts +14 -15
  219. package/types/src/input/input.d.ts +60 -80
  220. package/types/src/layout/flex/flex.d.ts +24 -1
  221. package/types/src/option/option.d.ts +2 -2
  222. package/types/src/select/select.d.ts +37 -15
  223. package/dist/autocomplete-CcDfKbfJ.js +0 -212
  224. package/dist/autocomplete-CcDfKbfJ.js.map +0 -1
  225. package/dist/autocomplete-Dfq-Rhjy.cjs +0 -43
  226. package/dist/autocomplete-Dfq-Rhjy.cjs.map +0 -1
  227. package/dist/date-range-CDX0VlcK.cjs +0 -58
  228. package/dist/date-range-CDX0VlcK.cjs.map +0 -1
  229. package/dist/date-range-DdGaWGVn.js +0 -130
  230. package/dist/date-range-DdGaWGVn.js.map +0 -1
  231. package/dist/input-2kqgsr0S.cjs +0 -43
  232. package/dist/input-2kqgsr0S.cjs.map +0 -1
  233. package/dist/input-D3hti5wB.js +0 -124
  234. package/dist/input-D3hti5wB.js.map +0 -1
  235. package/dist/menu-CCQYHiy2.js.map +0 -1
  236. package/dist/menu-ifiBMg-F.cjs +0 -31
  237. package/dist/menu-ifiBMg-F.cjs.map +0 -1
  238. package/dist/option-CM24cDF6.js +0 -40
  239. package/dist/option-CM24cDF6.js.map +0 -1
  240. package/dist/option-DOBWmGE5.cjs +0 -14
  241. package/dist/option-DOBWmGE5.cjs.map +0 -1
  242. package/dist/scroll-CCExKwoj.cjs +0 -33
  243. package/dist/scroll-CCExKwoj.cjs.map +0 -1
  244. package/dist/scroll-CYzhWpN5.js.map +0 -1
  245. package/dist/select-BakBo7W1.js +0 -99
  246. package/dist/select-BakBo7W1.js.map +0 -1
  247. package/dist/select-ljp7-IxH.cjs +0 -46
  248. package/dist/select-ljp7-IxH.cjs.map +0 -1
  249. package/dist/surface-AT93K5Zv.cjs +0 -7
  250. package/dist/surface-AT93K5Zv.cjs.map +0 -1
  251. package/dist/surface-DJMJ2MOG.js +0 -40
  252. package/dist/surface-DJMJ2MOG.js.map +0 -1
@@ -1,120 +1,43 @@
1
- import SchmancyInput from '@schmancy/input/input';
2
- import SchmancyOption from '@schmancy/option/option';
3
- import type { SchmancyInputChangeEvent } from '..';
4
1
  export type SchmancyAutocompleteChangeEvent = CustomEvent<{
5
2
  value: string | string[];
6
3
  }>;
7
4
  declare const SchmancyAutocomplete_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
8
5
  export default class SchmancyAutocomplete extends SchmancyAutocomplete_base {
9
- /**
10
- * Whether input is required for form validity.
11
- */
12
6
  required: boolean;
13
- /**
14
- * Placeholder text for the input.
15
- */
16
7
  placeholder: string;
17
- /**
18
- * Programmatic value of the autocomplete. Setting this
19
- * after the element is rendered will now update the display.
20
- */
21
8
  value: string;
22
- /**
23
- * Label for the input (floating label or similar).
24
- */
25
9
  label: string;
26
10
  /**
27
- * Max height of the dropdown options container.
11
+ * ⚠️ If you still want an explicit fallback for maximum dropdown height,
12
+ * you can keep this, but the `size()` middleware will already set a
13
+ * dynamic max-height based on viewport space.
28
14
  */
29
15
  maxHeight: string;
30
- /**
31
- * Whether multiple selections are allowed.
32
- */
33
16
  multi: boolean;
34
- /**
35
- * A local property to store the *display* value (label text).
36
- * This is separate from the raw `value`.
37
- */
38
- valueLabel: string;
17
+ /** Direct reference to the <input> inside <schmancy-input>. */
39
18
  inputRef: import("lit-html/directives/ref").Ref<HTMLInputElement>;
40
- /**
41
- * The main <ul> with id="options".
42
- */
43
- optionsContainer: HTMLUListElement;
44
- /**
45
- * The "no results found" <li> element.
46
- */
47
- empty: HTMLLIElement;
48
- /**
49
- * The SchmancyInput element (your visible text input).
50
- */
51
- input: SchmancyInput;
52
- /**
53
- * All the <schmancy-option> children assigned via the default slot.
54
- */
55
- options: SchmancyOption[];
19
+ private optionsContainer;
20
+ private empty;
21
+ private input;
22
+ private options;
56
23
  private readonly searchTerm$;
24
+ private startY;
57
25
  connectedCallback(): void;
58
- /**
59
- * firstUpdated (similar to componentDidMount in React).
60
- * We can do an initial sync of the input's display text
61
- * if a `value` was pre-set.
62
- */
63
26
  firstUpdated(): void;
64
- /**
65
- * This will be invoked *any time* a reactive property changes
66
- * after the first render. We specifically check if `value` changed,
67
- * so we can update the display text (and selected states) if needed.
68
- */
69
27
  protected updated(changedProps: Map<string | number | symbol, unknown>): void;
70
- /**
71
- * If user assigned new <schmancy-option> children, or changed them,
72
- * we also want to ensure the "no results" is correct and that
73
- * our input text is still in sync.
74
- */
75
28
  private handleSlotChange;
76
- /**
77
- * For multi-select, ensure that any `value` strings
78
- * are reflected in the child <schmancy-option>'s `selected` property.
79
- * For single select, do similarly for the one matching option.
80
- */
81
29
  private syncSelectionFromValue;
30
+ private updateInputValue;
82
31
  /**
83
- * Takes the current `value` (and child <schmancy-option>s) and updates
84
- * the displayed text in the schmancy-input. Called whenever we need
85
- * to re-sync the visible input text to the actual data.
86
- */
87
- updateInputValue(): void;
88
- /**
89
- * Show the dropdown list, using Floating UI for positioning.
90
- */
91
- showOptions(): Promise<void>;
92
- /**
93
- * Hide the dropdown immediately (no animation).
94
- */
95
- hideOptions(): void;
96
- /**
97
- * Called whenever the user types in the schmancy-input.
98
- */
99
- handleInputChange(event: SchmancyInputChangeEvent): void;
100
- /**
101
- * Called whenever user clicks or taps an <schmancy-option>.
102
- */
103
- handleOptionClick(value: string): void;
104
- /**
105
- * Check validity of the selected value(s) to satisfy forms.
32
+ * MAIN: Show the dropdown, using Floating UI to size it
33
+ * to the available space, and at least as wide as the input.
106
34
  */
35
+ private showOptions;
36
+ private hideOptions;
37
+ private handleInputChange;
38
+ private handleOptionClick;
107
39
  checkValidity(): boolean;
108
- /**
109
- * Actually cause form validation checks if needed.
110
- */
111
40
  reportValidity(): boolean;
112
- /**
113
- * Attempt to prevent iOS scrolling the background page
114
- * while swiping within the options list. (NB: This logic
115
- * currently needs a bit more nuance to be robust.)
116
- */
117
- private startY;
118
41
  private handleTouchStart;
119
42
  private preventScroll;
120
43
  render(): import("lit-html").TemplateResult<1>;
@@ -1,10 +1,8 @@
1
1
  import '@material/web/chips/chip-set.js';
2
2
  import '@material/web/chips/filter-chip.js';
3
- import { ChipSet } from '@material/web/chips/internal/chip-set';
4
3
  import { LitElement } from 'lit';
5
4
  declare const SchmancyChip_base: CustomElementConstructor & import("@mixins/index").Constructor<LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
6
5
  export default class SchmancyChip extends SchmancyChip_base {
7
- chipSet: ChipSet;
8
6
  label: string;
9
7
  value: string;
10
8
  selected: boolean;
@@ -27,41 +27,40 @@ export default class SchmancyDateRange extends SchmancyDateRange_base {
27
27
  dateTo: string;
28
28
  };
29
29
  step: moment.unitOfTime.DurationConstructor;
30
- selected?: boolean;
31
30
  }>;
32
31
  connectedCallback(): void;
33
32
  updated(changedProps: Map<string, unknown>): void;
34
33
  /**
35
- * Returns the date format string based on the current type.
34
+ * Format strings for the internal <input> and for display text.
36
35
  */
37
36
  private getDateFormat;
38
- /**
39
- * Returns the display format for showing dates.
40
- */
41
37
  private getDisplayFormat;
42
38
  /**
43
- * Initializes the preset date ranges.
39
+ * Build up a list of preset ranges (yesterday, today, etc.).
44
40
  */
45
41
  private initPresetRanges;
46
42
  /**
47
- * Updates the selectedDateRange state based on the current dateFrom and dateTo values.
43
+ * Based on the current dateFrom/dateTo, see if it matches a preset.
44
+ * Otherwise display a "Custom" range: "Jan 01, 2023 - Jan 07, 2023".
48
45
  */
49
46
  private updateSelectedDateRange;
50
47
  /**
51
- * Updates the internal date range state and dispatches a change event.
48
+ * Update the internal date range and fire a 'change' event to notify external code.
52
49
  */
53
- setDateRange(fromDate: string, toDate: string): void;
50
+ private setDateRange;
54
51
  /**
55
- * Called when a preset is selected. Updates the date range and closes the menu.
52
+ * Called when user selects a preset from the list.
53
+ * Updates date range and closes the menu.
56
54
  */
57
- handlePresetChange(presetLabel: string): void;
55
+ private handlePresetChange;
58
56
  /**
59
- * Called when the user applies a manual date change.
57
+ * Applies the date range from the inputs.
58
+ * Closes the menu when done.
60
59
  */
61
- handleDateRangeChange(): void;
60
+ private handleDateRangeChange;
62
61
  /**
63
- * Shifts the current date range by multiplying the range length with the given factor.
64
- * Use a negative factor to shift backward.
62
+ * Shift the current date range forward or backward by the same number of days.
63
+ * If the range is 7 days wide, shift 7 days, etc.
65
64
  */
66
65
  private shiftDateRange;
67
66
  render(): import("lit-html").TemplateResult<1>;
@@ -1,4 +1,4 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, PropertyValueMap } from 'lit';
2
2
  declare global {
3
3
  interface HTMLElementTagNameMap {
4
4
  'schmancy-input': SchmancyInput;
@@ -7,105 +7,81 @@ declare global {
7
7
  type EventDetails = {
8
8
  value: string;
9
9
  };
10
- export type SchmancyInputChangeEvent = CustomEvent<EventDetails>;
11
- declare const SchmancyInput_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
12
10
  /**
13
- * `schmancy-input` A custom input component.
11
+ * Custom events the component may emit:
12
+ * - 'input': on every keystroke
13
+ * - 'change': on native blur/change
14
+ * - 'enter': specifically when user presses Enter
14
15
  */
16
+ export type SchmancyInputInputEvent = CustomEvent<EventDetails>;
17
+ export type SchmancyInputChangeEvent = CustomEvent<EventDetails>;
18
+ export type SchmancyInputEnterEvent = CustomEvent<EventDetails>;
19
+ /** Common autocomplete/autofill hints. Extend as needed. */
20
+ type AutoFill = 'on' | 'off' | 'name' | 'username' | 'email' | 'new-password' | 'current-password' | 'organization-title' | 'none';
21
+ declare const SchmancyInput_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
15
22
  export default class SchmancyInput extends SchmancyInput_base {
23
+ /** If user does NOT set `id`, we'll autogenerate one. */
24
+ static _idCounter: number;
25
+ id: string;
16
26
  /**
17
- * The label of the control.
18
- * @attr
19
- * @type {string}
20
- * @default ''
27
+ * The label for the control. If populated, we render a `<label for="...">`.
28
+ * If empty, we add an `aria-label` to the <input> for better screenreader support.
21
29
  */
22
30
  label: string;
23
31
  /**
24
- * The type of the control.
25
- * @attr
26
- * @default 'text'
32
+ * The type of input. (e.g. 'text', 'password', 'email', etc.)
27
33
  */
28
34
  type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'date' | 'datetime-local' | 'time' | 'month' | 'week' | 'color' | 'file';
29
- clickable: boolean;
30
35
  /**
31
- * The name of the control.
32
- * @attr
33
- * @default 'name_' + Date.now()
36
+ * Name attribute (for form submissions). By default, a unique fallback.
34
37
  */
35
38
  name: string;
36
- /**
37
- * The placeholder of the control.
38
- * @attr
39
- * @default ''
40
- */
41
39
  placeholder: string;
42
- /**
43
- * The value of the control.
44
- * @attr
45
- * @default ''
46
- */
40
+ /** Current value of the input. */
47
41
  value: string;
48
- /**
49
- * The pattern attribute of the control.
50
- * @attr
51
- */
42
+ /** Pattern validation attribute. */
52
43
  pattern?: string;
44
+ /** Whether the control is required for form validation. */
53
45
  required: boolean;
46
+ /** Whether the control is disabled. */
54
47
  disabled: boolean;
48
+ /** Whether the input is read-only. */
55
49
  readonly: boolean;
50
+ /** If true, we visually show a pointer cursor even if readOnly. */
51
+ clickable: boolean;
52
+ /** Whether browser spellcheck is enabled. */
56
53
  spellcheck: boolean;
57
- align: 'left' | 'center' | 'right';
58
54
  /**
59
- * The inputmode attribute of the control.
60
- * @attr
61
- * @default undefined
55
+ * Text alignment within the input.
56
+ * - 'left' | 'center' | 'right'
62
57
  */
58
+ align: 'left' | 'center' | 'right';
59
+ /** inputmode attribute (affects on-screen keyboards in mobile). */
63
60
  inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
64
- /**
65
- * The minlength attribute of the control.
66
- * @attr
67
- */
68
61
  minlength?: number;
69
- /**
70
- * The maxlength attribute of the control.
71
- * @attr
72
- */
73
62
  maxlength?: number;
74
- /**
75
- * The min attribute of the control.
76
- * @attr
77
- */
78
63
  min?: string;
79
- /**
80
- * The max attribute of the control.
81
- * @attr
82
- */
83
64
  max?: string;
84
- /**
85
- * The step attribute of the control.
86
- * @attr
87
- */
88
65
  step?: number;
89
- /**
90
- * The autofocus attribute of the control.
91
- * @attr
92
- * @default false
93
- */
66
+ /** If true, auto-focus this input on first render. */
94
67
  autofocus: boolean;
95
- /**
96
- * The autocomplete attribute of the control.
97
- * @attr
98
- */
68
+ /** Autocomplete/autofill hints. */
99
69
  autocomplete: AutoFill;
100
70
  /**
101
- * tabIndex for focusing by tab key.
71
+ * tabIndex for focusing by tab key. Typically 0 or -1.
102
72
  */
103
73
  tabIndex: number;
74
+ /**
75
+ * A small hint text or error message to display under the input.
76
+ */
104
77
  hint?: string;
78
+ /**
79
+ * If true, we style the input as an error state, and possibly display
80
+ * the hint as an error message.
81
+ */
105
82
  error: boolean;
106
- inputElement: HTMLInputElement;
107
- inputRef: import("lit-html/directives/ref").Ref<HTMLInputElement>;
108
- /** Form-associated custom elements support. */
83
+ private inputElement;
84
+ private inputRef;
109
85
  static formAssociated: boolean;
110
86
  protected static shadowRootOptions: {
111
87
  delegatesFocus: boolean;
@@ -115,35 +91,39 @@ export default class SchmancyInput extends SchmancyInput_base {
115
91
  };
116
92
  private internals?;
117
93
  constructor();
118
- get form(): HTMLFormElement;
119
94
  /**
120
- * (Optional) Whenever value changes, sync with form internals for
121
- * form submission (if you're using form-associated custom elements).
95
+ * If user did not provide an ID, auto-generate one so <label for="...">
96
+ * and various aria-* attributes can reference it.
122
97
  */
98
+ protected willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
99
+ /** The form this element is associated with, if any. */
100
+ get form(): HTMLFormElement;
123
101
  protected updated(changedProps: Map<string, unknown>): void;
124
- /** Checks for validity of the control and shows the browser message if it's invalid. */
125
- reportValidity(): boolean;
126
- /** Checks for validity of the control and emits the invalid event if it is invalid. */
102
+ /**
103
+ * Native form methods:
104
+ * - checkValidity()
105
+ * - reportValidity()
106
+ * - setCustomValidity()
107
+ */
127
108
  checkValidity(): boolean;
128
- /** Sets a custom validity message. */
109
+ reportValidity(): boolean;
129
110
  setCustomValidity(message: string): void;
130
111
  firstUpdated(): void;
131
112
  /** Selects all text within the input. */
132
113
  select(): void;
133
- /** Returns the internal validity state object. */
114
+ /** Returns the native validity state of the inner <input>. */
134
115
  getValidity(): ValidityState | undefined;
135
116
  /**
136
- * Override focus so that focusing <schmancy-input> actually focuses
137
- * the internal <input>.
117
+ * Override to forward focus to the internal <input>.
118
+ * Also dispatch a 'focus' event for external listeners.
138
119
  */
139
120
  focus(options?: FocusOptions): void;
140
121
  /**
141
- * Same with click; bubble a click out if needed, but delegate to internal input.
122
+ * Override to forward clicks to the internal <input>.
123
+ * Also dispatch a 'click' event for external listeners.
142
124
  */
143
125
  click(): void;
144
- /**
145
- * Same with blur; bubble the event.
146
- */
126
+ /** Forward blur to the internal <input>. */
147
127
  blur(): void;
148
128
  protected render(): import("lit-html").TemplateResult<1>;
149
129
  }
@@ -2,10 +2,33 @@ import Layout from '../layout/layout';
2
2
  export declare class SchmancyFlex extends Layout {
3
3
  static styles: any[];
4
4
  layout: boolean;
5
+ /**
6
+ * The flex direction property:
7
+ * - "row" | "row-reverse" | "col" | "col-reverse"
8
+ */
5
9
  flow: 'row' | 'row-reverse' | 'col' | 'col-reverse';
10
+ /**
11
+ * The flex-wrap property:
12
+ * - "wrap" | "nowrap" | "wrap-reverse"
13
+ */
6
14
  wrap: 'wrap' | 'nowrap' | 'wrap-reverse';
15
+ /**
16
+ * Align-items property:
17
+ * - "start" (flex-start), "center", "end" (flex-end), "stretch", "baseline"
18
+ */
7
19
  align: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
8
- justify: 'start' | 'center' | 'end' | 'stretch' | 'between';
20
+ /**
21
+ * Justify-content property:
22
+ * - "start", "center", "end", "between"
23
+ * (Note: "stretch" doesn't exist as a Tailwind justify- class;
24
+ * for horizontal stretching, you typically rely on width or gap.)
25
+ */
26
+ justify: 'start' | 'center' | 'end' | 'between';
27
+ /**
28
+ * Gap sizes:
29
+ * - "none" (0), "sm" (2), "md" (4), "lg" (8)
30
+ * (Feel free to add more if your Tailwind config has them.)
31
+ */
9
32
  gap: 'none' | 'sm' | 'md' | 'lg';
10
33
  render(): import("lit-html").TemplateResult<1>;
11
34
  }
@@ -7,8 +7,8 @@ export default class SchmancyOption extends SchmancyOption_base {
7
7
  value: string;
8
8
  label: string | undefined;
9
9
  selected: boolean;
10
- handleOptionClick(option: string): void;
11
- protected render(): unknown;
10
+ private handleOptionClick;
11
+ protected render(): import("lit-html").TemplateResult<1>;
12
12
  }
13
13
  declare global {
14
14
  interface HTMLElementTagNameMap {
@@ -1,28 +1,50 @@
1
- import SchmancyOption from '@schmancy/option/option';
2
1
  export type SchmancySelectChangeEvent = CustomEvent<{
3
2
  value: string | string[];
4
3
  }>;
5
4
  declare const SchmancySelect_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
6
- export default class SchmancySelect extends SchmancySelect_base {
5
+ export declare class SchmancySelect extends SchmancySelect_base {
7
6
  required: boolean;
8
7
  placeholder: string;
9
8
  value: string;
9
+ selectedValues: string[];
10
10
  multi: boolean;
11
11
  label: string;
12
- valueLabel: string;
13
- ul: HTMLUListElement;
14
- overlay: HTMLElement;
15
- options: SchmancyOption[];
12
+ private isOpen;
13
+ private valueLabel;
14
+ private ul;
15
+ private options;
16
+ private cleanupPositioner?;
17
+ connectedCallback(): void;
18
+ disconnectedCallback(): void;
16
19
  firstUpdated(): void;
17
- updateDisplayLabel(): void;
18
- handleOptionClick(value: string): void;
19
- showOptions(): Promise<void>;
20
- hideOptions(): void;
20
+ /**
21
+ * Whenever new <schmancy-option> children get slotted in,
22
+ * or whenever properties change, ensure the correct .selected states
23
+ * and display text are applied.
24
+ */
25
+ private syncSelection;
26
+ /**
27
+ * We can also set up any ARIA attributes here.
28
+ * Note that we’re toggling `aria-selected` for screen readers,
29
+ * but the highlight in CSS is triggered by the option’s `selected` property.
30
+ */
31
+ private setupOptionsAccessibility;
32
+ /**
33
+ * Use @floating-ui/dom to position the <ul> under the "trigger" input.
34
+ */
35
+ private positionDropdown;
36
+ /**
37
+ * Keydown logic for opening/closing the dropdown and navigating options.
38
+ */
39
+ private handleKeyDown;
40
+ private focusOption;
41
+ private openDropdown;
42
+ private closeDropdown;
43
+ /**
44
+ * Main method for toggling or setting selected items.
45
+ */
46
+ private handleOptionSelect;
47
+ private dispatchChange;
21
48
  render(): import("lit-html").TemplateResult<1>;
22
49
  }
23
- declare global {
24
- interface HTMLElementTagNameMap {
25
- 'schmancy-select': SchmancySelect;
26
- }
27
- }
28
50
  export {};