react-material-design 0.0.0-stage → 0.5.0

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 (292) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  4. package/dist/components/Button/context.cjs +1 -0
  5. package/dist/components/Button/context.d.ts +29 -0
  6. package/dist/components/Button/context.js +41 -0
  7. package/dist/components/Button/default/index.cjs +1 -0
  8. package/dist/components/Button/default/index.d.ts +26 -0
  9. package/dist/components/Button/default/index.js +22 -0
  10. package/dist/components/Button/default/render.cjs +1 -0
  11. package/dist/components/Button/default/render.d.ts +3 -0
  12. package/dist/components/Button/default/render.js +203 -0
  13. package/dist/components/Button/default/style.css +1 -0
  14. package/dist/components/Button/group/index.cjs +1 -0
  15. package/dist/components/Button/group/index.d.ts +2 -0
  16. package/dist/components/Button/group/index.js +1 -0
  17. package/dist/components/Button/group/render.cjs +1 -0
  18. package/dist/components/Button/group/render.d.ts +49 -0
  19. package/dist/components/Button/group/render.js +100 -0
  20. package/dist/components/Button/group/style.css +1 -0
  21. package/dist/components/Button/icon/index.cjs +1 -0
  22. package/dist/components/Button/icon/index.d.ts +22 -0
  23. package/dist/components/Button/icon/index.js +23 -0
  24. package/dist/components/Button/icon/render.cjs +1 -0
  25. package/dist/components/Button/icon/render.d.ts +4 -0
  26. package/dist/components/Button/icon/render.js +178 -0
  27. package/dist/components/Button/icon/style.css +1 -0
  28. package/dist/components/Button/index.cjs +1 -0
  29. package/dist/components/Button/index.d.ts +1 -0
  30. package/dist/components/Button/index.js +55 -0
  31. package/dist/components/Button/split/index.cjs +1 -0
  32. package/dist/components/Button/split/index.d.ts +6 -0
  33. package/dist/components/Button/split/index.js +33 -0
  34. package/dist/components/Button/split/style.css +1 -0
  35. package/dist/components/Button/types.d.ts +19 -0
  36. package/dist/components/Card/index.d.ts +1 -0
  37. package/dist/components/Chip/index.cjs +1 -0
  38. package/dist/components/Chip/index.d.ts +50 -0
  39. package/dist/components/Chip/index.js +156 -0
  40. package/dist/components/Chip/style.css +1 -0
  41. package/dist/components/ContextMenu/index.cjs +1 -0
  42. package/dist/components/ContextMenu/index.d.ts +2 -0
  43. package/dist/components/ContextMenu/index.js +19 -0
  44. package/dist/components/ContextMenu/render.cjs +1 -0
  45. package/dist/components/ContextMenu/render.d.ts +4 -0
  46. package/dist/components/ContextMenu/render.js +59 -0
  47. package/dist/components/Dialog/Dialog.cjs +1 -0
  48. package/dist/components/Dialog/Dialog.d.ts +23 -0
  49. package/dist/components/Dialog/Dialog.js +182 -0
  50. package/dist/components/Dialog/DialogActions.cjs +1 -0
  51. package/dist/components/Dialog/DialogActions.d.ts +3 -0
  52. package/dist/components/Dialog/DialogActions.js +17 -0
  53. package/dist/components/Dialog/index.cjs +1 -0
  54. package/dist/components/Dialog/index.d.ts +4 -0
  55. package/dist/components/Dialog/index.js +3 -0
  56. package/dist/components/Dialog/style.css +1 -0
  57. package/dist/components/Divider/index.cjs +1 -0
  58. package/dist/components/Divider/index.d.ts +6 -0
  59. package/dist/components/Divider/index.js +29 -0
  60. package/dist/components/Divider/style.css +1 -0
  61. package/dist/components/Font/index.d.ts +9 -0
  62. package/dist/components/Icon/Icon.cjs +1 -0
  63. package/dist/components/Icon/Icon.d.ts +18 -0
  64. package/dist/components/Icon/Icon.js +47 -0
  65. package/dist/components/Icon/index.cjs +1 -0
  66. package/dist/components/Icon/index.d.ts +2 -0
  67. package/dist/components/Icon/index.js +1 -0
  68. package/dist/components/Icon/style.css +1 -0
  69. package/dist/components/Menu/Menu.cjs +1 -0
  70. package/dist/components/Menu/Menu.d.ts +4 -0
  71. package/dist/components/Menu/Menu.js +10 -0
  72. package/dist/components/Menu/Menu.render.cjs +1 -0
  73. package/dist/components/Menu/Menu.render.d.ts +15 -0
  74. package/dist/components/Menu/Menu.render.js +55 -0
  75. package/dist/components/Menu/MenuContainer.cjs +1 -0
  76. package/dist/components/Menu/MenuContainer.d.ts +7 -0
  77. package/dist/components/Menu/MenuContainer.js +46 -0
  78. package/dist/components/Menu/MenuGroup.cjs +1 -0
  79. package/dist/components/Menu/MenuGroup.d.ts +11 -0
  80. package/dist/components/Menu/MenuGroup.js +34 -0
  81. package/dist/components/Menu/MenuGroup.render.cjs +1 -0
  82. package/dist/components/Menu/MenuGroup.render.d.ts +6 -0
  83. package/dist/components/Menu/MenuGroup.render.js +31 -0
  84. package/dist/components/Menu/MenuItem.cjs +1 -0
  85. package/dist/components/Menu/MenuItem.d.ts +19 -0
  86. package/dist/components/Menu/MenuItem.js +30 -0
  87. package/dist/components/Menu/MenuItem.render.cjs +1 -0
  88. package/dist/components/Menu/MenuItem.render.d.ts +7 -0
  89. package/dist/components/Menu/MenuItem.render.js +75 -0
  90. package/dist/components/Menu/index.cjs +1 -0
  91. package/dist/components/Menu/index.d.ts +3 -0
  92. package/dist/components/Menu/index.js +4 -0
  93. package/dist/components/Menu/style.css +1 -0
  94. package/dist/components/Menubar/MenuSection.d.ts +8 -0
  95. package/dist/components/Menubar/index.cjs +1 -0
  96. package/dist/components/Menubar/index.d.ts +2 -0
  97. package/dist/components/Menubar/index.js +19 -0
  98. package/dist/components/Menubar/render.cjs +1 -0
  99. package/dist/components/Menubar/render.d.ts +3 -0
  100. package/dist/components/Menubar/render.js +58 -0
  101. package/dist/components/Menubar/style.css +1 -0
  102. package/dist/components/NumberField/NumberField.cjs +1 -0
  103. package/dist/components/NumberField/NumberField.d.ts +2 -0
  104. package/dist/components/NumberField/NumberField.js +19 -0
  105. package/dist/components/NumberField/NumberField.render.cjs +1 -0
  106. package/dist/components/NumberField/NumberField.render.d.ts +10 -0
  107. package/dist/components/NumberField/NumberField.render.js +268 -0
  108. package/dist/components/NumberField/index.cjs +1 -0
  109. package/dist/components/NumberField/index.d.ts +2 -0
  110. package/dist/components/NumberField/index.js +1 -0
  111. package/dist/components/NumberField/style.css +1 -0
  112. package/dist/components/ProgressIndicator/index.d.ts +9 -0
  113. package/dist/components/Select/Option.cjs +1 -0
  114. package/dist/components/Select/Option.d.ts +10 -0
  115. package/dist/components/Select/Option.js +24 -0
  116. package/dist/components/Select/Select.cjs +1 -0
  117. package/dist/components/Select/Select.d.ts +32 -0
  118. package/dist/components/Select/Select.js +265 -0
  119. package/dist/components/Select/index.cjs +1 -0
  120. package/dist/components/Select/index.d.ts +4 -0
  121. package/dist/components/Select/index.js +3 -0
  122. package/dist/components/Select/style.css +1 -0
  123. package/dist/components/Slider/Slider.cjs +1 -0
  124. package/dist/components/Slider/Slider.d.ts +26 -0
  125. package/dist/components/Slider/Slider.js +342 -0
  126. package/dist/components/Slider/index.cjs +1 -0
  127. package/dist/components/Slider/index.d.ts +1 -0
  128. package/dist/components/Slider/index.js +1 -0
  129. package/dist/components/Slider/style.css +1 -0
  130. package/dist/components/TextField/TextField.cjs +1 -0
  131. package/dist/components/TextField/TextField.d.ts +2 -0
  132. package/dist/components/TextField/TextField.js +19 -0
  133. package/dist/components/TextField/TextField.render.cjs +1 -0
  134. package/dist/components/TextField/TextField.render.d.ts +19 -0
  135. package/dist/components/TextField/TextField.render.js +159 -0
  136. package/dist/components/TextField/index.cjs +1 -0
  137. package/dist/components/TextField/index.d.ts +2 -0
  138. package/dist/components/TextField/index.js +1 -0
  139. package/dist/components/TextField/style.css +1 -0
  140. package/dist/components/Theme/Theme.cjs +4 -0
  141. package/dist/components/Theme/Theme.d.ts +14 -0
  142. package/dist/components/Theme/Theme.js +183 -0
  143. package/dist/components/Theme/index.cjs +1 -0
  144. package/dist/components/Theme/index.d.ts +1 -0
  145. package/dist/components/Theme/index.js +1 -0
  146. package/dist/components/Theme/style.css +1 -0
  147. package/dist/components/Theme/types.d.ts +29 -0
  148. package/dist/components/Toolbar/Toolbar.cjs +1 -0
  149. package/dist/components/Toolbar/Toolbar.d.ts +3 -0
  150. package/dist/components/Toolbar/Toolbar.js +19 -0
  151. package/dist/components/Toolbar/Toolbar.render.cjs +1 -0
  152. package/dist/components/Toolbar/Toolbar.render.d.ts +14 -0
  153. package/dist/components/Toolbar/Toolbar.render.js +64 -0
  154. package/dist/components/Toolbar/index.cjs +1 -0
  155. package/dist/components/Toolbar/index.d.ts +2 -0
  156. package/dist/components/Toolbar/index.js +1 -0
  157. package/dist/components/Toolbar/style.css +1 -0
  158. package/dist/components/Tooltip/Tooltip.cjs +1 -0
  159. package/dist/components/Tooltip/Tooltip.d.ts +12 -0
  160. package/dist/components/Tooltip/Tooltip.js +52 -0
  161. package/dist/components/Tooltip/index.cjs +1 -0
  162. package/dist/components/Tooltip/index.d.ts +1 -0
  163. package/dist/components/Tooltip/index.js +1 -0
  164. package/dist/components/Tooltip/style.css +1 -0
  165. package/dist/components/containers/FilledField/index.cjs +1 -0
  166. package/dist/components/containers/FilledField/index.d.ts +9 -0
  167. package/dist/components/containers/FilledField/index.js +40 -0
  168. package/dist/components/containers/FilledField/style.css +1 -0
  169. package/dist/components/containers/OutlinedField/index.cjs +1 -0
  170. package/dist/components/containers/OutlinedField/index.d.ts +9 -0
  171. package/dist/components/containers/OutlinedField/index.js +59 -0
  172. package/dist/components/containers/OutlinedField/style.css +1 -0
  173. package/dist/components/misc/FloatingElement/index.cjs +1 -0
  174. package/dist/components/misc/FloatingElement/index.d.ts +17 -0
  175. package/dist/components/misc/FloatingElement/index.js +106 -0
  176. package/dist/components/misc/FloatingElement/style.css +1 -0
  177. package/dist/components/misc/OrderedCollection/index.cjs +1 -0
  178. package/dist/components/misc/OrderedCollection/index.d.ts +27 -0
  179. package/dist/components/misc/OrderedCollection/index.js +98 -0
  180. package/dist/components/misc/OrderedCollection/style.css +1 -0
  181. package/dist/components/misc/Polymorphic.cjs +1 -0
  182. package/dist/components/misc/Polymorphic.d.ts +15 -0
  183. package/dist/components/misc/Polymorphic.js +51 -0
  184. package/dist/components/misc/StateLayer/index.cjs +1 -0
  185. package/dist/components/misc/StateLayer/index.d.ts +7 -0
  186. package/dist/components/misc/StateLayer/index.js +67 -0
  187. package/dist/components/misc/StateLayer/style.css +1 -0
  188. package/dist/components/misc/Transitionable/index.cjs +1 -0
  189. package/dist/components/misc/Transitionable/index.d.ts +6 -0
  190. package/dist/components/misc/Transitionable/index.js +54 -0
  191. package/dist/components/misc/Transitionable/style.css +1 -0
  192. package/dist/components/types.cjs +1 -0
  193. package/dist/components/types.d.ts +20 -0
  194. package/dist/components/types.js +13 -0
  195. package/dist/hooks/useFloating/autoUpdate.cjs +1 -0
  196. package/dist/hooks/useFloating/autoUpdate.d.ts +9 -0
  197. package/dist/hooks/useFloating/autoUpdate.js +64 -0
  198. package/dist/hooks/useFloating/index.cjs +1 -0
  199. package/dist/hooks/useFloating/index.d.ts +30 -0
  200. package/dist/hooks/useFloating/index.js +97 -0
  201. package/dist/hooks/useFloating/middleware/flip.cjs +1 -0
  202. package/dist/hooks/useFloating/middleware/flip.d.ts +2 -0
  203. package/dist/hooks/useFloating/middleware/flip.js +88 -0
  204. package/dist/hooks/useFloating/middleware/offset.cjs +1 -0
  205. package/dist/hooks/useFloating/middleware/offset.d.ts +2 -0
  206. package/dist/hooks/useFloating/middleware/offset.js +42 -0
  207. package/dist/hooks/useFloating/middleware/shift.cjs +1 -0
  208. package/dist/hooks/useFloating/middleware/shift.d.ts +2 -0
  209. package/dist/hooks/useFloating/middleware/shift.js +11 -0
  210. package/dist/hooks/useFloating/middleware/size.cjs +1 -0
  211. package/dist/hooks/useFloating/middleware/size.d.ts +6 -0
  212. package/dist/hooks/useFloating/middleware/size.js +7 -0
  213. package/dist/hooks/useFloating/utils.cjs +1 -0
  214. package/dist/hooks/useFloating/utils.d.ts +22 -0
  215. package/dist/hooks/useFloating/utils.js +145 -0
  216. package/dist/layouts/Content.cjs +1 -0
  217. package/dist/layouts/Content.d.ts +3 -0
  218. package/dist/layouts/Content.js +17 -0
  219. package/dist/layouts/Page/index.cjs +1 -0
  220. package/dist/layouts/Page/index.d.ts +7 -0
  221. package/dist/layouts/Page/index.js +135 -0
  222. package/dist/layouts/Page/style.css +1 -0
  223. package/dist/layouts/Panes/Pane.cjs +1 -0
  224. package/dist/layouts/Panes/Pane.d.ts +11 -0
  225. package/dist/layouts/Panes/Pane.js +27 -0
  226. package/dist/layouts/Panes/Pane.render.cjs +1 -0
  227. package/dist/layouts/Panes/Pane.render.d.ts +6 -0
  228. package/dist/layouts/Panes/Pane.render.js +36 -0
  229. package/dist/layouts/Panes/Panes.cjs +1 -0
  230. package/dist/layouts/Panes/Panes.d.ts +28 -0
  231. package/dist/layouts/Panes/Panes.js +182 -0
  232. package/dist/layouts/Panes/index.cjs +1 -0
  233. package/dist/layouts/Panes/index.d.ts +2 -0
  234. package/dist/layouts/Panes/index.js +3 -0
  235. package/dist/layouts/Panes/style.css +1 -0
  236. package/dist/layouts/Tabs/Tab.d.ts +13 -0
  237. package/dist/layouts/Tabs/Tabs.d.ts +9 -0
  238. package/dist/layouts/Tabs/index.cjs +1 -0
  239. package/dist/layouts/Tabs/index.d.ts +1 -0
  240. package/dist/layouts/Tabs/index.js +0 -0
  241. package/dist/layouts/Toolbox/index.cjs +1 -0
  242. package/dist/layouts/Toolbox/index.d.ts +5 -0
  243. package/dist/layouts/Toolbox/index.js +129 -0
  244. package/dist/layouts/Toolbox/style.css +1 -0
  245. package/dist/style/motions.d.ts +37 -0
  246. package/dist/style/shapes/12_sided_cookie.d.ts +3 -0
  247. package/dist/style/shapes/4_leaf_clover.d.ts +3 -0
  248. package/dist/style/shapes/4_sided_cookie.d.ts +3 -0
  249. package/dist/style/shapes/6_sided_cookie.d.ts +3 -0
  250. package/dist/style/shapes/7_sided_cookie.d.ts +3 -0
  251. package/dist/style/shapes/8_leaf_clover.d.ts +3 -0
  252. package/dist/style/shapes/9_sided_cookie.d.ts +3 -0
  253. package/dist/style/shapes/arch.d.ts +3 -0
  254. package/dist/style/shapes/arrow.d.ts +3 -0
  255. package/dist/style/shapes/boom.d.ts +3 -0
  256. package/dist/style/shapes/bun.d.ts +3 -0
  257. package/dist/style/shapes/burst.d.ts +3 -0
  258. package/dist/style/shapes/circle.d.ts +3 -0
  259. package/dist/style/shapes/clamshell.d.ts +3 -0
  260. package/dist/style/shapes/diamond.d.ts +3 -0
  261. package/dist/style/shapes/fan.d.ts +3 -0
  262. package/dist/style/shapes/flower.d.ts +3 -0
  263. package/dist/style/shapes/gem.d.ts +3 -0
  264. package/dist/style/shapes/ghost_ish.d.ts +3 -0
  265. package/dist/style/shapes/heart.d.ts +3 -0
  266. package/dist/style/shapes/index.d.ts +109 -0
  267. package/dist/style/shapes/oval.d.ts +3 -0
  268. package/dist/style/shapes/pentagon.d.ts +3 -0
  269. package/dist/style/shapes/pill.d.ts +3 -0
  270. package/dist/style/shapes/pixel_circle.d.ts +3 -0
  271. package/dist/style/shapes/pixel_triangle.d.ts +3 -0
  272. package/dist/style/shapes/puffy.d.ts +3 -0
  273. package/dist/style/shapes/puffy_diamond.d.ts +3 -0
  274. package/dist/style/shapes/semicircle.d.ts +3 -0
  275. package/dist/style/shapes/slanted.d.ts +3 -0
  276. package/dist/style/shapes/soft_boom.d.ts +3 -0
  277. package/dist/style/shapes/soft_burst.d.ts +3 -0
  278. package/dist/style/shapes/square.d.ts +3 -0
  279. package/dist/style/shapes/sunny.d.ts +3 -0
  280. package/dist/style/shapes/triangle.d.ts +3 -0
  281. package/dist/style/shapes/very_sunny.d.ts +3 -0
  282. package/dist/style/symbols.d.ts +2 -0
  283. package/dist/utils/dom.cjs +1 -0
  284. package/dist/utils/dom.d.ts +2 -0
  285. package/dist/utils/dom.js +53 -0
  286. package/dist/utils/hooks.cjs +1 -0
  287. package/dist/utils/hooks.d.ts +17 -0
  288. package/dist/utils/hooks.js +9 -0
  289. package/dist/utils/index.cjs +1 -0
  290. package/dist/utils/index.d.ts +44 -0
  291. package/dist/utils/index.js +74 -0
  292. package/package.json +169 -4
@@ -0,0 +1,268 @@
1
+ import e, { convertIconDefinition as t } from "../Icon/Icon.js";
2
+ import { clamp as n, isBrowser as r } from "../../utils/index.js";
3
+ import i from "../misc/StateLayer/index.js";
4
+ import a from "../Button/icon/index.js";
5
+ import o from "../containers/FilledField/index.js";
6
+ import s from "../containers/OutlinedField/index.js";
7
+ import './style.css';/* empty css */
8
+ import { c } from "react/compiler-runtime";
9
+ import l from "classnames";
10
+ import { useRef as u, useState as d } from "react";
11
+ import { Fragment as ee, jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import { useWindowEventListener as te } from "react-dom-event-hooks";
13
+ //#region lib/components/NumberField/NumberField.render.tsx
14
+ function ne(e, t = "decimal") {
15
+ return Intl.NumberFormat(e).formatToParts(1000.1).find((e) => e.type === t)?.value;
16
+ }
17
+ function re(e, t, r, i, a = 4) {
18
+ let o = 10 ** a;
19
+ return n((e.toFixed(a) * o + t.toFixed(a) * o) / o, r, i);
20
+ }
21
+ function ie(e, t, r, i, a = 4) {
22
+ let o = 10 ** a;
23
+ return n((e.toFixed(a) * o - t.toFixed(a) * o) / o, r, i);
24
+ }
25
+ function m(m) {
26
+ let h = c(149), g, _, v, y, b, x, S, C, w, T, E, D, O, ae, k;
27
+ if (h[0] !== m) {
28
+ let { shape: e, label: t, onValueChange: n, onChange: r, onInvalid: i, value: a, supportingText: o, clearable: s, decimal: c, hugeStep: l, hideArrow: u, leadingIcon: d, trailingIcon: ee, prefix: f, suffix: p, ...te } = m;
29
+ D = e, x = t, T = n, C = r, w = i, _ = a, ae = o, g = s, y = l, v = u, S = d, k = ee, E = f, O = p, b = te, h[0] = m, h[1] = g, h[2] = _, h[3] = v, h[4] = y, h[5] = b, h[6] = x, h[7] = S, h[8] = C, h[9] = w, h[10] = T, h[11] = E, h[12] = D, h[13] = O, h[14] = ae, h[15] = k;
30
+ } else g = h[1], _ = h[2], v = h[3], y = h[4], b = h[5], x = h[6], S = h[7], C = h[8], w = h[9], T = h[10], E = h[11], D = h[12], O = h[13], ae = h[14], k = h[15];
31
+ let A = u(null), oe;
32
+ h[16] !== _ || h[17] !== m.defaultValue ? (oe = _?.toString() ?? m.defaultValue?.toString() ?? "", h[16] = _, h[17] = m.defaultValue, h[18] = oe) : oe = h[18];
33
+ let [se, ce] = d(oe), le;
34
+ h[19] !== _ || h[20] !== se ? (le = _?.toString() ?? se, h[19] = _, h[20] = se, h[21] = le) : le = h[21];
35
+ let j = le, [ue, de] = d(!1), [M, fe] = d(), [pe, me] = d(!1), N = u(!1), he = u(null), ge = u(null), P;
36
+ h[22] === Symbol.for("react.memo_cache_sentinel") ? (P = (e) => N.current = e.shiftKey, h[22] = P) : P = h[22];
37
+ let _e = P, ve = typeof m.value == "number" || !!j.length || pe, F = M ?? ae, I = m.lang ?? (r() ? window.navigator.language : void 0), L;
38
+ h[23] === m.min ? L = h[24] : (L = m.min === void 0 ? void 0 : parseFloat(m.min.toString()), h[23] = m.min, h[24] = L);
39
+ let R = L, ye;
40
+ h[25] === m.max ? ye = h[26] : (ye = m.max === void 0 ? void 0 : parseFloat(m.max.toString()), h[25] = m.max, h[26] = ye);
41
+ let z = ye, be;
42
+ h[27] === m.step ? be = h[28] : (be = m.step === void 0 ? void 0 : parseFloat(m.step.toString()), h[27] = m.step, h[28] = be);
43
+ let B = be, xe;
44
+ h[29] === y ? xe = h[30] : (xe = y === void 0 ? void 0 : parseFloat(y.toString()), h[29] = y, h[30] = xe);
45
+ let V = xe, H = x ? x + (m.required ? "*" : "") : void 0, Se;
46
+ h[31] !== _ || h[32] !== T ? (Se = (e) => {
47
+ _ === void 0 && ce(e), fe(void 0), me(!1), T?.(parseFloat(e));
48
+ }, h[31] = _, h[32] = T, h[33] = Se) : Se = h[33];
49
+ let U = Se, Ce;
50
+ h[34] !== C || h[35] !== U ? (Ce = (e) => {
51
+ U(e.target.value), C?.(e);
52
+ }, h[34] = C, h[35] = U, h[36] = Ce) : Ce = h[36];
53
+ let we = Ce, Te;
54
+ h[37] === Symbol.for("react.memo_cache_sentinel") ? (Te = () => {
55
+ ge.current !== null && clearTimeout(ge.current), he.current !== null && clearInterval(he.current);
56
+ }, h[37] = Te) : Te = h[37];
57
+ let Ee = Te, De;
58
+ h[38] !== V || h[39] !== z || h[40] !== R || h[41] !== U || h[42] !== B || h[43] !== j ? (De = (e) => {
59
+ let t = e === void 0 || e, r = R ?? -Infinity, i = z ?? Infinity, a = () => n((N.current ? V ?? B : B) ?? 1, r, i);
60
+ U(re(parseFloat(j || `${R ?? 0}`), a(), r, i).toString()), t && (Ee(), ge.current = setTimeout(() => he.current = setInterval(() => U(re(parseFloat(A.current?.value ? A.current.value : `${R ?? 0}`), a(), r, i).toString()), 20), 400));
61
+ }, h[38] = V, h[39] = z, h[40] = R, h[41] = U, h[42] = B, h[43] = j, h[44] = De) : De = h[44];
62
+ let W = De, Oe;
63
+ h[45] !== V || h[46] !== z || h[47] !== R || h[48] !== U || h[49] !== B || h[50] !== j ? (Oe = (e) => {
64
+ let t = e === void 0 || e, r = R ?? -Infinity, i = z ?? Infinity, a = () => n((N.current ? V ?? B : B) ?? 1, R ?? -Infinity, z ?? Infinity);
65
+ U(ie(parseFloat(j || `${R ?? 0}`), a(), r, i).toString()), t && (Ee(), ge.current = setTimeout(() => he.current = setInterval(() => U(ie(parseFloat(A.current?.value ? A.current.value : `${R ?? 0}`), a(), r, i).toString()), 20), 400));
66
+ }, h[45] = V, h[46] = z, h[47] = R, h[48] = U, h[49] = B, h[50] = j, h[51] = Oe) : Oe = h[51];
67
+ let G = Oe, ke;
68
+ h[52] === W ? ke = h[53] : (ke = () => W(), h[52] = W, h[53] = ke);
69
+ let K = ke, Ae;
70
+ h[54] === G ? Ae = h[55] : (Ae = () => G(), h[54] = G, h[55] = Ae);
71
+ let q = Ae, je;
72
+ h[56] === Symbol.for("react.memo_cache_sentinel") ? (je = () => de(!0), h[56] = je) : je = h[56];
73
+ let Me = je, Ne;
74
+ h[57] === Symbol.for("react.memo_cache_sentinel") ? (Ne = (e) => {
75
+ de(!1), A.current?.validity.badInput ? me(!0) : A.current?.validity.valid && (e.currentTarget.value = e.currentTarget.valueAsNumber.toString());
76
+ }, h[57] = Ne) : Ne = h[57];
77
+ let Pe = Ne, Fe;
78
+ h[58] === w ? Fe = h[59] : (Fe = (e) => {
79
+ e.preventDefault(), fe(e.currentTarget.validationMessage), w?.(e), e.currentTarget.focus();
80
+ }, h[58] = w, h[59] = Fe);
81
+ let Ie = Fe, Le;
82
+ h[60] === S ? Le = h[61] : (Le = t(S), h[60] = S, h[61] = Le);
83
+ let J = Le, Re;
84
+ bb0: {
85
+ if (g) {
86
+ let e = k ?? "close", t;
87
+ h[62] === U ? t = h[63] : (t = () => U(""), h[62] = U, h[63] = t);
88
+ let n;
89
+ h[64] !== e || h[65] !== t ? (n = /* @__PURE__ */ f(a, {
90
+ icon: e,
91
+ color: "standard",
92
+ onClick: t,
93
+ className: "trailing"
94
+ }), h[64] = e, h[65] = t, h[66] = n) : n = h[66], Re = n;
95
+ break bb0;
96
+ }
97
+ if (M) {
98
+ let t;
99
+ h[67] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ f(e, {
100
+ name: "error",
101
+ fill: !0,
102
+ className: "error"
103
+ }), h[67] = t) : t = h[67], Re = t;
104
+ break bb0;
105
+ }
106
+ Re = k;
107
+ }
108
+ let ze = Re, Be;
109
+ h[68] === ze ? Be = h[69] : (Be = t(ze), h[68] = ze, h[69] = Be);
110
+ let Y = Be, Ve;
111
+ h[70] !== G || h[71] !== W || h[72] !== I ? (Ve = (e) => {
112
+ let t = ne(I);
113
+ e.ctrlKey || (RegExp(`^[^\\d.${t}]$`).test(e.key) && e.preventDefault(), N.current && (e.code === "ArrowDown" || e.code === "ArrowUp") && (e.preventDefault(), e.code === "ArrowUp" ? W(!1) : e.code === "ArrowDown" && G(!1)));
114
+ }, h[70] = G, h[71] = W, h[72] = I, h[73] = Ve) : Ve = h[73];
115
+ let He = Ve, Ue;
116
+ h[74] !== b || h[75] !== I || h[76] !== we || h[77] !== Ie || h[78] !== He || h[79] !== m.required || h[80] !== j ? (Ue = /* @__PURE__ */ f("input", {
117
+ ...b,
118
+ ref: A,
119
+ type: "number",
120
+ lang: I,
121
+ required: m.required,
122
+ onFocus: Me,
123
+ onBlur: Pe,
124
+ value: j,
125
+ onChange: we,
126
+ onKeyDown: He,
127
+ onInvalid: Ie,
128
+ title: ""
129
+ }), h[74] = b, h[75] = I, h[76] = we, h[77] = Ie, h[78] = He, h[79] = m.required, h[80] = j, h[81] = Ue) : Ue = h[81];
130
+ let X = Ue, We;
131
+ bb1: {
132
+ if (D === "filled") {
133
+ let t;
134
+ h[82] === Symbol.for("react.memo_cache_sentinel") ? (t = () => requestAnimationFrame(() => A.current?.focus()), h[82] = t) : t = h[82];
135
+ let n;
136
+ h[83] !== H || h[84] !== x ? (n = x && /* @__PURE__ */ f("span", {
137
+ className: "label",
138
+ children: H
139
+ }), h[83] = H, h[84] = x, h[85] = n) : n = h[85];
140
+ let r;
141
+ h[86] !== E || h[87] !== O ? (r = l("content", {
142
+ prefix: E,
143
+ suffix: O
144
+ }), h[86] = E, h[87] = O, h[88] = r) : r = h[88];
145
+ let a;
146
+ h[89] === E ? a = h[90] : (a = E && /* @__PURE__ */ f("span", {
147
+ className: "prefix",
148
+ children: E
149
+ }), h[89] = E, h[90] = a);
150
+ let o;
151
+ h[91] === O ? o = h[92] : (o = O && /* @__PURE__ */ f("span", {
152
+ className: "suffix",
153
+ children: O
154
+ }), h[91] = O, h[92] = o);
155
+ let s;
156
+ h[93] !== X || h[94] !== r || h[95] !== a || h[96] !== o ? (s = /* @__PURE__ */ p("div", {
157
+ className: r,
158
+ children: [
159
+ a,
160
+ X,
161
+ o
162
+ ]
163
+ }), h[93] = X, h[94] = r, h[95] = a, h[96] = o, h[97] = s) : s = h[97];
164
+ let c;
165
+ h[98] !== n || h[99] !== s ? (c = /* @__PURE__ */ p("div", {
166
+ className: "container",
167
+ onMouseDown: t,
168
+ children: [n, s]
169
+ }), h[98] = n, h[99] = s, h[100] = c) : c = h[100];
170
+ let u;
171
+ h[101] !== v || h[102] !== q || h[103] !== K ? (u = !v && /* @__PURE__ */ p("div", {
172
+ className: "arrow",
173
+ children: [/* @__PURE__ */ p("div", {
174
+ className: "button",
175
+ onMouseDown: K,
176
+ children: [/* @__PURE__ */ f(i, {}), /* @__PURE__ */ f(e, { name: "keyboard_arrow_up" })]
177
+ }), /* @__PURE__ */ p("div", {
178
+ className: "button",
179
+ onMouseDown: q,
180
+ children: [/* @__PURE__ */ f(i, {}), /* @__PURE__ */ f(e, { name: "keyboard_arrow_down" })]
181
+ })]
182
+ }), h[101] = v, h[102] = q, h[103] = K, h[104] = u) : u = h[104];
183
+ let d;
184
+ h[105] !== J || h[106] !== c || h[107] !== u || h[108] !== Y ? (d = /* @__PURE__ */ p(ee, { children: [
185
+ J,
186
+ c,
187
+ Y,
188
+ u
189
+ ] }), h[105] = J, h[106] = c, h[107] = u, h[108] = Y, h[109] = d) : d = h[109], We = d;
190
+ break bb1;
191
+ }
192
+ let t;
193
+ h[110] !== E || h[111] !== O ? (t = l("content", {
194
+ prefix: E,
195
+ suffix: O
196
+ }), h[110] = E, h[111] = O, h[112] = t) : t = h[112];
197
+ let n;
198
+ h[113] === E ? n = h[114] : (n = E && /* @__PURE__ */ f("span", {
199
+ className: "prefix",
200
+ children: E
201
+ }), h[113] = E, h[114] = n);
202
+ let r;
203
+ h[115] === O ? r = h[116] : (r = O && /* @__PURE__ */ f("span", {
204
+ className: "suffix",
205
+ children: O
206
+ }), h[115] = O, h[116] = r);
207
+ let a;
208
+ h[117] !== X || h[118] !== t || h[119] !== n || h[120] !== r ? (a = /* @__PURE__ */ p("div", {
209
+ className: t,
210
+ children: [
211
+ n,
212
+ X,
213
+ r
214
+ ]
215
+ }), h[117] = X, h[118] = t, h[119] = n, h[120] = r, h[121] = a) : a = h[121];
216
+ let o;
217
+ h[122] !== v || h[123] !== q || h[124] !== K ? (o = !v && /* @__PURE__ */ p("div", {
218
+ className: "arrow",
219
+ children: [/* @__PURE__ */ p("div", {
220
+ className: "button",
221
+ onMouseDown: K,
222
+ children: [/* @__PURE__ */ f(i, {}), /* @__PURE__ */ f(e, { name: "keyboard_arrow_up" })]
223
+ }), /* @__PURE__ */ p("div", {
224
+ className: "button",
225
+ onMouseDown: q,
226
+ children: [/* @__PURE__ */ f(i, {}), /* @__PURE__ */ f(e, { name: "keyboard_arrow_down" })]
227
+ })]
228
+ }), h[122] = v, h[123] = q, h[124] = K, h[125] = o) : o = h[125];
229
+ let s;
230
+ h[126] !== J || h[127] !== a || h[128] !== o || h[129] !== Y ? (s = /* @__PURE__ */ p(ee, { children: [
231
+ J,
232
+ a,
233
+ Y,
234
+ o
235
+ ] }), h[126] = J, h[127] = a, h[128] = o, h[129] = Y, h[130] = s) : s = h[130], We = s;
236
+ }
237
+ let Ge = We;
238
+ te("keydown", _e), te("keyup", _e), te("mouseup", Ee);
239
+ let Z;
240
+ h[131] === M ? Z = h[132] : (Z = l("TextField", "NumberField", { error: M }), h[131] = M, h[132] = Z);
241
+ let Q;
242
+ h[133] !== Ge || h[134] !== M || h[135] !== ve || h[136] !== ue || h[137] !== H || h[138] !== J || h[139] !== m.prefix || h[140] !== D || h[141] !== Y ? (Q = f(D === "filled" ? o : s, {
243
+ label: H,
244
+ filled: ve || !!m.prefix,
245
+ focus: ue,
246
+ error: !!M,
247
+ className: l({
248
+ leadingIcon: J,
249
+ trailingIcon: Y
250
+ }),
251
+ children: Ge
252
+ }), h[133] = Ge, h[134] = M, h[135] = ve, h[136] = ue, h[137] = H, h[138] = J, h[139] = m.prefix, h[140] = D, h[141] = Y, h[142] = Q) : Q = h[142];
253
+ let $;
254
+ h[143] === F ? $ = h[144] : ($ = F && /* @__PURE__ */ f("div", {
255
+ className: "support",
256
+ children: /* @__PURE__ */ f("div", {
257
+ className: "message",
258
+ children: F
259
+ })
260
+ }), h[143] = F, h[144] = $);
261
+ let Ke;
262
+ return h[145] !== Z || h[146] !== Q || h[147] !== $ ? (Ke = /* @__PURE__ */ p("div", {
263
+ className: Z,
264
+ children: [Q, $]
265
+ }), h[145] = Z, h[146] = Q, h[147] = $, h[148] = Ke) : Ke = h[148], Ke;
266
+ }
267
+ //#endregion
268
+ export { m as default };
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./NumberField.cjs");exports.default=e.default;
@@ -0,0 +1,2 @@
1
+ export { default } from './NumberField';
2
+ export type { NumberFieldProps } from './NumberField.render';
@@ -0,0 +1 @@
1
+ export { default } from "./NumberField.js";
@@ -0,0 +1 @@
1
+ .TextField.NumberField>.FilledField>.arrow,.TextField.NumberField>.OutlinedField>.arrow{flex-direction:column;justify-content:center;align-self:stretch;gap:2px;display:flex}.TextField.NumberField>.FilledField>.arrow>.button,.TextField.NumberField>.OutlinedField>.arrow>.button{border-radius:var(--md-sys-shape-corner-extra-small);color:var(--md-sys-color-on-surface-variant);cursor:pointer;justify-content:center;align-items:center;width:36px;height:22px;display:flex}.TextField.NumberField>.FilledField>.arrow{margin-top:-1px}.TextField.NumberField>.FilledField>.arrow>.button{background-color:var(--md-sys-color-surface-container)}.TextField.NumberField>.FilledField>.arrow:nth-last-child(2):not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-right:-8px}.TextField.NumberField>.FilledField>.arrow:nth-last-child(2):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:-8px}.TextField.NumberField>.OutlinedField>.arrow>.button{background-color:var(--md-sys-color-surface-container-highest)}.TextField.NumberField>.OutlinedField>.arrow:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-right:-6px}.TextField.NumberField>.OutlinedField>.arrow:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:-8px}
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface ProgressIndicatorProps {
3
+ id?: string;
4
+ type?: "circular" | "linear";
5
+ progress?: number;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ }
9
+ export default function ProgressIndicator(props: ProgressIndicatorProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ const e=require("../misc/OrderedCollection/index.cjs");let t=require("react/compiler-runtime");require("react");let n=require("react/jsx-runtime");function r(r){let i=(0,t.c)(9),a;i[0]!==r.className||i[1]!==r.default||i[2]!==r.disabled||i[3]!==r.icon||i[4]!==r.label||i[5]!==r.value?(a={icon:r.icon,label:r.label,value:r.value,default:r.default,disabled:r.disabled,className:r.className},i[0]=r.className,i[1]=r.default,i[2]=r.disabled,i[3]=r.icon,i[4]=r.label,i[5]=r.value,i[6]=a):a=i[6];let o=a,s;return i[7]===o?s=i[8]:(s=(0,n.jsx)(e.OrderedCollectionChild,{name:`Option`,parentName:`Select`,content:o}),i[7]=o,i[8]=s),s}exports.default=r;
@@ -0,0 +1,10 @@
1
+ import { IconDefinition } from '../Icon/Icon';
2
+ export interface OptionProps<T extends string | number = string> {
3
+ icon?: IconDefinition;
4
+ label?: string;
5
+ value: T;
6
+ default?: boolean;
7
+ disabled?: boolean;
8
+ className?: string;
9
+ }
10
+ export default function Option(props: OptionProps<string | number>): import('react').JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { OrderedCollectionChild as e } from "../misc/OrderedCollection/index.js";
2
+ import { c as t } from "react/compiler-runtime";
3
+ import "react";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ //#region lib/components/Select/Option.tsx
6
+ function r(r) {
7
+ let i = t(9), a;
8
+ i[0] !== r.className || i[1] !== r.default || i[2] !== r.disabled || i[3] !== r.icon || i[4] !== r.label || i[5] !== r.value ? (a = {
9
+ icon: r.icon,
10
+ label: r.label,
11
+ value: r.value,
12
+ default: r.default,
13
+ disabled: r.disabled,
14
+ className: r.className
15
+ }, i[0] = r.className, i[1] = r.default, i[2] = r.disabled, i[3] = r.icon, i[4] = r.label, i[5] = r.value, i[6] = a) : a = i[6];
16
+ let o = a, s;
17
+ return i[7] === o ? s = i[8] : (s = /* @__PURE__ */ n(e, {
18
+ name: "Option",
19
+ parentName: "Select",
20
+ content: o
21
+ }), i[7] = o, i[8] = s), s;
22
+ }
23
+ //#endregion
24
+ export { r as default };
@@ -0,0 +1 @@
1
+ require('./style.css');const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../Theme/Theme.cjs"),n=require("../../utils/index.cjs"),r=require("../misc/OrderedCollection/index.cjs"),i=require("../Menu/Menu.cjs"),a=require("../Menu/MenuItem.cjs");require("../Menu/index.cjs");const o=require("../misc/FloatingElement/index.cjs"),s=require("../Button/icon/index.cjs"),ee=require("../Chip/index.cjs"),c=require("../containers/FilledField/index.cjs"),te=require("../containers/OutlinedField/index.cjs");;/* empty css */let l=require("classnames");l=e.__toESM(l,1);let u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime"),f=require("react-dom-event-hooks");function p(){return n.isBrowser()?/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent):!1}function m(e){let{shape:n,value:m,multiple:h,searchable:g,supportingText:_,onValueChange:v,onChange:y,onInvalid:ne}=e,{popoversContainer:re}=t.useTheme(`Select`),b=(0,u.useRef)(null),x=(0,u.useRef)(null),S=(0,u.useRef)(null),[C,ie]=(0,u.useState)([]),[ae,oe]=(0,u.useState)(p()),[w,T]=(0,u.useState)(``),[E,D]=(0,u.useState)(e.value??e.defaultValue),O=(0,u.useMemo)(()=>{let e=m??E;return h&&(e??=[]),Array.isArray(e)?e.map(e=>C?.find(t=>t.value===e)).filter(e=>!!e):C?.find(t=>t.value===e)},[m,E,h,C]),k=(0,u.useMemo)(()=>C.filter(e=>e&&(e.label??e.value.toString()).includes(w)),[w,C]),A=e.label?e.label+(e.required?`*`:``):void 0,j=(0,u.useRef)(null),M=(0,u.useRef)(!1),N=Array.isArray(O)&&!!O.length||!Array.isArray(O)&&O!==void 0,P=N||!!w.length,[F,I]=(0,u.useState)(e.defaultMenuIsOpen??!1),[L,se]=(0,u.useState)(e.defaultMenuIsOpen??!1),R=(0,u.useRef)(e.defaultMenuIsOpen??!1),[z,B]=(0,u.useState)(),[V,H]=(0,u.useState)(!1),U=z??_,[ce,le]=(0,u.useState)(null),ue=(0,u.useCallback)(e=>le(e.split(`-`)[0]),[]),W=C?.filter(t=>!e.multiple||!e.value?.includes(t.value)).filter(e=>!w||e.label?.toLowerCase().includes(w.trim().toLowerCase())),[G,K]=(0,u.useState)(C?.findIndex(e=>Array.isArray(O)&&O.at(0)?.value===e.value||!Array.isArray(O)&&O?.value===e.value)??null),de=(0,u.useMemo)(()=>(0,d.jsx)(`input`,{required:e.required,value:N?`true`:``,onChange:()=>{},onInvalid:e=>{H(!0),B(e.currentTarget.validationMessage),e.preventDefault()},style:{display:`none`}}),[e.required,N]),fe=(0,u.useCallback)((e,t)=>e.label===t.label&&e.value===t.value&&e.icon===t.icon&&e.className===t.className&&e.disabled===t.disabled&&e.default===t.default,[]),q=(0,u.useCallback)(e=>{se(e),R.current=e},[]),J=(0,u.useCallback)(()=>{q(!0),S.current?.focus()},[q]),Y=(0,u.useCallback)(e=>{let t;if(h&&Array.isArray(O)){if(e===void 0)return v?.([]);t=O.map(({value:e})=>e),t.includes(e)?t=t.filter(t=>t!==e):t.push(e),m===void 0&&D(t),v?.(t),y?.(C?.filter(e=>t.includes(e.value))??[])}else h||(m===void 0&&D(e),v?.(e),y?.(C?.find(e=>t.includes(e.value))))},[m,h,y,v,C,O]),X=(0,u.useCallback)(t=>{let n,r,i;if(!e.disabled)switch(t.code){case`ArrowDown`:case`ArrowRight`:if(t.code===`ArrowRight`&&L)break;W&&(L?(i=G===null?0:(G+1)%W.length,K(i)):h||(i=Math.max(0,Math.min(W.length-1,G===null?0:G+1)),K(i),r=W?.at(i),r&&Y(r.value))),t.preventDefault();break;case`ArrowUp`:case`ArrowLeft`:if(W){if(t.code===`ArrowLeft`&&L)break;L?(i=G!==null&&G>0?(G-1)%W.length:W.length-1,K(i)):h||(i=Math.max(0,Math.min(W.length-1,G===null?W.length-1:G-1)),K(i),r=W?.at(i),r&&Y(r.value))}t.preventDefault();break;case`Space`:F&&!L&&q(!0);break;case`Enter`:case`NumpadEnter`:r=G===null?void 0:W?.at(G),r&&(Y(r.value),z&&B(void 0),H(!1),x.current?.classList.remove(`invalid`)),q(!1),T(``);break;case`Escape`:q(!1),T(``),n=W?.findIndex(e=>e.label===E||e.value===E),K(n===void 0||n<0?null:n)}},[W,z,F,G,E,L,h,e.disabled,q,Y]),Z=(0,u.useCallback)(e=>Y(e),[Y]),Q=(0,u.useMemo)(()=>h&&Array.isArray(O)?O.map(t=>(0,d.jsx)(ee.default,{variant:`input`,label:t.label??t.value.toString(),data:t.value,type:`button`,tabIndex:-1,selectable:!1,deletable:!0,onDelete:Z,disabled:e.disabled},t.value)):null,[Z,h,e.disabled,O]),$=(0,u.useMemo)(()=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{className:`control`,onMouseDown:J,children:[Q,(0,d.jsx)(`input`,{ref:S,className:(0,l.default)({searchable:g}),value:F?w:``,placeholder:Array.isArray(O)?``:O?.label??O?.value.toString(),readOnly:!g,disabled:e.disabled,onChange:e=>{T(e.target.value),!L&&e.target.value&&q(!0)},onKeyDown:X,onMouseDown:()=>{e.disabled||(q(!L),T(``))},onFocus:()=>{e.disabled||(I(!0),q(!0),T(``))},onBlur:()=>{e.disabled||M.current||I(!1)}})]}),e.clearable&&(0,d.jsx)(s.default,{className:`clear-indicator`,color:`standard`,icon:`close`,onClick:e=>{e.preventDefault(),Y()},onTouchEnd:e=>{e.preventDefault(),Y()},tabIndex:-1,disabled:e.disabled}),(0,d.jsx)(s.default,{className:(0,l.default)(`dropdown-indicator`,{open:L}),color:`standard`,icon:L?`arrow_drop_up`:`arrow_drop_down`,tabIndex:-1,onMouseUp:()=>{e.disabled||(q(!L),T(``))},disabled:e.disabled,type:`button`})]}),[Q,w,F,L,X,J,e.clearable,e.disabled,g,q,Y,O]);return(0,f.useWindowEventListener)(`resize`,()=>oe(p())),(0,f.useWindowEventListener)(`mousedown`,e=>{b.current?.contains(e.target)||(q(!1),I(!1))}),(0,d.jsxs)(`div`,{ref:b,className:(0,l.default)(`Select`,{error:z||V},e.className),children:[de,n===`filled`?(0,d.jsx)(c.default,{disabled:e.disabled,label:A,filled:P,focus:F||L,error:!!z||V,className:(0,l.default)({searchable:g}),children:$}):(0,d.jsx)(te.default,{disabled:e.disabled,label:A,filled:P,focus:F||L,error:!!z||V,className:(0,l.default)({searchable:g}),children:$}),U&&(0,d.jsx)(`span`,{className:`support`,children:U}),(0,d.jsx)(`select`,{multiple:h,value:Array.isArray(O)?O.map(e=>e.value.toString()):O?.value,tabIndex:e.tabIndex,onFocus:e.onFocus,onInvalid:e=>{e.preventDefault(),B(e.currentTarget.validationMessage),ne?.(e),e.currentTarget.focus()},style:{display:ae?`block`:`none`},onChange:e=>{let t=[],n;for(let n=0;n<e.target.selectedOptions.length;n++)t.push(e.target.selectedOptions[n].value);n=C.filter(e=>t.includes(e.value))??[],h?(v?.(t),y?.(n)):(v?.(t.at(0)??``),y?.(n.at(0))),z&&B(void 0),H(!1),x.current?.classList.remove(`invalid`)},required:e.required,children:k?.map(e=>(0,d.jsx)(`option`,{value:e.value,label:e.label},e.value))}),(0,d.jsx)(o.default,{root:re,flip:(0,u.useMemo)(()=>({allowedPlacements:[`top-start`,`top-end`,`bottom-start`,`bottom-end`]}),[]),autoUpdate:!0,placement:`bottom-start`,open:L,onPlacementChange:ue,children:(0,d.jsxs)(i.default,{ref:j,className:(0,l.default)(`sub-component`,ce,{visible:L}),onMouseEnter:()=>{M.current=!0},onMouseLeave:()=>{M.current=!1},children:[k?.map((e,t)=>(0,d.jsx)(a.default,{icon:e.icon,text:e.label??e.value.toString(),type:`button`,disabled:e.disabled,tabIndex:-1,selectable:!0,selected:h&&Array.isArray(O)&&O.some(t=>t.value===e.value)||!Array.isArray(O)&&O?.value===e.value,className:(0,l.default)(e.className,{hovered:G===t}),onClick:()=>{Y(e.value),S.current?.focus(),z&&B(void 0),H(!1),x.current?.classList.remove(`invalid`)},onMouseEnter:()=>{R.current&&K(t)}},e.value)),!C.length&&e.noOptionMessage?(0,d.jsx)(a.default,{text:e.noOptionMessage,style:{justifyContent:`center`,cursor:`default`}}):null]})}),(0,d.jsx)(r.default,{childName:`Option`,onChildrenChange:ie,compareChild:fe,children:e.children})]})}exports.default=m;
@@ -0,0 +1,32 @@
1
+ import { OptionProps } from './Option';
2
+ import { PropsWithChildren, SelectHTMLAttributes, default as React } from 'react';
3
+ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "onChange" | "value" | "defaultValue"> {
4
+ shape?: "filled" | "outlined";
5
+ label?: string;
6
+ defaultMenuIsOpen?: boolean;
7
+ clearable?: boolean;
8
+ searchable?: boolean;
9
+ noOptionMessage?: string | null;
10
+ hideErrorText?: boolean;
11
+ supportingText?: string;
12
+ tabIndex?: number;
13
+ hideDropdownIndicator?: boolean;
14
+ onMenuOpen?: () => void;
15
+ onMenuClose?: () => void;
16
+ }
17
+ export interface SingleSelectProps<T extends string | number = string> extends SelectProps {
18
+ multiple?: false;
19
+ defaultValue?: T;
20
+ value?: T;
21
+ onValueChange?: (value: T | undefined) => void;
22
+ onChange?: (newValue: OptionProps<T> | undefined) => void;
23
+ small?: boolean;
24
+ }
25
+ export interface MultiSelectProps<T extends string | number = string> extends SelectProps {
26
+ multiple: true;
27
+ defaultValue?: T[];
28
+ value?: T[];
29
+ onValueChange?: (values: T[]) => void;
30
+ onChange?: (newValue: OptionProps<T>[]) => void;
31
+ }
32
+ export default function Select<T extends string | number = string>(props: PropsWithChildren<SingleSelectProps<T> | MultiSelectProps<T>>): React.JSX.Element;
@@ -0,0 +1,265 @@
1
+ import { useTheme as e } from "../Theme/Theme.js";
2
+ import { isBrowser as t } from "../../utils/index.js";
3
+ import n from "../misc/OrderedCollection/index.js";
4
+ import r from "../Menu/Menu.js";
5
+ import i from "../Menu/MenuItem.js";
6
+ import "../Menu/index.js";
7
+ import ee from "../misc/FloatingElement/index.js";
8
+ import a from "../Button/icon/index.js";
9
+ import te from "../Chip/index.js";
10
+ import o from "../containers/FilledField/index.js";
11
+ import ne from "../containers/OutlinedField/index.js";
12
+ import './style.css';/* empty css */
13
+ import s from "classnames";
14
+ import { useCallback as c, useMemo as l, useRef as u, useState as d } from "react";
15
+ import { Fragment as re, jsx as f, jsxs as p } from "react/jsx-runtime";
16
+ import { useWindowEventListener as m } from "react-dom-event-hooks";
17
+ //#region lib/components/Select/Select.tsx
18
+ function h() {
19
+ return t() ? /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) : !1;
20
+ }
21
+ function g(t) {
22
+ let { shape: g, value: _, multiple: v, searchable: y, supportingText: ie, onValueChange: b, onChange: x, onInvalid: S } = t, { popoversContainer: ae } = e("Select"), C = u(null), w = u(null), T = u(null), [E, D] = d([]), [oe, se] = d(h()), [O, k] = d(""), [A, j] = d(t.value ?? t.defaultValue), M = l(() => {
23
+ let e = _ ?? A;
24
+ return v && (e ??= []), Array.isArray(e) ? e.map((e) => E?.find((t) => t.value === e)).filter((e) => !!e) : E?.find((t) => t.value === e);
25
+ }, [
26
+ _,
27
+ A,
28
+ v,
29
+ E
30
+ ]), N = l(() => E.filter((e) => e && (e.label ?? e.value.toString()).includes(O)), [O, E]), ce = t.label ? t.label + (t.required ? "*" : "") : void 0, le = u(null), P = u(!1), F = Array.isArray(M) && !!M.length || !Array.isArray(M) && M !== void 0, ue = F || !!O.length, [I, L] = d(t.defaultMenuIsOpen ?? !1), [R, de] = d(t.defaultMenuIsOpen ?? !1), z = u(t.defaultMenuIsOpen ?? !1), [B, V] = d(), [H, U] = d(!1), W = B ?? ie, [fe, pe] = d(null), me = c((e) => pe(e.split("-")[0]), []), G = E?.filter((e) => !t.multiple || !t.value?.includes(e.value)).filter((e) => !O || e.label?.toLowerCase().includes(O.trim().toLowerCase())), [K, q] = d(E?.findIndex((e) => Array.isArray(M) && M.at(0)?.value === e.value || !Array.isArray(M) && M?.value === e.value) ?? null), he = l(() => /* @__PURE__ */ f("input", {
31
+ required: t.required,
32
+ value: F ? "true" : "",
33
+ onChange: () => {},
34
+ onInvalid: (e) => {
35
+ U(!0), V(e.currentTarget.validationMessage), e.preventDefault();
36
+ },
37
+ style: { display: "none" }
38
+ }), [t.required, F]), ge = c((e, t) => e.label === t.label && e.value === t.value && e.icon === t.icon && e.className === t.className && e.disabled === t.disabled && e.default === t.default, []), J = c((e) => {
39
+ de(e), z.current = e;
40
+ }, []), Y = c(() => {
41
+ J(!0), T.current?.focus();
42
+ }, [J]), X = c((e) => {
43
+ let t;
44
+ if (v && Array.isArray(M)) {
45
+ if (e === void 0) return b?.([]);
46
+ t = M.map(({ value: e }) => e), t.includes(e) ? t = t.filter((t) => t !== e) : t.push(e), _ === void 0 && j(t), b?.(t), x?.(E?.filter((e) => t.includes(e.value)) ?? []);
47
+ } else v || (_ === void 0 && j(e), b?.(e), x?.(E?.find((e) => t.includes(e.value))));
48
+ }, [
49
+ _,
50
+ v,
51
+ x,
52
+ b,
53
+ E,
54
+ M
55
+ ]), Z = c((e) => {
56
+ let n, r, i;
57
+ if (!t.disabled) switch (e.code) {
58
+ case "ArrowDown":
59
+ case "ArrowRight":
60
+ if (e.code === "ArrowRight" && R) break;
61
+ G && (R ? (i = K === null ? 0 : (K + 1) % G.length, q(i)) : v || (i = Math.max(0, Math.min(G.length - 1, K === null ? 0 : K + 1)), q(i), r = G?.at(i), r && X(r.value))), e.preventDefault();
62
+ break;
63
+ case "ArrowUp":
64
+ case "ArrowLeft":
65
+ if (G) {
66
+ if (e.code === "ArrowLeft" && R) break;
67
+ R ? (i = K !== null && K > 0 ? (K - 1) % G.length : G.length - 1, q(i)) : v || (i = Math.max(0, Math.min(G.length - 1, K === null ? G.length - 1 : K - 1)), q(i), r = G?.at(i), r && X(r.value));
68
+ }
69
+ e.preventDefault();
70
+ break;
71
+ case "Space":
72
+ I && !R && J(!0);
73
+ break;
74
+ case "Enter":
75
+ case "NumpadEnter":
76
+ r = K === null ? void 0 : G?.at(K), r && (X(r.value), B && V(void 0), U(!1), w.current?.classList.remove("invalid")), J(!1), k("");
77
+ break;
78
+ case "Escape": J(!1), k(""), n = G?.findIndex((e) => e.label === A || e.value === A), q(n === void 0 || n < 0 ? null : n);
79
+ }
80
+ }, [
81
+ G,
82
+ B,
83
+ I,
84
+ K,
85
+ A,
86
+ R,
87
+ v,
88
+ t.disabled,
89
+ J,
90
+ X
91
+ ]), Q = c((e) => X(e), [X]), $ = l(() => v && Array.isArray(M) ? M.map((e) => /* @__PURE__ */ f(te, {
92
+ variant: "input",
93
+ label: e.label ?? e.value.toString(),
94
+ data: e.value,
95
+ type: "button",
96
+ tabIndex: -1,
97
+ selectable: !1,
98
+ deletable: !0,
99
+ onDelete: Q,
100
+ disabled: t.disabled
101
+ }, e.value)) : null, [
102
+ Q,
103
+ v,
104
+ t.disabled,
105
+ M
106
+ ]), _e = l(() => /* @__PURE__ */ p(re, { children: [
107
+ /* @__PURE__ */ p("div", {
108
+ className: "control",
109
+ onMouseDown: Y,
110
+ children: [$, /* @__PURE__ */ f("input", {
111
+ ref: T,
112
+ className: s({ searchable: y }),
113
+ value: I ? O : "",
114
+ placeholder: Array.isArray(M) ? "" : M?.label ?? M?.value.toString(),
115
+ readOnly: !y,
116
+ disabled: t.disabled,
117
+ onChange: (e) => {
118
+ k(e.target.value), !R && e.target.value && J(!0);
119
+ },
120
+ onKeyDown: Z,
121
+ onMouseDown: () => {
122
+ t.disabled || (J(!R), k(""));
123
+ },
124
+ onFocus: () => {
125
+ t.disabled || (L(!0), J(!0), k(""));
126
+ },
127
+ onBlur: () => {
128
+ t.disabled || P.current || L(!1);
129
+ }
130
+ })]
131
+ }),
132
+ t.clearable && /* @__PURE__ */ f(a, {
133
+ className: "clear-indicator",
134
+ color: "standard",
135
+ icon: "close",
136
+ onClick: (e) => {
137
+ e.preventDefault(), X();
138
+ },
139
+ onTouchEnd: (e) => {
140
+ e.preventDefault(), X();
141
+ },
142
+ tabIndex: -1,
143
+ disabled: t.disabled
144
+ }),
145
+ /* @__PURE__ */ f(a, {
146
+ className: s("dropdown-indicator", { open: R }),
147
+ color: "standard",
148
+ icon: R ? "arrow_drop_up" : "arrow_drop_down",
149
+ tabIndex: -1,
150
+ onMouseUp: () => {
151
+ t.disabled || (J(!R), k(""));
152
+ },
153
+ disabled: t.disabled,
154
+ type: "button"
155
+ })
156
+ ] }), [
157
+ $,
158
+ O,
159
+ I,
160
+ R,
161
+ Z,
162
+ Y,
163
+ t.clearable,
164
+ t.disabled,
165
+ y,
166
+ J,
167
+ X,
168
+ M
169
+ ]);
170
+ return m("resize", () => se(h())), m("mousedown", (e) => {
171
+ C.current?.contains(e.target) || (J(!1), L(!1));
172
+ }), /* @__PURE__ */ p("div", {
173
+ ref: C,
174
+ className: s("Select", { error: B || H }, t.className),
175
+ children: [
176
+ he,
177
+ f(g === "filled" ? o : ne, {
178
+ disabled: t.disabled,
179
+ label: ce,
180
+ filled: ue,
181
+ focus: I || R,
182
+ error: !!B || H,
183
+ className: s({ searchable: y }),
184
+ children: _e
185
+ }),
186
+ W && /* @__PURE__ */ f("span", {
187
+ className: "support",
188
+ children: W
189
+ }),
190
+ /* @__PURE__ */ f("select", {
191
+ multiple: v,
192
+ value: Array.isArray(M) ? M.map((e) => e.value.toString()) : M?.value,
193
+ tabIndex: t.tabIndex,
194
+ onFocus: t.onFocus,
195
+ onInvalid: (e) => {
196
+ e.preventDefault(), V(e.currentTarget.validationMessage), S?.(e), e.currentTarget.focus();
197
+ },
198
+ style: { display: oe ? "block" : "none" },
199
+ onChange: (e) => {
200
+ let t = [], n;
201
+ for (let n = 0; n < e.target.selectedOptions.length; n++) t.push(e.target.selectedOptions[n].value);
202
+ n = E.filter((e) => t.includes(e.value)) ?? [], v ? (b?.(t), x?.(n)) : (b?.(t.at(0) ?? ""), x?.(n.at(0))), B && V(void 0), U(!1), w.current?.classList.remove("invalid");
203
+ },
204
+ required: t.required,
205
+ children: N?.map((e) => /* @__PURE__ */ f("option", {
206
+ value: e.value,
207
+ label: e.label
208
+ }, e.value))
209
+ }),
210
+ /* @__PURE__ */ f(ee, {
211
+ root: ae,
212
+ flip: l(() => ({ allowedPlacements: [
213
+ "top-start",
214
+ "top-end",
215
+ "bottom-start",
216
+ "bottom-end"
217
+ ] }), []),
218
+ autoUpdate: !0,
219
+ placement: "bottom-start",
220
+ open: R,
221
+ onPlacementChange: me,
222
+ children: /* @__PURE__ */ p(r, {
223
+ ref: le,
224
+ className: s("sub-component", fe, { visible: R }),
225
+ onMouseEnter: () => {
226
+ P.current = !0;
227
+ },
228
+ onMouseLeave: () => {
229
+ P.current = !1;
230
+ },
231
+ children: [N?.map((e, t) => /* @__PURE__ */ f(i, {
232
+ icon: e.icon,
233
+ text: e.label ?? e.value.toString(),
234
+ type: "button",
235
+ disabled: e.disabled,
236
+ tabIndex: -1,
237
+ selectable: !0,
238
+ selected: v && Array.isArray(M) && M.some((t) => t.value === e.value) || !Array.isArray(M) && M?.value === e.value,
239
+ className: s(e.className, { hovered: K === t }),
240
+ onClick: () => {
241
+ X(e.value), T.current?.focus(), B && V(void 0), U(!1), w.current?.classList.remove("invalid");
242
+ },
243
+ onMouseEnter: () => {
244
+ z.current && q(t);
245
+ }
246
+ }, e.value)), !E.length && t.noOptionMessage ? /* @__PURE__ */ f(i, {
247
+ text: t.noOptionMessage,
248
+ style: {
249
+ justifyContent: "center",
250
+ cursor: "default"
251
+ }
252
+ }) : null]
253
+ })
254
+ }),
255
+ /* @__PURE__ */ f(n, {
256
+ childName: "Option",
257
+ onChildrenChange: D,
258
+ compareChild: ge,
259
+ children: t.children
260
+ })
261
+ ]
262
+ });
263
+ }
264
+ //#endregion
265
+ export { g as default };
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./Option.cjs"),t=require("./Select.cjs");exports.Option=e.default,exports.default=t.default;
@@ -0,0 +1,4 @@
1
+ export { default as Option } from './Option';
2
+ export type { OptionProps } from './Option';
3
+ export { default } from './Select';
4
+ export type { MultiSelectProps, SelectProps, SingleSelectProps } from './Select';
@@ -0,0 +1,3 @@
1
+ import e from "./Option.js";
2
+ import t from "./Select.js";
3
+ export { e as Option, t as default };