@laser-ui/components 0.0.1

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 (653) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +71 -0
  4. package/accordion/Accordion.d.ts +3 -0
  5. package/accordion/Accordion.js +162 -0
  6. package/accordion/index.d.ts +2 -0
  7. package/accordion/index.js +1 -0
  8. package/accordion/types.d.ts +20 -0
  9. package/accordion/types.js +1 -0
  10. package/accordion/vars.d.ts +10 -0
  11. package/accordion/vars.js +10 -0
  12. package/affix/Affix.d.ts +3 -0
  13. package/affix/Affix.js +56 -0
  14. package/affix/index.d.ts +2 -0
  15. package/affix/index.js +1 -0
  16. package/affix/types.d.ts +14 -0
  17. package/affix/types.js +1 -0
  18. package/alert/Alert.d.ts +3 -0
  19. package/alert/Alert.js +53 -0
  20. package/alert/index.d.ts +2 -0
  21. package/alert/index.js +1 -0
  22. package/alert/types.d.ts +13 -0
  23. package/alert/types.js +1 -0
  24. package/alert/vars.d.ts +14 -0
  25. package/alert/vars.js +14 -0
  26. package/anchor/Anchor.d.ts +10 -0
  27. package/anchor/Anchor.js +112 -0
  28. package/anchor/index.d.ts +2 -0
  29. package/anchor/index.js +1 -0
  30. package/anchor/types.d.ts +23 -0
  31. package/anchor/types.js +1 -0
  32. package/anchor/vars.d.ts +11 -0
  33. package/anchor/vars.js +11 -0
  34. package/avatar/Avatar.d.ts +3 -0
  35. package/avatar/Avatar.js +43 -0
  36. package/avatar/index.d.ts +2 -0
  37. package/avatar/index.js +1 -0
  38. package/avatar/types.d.ts +11 -0
  39. package/avatar/types.js +1 -0
  40. package/avatar/vars.d.ts +9 -0
  41. package/avatar/vars.js +9 -0
  42. package/badge/Badge.d.ts +7 -0
  43. package/badge/Badge.js +61 -0
  44. package/badge/BadgeText.d.ts +2 -0
  45. package/badge/BadgeText.js +40 -0
  46. package/badge/index.d.ts +2 -0
  47. package/badge/index.js +1 -0
  48. package/badge/internal/BadgeNumber.d.ts +10 -0
  49. package/badge/internal/BadgeNumber.js +37 -0
  50. package/badge/types.d.ts +19 -0
  51. package/badge/types.js +1 -0
  52. package/badge/vars.d.ts +12 -0
  53. package/badge/vars.js +12 -0
  54. package/breadcrumb/Breadcrumb.d.ts +3 -0
  55. package/breadcrumb/Breadcrumb.js +22 -0
  56. package/breadcrumb/index.d.ts +2 -0
  57. package/breadcrumb/index.js +1 -0
  58. package/breadcrumb/types.d.ts +15 -0
  59. package/breadcrumb/types.js +1 -0
  60. package/breadcrumb/vars.d.ts +8 -0
  61. package/breadcrumb/vars.js +8 -0
  62. package/button/Button.d.ts +3 -0
  63. package/button/Button.js +50 -0
  64. package/button/index.d.ts +2 -0
  65. package/button/index.js +1 -0
  66. package/button/types.d.ts +14 -0
  67. package/button/types.js +1 -0
  68. package/button/vars.d.ts +23 -0
  69. package/button/vars.js +23 -0
  70. package/card/Card.d.ts +11 -0
  71. package/card/Card.js +30 -0
  72. package/card/CardAction.d.ts +3 -0
  73. package/card/CardAction.js +17 -0
  74. package/card/CardContent.d.ts +3 -0
  75. package/card/CardContent.js +13 -0
  76. package/card/CardHeader.d.ts +3 -0
  77. package/card/CardHeader.js +13 -0
  78. package/card/index.d.ts +2 -0
  79. package/card/index.js +1 -0
  80. package/card/types.d.ts +17 -0
  81. package/card/types.js +1 -0
  82. package/card/vars.d.ts +12 -0
  83. package/card/vars.js +12 -0
  84. package/cascader/Cascader.d.ts +5 -0
  85. package/cascader/Cascader.js +487 -0
  86. package/cascader/index.d.ts +2 -0
  87. package/cascader/index.js +1 -0
  88. package/cascader/internal/CascaderPanel.d.ts +23 -0
  89. package/cascader/internal/CascaderPanel.js +135 -0
  90. package/cascader/internal/CascaderSearchPanel.d.ts +22 -0
  91. package/cascader/internal/CascaderSearchPanel.js +73 -0
  92. package/cascader/internal/types.d.ts +8 -0
  93. package/cascader/internal/types.js +1 -0
  94. package/cascader/types.d.ts +49 -0
  95. package/cascader/types.js +1 -0
  96. package/cascader/vars.d.ts +32 -0
  97. package/cascader/vars.js +32 -0
  98. package/checkbox/Checkbox.d.ts +7 -0
  99. package/checkbox/Checkbox.js +25 -0
  100. package/checkbox/CheckboxGroup.d.ts +3 -0
  101. package/checkbox/CheckboxGroup.js +25 -0
  102. package/checkbox/index.d.ts +2 -0
  103. package/checkbox/index.js +1 -0
  104. package/checkbox/types.d.ts +29 -0
  105. package/checkbox/types.js +1 -0
  106. package/checkbox/vars.d.ts +11 -0
  107. package/checkbox/vars.js +11 -0
  108. package/compose/Compose.d.ts +7 -0
  109. package/compose/Compose.js +24 -0
  110. package/compose/ComposeItem.d.ts +3 -0
  111. package/compose/ComposeItem.js +18 -0
  112. package/compose/index.d.ts +2 -0
  113. package/compose/index.js +1 -0
  114. package/compose/types.d.ts +12 -0
  115. package/compose/types.js +1 -0
  116. package/compose/vars.d.ts +10 -0
  117. package/compose/vars.js +10 -0
  118. package/config-provider/ConfigProvider.d.ts +3 -0
  119. package/config-provider/ConfigProvider.js +14 -0
  120. package/config-provider/index.d.ts +2 -0
  121. package/config-provider/index.js +1 -0
  122. package/config-provider/types.d.ts +7 -0
  123. package/config-provider/types.js +1 -0
  124. package/context/index.d.ts +33 -0
  125. package/context/index.js +106 -0
  126. package/context/props.d.ts +134 -0
  127. package/context/props.js +1 -0
  128. package/date-picker/DatePicker.d.ts +3 -0
  129. package/date-picker/DatePicker.js +376 -0
  130. package/date-picker/index.d.ts +2 -0
  131. package/date-picker/index.js +1 -0
  132. package/date-picker/internal/DatePickerPanel.d.ts +15 -0
  133. package/date-picker/internal/DatePickerPanel.js +104 -0
  134. package/date-picker/types.d.ts +37 -0
  135. package/date-picker/types.js +1 -0
  136. package/date-picker/vars.d.ts +36 -0
  137. package/date-picker/vars.js +36 -0
  138. package/dayjs.d.ts +3 -0
  139. package/dayjs.js +11 -0
  140. package/drawer/Drawer.d.ts +9 -0
  141. package/drawer/Drawer.js +141 -0
  142. package/drawer/DrawerFooter.d.ts +3 -0
  143. package/drawer/DrawerFooter.js +51 -0
  144. package/drawer/DrawerHeader.d.ts +3 -0
  145. package/drawer/DrawerHeader.js +37 -0
  146. package/drawer/index.d.ts +2 -0
  147. package/drawer/index.js +1 -0
  148. package/drawer/types.d.ts +36 -0
  149. package/drawer/types.js +1 -0
  150. package/drawer/vars.d.ts +21 -0
  151. package/drawer/vars.js +18 -0
  152. package/dropdown/Dropdown.d.ts +5 -0
  153. package/dropdown/Dropdown.js +376 -0
  154. package/dropdown/index.d.ts +2 -0
  155. package/dropdown/index.js +1 -0
  156. package/dropdown/internal/DropdownGroup.d.ts +13 -0
  157. package/dropdown/internal/DropdownGroup.js +8 -0
  158. package/dropdown/internal/DropdownItem.d.ts +16 -0
  159. package/dropdown/internal/DropdownItem.js +9 -0
  160. package/dropdown/internal/DropdownSub.d.ts +22 -0
  161. package/dropdown/internal/DropdownSub.js +78 -0
  162. package/dropdown/types.d.ts +31 -0
  163. package/dropdown/types.js +1 -0
  164. package/dropdown/utils.d.ts +4 -0
  165. package/dropdown/utils.js +18 -0
  166. package/dropdown/vars.d.ts +23 -0
  167. package/dropdown/vars.js +23 -0
  168. package/empty/Empty.d.ts +7 -0
  169. package/empty/Empty.js +18 -0
  170. package/empty/index.d.ts +2 -0
  171. package/empty/index.js +1 -0
  172. package/empty/types.d.ts +8 -0
  173. package/empty/types.js +1 -0
  174. package/empty/vars.d.ts +7 -0
  175. package/empty/vars.js +7 -0
  176. package/fab/Fab.d.ts +9 -0
  177. package/fab/Fab.js +31 -0
  178. package/fab/FabBacktop.d.ts +3 -0
  179. package/fab/FabBacktop.js +58 -0
  180. package/fab/FabButton.d.ts +3 -0
  181. package/fab/FabButton.js +23 -0
  182. package/fab/index.d.ts +2 -0
  183. package/fab/index.js +1 -0
  184. package/fab/types.d.ts +26 -0
  185. package/fab/types.js +1 -0
  186. package/fab/vars.d.ts +28 -0
  187. package/fab/vars.js +28 -0
  188. package/form/Form.d.ts +7 -0
  189. package/form/Form.js +34 -0
  190. package/form/FormItem.d.ts +5 -0
  191. package/form/FormItem.js +201 -0
  192. package/form/hooks.d.ts +5 -0
  193. package/form/hooks.js +18 -0
  194. package/form/index.d.ts +8 -0
  195. package/form/index.js +7 -0
  196. package/form/internal/FormError.d.ts +12 -0
  197. package/form/internal/FormError.js +24 -0
  198. package/form/model/abstract-control.d.ts +67 -0
  199. package/form/model/abstract-control.js +335 -0
  200. package/form/model/form-control.d.ts +23 -0
  201. package/form/model/form-control.js +72 -0
  202. package/form/model/form-group.d.ts +62 -0
  203. package/form/model/form-group.js +165 -0
  204. package/form/model/types.d.ts +8 -0
  205. package/form/model/types.js +1 -0
  206. package/form/model/validators.d.ts +11 -0
  207. package/form/model/validators.js +83 -0
  208. package/form/model/vars.d.ts +1 -0
  209. package/form/model/vars.js +1 -0
  210. package/form/types.d.ts +63 -0
  211. package/form/types.js +1 -0
  212. package/form/vars.d.ts +27 -0
  213. package/form/vars.js +25 -0
  214. package/hooks/index.d.ts +14 -0
  215. package/hooks/index.js +14 -0
  216. package/hooks/useComponentProps.d.ts +2 -0
  217. package/hooks/useComponentProps.js +15 -0
  218. package/hooks/useControlled.d.ts +3 -0
  219. package/hooks/useControlled.js +26 -0
  220. package/hooks/useDesign.d.ts +12 -0
  221. package/hooks/useDesign.js +8 -0
  222. package/hooks/useFocusVisible.d.ts +2 -0
  223. package/hooks/useFocusVisible.js +38 -0
  224. package/hooks/useLayout.d.ts +5 -0
  225. package/hooks/useLayout.js +10 -0
  226. package/hooks/useListenGlobalScrolling.d.ts +1 -0
  227. package/hooks/useListenGlobalScrolling.js +9 -0
  228. package/hooks/useLockScroll.d.ts +1 -0
  229. package/hooks/useLockScroll.js +24 -0
  230. package/hooks/useMaxIndex.d.ts +1 -0
  231. package/hooks/useMaxIndex.js +32 -0
  232. package/hooks/useNamespace.d.ts +1 -0
  233. package/hooks/useNamespace.js +6 -0
  234. package/hooks/useNestedPopup.d.ts +13 -0
  235. package/hooks/useNestedPopup.js +37 -0
  236. package/hooks/useNextTick.d.ts +2 -0
  237. package/hooks/useNextTick.js +9 -0
  238. package/hooks/useScopedProps.d.ts +8 -0
  239. package/hooks/useScopedProps.js +7 -0
  240. package/hooks/useStyled.d.ts +20 -0
  241. package/hooks/useStyled.js +82 -0
  242. package/hooks/useTranslation.d.ts +4 -0
  243. package/hooks/useTranslation.js +17 -0
  244. package/icon/Icon.d.ts +3 -0
  245. package/icon/Icon.js +18 -0
  246. package/icon/index.d.ts +2 -0
  247. package/icon/index.js +1 -0
  248. package/icon/types.d.ts +12 -0
  249. package/icon/types.js +1 -0
  250. package/icon/vars.d.ts +7 -0
  251. package/icon/vars.js +7 -0
  252. package/image/Image.d.ts +9 -0
  253. package/image/Image.js +50 -0
  254. package/image/ImageAction.d.ts +3 -0
  255. package/image/ImageAction.js +15 -0
  256. package/image/ImagePreview.d.ts +3 -0
  257. package/image/ImagePreview.js +261 -0
  258. package/image/index.d.ts +2 -0
  259. package/image/index.js +1 -0
  260. package/image/types.d.ts +24 -0
  261. package/image/types.js +1 -0
  262. package/image/vars.d.ts +26 -0
  263. package/image/vars.js +26 -0
  264. package/index.d.ts +52 -0
  265. package/index.js +52 -0
  266. package/input/Input.d.ts +7 -0
  267. package/input/Input.js +56 -0
  268. package/input/InputNumber.d.ts +2 -0
  269. package/input/InputNumber.js +142 -0
  270. package/input/index.d.ts +2 -0
  271. package/input/index.js +1 -0
  272. package/input/types.d.ts +44 -0
  273. package/input/types.js +1 -0
  274. package/input/vars.d.ts +14 -0
  275. package/input/vars.js +14 -0
  276. package/internal/circular-progress/CircularProgress.d.ts +2 -0
  277. package/internal/circular-progress/CircularProgress.js +11 -0
  278. package/internal/circular-progress/index.d.ts +1 -0
  279. package/internal/circular-progress/index.js +1 -0
  280. package/internal/circular-progress/vars.d.ts +4 -0
  281. package/internal/circular-progress/vars.js +4 -0
  282. package/internal/mask/Mask.d.ts +3 -0
  283. package/internal/mask/Mask.js +36 -0
  284. package/internal/mask/index.d.ts +2 -0
  285. package/internal/mask/index.js +1 -0
  286. package/internal/mask/types.d.ts +7 -0
  287. package/internal/mask/types.js +1 -0
  288. package/internal/mask/vars.d.ts +3 -0
  289. package/internal/mask/vars.js +3 -0
  290. package/internal/popup/Popup.d.ts +3 -0
  291. package/internal/popup/Popup.js +132 -0
  292. package/internal/popup/index.d.ts +2 -0
  293. package/internal/popup/index.js +1 -0
  294. package/internal/popup/types.d.ts +21 -0
  295. package/internal/popup/types.js +1 -0
  296. package/internal/portal/Portal.d.ts +3 -0
  297. package/internal/portal/Portal.js +14 -0
  298. package/internal/portal/index.d.ts +2 -0
  299. package/internal/portal/index.js +1 -0
  300. package/internal/portal/types.d.ts +6 -0
  301. package/internal/portal/types.js +1 -0
  302. package/internal/transition/CollapseTransition.d.ts +3 -0
  303. package/internal/transition/CollapseTransition.js +101 -0
  304. package/internal/transition/Transition.d.ts +3 -0
  305. package/internal/transition/Transition.js +87 -0
  306. package/internal/transition/index.d.ts +3 -0
  307. package/internal/transition/index.js +2 -0
  308. package/internal/transition/types.d.ts +33 -0
  309. package/internal/transition/types.js +1 -0
  310. package/internal/wave/Wave.d.ts +3 -0
  311. package/internal/wave/Wave.js +25 -0
  312. package/internal/wave/index.d.ts +2 -0
  313. package/internal/wave/index.js +1 -0
  314. package/internal/wave/types.d.ts +6 -0
  315. package/internal/wave/types.js +1 -0
  316. package/internal/wave/vars.d.ts +3 -0
  317. package/internal/wave/vars.js +3 -0
  318. package/menu/Menu.d.ts +5 -0
  319. package/menu/Menu.js +386 -0
  320. package/menu/index.d.ts +2 -0
  321. package/menu/index.js +1 -0
  322. package/menu/internal/MenuGroup.d.ts +15 -0
  323. package/menu/internal/MenuGroup.js +8 -0
  324. package/menu/internal/MenuItem.d.ts +23 -0
  325. package/menu/internal/MenuItem.js +18 -0
  326. package/menu/internal/MenuSub.d.ts +31 -0
  327. package/menu/internal/MenuSub.js +129 -0
  328. package/menu/types.d.ts +30 -0
  329. package/menu/types.js +1 -0
  330. package/menu/utils.d.ts +4 -0
  331. package/menu/utils.js +18 -0
  332. package/menu/vars.d.ts +28 -0
  333. package/menu/vars.js +28 -0
  334. package/modal/Modal.d.ts +11 -0
  335. package/modal/Modal.js +127 -0
  336. package/modal/ModalAlert.d.ts +3 -0
  337. package/modal/ModalAlert.js +19 -0
  338. package/modal/ModalFooter.d.ts +3 -0
  339. package/modal/ModalFooter.js +51 -0
  340. package/modal/ModalHeader.d.ts +3 -0
  341. package/modal/ModalHeader.js +37 -0
  342. package/modal/index.d.ts +2 -0
  343. package/modal/index.js +1 -0
  344. package/modal/types.d.ts +39 -0
  345. package/modal/types.js +1 -0
  346. package/modal/vars.d.ts +23 -0
  347. package/modal/vars.js +23 -0
  348. package/notification/Notification.d.ts +3 -0
  349. package/notification/Notification.js +129 -0
  350. package/notification/index.d.ts +2 -0
  351. package/notification/index.js +1 -0
  352. package/notification/types.d.ts +18 -0
  353. package/notification/types.js +1 -0
  354. package/notification/vars.d.ts +17 -0
  355. package/notification/vars.js +14 -0
  356. package/package.json +47 -0
  357. package/pagination/Pagination.d.ts +3 -0
  358. package/pagination/Pagination.js +191 -0
  359. package/pagination/index.d.ts +2 -0
  360. package/pagination/index.js +1 -0
  361. package/pagination/types.d.ts +23 -0
  362. package/pagination/types.js +1 -0
  363. package/pagination/utils.d.ts +2 -0
  364. package/pagination/utils.js +14 -0
  365. package/pagination/vars.d.ts +14 -0
  366. package/pagination/vars.js +14 -0
  367. package/popover/Popover.d.ts +9 -0
  368. package/popover/Popover.js +173 -0
  369. package/popover/PopoverFooter.d.ts +3 -0
  370. package/popover/PopoverFooter.js +51 -0
  371. package/popover/PopoverHeader.d.ts +3 -0
  372. package/popover/PopoverHeader.js +37 -0
  373. package/popover/index.d.ts +2 -0
  374. package/popover/index.js +1 -0
  375. package/popover/types.d.ts +46 -0
  376. package/popover/types.js +1 -0
  377. package/popover/vars.d.ts +30 -0
  378. package/popover/vars.js +27 -0
  379. package/progress/Progress.d.ts +3 -0
  380. package/progress/Progress.js +45 -0
  381. package/progress/index.d.ts +2 -0
  382. package/progress/index.js +1 -0
  383. package/progress/types.d.ts +19 -0
  384. package/progress/types.js +1 -0
  385. package/progress/vars.d.ts +15 -0
  386. package/progress/vars.js +15 -0
  387. package/radio/Radio.d.ts +7 -0
  388. package/radio/Radio.js +38 -0
  389. package/radio/RadioGroup.d.ts +3 -0
  390. package/radio/RadioGroup.js +21 -0
  391. package/radio/index.d.ts +2 -0
  392. package/radio/index.js +1 -0
  393. package/radio/types.d.ts +31 -0
  394. package/radio/types.js +1 -0
  395. package/radio/vars.d.ts +14 -0
  396. package/radio/vars.js +14 -0
  397. package/rating/Rating.d.ts +3 -0
  398. package/rating/Rating.js +34 -0
  399. package/rating/index.d.ts +2 -0
  400. package/rating/index.js +1 -0
  401. package/rating/internal/RatingStar.d.ts +19 -0
  402. package/rating/internal/RatingStar.js +37 -0
  403. package/rating/types.d.ts +18 -0
  404. package/rating/types.js +1 -0
  405. package/rating/vars.d.ts +11 -0
  406. package/rating/vars.js +11 -0
  407. package/resources.json +128 -0
  408. package/root/Root.d.ts +3 -0
  409. package/root/Root.js +85 -0
  410. package/root/dialog-service.d.ts +12 -0
  411. package/root/dialog-service.js +62 -0
  412. package/root/index.d.ts +3 -0
  413. package/root/index.js +2 -0
  414. package/root/types.d.ts +16 -0
  415. package/root/types.js +1 -0
  416. package/root/vars.d.ts +25 -0
  417. package/root/vars.js +13 -0
  418. package/select/Select.d.ts +5 -0
  419. package/select/Select.js +528 -0
  420. package/select/index.d.ts +2 -0
  421. package/select/index.js +1 -0
  422. package/select/types.d.ts +50 -0
  423. package/select/types.js +1 -0
  424. package/select/vars.d.ts +31 -0
  425. package/select/vars.js +31 -0
  426. package/separator/Separator.d.ts +3 -0
  427. package/separator/Separator.js +19 -0
  428. package/separator/index.d.ts +2 -0
  429. package/separator/index.js +1 -0
  430. package/separator/types.d.ts +8 -0
  431. package/separator/types.js +1 -0
  432. package/separator/vars.d.ts +9 -0
  433. package/separator/vars.js +9 -0
  434. package/skeleton/Skeleton.d.ts +3 -0
  435. package/skeleton/Skeleton.js +13 -0
  436. package/skeleton/index.d.ts +2 -0
  437. package/skeleton/index.js +1 -0
  438. package/skeleton/types.d.ts +7 -0
  439. package/skeleton/types.js +1 -0
  440. package/skeleton/vars.d.ts +6 -0
  441. package/skeleton/vars.js +6 -0
  442. package/slider/Slider.d.ts +3 -0
  443. package/slider/Slider.js +324 -0
  444. package/slider/index.d.ts +2 -0
  445. package/slider/index.js +1 -0
  446. package/slider/types.d.ts +28 -0
  447. package/slider/types.js +1 -0
  448. package/slider/vars.d.ts +17 -0
  449. package/slider/vars.js +17 -0
  450. package/slides/Slides.d.ts +3 -0
  451. package/slides/Slides.js +277 -0
  452. package/slides/index.d.ts +2 -0
  453. package/slides/index.js +1 -0
  454. package/slides/types.d.ts +29 -0
  455. package/slides/types.js +1 -0
  456. package/slides/vars.d.ts +20 -0
  457. package/slides/vars.js +20 -0
  458. package/spinner/Spinner.d.ts +3 -0
  459. package/spinner/Spinner.js +66 -0
  460. package/spinner/index.d.ts +2 -0
  461. package/spinner/index.js +1 -0
  462. package/spinner/types.d.ts +12 -0
  463. package/spinner/types.js +1 -0
  464. package/spinner/vars.d.ts +7 -0
  465. package/spinner/vars.js +7 -0
  466. package/stepper/Stepper.d.ts +3 -0
  467. package/stepper/Stepper.js +87 -0
  468. package/stepper/index.d.ts +2 -0
  469. package/stepper/index.js +1 -0
  470. package/stepper/types.d.ts +22 -0
  471. package/stepper/types.js +1 -0
  472. package/stepper/vars.d.ts +19 -0
  473. package/stepper/vars.js +19 -0
  474. package/switch/Switch.d.ts +2 -0
  475. package/switch/Switch.js +48 -0
  476. package/switch/index.d.ts +2 -0
  477. package/switch/index.js +1 -0
  478. package/switch/types.d.ts +18 -0
  479. package/switch/types.js +1 -0
  480. package/switch/vars.d.ts +17 -0
  481. package/switch/vars.js +17 -0
  482. package/table/Table.d.ts +17 -0
  483. package/table/Table.js +72 -0
  484. package/table/TableEmpty.d.ts +3 -0
  485. package/table/TableEmpty.js +37 -0
  486. package/table/TableExpand.d.ts +3 -0
  487. package/table/TableExpand.js +20 -0
  488. package/table/TableFilter.d.ts +3 -0
  489. package/table/TableFilter.js +22 -0
  490. package/table/TableTd.d.ts +3 -0
  491. package/table/TableTd.js +11 -0
  492. package/table/TableTh.d.ts +3 -0
  493. package/table/TableTh.js +33 -0
  494. package/table/TableThAction.d.ts +3 -0
  495. package/table/TableThAction.js +18 -0
  496. package/table/index.d.ts +2 -0
  497. package/table/index.js +1 -0
  498. package/table/internal/TableCell.d.ts +19 -0
  499. package/table/internal/TableCell.js +61 -0
  500. package/table/types.d.ts +73 -0
  501. package/table/types.js +1 -0
  502. package/table/vars.d.ts +29 -0
  503. package/table/vars.js +28 -0
  504. package/tabs/Tabs.d.ts +5 -0
  505. package/tabs/Tabs.js +248 -0
  506. package/tabs/index.d.ts +2 -0
  507. package/tabs/index.js +1 -0
  508. package/tabs/types.d.ts +28 -0
  509. package/tabs/types.js +1 -0
  510. package/tabs/vars.d.ts +30 -0
  511. package/tabs/vars.js +30 -0
  512. package/tag/Tag.d.ts +3 -0
  513. package/tag/Tag.js +16 -0
  514. package/tag/index.d.ts +2 -0
  515. package/tag/index.js +1 -0
  516. package/tag/types.d.ts +9 -0
  517. package/tag/types.js +1 -0
  518. package/tag/vars.d.ts +13 -0
  519. package/tag/vars.js +13 -0
  520. package/textarea/Textarea.d.ts +3 -0
  521. package/textarea/Textarea.js +72 -0
  522. package/textarea/index.d.ts +2 -0
  523. package/textarea/index.js +1 -0
  524. package/textarea/types.d.ts +18 -0
  525. package/textarea/types.js +1 -0
  526. package/textarea/vars.d.ts +7 -0
  527. package/textarea/vars.js +7 -0
  528. package/time-picker/TimePicker.d.ts +3 -0
  529. package/time-picker/TimePicker.js +338 -0
  530. package/time-picker/index.d.ts +2 -0
  531. package/time-picker/index.js +1 -0
  532. package/time-picker/internal/TimePickerPanel.d.ts +16 -0
  533. package/time-picker/internal/TimePickerPanel.js +138 -0
  534. package/time-picker/types.d.ts +33 -0
  535. package/time-picker/types.js +1 -0
  536. package/time-picker/utils.d.ts +4 -0
  537. package/time-picker/utils.js +26 -0
  538. package/time-picker/vars.d.ts +20 -0
  539. package/time-picker/vars.js +20 -0
  540. package/timeline/Timeline.d.ts +3 -0
  541. package/timeline/Timeline.js +53 -0
  542. package/timeline/index.d.ts +2 -0
  543. package/timeline/index.js +1 -0
  544. package/timeline/types.d.ts +15 -0
  545. package/timeline/types.js +1 -0
  546. package/timeline/vars.d.ts +19 -0
  547. package/timeline/vars.js +19 -0
  548. package/toast/Toast.d.ts +3 -0
  549. package/toast/Toast.js +123 -0
  550. package/toast/index.d.ts +2 -0
  551. package/toast/index.js +1 -0
  552. package/toast/types.d.ts +17 -0
  553. package/toast/types.js +1 -0
  554. package/toast/vars.d.ts +14 -0
  555. package/toast/vars.js +11 -0
  556. package/tooltip/Tooltip.d.ts +3 -0
  557. package/tooltip/Tooltip.js +113 -0
  558. package/tooltip/index.d.ts +2 -0
  559. package/tooltip/index.js +1 -0
  560. package/tooltip/types.d.ts +29 -0
  561. package/tooltip/types.js +1 -0
  562. package/tooltip/vars.d.ts +20 -0
  563. package/tooltip/vars.js +17 -0
  564. package/transfer/Transfer.d.ts +3 -0
  565. package/transfer/Transfer.js +156 -0
  566. package/transfer/index.d.ts +2 -0
  567. package/transfer/index.js +1 -0
  568. package/transfer/internal/TransferPanel.d.ts +21 -0
  569. package/transfer/internal/TransferPanel.js +42 -0
  570. package/transfer/types.d.ts +34 -0
  571. package/transfer/types.js +1 -0
  572. package/transfer/vars.d.ts +17 -0
  573. package/transfer/vars.js +17 -0
  574. package/tree/Tree.d.ts +3 -0
  575. package/tree/Tree.js +165 -0
  576. package/tree/index.d.ts +2 -0
  577. package/tree/index.js +1 -0
  578. package/tree/internal/TreePanel.d.ts +32 -0
  579. package/tree/internal/TreePanel.js +167 -0
  580. package/tree/node/abstract-node.d.ts +25 -0
  581. package/tree/node/abstract-node.js +68 -0
  582. package/tree/node/multiple-node.d.ts +18 -0
  583. package/tree/node/multiple-node.js +109 -0
  584. package/tree/node/single-node.d.ts +16 -0
  585. package/tree/node/single-node.js +60 -0
  586. package/tree/node/types.d.ts +6 -0
  587. package/tree/node/types.js +1 -0
  588. package/tree/node/vars.d.ts +2 -0
  589. package/tree/node/vars.js +1 -0
  590. package/tree/types.d.ts +34 -0
  591. package/tree/types.js +1 -0
  592. package/tree/utils.d.ts +6 -0
  593. package/tree/utils.js +9 -0
  594. package/tree/vars.d.ts +20 -0
  595. package/tree/vars.js +20 -0
  596. package/tree-select/TreeSelect.d.ts +6 -0
  597. package/tree-select/TreeSelect.js +509 -0
  598. package/tree-select/index.d.ts +2 -0
  599. package/tree-select/index.js +1 -0
  600. package/tree-select/internal/TreeSelectSearchPanel.d.ts +22 -0
  601. package/tree-select/internal/TreeSelectSearchPanel.js +73 -0
  602. package/tree-select/internal/types.d.ts +8 -0
  603. package/tree-select/internal/types.js +1 -0
  604. package/tree-select/types.d.ts +48 -0
  605. package/tree-select/types.js +1 -0
  606. package/tree-select/vars.d.ts +37 -0
  607. package/tree-select/vars.js +37 -0
  608. package/types.d.ts +21 -0
  609. package/types.js +1 -0
  610. package/upload/Upload.d.ts +19 -0
  611. package/upload/Upload.js +203 -0
  612. package/upload/UploadAction.d.ts +3 -0
  613. package/upload/UploadAction.js +44 -0
  614. package/upload/UploadButton.d.ts +3 -0
  615. package/upload/UploadButton.js +31 -0
  616. package/upload/UploadList.d.ts +3 -0
  617. package/upload/UploadList.js +62 -0
  618. package/upload/UploadPicture.d.ts +3 -0
  619. package/upload/UploadPicture.js +72 -0
  620. package/upload/UploadPictureList.d.ts +3 -0
  621. package/upload/UploadPictureList.js +62 -0
  622. package/upload/UploadPreviewAction.d.ts +3 -0
  623. package/upload/UploadPreviewAction.js +32 -0
  624. package/upload/index.d.ts +2 -0
  625. package/upload/index.js +1 -0
  626. package/upload/types.d.ts +78 -0
  627. package/upload/types.js +1 -0
  628. package/upload/vars.d.ts +65 -0
  629. package/upload/vars.js +65 -0
  630. package/utils/handleModalKeyDown.d.ts +2 -0
  631. package/utils/handleModalKeyDown.js +17 -0
  632. package/utils/index.d.ts +6 -0
  633. package/utils/index.js +6 -0
  634. package/utils/isPrintableCharacter.d.ts +1 -0
  635. package/utils/isPrintableCharacter.js +3 -0
  636. package/utils/mergeCS.d.ts +11 -0
  637. package/utils/mergeCS.js +6 -0
  638. package/utils/position/getHorizontalSidePosition.d.ts +14 -0
  639. package/utils/position/getHorizontalSidePosition.js +22 -0
  640. package/utils/position/getPopupPosition.d.ts +18 -0
  641. package/utils/position/getPopupPosition.js +170 -0
  642. package/utils/position/getVerticalSidePosition.d.ts +17 -0
  643. package/utils/position/getVerticalSidePosition.js +43 -0
  644. package/vars.d.ts +5 -0
  645. package/vars.js +5 -0
  646. package/virtual-scroll/VirtualScroll.d.ts +5 -0
  647. package/virtual-scroll/VirtualScroll.js +430 -0
  648. package/virtual-scroll/index.d.ts +2 -0
  649. package/virtual-scroll/index.js +1 -0
  650. package/virtual-scroll/types.d.ts +34 -0
  651. package/virtual-scroll/types.js +1 -0
  652. package/virtual-scroll/vars.d.ts +1 -0
  653. package/virtual-scroll/vars.js +1 -0
@@ -0,0 +1,277 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createElement as _createElement } from "react";
4
+ import { useAsync, useEvent, useRefExtra } from '@laser-ui/hooks';
5
+ import { ReactComponent as KeyboardArrowLeftOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_left.svg';
6
+ import { ReactComponent as KeyboardArrowRightOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_right.svg';
7
+ import { isBoolean, isNumber, isUndefined, nth } from 'lodash';
8
+ import { useEffect, useId, useRef, useState } from 'react';
9
+ import { CLASSES } from './vars';
10
+ import { useComponentProps, useControlled, useNamespace, useStyled } from '../hooks';
11
+ import { Icon } from '../icon';
12
+ import { mergeCS } from '../utils';
13
+ export function Slides(props) {
14
+ var _a, _b;
15
+ const _c = useComponentProps('Slides', props), { styleOverrides, styleProvider, list, active: activeProp, defaultActive, autoplay: autoplayProp = 0, arrow = 'hover', pagination: paginationProp = true, vertical = false, effect = 'slide', onActiveChange } = _c, restProps = __rest(_c, ["styleOverrides", "styleProvider", "list", "active", "defaultActive", "autoplay", "arrow", "pagination", "vertical", "effect", "onActiveChange"]);
16
+ const namespace = useNamespace();
17
+ const styled = useStyled(CLASSES, { slides: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.slides }, styleOverrides);
18
+ const async = useAsync();
19
+ const slidesRef = useRef(null);
20
+ const windowRef = useRefExtra(() => window);
21
+ const uniqueId = useId();
22
+ const viewId = `${namespace}-slides-view-${uniqueId}`;
23
+ const dataRef = useRef({
24
+ startDragTime: 0,
25
+ });
26
+ const autoplay = Object.assign({ delay: 0, stopOnLast: false, pauseOnMouseEnter: true }, isNumber(autoplayProp) ? { delay: autoplayProp } : autoplayProp);
27
+ const pagination = Object.assign({ visible: true, dynamic: false }, isBoolean(paginationProp) ? { visible: paginationProp } : paginationProp === 'hover' ? { visible: 'hover' } : paginationProp);
28
+ const [active, changeActive] = useControlled((_b = defaultActive !== null && defaultActive !== void 0 ? defaultActive : (_a = nth(list, 0)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null, activeProp, (id) => {
29
+ if (onActiveChange) {
30
+ onActiveChange(id, list.find((s) => s.id === id));
31
+ }
32
+ });
33
+ const activeIndex = list.findIndex((s) => s.id === active);
34
+ const [mouseEnter, setMouseEnter] = useState(false);
35
+ const [dragStartPosition, setDragStartPosition] = useState();
36
+ const [dragDistance, setDragDistance] = useState(0);
37
+ const [dragOpacity, setDragOpacity] = useState();
38
+ const listenDragEvent = !isUndefined(dragStartPosition);
39
+ const changeDragDistance = (distance) => {
40
+ if (slidesRef.current) {
41
+ const els = [];
42
+ const slideEls = slidesRef.current.querySelectorAll(`.${namespace}-slides__slide`);
43
+ slideEls.forEach((el) => {
44
+ const index = Number(el.dataset['index']);
45
+ els[index] = el;
46
+ });
47
+ if (distance > 0) {
48
+ let size = 0;
49
+ for (let index = activeIndex - 1; index >= 0; index--) {
50
+ size += els[index][vertical ? 'offsetHeight' : 'offsetWidth'];
51
+ }
52
+ const distanceValue = Math.abs(distance) > size
53
+ ? size +
54
+ Math.sin(Math.min((Math.abs(distance) - size) / (els[0][vertical ? 'offsetHeight' : 'offsetWidth'] * 3), 1) * (Math.PI / 2)) *
55
+ els[0][vertical ? 'offsetHeight' : 'offsetWidth']
56
+ : distance;
57
+ setDragDistance(distanceValue);
58
+ setDragOpacity({
59
+ index: activeIndex,
60
+ value: activeIndex === 0
61
+ ? 1
62
+ : Math.max(1 - Math.abs(distanceValue) / els[activeIndex - 1][vertical ? 'offsetHeight' : 'offsetWidth'], 0),
63
+ });
64
+ }
65
+ else {
66
+ let size = 0;
67
+ for (let index = activeIndex + 1; index < list.length; index++) {
68
+ size += els[index][vertical ? 'offsetHeight' : 'offsetWidth'];
69
+ }
70
+ const distanceValue = Math.abs(distance) > size
71
+ ? -(size +
72
+ Math.sin(Math.min((Math.abs(distance) - size) / (els[list.length - 1][vertical ? 'offsetHeight' : 'offsetWidth'] * 3), 1) *
73
+ (Math.PI / 2)) *
74
+ els[list.length - 1][vertical ? 'offsetHeight' : 'offsetWidth'])
75
+ : distance;
76
+ setDragDistance(distanceValue);
77
+ setDragOpacity({
78
+ index: Math.min(activeIndex + 1, list.length - 1),
79
+ value: activeIndex === list.length - 1
80
+ ? 1
81
+ : Math.min(Math.abs(distanceValue) / els[activeIndex + 1][vertical ? 'offsetHeight' : 'offsetWidth'], 1),
82
+ });
83
+ }
84
+ }
85
+ };
86
+ const handleDragEnd = () => {
87
+ var _a, _b, _c, _d;
88
+ if (slidesRef.current) {
89
+ const els = [];
90
+ const slideEls = slidesRef.current.querySelectorAll(`.${namespace}-slides__slide`);
91
+ slideEls.forEach((el) => {
92
+ const index = Number(el.dataset['index']);
93
+ els[index] = el;
94
+ });
95
+ if (dragDistance > 0) {
96
+ let newIndex = activeIndex;
97
+ let size = 0;
98
+ for (let index = activeIndex - 1; index >= 0; index--) {
99
+ if (Math.abs(dragDistance) > size + els[index][vertical ? 'offsetHeight' : 'offsetWidth'] / 2) {
100
+ size += els[index][vertical ? 'offsetHeight' : 'offsetWidth'];
101
+ newIndex = index;
102
+ }
103
+ else {
104
+ break;
105
+ }
106
+ }
107
+ if (newIndex === activeIndex) {
108
+ if (performance.now() - dataRef.current.startDragTime < 300 && Math.abs(dragDistance) > 30) {
109
+ const id = (_a = nth(list, Math.max(newIndex - 1, 0))) === null || _a === void 0 ? void 0 : _a.id;
110
+ if (!isUndefined(id)) {
111
+ changeActive(id);
112
+ }
113
+ }
114
+ }
115
+ else {
116
+ const id = (_b = nth(list, newIndex)) === null || _b === void 0 ? void 0 : _b.id;
117
+ if (!isUndefined(id)) {
118
+ changeActive(id);
119
+ }
120
+ }
121
+ }
122
+ else {
123
+ let newIndex = activeIndex;
124
+ let size = 0;
125
+ for (let index = activeIndex + 1; index < list.length; index++) {
126
+ if (Math.abs(dragDistance) > size + els[index][vertical ? 'offsetHeight' : 'offsetWidth'] / 2) {
127
+ size += els[index][vertical ? 'offsetHeight' : 'offsetWidth'];
128
+ newIndex = index;
129
+ }
130
+ else {
131
+ break;
132
+ }
133
+ }
134
+ if (newIndex === activeIndex) {
135
+ if (performance.now() - dataRef.current.startDragTime < 300 && Math.abs(dragDistance) > 30) {
136
+ const id = (_c = nth(list, Math.min(newIndex + 1, list.length - 1))) === null || _c === void 0 ? void 0 : _c.id;
137
+ if (!isUndefined(id)) {
138
+ changeActive(id);
139
+ }
140
+ }
141
+ }
142
+ else {
143
+ const id = (_d = nth(list, newIndex)) === null || _d === void 0 ? void 0 : _d.id;
144
+ if (!isUndefined(id)) {
145
+ changeActive(id);
146
+ }
147
+ }
148
+ }
149
+ }
150
+ setDragStartPosition(undefined);
151
+ setDragDistance(0);
152
+ setDragOpacity(undefined);
153
+ };
154
+ useEffect(() => {
155
+ if (slidesRef.current) {
156
+ let size = 0;
157
+ const slideEls = slidesRef.current.querySelectorAll(`.${namespace}-slides__slide`);
158
+ slideEls.forEach((el) => {
159
+ const index = Number(el.dataset['index']);
160
+ if (index < activeIndex) {
161
+ size += el[vertical ? 'offsetHeight' : 'offsetWidth'];
162
+ }
163
+ else if (index === activeIndex) {
164
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
165
+ slidesRef.current.style.height = el.offsetHeight + 'px';
166
+ }
167
+ });
168
+ const containerEl = slidesRef.current.querySelector(`.${namespace}-slides__container`);
169
+ containerEl.style.transform = effect === 'slide' ? `translate${vertical ? 'Y' : 'X'}(calc(-${size}px + ${dragDistance}px))` : '';
170
+ }
171
+ });
172
+ useEffect(() => {
173
+ var _a, _b;
174
+ if (autoplay.delay === 0 ||
175
+ (autoplay.stopOnLast && activeIndex === list.length - 1) ||
176
+ (autoplay.pauseOnMouseEnter && mouseEnter) ||
177
+ listenDragEvent) {
178
+ (_b = (_a = dataRef.current).clearTid) === null || _b === void 0 ? void 0 : _b.call(_a);
179
+ dataRef.current.clearTid = undefined;
180
+ }
181
+ else if (isUndefined(dataRef.current.clearTid)) {
182
+ dataRef.current.clearTid = async.setTimeout(() => {
183
+ var _a;
184
+ dataRef.current.clearTid = undefined;
185
+ const id = (_a = nth(list, (activeIndex + 1) % list.length)) === null || _a === void 0 ? void 0 : _a.id;
186
+ if (!isUndefined(id)) {
187
+ changeActive(id);
188
+ }
189
+ }, autoplay.delay, () => {
190
+ dataRef.current.clearTid = undefined;
191
+ });
192
+ }
193
+ });
194
+ useEvent(windowRef, 'touchmove', (e) => {
195
+ if (listenDragEvent) {
196
+ e.preventDefault();
197
+ changeDragDistance(e.touches[0][vertical ? 'clientY' : 'clientX'] - dragStartPosition);
198
+ }
199
+ }, { passive: false }, !listenDragEvent);
200
+ useEvent(windowRef, 'mousemove', (e) => {
201
+ if (listenDragEvent) {
202
+ e.preventDefault();
203
+ changeDragDistance(e[vertical ? 'clientY' : 'clientX'] - dragStartPosition);
204
+ }
205
+ }, {}, !listenDragEvent);
206
+ useEvent(windowRef, 'mouseup', () => {
207
+ handleDragEnd();
208
+ }, {}, !listenDragEvent);
209
+ return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('slides', {
210
+ 'slides--vertical': vertical,
211
+ 'slides--fade': effect === 'fade',
212
+ }), {
213
+ className: restProps.className,
214
+ style: restProps.style,
215
+ }), { ref: slidesRef, onMouseEnter: (e) => {
216
+ var _a;
217
+ (_a = restProps.onMouseEnter) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
218
+ setMouseEnter(true);
219
+ }, onMouseLeave: (e) => {
220
+ var _a;
221
+ (_a = restProps.onMouseLeave) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
222
+ setMouseEnter(false);
223
+ }, children: [_jsx("div", Object.assign({}, mergeCS(styled('slides__container'), {
224
+ style: { transition: listenDragEvent ? 'none' : undefined },
225
+ }), { id: viewId, role: "region", "aria-live": "polite", onMouseDown: (e) => {
226
+ e.preventDefault();
227
+ if (e.button === 0) {
228
+ setDragStartPosition(e[vertical ? 'clientY' : 'clientX']);
229
+ dataRef.current.startDragTime = performance.now();
230
+ }
231
+ }, onTouchStart: (e) => {
232
+ setDragStartPosition(e.touches[0][vertical ? 'clientY' : 'clientX']);
233
+ dataRef.current.startDragTime = performance.now();
234
+ }, onTouchEnd: () => {
235
+ handleDragEnd();
236
+ }, children: list.map((slide, index) => {
237
+ let opacity = index <= activeIndex ? 1 : 0;
238
+ if (listenDragEvent && dragOpacity && dragOpacity.index === index) {
239
+ opacity = dragOpacity.value;
240
+ }
241
+ return (_createElement("div", Object.assign({}, mergeCS(styled('slides__slide'), {
242
+ style: effect === 'slide' ? undefined : { opacity, transition: listenDragEvent ? 'none' : undefined },
243
+ }), { key: slide.id, "aria-hidden": slide.id !== active, "data-index": index }), slide.content));
244
+ }) })), (arrow === true || arrow === 'hover') && (_jsxs(_Fragment, { children: [_jsx("button", Object.assign({}, styled('slides__arrow', 'slides__arrow--prev', {
245
+ 'slides__arrow.is-hidden': arrow === 'hover' && !mouseEnter,
246
+ }), { tabIndex: -1, disabled: activeIndex === 0, onClick: () => {
247
+ var _a;
248
+ const id = (_a = nth(list, activeIndex - 1)) === null || _a === void 0 ? void 0 : _a.id;
249
+ if (!isUndefined(id)) {
250
+ changeActive(id);
251
+ }
252
+ }, children: _jsx(Icon, { children: _jsx(KeyboardArrowLeftOutlined, {}) }) })), _jsx("button", Object.assign({}, styled('slides__arrow', 'slides__arrow--next', {
253
+ 'slides__arrow.is-hidden': arrow === 'hover' && !mouseEnter,
254
+ }), { tabIndex: -1, disabled: activeIndex === list.length - 1, onClick: () => {
255
+ var _a;
256
+ const id = (_a = nth(list, activeIndex + 1)) === null || _a === void 0 ? void 0 : _a.id;
257
+ if (!isUndefined(id)) {
258
+ changeActive(id);
259
+ }
260
+ }, children: _jsx(Icon, { children: _jsx(KeyboardArrowRightOutlined, {}) }) }))] })), (pagination.visible === true || pagination.visible === 'hover') && (_jsx("div", Object.assign({}, styled('slides__pagination', {
261
+ 'slides__pagination.is-hidden': pagination.visible === 'hover' && !mouseEnter,
262
+ 'slides__pagination--dynamic': pagination.dynamic,
263
+ }), { role: "radiogroup", children: list.map((slide, index) => {
264
+ const checked = active === slide.id;
265
+ return (_createElement("input", Object.assign({}, mergeCS(styled('slides__pagination-radio', {
266
+ 'slides__pagination-radio.is-checked': checked,
267
+ 'slides__pagination-radio--prev-1': pagination.dynamic && index - activeIndex === -1,
268
+ 'slides__pagination-radio--prev-2': pagination.dynamic && index - activeIndex === -2,
269
+ 'slides__pagination-radio--next-1': pagination.dynamic && index - activeIndex === 1,
270
+ 'slides__pagination-radio--next-2': pagination.dynamic && index - activeIndex === 2,
271
+ }), {
272
+ style: { [vertical ? 'top' : 'left']: pagination.dynamic ? 40 - 8 - 16 * activeIndex : undefined },
273
+ }), { key: slide.id, type: "radio", value: slide.id, checked: checked, name: uniqueId, title: slide.tooltip, "aria-checked": checked, "aria-controls": viewId, onChange: () => {
274
+ changeActive(slide.id);
275
+ } })));
276
+ }) })))] })));
277
+ }
@@ -0,0 +1,2 @@
1
+ export type { SlidesProps } from './types';
2
+ export { Slides } from './Slides';
@@ -0,0 +1 @@
1
+ export { Slides } from './Slides';
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import type { CLASSES } from './vars';
3
+ import type { BaseProps } from '../types';
4
+ export {};
5
+ export interface SlidesAutoplayOptions {
6
+ delay?: number;
7
+ stopOnLast?: boolean;
8
+ pauseOnMouseEnter?: boolean;
9
+ }
10
+ export interface SlidesPaginationOptions {
11
+ visible?: boolean | 'hover';
12
+ dynamic?: boolean;
13
+ }
14
+ export interface SlidesItem<ID extends React.Key> {
15
+ id: ID;
16
+ tooltip?: string;
17
+ content: React.ReactNode;
18
+ }
19
+ export interface SlidesProps<ID extends React.Key, T extends SlidesItem<ID>> extends BaseProps<'slides', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
20
+ list: T[];
21
+ active?: ID;
22
+ defaultActive?: ID;
23
+ autoplay?: number | SlidesAutoplayOptions;
24
+ arrow?: boolean | 'hover';
25
+ pagination?: boolean | 'hover' | SlidesPaginationOptions;
26
+ vertical?: boolean;
27
+ effect?: 'slide' | 'fade';
28
+ onActiveChange?: (id: ID, origin: T) => void;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export declare const CLASSES: {
2
+ slides: string;
3
+ 'slides--vertical': string;
4
+ 'slides--fade': string;
5
+ slides__container: string;
6
+ slides__slide: string;
7
+ slides__arrow: string;
8
+ 'slides__arrow.is-hidden': string;
9
+ 'slides__arrow--prev': string;
10
+ 'slides__arrow--next': string;
11
+ slides__pagination: string;
12
+ 'slides__pagination.is-hidden': string;
13
+ 'slides__pagination--dynamic': string;
14
+ 'slides__pagination-radio': string;
15
+ 'slides__pagination-radio.is-checked': string;
16
+ 'slides__pagination-radio--prev-1': string;
17
+ 'slides__pagination-radio--prev-2': string;
18
+ 'slides__pagination-radio--next-1': string;
19
+ 'slides__pagination-radio--next-2': string;
20
+ };
package/slides/vars.js ADDED
@@ -0,0 +1,20 @@
1
+ export const CLASSES = {
2
+ slides: '^slides',
3
+ 'slides--vertical': '^slides--vertical',
4
+ 'slides--fade': '^slides--fade',
5
+ slides__container: '^slides__container',
6
+ slides__slide: '^slides__slide',
7
+ slides__arrow: '^slides__arrow',
8
+ 'slides__arrow.is-hidden': 'is-hidden',
9
+ 'slides__arrow--prev': '^slides__arrow--prev',
10
+ 'slides__arrow--next': '^slides__arrow--next',
11
+ slides__pagination: '^slides__pagination',
12
+ 'slides__pagination.is-hidden': 'is-hidden',
13
+ 'slides__pagination--dynamic': '^slides__pagination--dynamic',
14
+ 'slides__pagination-radio': '^slides__pagination-radio',
15
+ 'slides__pagination-radio.is-checked': 'is-checked',
16
+ 'slides__pagination-radio--prev-1': '^slides__pagination-radio--prev-1',
17
+ 'slides__pagination-radio--prev-2': '^slides__pagination-radio--prev-2',
18
+ 'slides__pagination-radio--next-1': '^slides__pagination-radio--next-1',
19
+ 'slides__pagination-radio--next-2': '^slides__pagination-radio--next-2',
20
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SpinnerProps } from './types';
3
+ export declare function Spinner(props: SpinnerProps): JSX.Element | null;
@@ -0,0 +1,66 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useAsync, useForceUpdate } from '@laser-ui/hooks';
4
+ import { checkNodeExist } from '@laser-ui/utils';
5
+ import { isNumber, isUndefined } from 'lodash';
6
+ import { useEffect, useRef } from 'react';
7
+ import { CLASSES } from './vars';
8
+ import { useComponentProps, useStyled } from '../hooks';
9
+ import { Icon } from '../icon';
10
+ import { CircularProgress } from '../internal/circular-progress';
11
+ import { Transition } from '../internal/transition';
12
+ import { mergeCS } from '../utils';
13
+ import { TTANSITION_DURING_BASE } from '../vars';
14
+ export function Spinner(props) {
15
+ const _a = useComponentProps('Spinner', props), { children, styleOverrides, styleProvider, visible: visibleProp, text, size = 28, delay, alone = false, afterVisibleChange } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "visible", "text", "size", "delay", "alone", "afterVisibleChange"]);
16
+ const styled = useStyled(CLASSES, { spinner: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.spinner }, styleOverrides);
17
+ const async = useAsync();
18
+ const forceUpdate = useForceUpdate();
19
+ const spinnerRef = useRef(null);
20
+ const containerRef = useRef(null);
21
+ const dataRef = useRef({
22
+ delayVisible: false,
23
+ });
24
+ if (visibleProp === false) {
25
+ dataRef.current.delayVisible = false;
26
+ }
27
+ const visible = isUndefined(delay) ? visibleProp : dataRef.current.delayVisible;
28
+ useEffect(() => {
29
+ if (isNumber(delay) && visibleProp) {
30
+ const clearTid = async.setTimeout(() => {
31
+ dataRef.current.delayVisible = true;
32
+ forceUpdate();
33
+ }, delay);
34
+ return () => {
35
+ clearTid();
36
+ };
37
+ }
38
+ }, [async, delay, forceUpdate, visibleProp]);
39
+ const transitionStyles = {
40
+ enter: { opacity: 0 },
41
+ entering: {
42
+ transition: ['opacity'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms linear`).join(', '),
43
+ },
44
+ leaving: {
45
+ opacity: 0,
46
+ transition: ['opacity'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms linear`).join(', '),
47
+ },
48
+ leaved: { display: 'none' },
49
+ };
50
+ return (_jsx(Transition, { enter: visible, during: TTANSITION_DURING_BASE, afterRender: () => {
51
+ if (!alone && spinnerRef.current && containerRef.current) {
52
+ containerRef.current.style.height = `${spinnerRef.current.offsetHeight}px`;
53
+ }
54
+ }, destroyWhenLeaved: true, afterEnter: () => {
55
+ afterVisibleChange === null || afterVisibleChange === void 0 ? void 0 : afterVisibleChange(true);
56
+ }, afterLeave: () => {
57
+ afterVisibleChange === null || afterVisibleChange === void 0 ? void 0 : afterVisibleChange(false);
58
+ }, children: (state) => (_jsx("div", Object.assign({}, restProps, mergeCS(styled('spinner', {
59
+ 'spinner--alone': alone,
60
+ }), {
61
+ className: restProps.className,
62
+ style: Object.assign(Object.assign({}, restProps.style), transitionStyles[state]),
63
+ }), { ref: spinnerRef, children: _jsxs("div", Object.assign({}, styled('spinner__container'), { ref: containerRef, children: [children !== false && (_jsx("div", Object.assign({}, mergeCS(styled('spinner__icon'), {
64
+ style: { fontSize: size },
65
+ }), { children: checkNodeExist(children) ? (children) : (_jsx(Icon, { children: _jsx(CircularProgress, {}) })) }))), checkNodeExist(text) && _jsx("div", Object.assign({}, styled('spinner__text'), { children: text }))] })) }))) }));
66
+ }
@@ -0,0 +1,2 @@
1
+ export type { SpinnerProps } from './types';
2
+ export { Spinner } from './Spinner';
@@ -0,0 +1 @@
1
+ export { Spinner } from './Spinner';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { CLASSES } from './vars';
3
+ import type { BaseProps } from '../types';
4
+ export {};
5
+ export interface SpinnerProps extends BaseProps<'spinner', typeof CLASSES>, React.HTMLAttributes<HTMLElement> {
6
+ visible: boolean;
7
+ text?: React.ReactNode;
8
+ size?: number | string;
9
+ delay?: number;
10
+ alone?: boolean;
11
+ afterVisibleChange?: (visible: boolean) => void;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const CLASSES: {
2
+ spinner: string;
3
+ 'spinner--alone': string;
4
+ spinner__container: string;
5
+ spinner__icon: string;
6
+ spinner__text: string;
7
+ };
@@ -0,0 +1,7 @@
1
+ export const CLASSES = {
2
+ spinner: '^spinner',
3
+ 'spinner--alone': '^spinner--alone',
4
+ spinner__container: '^spinner__container',
5
+ spinner__icon: '^spinner__icon',
6
+ spinner__text: '^spinner__text',
7
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { StepperItem, StepperProps } from './types';
3
+ export declare function Stepper<T extends StepperItem>(props: StepperProps<T>): JSX.Element | null;
@@ -0,0 +1,87 @@
1
+ import { __rest } from "tslib";
2
+ import { createElement as _createElement } from "react";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { checkNodeExist } from '@laser-ui/utils';
5
+ import { ReactComponent as CheckOutlined } from '@material-design-icons/svg/outlined/check.svg';
6
+ import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
7
+ import { isNumber, isUndefined } from 'lodash';
8
+ import { CLASSES } from './vars';
9
+ import { useComponentProps, useStyled } from '../hooks';
10
+ import { Icon } from '../icon';
11
+ import { CollapseTransition } from '../internal/transition';
12
+ import { Progress } from '../progress';
13
+ import { mergeCS } from '../utils';
14
+ import { TTANSITION_DURING_BASE } from '../vars';
15
+ export function Stepper(props) {
16
+ const _a = useComponentProps('Stepper', props), { styleOverrides, styleProvider, list, active, percent, dotSize = 36, clickable = false, labelBottom = false, vertical = false, onClick } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "list", "active", "percent", "dotSize", "clickable", "labelBottom", "vertical", "onClick"]);
17
+ const styled = useStyled(CLASSES, { stepper: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.stepper }, styleOverrides);
18
+ return (_jsx("div", Object.assign({}, restProps, mergeCS(styled('stepper', {
19
+ 'stepper--button': clickable,
20
+ 'stepper--label-bottom': labelBottom,
21
+ 'stepper--vertical': vertical,
22
+ }), {
23
+ className: restProps.className,
24
+ style: restProps.style,
25
+ }), { children: list.map((item, index) => {
26
+ const { step: itemStep = index + 1, title: itemTitle, description: itemDescription, state: itemState, color: itemColor, dot: itemDot, } = item;
27
+ const isWait = itemStep > active;
28
+ const isActive = itemStep === active;
29
+ const isCompleted = itemStep < active;
30
+ const isProgress = isActive && isNumber(percent);
31
+ const titleNode = (_jsx("div", Object.assign({}, mergeCS(styled('stepper__step-title'), {
32
+ style: { marginTop: labelBottom ? undefined : `calc((${dotSize}px - 1.1em) / 2)` },
33
+ }), { children: itemTitle })));
34
+ const separatoreNode = vertical && labelBottom
35
+ ? null
36
+ : index !== list.length - 1 && (_jsx("div", Object.assign({}, mergeCS(styled('stepper__step-separator'), {
37
+ style: {
38
+ top: vertical ? `${dotSize}px` : `calc((${dotSize}px - 2px) / 2)`,
39
+ left: vertical ? `${dotSize / 2}px` : labelBottom ? `calc(50% + ${dotSize / 2}px)` : undefined,
40
+ width: !vertical && labelBottom ? `calc(100% - ${dotSize}px)` : undefined,
41
+ height: vertical ? `calc(100% - ${dotSize}px)` : undefined,
42
+ },
43
+ }))));
44
+ return (_createElement("div", Object.assign({}, mergeCS(styled('stepper__step', isUndefined(itemState)
45
+ ? {
46
+ 'stepper__step.is-wait': isWait,
47
+ 'stepper__step.is-active': isActive,
48
+ 'stepper__step.is-completed': isCompleted,
49
+ }
50
+ : {}, {
51
+ [`stepper__step.is-${itemState}`]: itemState,
52
+ }), {
53
+ style: Object.assign({ '--color': itemColor }, { maxWidth: !vertical && index === list.length - 1 ? `calc(100% / ${list.length})` : undefined, width: !vertical && labelBottom ? `calc(100% / ${list.length})` : undefined }),
54
+ }), { key: itemStep, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, onKeyDown: (e) => {
55
+ if (clickable) {
56
+ if (e.code === 'Enter' || e.code === 'Space') {
57
+ e.preventDefault();
58
+ onClick === null || onClick === void 0 ? void 0 : onClick(itemStep, item);
59
+ }
60
+ }
61
+ }, onClick: () => {
62
+ if (clickable) {
63
+ onClick === null || onClick === void 0 ? void 0 : onClick(itemStep, item);
64
+ }
65
+ } }),
66
+ _jsxs("div", Object.assign({}, styled('stepper__step-header'), { children: [_jsxs("div", Object.assign({}, mergeCS(styled('stepper__step-dot', {
67
+ 'stepper__step-dot--progress': isProgress,
68
+ }), { style: { width: dotSize, height: dotSize } }), { children: [itemDot === false ? null : checkNodeExist(itemDot) ? (itemDot) : itemState === 'error' ? (_jsx(Icon, { children: _jsx(CloseOutlined, {}) })) : isCompleted ? (_jsx(Icon, { children: _jsx(CheckOutlined, {}) })) : (itemStep), isProgress && (_jsx("div", Object.assign({}, styled('stepper__step-progress'), { children: _jsx(Progress, { percent: percent, pattern: "circle", state: "process", label: false, size: dotSize + 8, lineWidth: 4 }) })))] })), !labelBottom && titleNode, !vertical && separatoreNode] })),
69
+ labelBottom && titleNode,
70
+ vertical && separatoreNode,
71
+ checkNodeExist(itemDescription) && (_jsx(CollapseTransition, { originalSize: {
72
+ height: 'auto',
73
+ }, collapsedSize: {
74
+ height: 0,
75
+ }, enter: !vertical || isActive, during: TTANSITION_DURING_BASE, styles: {
76
+ entering: {
77
+ transition: ['height', 'padding', 'margin'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms ease-out`).join(', '),
78
+ },
79
+ leaving: {
80
+ transition: ['height', 'padding', 'margin'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms ease-in`).join(', '),
81
+ },
82
+ leaved: { display: 'none' },
83
+ }, children: (descriptionRef, collapseStyle) => (_jsx("div", Object.assign({}, mergeCS(styled('stepper__step-description'), {
84
+ style: Object.assign({ marginLeft: labelBottom ? undefined : `calc(${dotSize}px + 8px)` }, collapseStyle),
85
+ }), { ref: descriptionRef, children: itemDescription }))) }))));
86
+ }) })));
87
+ }
@@ -0,0 +1,2 @@
1
+ export type { StepperProps } from './types';
2
+ export { Stepper } from './Stepper';
@@ -0,0 +1 @@
1
+ export { Stepper } from './Stepper';
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import type { CLASSES } from './vars';
3
+ import type { BaseProps } from '../types';
4
+ export {};
5
+ export interface StepperItem {
6
+ step?: number;
7
+ title: React.ReactNode;
8
+ description?: React.ReactNode;
9
+ state?: 'wait' | 'active' | 'completed' | 'warning' | 'error';
10
+ color?: string;
11
+ dot?: React.ReactNode;
12
+ }
13
+ export interface StepperProps<T extends StepperItem> extends BaseProps<'stepper', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'onClick'> {
14
+ list: T[];
15
+ active: number;
16
+ percent?: number;
17
+ dotSize?: number;
18
+ clickable?: boolean;
19
+ labelBottom?: boolean;
20
+ vertical?: boolean;
21
+ onClick?: (step: number, origin: T) => void;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ export declare const CLASSES: {
2
+ stepper: string;
3
+ 'stepper--button': string;
4
+ 'stepper--label-bottom': string;
5
+ 'stepper--vertical': string;
6
+ stepper__step: string;
7
+ 'stepper__step.is-wait': string;
8
+ 'stepper__step.is-active': string;
9
+ 'stepper__step.is-completed': string;
10
+ 'stepper__step.is-warning': string;
11
+ 'stepper__step.is-error': string;
12
+ 'stepper__step-header': string;
13
+ 'stepper__step-title': string;
14
+ 'stepper__step-description': string;
15
+ 'stepper__step-dot': string;
16
+ 'stepper__step-dot--progress': string;
17
+ 'stepper__step-separator': string;
18
+ 'stepper__step-progress': string;
19
+ };
@@ -0,0 +1,19 @@
1
+ export const CLASSES = {
2
+ stepper: '^stepper',
3
+ 'stepper--button': '^stepper--button',
4
+ 'stepper--label-bottom': '^stepper--label-bottom',
5
+ 'stepper--vertical': '^stepper--vertical',
6
+ stepper__step: '^stepper__step',
7
+ 'stepper__step.is-wait': 'is-wait',
8
+ 'stepper__step.is-active': 'is-active',
9
+ 'stepper__step.is-completed': 'is-completed',
10
+ 'stepper__step.is-warning': 'is-warning',
11
+ 'stepper__step.is-error': 'is-error',
12
+ 'stepper__step-header': '^stepper__step-header',
13
+ 'stepper__step-title': '^stepper__step-title',
14
+ 'stepper__step-description': '^stepper__step-description',
15
+ 'stepper__step-dot': '^stepper__step-dot',
16
+ 'stepper__step-dot--progress': '^stepper__step-dot--progress',
17
+ 'stepper__step-separator': '^stepper__step-separator',
18
+ 'stepper__step-progress': '^stepper__step-progress',
19
+ };
@@ -0,0 +1,2 @@
1
+ import type { SwitchProps } from './types';
2
+ export declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;