@vlrc-fe/components 1.0.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 (219) hide show
  1. package/README.md +193 -0
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.js +42 -0
  4. package/dist/index10.cjs +1 -0
  5. package/dist/index10.js +85 -0
  6. package/dist/index100.cjs +1 -0
  7. package/dist/index100.js +65 -0
  8. package/dist/index101.cjs +1 -0
  9. package/dist/index101.js +48 -0
  10. package/dist/index102.cjs +1 -0
  11. package/dist/index102.js +67 -0
  12. package/dist/index103.cjs +1 -0
  13. package/dist/index103.js +151 -0
  14. package/dist/index104.cjs +1 -0
  15. package/dist/index104.js +23 -0
  16. package/dist/index105.cjs +1 -0
  17. package/dist/index105.js +27 -0
  18. package/dist/index106.cjs +1 -0
  19. package/dist/index106.js +53 -0
  20. package/dist/index107.cjs +1 -0
  21. package/dist/index107.js +161 -0
  22. package/dist/index108.cjs +1 -0
  23. package/dist/index108.js +16 -0
  24. package/dist/index109.cjs +1 -0
  25. package/dist/index11.cjs +1 -0
  26. package/dist/index11.js +86 -0
  27. package/dist/index12.cjs +1 -0
  28. package/dist/index12.js +122 -0
  29. package/dist/index13.cjs +1 -0
  30. package/dist/index13.js +14 -0
  31. package/dist/index14.cjs +1 -0
  32. package/dist/index14.js +16 -0
  33. package/dist/index15.cjs +1 -0
  34. package/dist/index15.js +115 -0
  35. package/dist/index16.cjs +1 -0
  36. package/dist/index16.js +727 -0
  37. package/dist/index17.cjs +1 -0
  38. package/dist/index17.js +348 -0
  39. package/dist/index18.cjs +1 -0
  40. package/dist/index18.js +76 -0
  41. package/dist/index19.cjs +1 -0
  42. package/dist/index19.js +14 -0
  43. package/dist/index2.cjs +1 -0
  44. package/dist/index2.js +122 -0
  45. package/dist/index20.cjs +1 -0
  46. package/dist/index20.js +116 -0
  47. package/dist/index21.cjs +1 -0
  48. package/dist/index21.js +35 -0
  49. package/dist/index22.cjs +1 -0
  50. package/dist/index22.js +18 -0
  51. package/dist/index23.cjs +1 -0
  52. package/dist/index23.js +27 -0
  53. package/dist/index24.cjs +1 -0
  54. package/dist/index24.js +35 -0
  55. package/dist/index25.cjs +1 -0
  56. package/dist/index25.js +97 -0
  57. package/dist/index26.cjs +1 -0
  58. package/dist/index26.js +28 -0
  59. package/dist/index27.cjs +1 -0
  60. package/dist/index27.js +14 -0
  61. package/dist/index28.cjs +1 -0
  62. package/dist/index28.js +67 -0
  63. package/dist/index29.cjs +1 -0
  64. package/dist/index29.js +13 -0
  65. package/dist/index3.cjs +1 -0
  66. package/dist/index3.js +8 -0
  67. package/dist/index30.cjs +1 -0
  68. package/dist/index30.js +35 -0
  69. package/dist/index31.cjs +1 -0
  70. package/dist/index31.js +43 -0
  71. package/dist/index32.cjs +1 -0
  72. package/dist/index32.js +14 -0
  73. package/dist/index33.cjs +1 -0
  74. package/dist/index33.js +64 -0
  75. package/dist/index34.cjs +1 -0
  76. package/dist/index34.js +23 -0
  77. package/dist/index35.cjs +1 -0
  78. package/dist/index35.js +34 -0
  79. package/dist/index36.cjs +1 -0
  80. package/dist/index36.js +27 -0
  81. package/dist/index37.cjs +1 -0
  82. package/dist/index37.js +26 -0
  83. package/dist/index38.cjs +1 -0
  84. package/dist/index38.js +157 -0
  85. package/dist/index39.cjs +1 -0
  86. package/dist/index39.js +34 -0
  87. package/dist/index4.cjs +1 -0
  88. package/dist/index4.js +43 -0
  89. package/dist/index40.cjs +1 -0
  90. package/dist/index40.js +46 -0
  91. package/dist/index41.cjs +1 -0
  92. package/dist/index41.js +118 -0
  93. package/dist/index42.cjs +1 -0
  94. package/dist/index42.js +125 -0
  95. package/dist/index43.cjs +1 -0
  96. package/dist/index43.js +26 -0
  97. package/dist/index44.cjs +1 -0
  98. package/dist/index44.js +88 -0
  99. package/dist/index45.cjs +1 -0
  100. package/dist/index45.js +221 -0
  101. package/dist/index46.cjs +1 -0
  102. package/dist/index46.js +166 -0
  103. package/dist/index47.cjs +1 -0
  104. package/dist/index47.js +126 -0
  105. package/dist/index48.cjs +1 -0
  106. package/dist/index48.js +15 -0
  107. package/dist/index49.cjs +1 -0
  108. package/dist/index49.js +9 -0
  109. package/dist/index5.cjs +1 -0
  110. package/dist/index5.js +24 -0
  111. package/dist/index50.cjs +1 -0
  112. package/dist/index50.js +17 -0
  113. package/dist/index51.cjs +1 -0
  114. package/dist/index51.js +22 -0
  115. package/dist/index52.cjs +1 -0
  116. package/dist/index52.js +18 -0
  117. package/dist/index53.cjs +1 -0
  118. package/dist/index53.js +6 -0
  119. package/dist/index54.cjs +1 -0
  120. package/dist/index54.js +7 -0
  121. package/dist/index55.cjs +1 -0
  122. package/dist/index55.js +8 -0
  123. package/dist/index56.cjs +1 -0
  124. package/dist/index56.js +7 -0
  125. package/dist/index57.cjs +1 -0
  126. package/dist/index57.js +7 -0
  127. package/dist/index58.cjs +1 -0
  128. package/dist/index58.js +9 -0
  129. package/dist/index59.cjs +1 -0
  130. package/dist/index59.js +69 -0
  131. package/dist/index6.cjs +1 -0
  132. package/dist/index6.js +51 -0
  133. package/dist/index60.cjs +1 -0
  134. package/dist/index60.js +11 -0
  135. package/dist/index61.cjs +1 -0
  136. package/dist/index61.js +202 -0
  137. package/dist/index62.cjs +1 -0
  138. package/dist/index62.js +124 -0
  139. package/dist/index63.cjs +1 -0
  140. package/dist/index63.js +32 -0
  141. package/dist/index64.cjs +1 -0
  142. package/dist/index64.js +20 -0
  143. package/dist/index65.cjs +1 -0
  144. package/dist/index65.js +69 -0
  145. package/dist/index66.cjs +1 -0
  146. package/dist/index66.js +32 -0
  147. package/dist/index67.cjs +1 -0
  148. package/dist/index67.js +11 -0
  149. package/dist/index68.cjs +1 -0
  150. package/dist/index68.js +280 -0
  151. package/dist/index69.cjs +1 -0
  152. package/dist/index69.js +157 -0
  153. package/dist/index7.cjs +1 -0
  154. package/dist/index7.js +88 -0
  155. package/dist/index70.cjs +1 -0
  156. package/dist/index70.js +20 -0
  157. package/dist/index71.cjs +1 -0
  158. package/dist/index71.js +10 -0
  159. package/dist/index72.cjs +1 -0
  160. package/dist/index72.js +14 -0
  161. package/dist/index73.cjs +1 -0
  162. package/dist/index73.js +8 -0
  163. package/dist/index74.cjs +1 -0
  164. package/dist/index74.js +8 -0
  165. package/dist/index75.cjs +1 -0
  166. package/dist/index75.js +11 -0
  167. package/dist/index76.cjs +1 -0
  168. package/dist/index76.js +10 -0
  169. package/dist/index77.cjs +1 -0
  170. package/dist/index77.js +6 -0
  171. package/dist/index78.cjs +1 -0
  172. package/dist/index78.js +8 -0
  173. package/dist/index79.cjs +1 -0
  174. package/dist/index79.js +8 -0
  175. package/dist/index8.cjs +1 -0
  176. package/dist/index8.js +68 -0
  177. package/dist/index80.cjs +1 -0
  178. package/dist/index80.js +10 -0
  179. package/dist/index81.cjs +1 -0
  180. package/dist/index81.js +11 -0
  181. package/dist/index82.cjs +1 -0
  182. package/dist/index82.js +15 -0
  183. package/dist/index83.cjs +1 -0
  184. package/dist/index83.js +11 -0
  185. package/dist/index84.cjs +1 -0
  186. package/dist/index84.js +11 -0
  187. package/dist/index85.cjs +1 -0
  188. package/dist/index85.js +6 -0
  189. package/dist/index86.cjs +1 -0
  190. package/dist/index86.js +43 -0
  191. package/dist/index87.cjs +1 -0
  192. package/dist/index87.js +382 -0
  193. package/dist/index88.cjs +1 -0
  194. package/dist/index88.js +40 -0
  195. package/dist/index89.cjs +1 -0
  196. package/dist/index89.js +23 -0
  197. package/dist/index9.cjs +1 -0
  198. package/dist/index9.js +20 -0
  199. package/dist/index90.cjs +1 -0
  200. package/dist/index90.js +59 -0
  201. package/dist/index91.cjs +1 -0
  202. package/dist/index91.js +55 -0
  203. package/dist/index92.cjs +1 -0
  204. package/dist/index92.js +54 -0
  205. package/dist/index93.cjs +1 -0
  206. package/dist/index93.js +57 -0
  207. package/dist/index94.cjs +1 -0
  208. package/dist/index94.js +57 -0
  209. package/dist/index95.cjs +1 -0
  210. package/dist/index95.js +88 -0
  211. package/dist/index96.cjs +1 -0
  212. package/dist/index96.js +66 -0
  213. package/dist/index97.cjs +1 -0
  214. package/dist/index97.js +594 -0
  215. package/dist/index98.cjs +9 -0
  216. package/dist/index98.js +30 -0
  217. package/dist/index99.cjs +1 -0
  218. package/dist/index99.js +50 -0
  219. package/package.json +82 -0
@@ -0,0 +1,50 @@
1
+ import { cn as e } from "./index3.js";
2
+ //#region src/Form/FormNumberInput/useFormNumberInput.ts
3
+ var t = [
4
+ "[appearance:textfield]",
5
+ "[&::-webkit-outer-spin-button]:appearance-none",
6
+ "[&::-webkit-inner-spin-button]:appearance-none",
7
+ "rounded-r-none",
8
+ "relative"
9
+ ];
10
+ function n({ rules: n, inputClassName: r, stepper: i, min: a, max: o, onChange: s, passthroughProps: c }) {
11
+ let l = n?.required !== void 0 && n.required !== !1;
12
+ return {
13
+ isRequired: l,
14
+ enhancedRules: (() => {
15
+ if (!n) return n;
16
+ let e = { ...n };
17
+ return l && typeof e.required != "string" && typeof e.required != "object" ? e.required = "Trường này là bắt buộc" : typeof e.required == "object" && !e.required.message && (e.required = {
18
+ ...e.required,
19
+ message: "Trường này là bắt buộc"
20
+ }), e;
21
+ })(),
22
+ numericClass: e(t, r),
23
+ getHandlers: ({ currentValue: e, field: t }) => {
24
+ let n = () => {
25
+ let n = Math.min((e ?? 0) + i, o);
26
+ t.onChange(n), s?.(n);
27
+ }, r = () => {
28
+ let n = Math.max((e ?? 0) - i, a);
29
+ t.onChange(n), s?.(n);
30
+ };
31
+ return {
32
+ handleIncrement: n,
33
+ handleDecrement: r,
34
+ handleKeyDown: (e) => {
35
+ e.key === "ArrowUp" ? (e.preventDefault(), n()) : e.key === "ArrowDown" && (e.preventDefault(), r()), c.onKeyDown && c.onKeyDown(e);
36
+ },
37
+ handleBlur: () => {
38
+ let n = e;
39
+ n !== void 0 && (n < a ? (t.onChange(a), s?.(a)) : n > o && (t.onChange(o), s?.(o))), t.onBlur(), c.onBlur && c.onBlur();
40
+ },
41
+ numericOnValueChange: (e) => {
42
+ let n = e.floatValue === void 0 ? void 0 : e.floatValue;
43
+ t.onChange(n), s?.(n);
44
+ }
45
+ };
46
+ }
47
+ };
48
+ }
49
+ //#endregion
50
+ export { n as useFormNumberInput };
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@vlrc-fe/components",
3
+ "version": "1.0.0",
4
+ "description": "Reusable PlatformCore React components.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "main": "./dist/index.cjs",
13
+ "module": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs"
20
+ },
21
+ "./DataTable": {
22
+ "types": "./dist/DataTable/index.d.ts",
23
+ "import": "./dist/DataTable/index.js"
24
+ },
25
+ "./DataTable/*": {
26
+ "types": "./dist/DataTable/*.d.ts",
27
+ "import": "./dist/DataTable/*.js"
28
+ },
29
+ "./Icons": {
30
+ "types": "./dist/Icons/index.d.ts",
31
+ "import": "./dist/Icons/index.js"
32
+ },
33
+ "./ui/*": {
34
+ "types": "./dist/ui/*.d.ts",
35
+ "import": "./dist/ui/*.js"
36
+ }
37
+ },
38
+ "peerDependencies": {
39
+ "@radix-ui/react-dialog": "^1.1.15",
40
+ "@radix-ui/react-direction": "^1.1.1",
41
+ "@radix-ui/react-slot": "^1.2.4",
42
+ "@radix-ui/react-accordion": "^1.2.12",
43
+ "@radix-ui/react-checkbox": "^1.3.3",
44
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
45
+ "@radix-ui/react-label": "^2.1.8",
46
+ "@radix-ui/react-popover": "^1.1.15",
47
+ "@radix-ui/react-radio-group": "^1.3.8",
48
+ "@radix-ui/react-scroll-area": "^1.2.10",
49
+ "@radix-ui/react-select": "^2.2.6",
50
+ "@radix-ui/react-separator": "^1.1.8",
51
+ "@radix-ui/react-tooltip": "^1.2.8",
52
+ "@tanstack/react-table": "^8.21.3",
53
+ "ahooks": "^3.9.7",
54
+ "class-variance-authority": "^0.7.1",
55
+ "clsx": "^2.1.1",
56
+ "cmdk": "^1.1.1",
57
+ "lodash-es": "^4.18.1",
58
+ "lucide-react": "^1.16.0",
59
+ "next-themes": "^0.4.6",
60
+ "react": "^19.0.0",
61
+ "react-day-picker": "^10.0.1",
62
+ "react-dom": "^19.0.0",
63
+ "react-i18next": "^17.0.8",
64
+ "sonner": "^2.0.7",
65
+ "tailwind-merge": "^3.6.0",
66
+ "react-hook-form": "^7.76.1",
67
+ "react-number-format": "^5.4.5",
68
+ "date-fns": "^4.3.0"
69
+ },
70
+ "devDependencies": {
71
+ "@vitejs/plugin-react": "^6.0.2",
72
+ "typescript": "~6.0.3",
73
+ "vite": "8.0.14"
74
+ },
75
+ "publishConfig": {
76
+ "access": "public"
77
+ },
78
+ "scripts": {
79
+ "build": "tsc -p tsconfig.json && vite build",
80
+ "lint": "eslint ."
81
+ }
82
+ }