@ikas/core 1.0.19 → 1.0.20

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 (386) hide show
  1. package/dist/core.css +1 -1
  2. package/dist/index121.cjs +1 -1
  3. package/dist/index121.js +8 -8
  4. package/dist/index130.cjs +1 -1
  5. package/dist/index130.js +1 -1
  6. package/dist/index131.cjs +1 -1
  7. package/dist/index131.js +70 -3
  8. package/dist/index132.cjs +1 -1
  9. package/dist/index132.js +19 -4
  10. package/dist/index133.cjs +1 -1
  11. package/dist/index133.js +34 -7
  12. package/dist/index134.cjs +1 -1
  13. package/dist/index134.js +49 -6
  14. package/dist/index135.cjs +1 -1
  15. package/dist/index135.js +32 -63
  16. package/dist/index136.cjs +1 -1
  17. package/dist/index136.js +88 -15
  18. package/dist/index137.cjs +1 -1
  19. package/dist/index137.js +59 -34
  20. package/dist/index138.cjs +6 -1
  21. package/dist/index138.js +17 -50
  22. package/dist/index139.cjs +1 -1
  23. package/dist/index139.js +4 -40
  24. package/dist/index140.cjs +1 -1
  25. package/dist/index140.js +7 -91
  26. package/dist/index141.cjs +1 -1
  27. package/dist/index141.js +6 -59
  28. package/dist/index142.cjs +1 -6
  29. package/dist/index142.js +4 -17
  30. package/dist/index149.cjs +1 -1
  31. package/dist/index149.js +1 -1
  32. package/dist/index153.cjs +1 -1
  33. package/dist/index153.js +2 -2
  34. package/dist/index154.cjs +1 -1
  35. package/dist/index154.js +1 -1
  36. package/dist/index155.cjs +1 -1
  37. package/dist/index155.js +1 -1
  38. package/dist/index157.cjs +1 -1
  39. package/dist/index157.js +1 -1
  40. package/dist/index159.cjs +1 -1
  41. package/dist/index159.js +2 -2
  42. package/dist/index161.cjs +1 -1
  43. package/dist/index161.js +1 -1
  44. package/dist/index163.cjs +1 -1
  45. package/dist/index163.js +2 -2
  46. package/dist/index186.cjs +1 -1
  47. package/dist/index186.js +1 -1
  48. package/dist/index190.cjs +1 -1
  49. package/dist/index190.js +3 -3
  50. package/dist/index194.cjs +1 -6
  51. package/dist/index194.js +27 -11
  52. package/dist/index195.cjs +1 -1
  53. package/dist/index195.js +2 -15
  54. package/dist/index196.cjs +1 -1
  55. package/dist/index196.js +28 -2
  56. package/dist/index197.cjs +1 -1
  57. package/dist/index197.js +31 -7
  58. package/dist/index198.cjs +1 -2
  59. package/dist/index198.js +113 -324
  60. package/dist/index199.cjs +1 -1
  61. package/dist/index199.js +56 -46
  62. package/dist/index200.cjs +1 -1
  63. package/dist/index200.js +56 -23
  64. package/dist/index201.cjs +1 -1
  65. package/dist/index201.js +17 -2
  66. package/dist/index202.cjs +6 -1
  67. package/dist/index202.js +11 -28
  68. package/dist/index203.cjs +1 -1
  69. package/dist/index203.js +14 -31
  70. package/dist/index204.cjs +1 -1
  71. package/dist/index204.js +2 -116
  72. package/dist/index205.cjs +1 -1
  73. package/dist/index205.js +7 -59
  74. package/dist/index206.cjs +2 -1
  75. package/dist/index206.js +323 -56
  76. package/dist/index207.cjs +1 -1
  77. package/dist/index207.js +48 -15
  78. package/dist/index208.cjs +1 -1
  79. package/dist/index208.js +7 -7
  80. package/dist/index209.cjs +1 -1
  81. package/dist/index209.js +2 -2
  82. package/dist/index210.cjs +1 -1
  83. package/dist/index210.js +2 -2
  84. package/dist/index216.cjs +1 -1
  85. package/dist/index216.js +1 -1
  86. package/dist/index218.cjs +1 -1
  87. package/dist/index218.js +83 -5
  88. package/dist/index219.cjs +1 -1
  89. package/dist/index219.js +5 -5
  90. package/dist/index220.cjs +1 -1
  91. package/dist/index220.js +5 -20
  92. package/dist/index221.cjs +1 -1
  93. package/dist/index221.js +20 -83
  94. package/dist/index222.cjs +1 -1
  95. package/dist/index222.js +2 -2
  96. package/dist/index223.cjs +1 -8
  97. package/dist/index223.js +2 -76
  98. package/dist/index224.cjs +1 -8
  99. package/dist/index224.js +2 -93
  100. package/dist/index225.cjs +1 -5
  101. package/dist/index225.js +2 -52
  102. package/dist/index226.cjs +1 -1
  103. package/dist/index226.js +2 -8
  104. package/dist/index227.cjs +1 -1
  105. package/dist/index227.js +2 -5
  106. package/dist/index228.cjs +1 -1
  107. package/dist/index228.js +2 -52
  108. package/dist/index229.cjs +8 -1
  109. package/dist/index229.js +76 -2
  110. package/dist/index230.cjs +8 -1
  111. package/dist/index230.js +93 -2
  112. package/dist/index231.cjs +5 -1
  113. package/dist/index231.js +52 -2
  114. package/dist/index232.cjs +1 -1
  115. package/dist/index232.js +8 -2
  116. package/dist/index233.cjs +1 -1
  117. package/dist/index233.js +5 -2
  118. package/dist/index234.cjs +1 -1
  119. package/dist/index234.js +52 -2
  120. package/dist/index235.cjs +1 -1
  121. package/dist/index235.js +26 -16
  122. package/dist/index236.cjs +1 -1
  123. package/dist/index236.js +16 -6
  124. package/dist/index237.cjs +1 -1
  125. package/dist/index237.js +42 -3
  126. package/dist/index238.cjs +1 -1
  127. package/dist/index238.js +13 -28
  128. package/dist/index239.cjs +1 -1
  129. package/dist/index239.js +13 -7
  130. package/dist/index240.cjs +1 -1
  131. package/dist/index240.js +60 -4
  132. package/dist/index241.cjs +1 -1
  133. package/dist/index241.js +15 -6
  134. package/dist/index242.cjs +1 -1
  135. package/dist/index242.js +5 -10
  136. package/dist/index243.cjs +1 -1
  137. package/dist/index243.js +3 -26
  138. package/dist/index244.cjs +1 -1
  139. package/dist/index244.js +29 -16
  140. package/dist/index245.cjs +1 -1
  141. package/dist/index245.js +7 -42
  142. package/dist/index246.cjs +1 -1
  143. package/dist/index246.js +4 -13
  144. package/dist/index247.cjs +1 -1
  145. package/dist/index247.js +7 -13
  146. package/dist/index248.cjs +1 -1
  147. package/dist/index248.js +10 -60
  148. package/dist/index249.cjs +1 -1
  149. package/dist/index249.js +3 -3
  150. package/dist/index250.cjs +1 -1
  151. package/dist/index250.js +7 -7
  152. package/dist/index252.cjs +1 -1
  153. package/dist/index252.js +4 -4
  154. package/dist/index253.cjs +1 -1
  155. package/dist/index253.js +2 -2
  156. package/dist/index254.cjs +1 -1
  157. package/dist/index254.js +1 -1
  158. package/dist/index257.cjs +1 -1
  159. package/dist/index257.js +5 -3
  160. package/dist/index258.cjs +1 -1
  161. package/dist/index258.js +3 -6
  162. package/dist/index259.cjs +1 -1
  163. package/dist/index259.js +5 -6
  164. package/dist/index260.cjs +1 -1
  165. package/dist/index260.js +7 -5
  166. package/dist/index269.cjs +1 -1
  167. package/dist/index269.js +1 -1
  168. package/dist/index272.cjs +1 -1
  169. package/dist/index272.js +1 -1
  170. package/dist/index273.cjs +1 -1
  171. package/dist/index273.js +1 -1
  172. package/dist/index275.cjs +1 -1
  173. package/dist/index275.js +3 -3
  174. package/dist/index276.cjs +1 -1
  175. package/dist/index276.js +2 -2
  176. package/dist/index277.cjs +1 -1
  177. package/dist/index277.js +1 -1
  178. package/dist/index278.cjs +1 -1
  179. package/dist/index278.js +2 -2
  180. package/dist/index279.cjs +1 -1
  181. package/dist/index279.js +2 -2
  182. package/dist/index280.cjs +1 -1
  183. package/dist/index280.js +3 -3
  184. package/dist/index281.cjs +1 -1
  185. package/dist/index281.js +3 -3
  186. package/dist/index282.cjs +1 -1
  187. package/dist/index282.js +2 -2
  188. package/dist/index283.cjs +1 -1
  189. package/dist/index283.js +2 -2
  190. package/dist/index284.cjs +1 -1
  191. package/dist/index284.js +3 -3
  192. package/dist/index285.cjs +1 -1
  193. package/dist/index285.js +12 -5
  194. package/dist/index286.cjs +1 -1
  195. package/dist/index286.js +4 -5
  196. package/dist/index287.cjs +1 -1
  197. package/dist/index287.js +5 -12
  198. package/dist/index288.cjs +1 -1
  199. package/dist/index288.js +6 -4
  200. package/dist/index289.cjs +1 -1
  201. package/dist/index289.js +4 -5
  202. package/dist/index290.cjs +1 -1
  203. package/dist/index290.js +26 -5
  204. package/dist/index291.cjs +1 -1
  205. package/dist/index291.js +9 -12
  206. package/dist/index292.cjs +1 -1
  207. package/dist/index292.js +5 -4
  208. package/dist/index293.cjs +1 -1
  209. package/dist/index293.js +5 -26
  210. package/dist/index294.cjs +1 -1
  211. package/dist/index294.js +4 -8
  212. package/dist/index295.cjs +1 -1
  213. package/dist/index295.js +5 -5
  214. package/dist/index296.cjs +1 -1
  215. package/dist/index296.js +8 -4
  216. package/dist/index297.cjs +1 -1
  217. package/dist/index297.js +4 -5
  218. package/dist/index298.cjs +1 -1
  219. package/dist/index298.js +7 -5
  220. package/dist/index299.cjs +1 -1
  221. package/dist/index299.js +5 -9
  222. package/dist/index300.cjs +1 -1
  223. package/dist/index300.js +5 -3
  224. package/dist/index301.cjs +1 -1
  225. package/dist/index301.js +5 -7
  226. package/dist/index302.cjs +1 -1
  227. package/dist/index302.js +11 -4
  228. package/dist/index303.cjs +1 -1
  229. package/dist/index303.js +4 -6
  230. package/dist/index304.cjs +1 -1
  231. package/dist/index304.js +38 -6
  232. package/dist/index305.cjs +1 -1
  233. package/dist/index305.js +2 -8
  234. package/dist/index306.cjs +1 -1
  235. package/dist/index306.js +2 -4
  236. package/dist/index307.cjs +1 -1
  237. package/dist/index307.js +7 -2
  238. package/dist/index308.cjs +1 -1
  239. package/dist/index308.js +7 -38
  240. package/dist/index309.cjs +1 -1
  241. package/dist/index309.js +4 -2
  242. package/dist/index315.cjs +1 -1
  243. package/dist/index315.js +1 -1
  244. package/dist/index317.cjs +1 -1
  245. package/dist/index317.js +5 -8
  246. package/dist/index318.cjs +1 -1
  247. package/dist/index318.js +15 -6
  248. package/dist/index319.cjs +1 -1
  249. package/dist/index319.js +3 -6
  250. package/dist/index320.cjs +1 -1
  251. package/dist/index320.js +5 -7
  252. package/dist/index321.cjs +1 -1
  253. package/dist/index321.js +6 -13
  254. package/dist/index322.cjs +1 -1
  255. package/dist/index322.js +4 -12
  256. package/dist/index323.cjs +1 -1
  257. package/dist/index323.js +9 -13
  258. package/dist/index324.cjs +1 -1
  259. package/dist/index324.js +5 -5
  260. package/dist/index325.cjs +1 -1
  261. package/dist/index325.js +7 -13
  262. package/dist/index326.cjs +1 -1
  263. package/dist/index326.js +12 -3
  264. package/dist/index327.cjs +1 -1
  265. package/dist/index327.js +9 -7
  266. package/dist/index328.cjs +1 -1
  267. package/dist/index328.js +5 -3
  268. package/dist/index329.cjs +1 -1
  269. package/dist/index329.js +7 -9
  270. package/dist/index330.cjs +1 -1
  271. package/dist/index330.js +6 -5
  272. package/dist/index331.cjs +1 -1
  273. package/dist/index331.js +29 -8
  274. package/dist/index332.cjs +1 -1
  275. package/dist/index332.js +8 -11
  276. package/dist/index333.cjs +1 -1
  277. package/dist/index333.js +3 -6
  278. package/dist/index334.cjs +1 -1
  279. package/dist/index334.js +15 -28
  280. package/dist/index335.cjs +1 -1
  281. package/dist/index335.js +13 -8
  282. package/dist/index336.cjs +1 -1
  283. package/dist/index336.js +12 -4
  284. package/dist/index337.cjs +1 -1
  285. package/dist/index337.js +13 -16
  286. package/dist/index338.cjs +1 -1
  287. package/dist/index338.js +1 -1
  288. package/dist/index342.cjs +1 -1
  289. package/dist/index342.js +2 -2
  290. package/dist/index343.cjs +1 -1
  291. package/dist/index343.js +1 -1
  292. package/dist/index344.cjs +1 -1
  293. package/dist/index344.js +1 -1
  294. package/dist/index345.cjs +1 -1
  295. package/dist/index345.js +1 -1
  296. package/dist/index346.cjs +1 -1
  297. package/dist/index346.js +1 -1
  298. package/dist/index347.cjs +1 -1
  299. package/dist/index347.js +1 -1
  300. package/dist/index348.cjs +1 -1
  301. package/dist/index348.js +4 -4
  302. package/dist/index349.cjs +1 -1
  303. package/dist/index349.js +1 -1
  304. package/dist/index351.cjs +1 -1
  305. package/dist/index351.js +11 -5
  306. package/dist/index352.cjs +1 -1
  307. package/dist/index352.js +37 -11
  308. package/dist/index353.cjs +1 -1
  309. package/dist/index353.js +42 -7
  310. package/dist/index354.cjs +1 -1
  311. package/dist/index354.js +29 -33
  312. package/dist/index355.cjs +1 -1
  313. package/dist/index355.js +26 -43
  314. package/dist/index356.cjs +1 -1
  315. package/dist/index356.js +7 -33
  316. package/dist/index357.cjs +1 -1
  317. package/dist/index357.js +6 -26
  318. package/dist/index358.cjs +1 -1
  319. package/dist/index358.js +17 -13
  320. package/dist/index359.cjs +1 -1
  321. package/dist/index359.js +5 -3
  322. package/dist/index360.cjs +1 -1
  323. package/dist/index360.js +13 -17
  324. package/dist/index361.cjs +1 -1
  325. package/dist/index361.js +3 -5
  326. package/dist/index362.cjs +1 -1
  327. package/dist/index362.js +11 -3
  328. package/dist/index363.cjs +1 -1
  329. package/dist/index363.js +7 -8
  330. package/dist/index364.cjs +1 -1
  331. package/dist/index364.js +3 -4
  332. package/dist/index365.cjs +1 -1
  333. package/dist/index365.js +6 -10
  334. package/dist/index366.cjs +1 -1
  335. package/dist/index366.js +6 -6
  336. package/dist/index367.cjs +1 -1
  337. package/dist/index367.js +6 -3
  338. package/dist/index368.cjs +1 -1
  339. package/dist/index368.js +4 -7
  340. package/dist/index369.cjs +1 -1
  341. package/dist/index369.js +4 -7
  342. package/dist/index370.cjs +1 -1
  343. package/dist/index370.js +4 -7
  344. package/dist/index371.cjs +1 -1
  345. package/dist/index371.js +3 -3
  346. package/dist/index372.cjs +1 -1
  347. package/dist/index372.js +15 -4
  348. package/dist/index373.cjs +1 -1
  349. package/dist/index373.js +3 -4
  350. package/dist/index374.cjs +1 -1
  351. package/dist/index374.js +8 -4
  352. package/dist/index375.cjs +1 -1
  353. package/dist/index375.js +4 -14
  354. package/dist/index376.cjs +1 -1
  355. package/dist/index376.js +4 -8
  356. package/dist/index382.cjs +1 -1
  357. package/dist/index382.js +8 -4
  358. package/dist/index383.cjs +1 -1
  359. package/dist/index383.js +4 -8
  360. package/dist/index384.cjs +1 -1
  361. package/dist/index384.js +3 -15
  362. package/dist/index385.cjs +1 -1
  363. package/dist/index385.js +6 -4
  364. package/dist/index386.cjs +1 -1
  365. package/dist/index386.js +8 -4
  366. package/dist/index387.cjs +1 -1
  367. package/dist/index387.js +8 -6
  368. package/dist/index388.cjs +1 -1
  369. package/dist/index388.js +16 -8
  370. package/dist/index390.cjs +1 -1
  371. package/dist/index390.js +1 -1
  372. package/dist/index391.cjs +1 -1
  373. package/dist/index391.js +5 -15
  374. package/dist/index392.cjs +1 -1
  375. package/dist/index392.js +7 -5
  376. package/dist/index393.cjs +1 -1
  377. package/dist/index393.js +3 -7
  378. package/dist/index394.cjs +1 -1
  379. package/dist/index394.js +15 -3
  380. package/dist/index50.cjs +1 -1
  381. package/dist/index50.js +3 -3
  382. package/dist/index56.cjs +1 -1
  383. package/dist/index56.js +1 -1
  384. package/dist/index57.cjs +1 -1
  385. package/dist/index57.js +1 -1
  386. package/package.json +1 -1
package/dist/index121.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),A=require("mobx-react-lite"),X=require("mobx"),M=require("react-router-dom"),G=require("@ikas/ui"),C=require("./index3.cjs"),a=require("./index8.cjs"),W=require("./index135.cjs"),_=require("./index136.cjs"),J=require("./index137.cjs"),Q=require("./index138.cjs"),Y=require("./index139.cjs"),Z=require("./index140.cjs"),$=require("./index141.cjs"),ee=require("./index11.cjs"),te=require("./index142.cjs"),re=require("./index63.cjs");function le(b){var I,D;const{model:l,columnDefinition:e,rowData:t,isHeader:c,isSummary:d,isSelected:P,index:K,expandableCellProps:i}=b,v=l.displayedColumnDefinitions.findIndex(n=>n.columnKey===e.columnKey),O=!!l.isSelectable&&v===0,m=c?e.headerAlignment??e.alignment:e.alignment,f=l.isStickyColumnEnabled&&v===0?l.isSelectable?40:0:void 0,U=t&&e.isDisabled?e.isDisabled(t):!1,p=X.action(n=>{const{setValue:s}=e;s&&(l.selectedData.length&&P?l.selectedData.forEach(u=>s(u,n)):t&&s(t,n))}),k=n=>{c||d||l.onCellClick&&t&&(n.preventDefault(),l.onCellClick(t,e))},E=t?t[l.idKey]+""+e.columnKey:void 0,o=E?(I=l.validator)==null?void 0:I.results[E]:void 0,B=!!((D=o==null?void 0:o.messages)!=null&&D.length),L=()=>{var n,s,u,y,R;if(c)return r.jsx(W.HeaderCell,{model:l,columnDefinition:e,alignment:m});if(d)return r.jsx(_.SummaryCell,{columnDefinition:e,alignment:m});switch(e.type){case a.CellType.TEXT:return r.jsx(J.TextCell,{value:(n=e.getValue)==null?void 0:n.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.NUMBER:return r.jsx(Q.NumberCell,{value:(s=e.getValue)==null?void 0:s.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.PRICE:return r.jsx(Y.PriceCell,{value:(u=e.getValue)==null?void 0:u.call(e,t),rowData:t,columnDefinition:e});case a.CellType.SELECT:return r.jsx(Z.SelectCell,{value:(y=e.getValue)==null?void 0:y.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.IMAGE_SELECT:return r.jsx($.ImageSelectCell,{value:(R=e.getValue)==null?void 0:R.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.PRODUCT:return r.jsx(ee.ProductCell,{rowData:t,columnDefinition:e});case a.CellType.CUSTOM:return e.render(t);default:return r.jsx("div",{})}},h=n=>{const s=r.jsx("div",{className:C.cn("w-full",(o==null?void 0:o.status)==="error"&&"has-error"),children:n});return B?r.jsx(G.Tooltip,{title:r.jsx("div",{className:"text-center",children:o==null?void 0:o.messages.map((u,y)=>r.jsxs("div",{className:"mb-1.5 last:mb-0 relative pl-2",children:[r.jsx("span",{className:"absolute left-0 text-base",children:"*"}),u]},y))}),color:"error",children:s}):s},T=()=>{if(c||d)return L();const n=L(),s=e.type;return s===a.CellType.TEXT&&e.inputMode||s===a.CellType.NUMBER&&e.inputMode||s===a.CellType.SELECT||s===a.CellType.PRICE?h(n):n},S=()=>i?!i.isExpandable&&i.paddingLeft?r.jsx("div",{style:{marginRight:6}}):i.isExpandable?r.jsx("div",{className:"flex items-start h-full",children:r.jsx("div",{className:"w-4 h-4 relative z-[699] mr-1.5 cursor-pointer",style:{top:3},onClick:n=>{n.stopPropagation(),i.changeExpandStatus()},children:r.jsx(re.default,{className:C.cn("h-4 w-4 text-gray-blue-5 transition-transform duration-300 ease-in-out -rotate-90 cursor-pointer",i.isExpanded&&"rotate-0")})})}):null:null;let x=0;const j=!l.isSelectable;let g=l.isDraggable&&K===0&&!c&&!d;g&&e.isDragDisabled&&t&&(g=!e.isDragDisabled(t),x+=j?48:38),typeof(i==null?void 0:i.paddingLeft)=="number"&&(x+=i.paddingLeft);const F=e.isLinkEnabled&&e.isLinkCoverContent&&l.getRowLink&&t,z=e.isLinkEnabled&&!e.isLinkCoverContent&&l.getRowLink&&t,w=t&&l.getRowLink?l.getRowLink(t):void 0,q=c||d,N=C.cn("flex items-center flex-wrap relative w-full",q?C.cn("min-h-[40px] py-0 px-3",l.hideHeaderBackgroundColor?"bg-white":"bg-gray-blue-1"):"min-h-[54px] py-4 px-3 bg-white",O&&"pl-0",U&&!q&&"opacity-50 pointer-events-none",e.borderLeft&&"border-l border-gray-blue-2",e.borderRight&&"border-r border-gray-blue-2",f!=null&&"datatable-sticky-column"),V={justifyContent:m??"flex-start",paddingLeft:x>0?x:void 0,...f!=null?{position:"sticky",left:f,zIndex:2,transition:"box-shadow 0.3s",boxShadow:"var(--datatable-sticky-shadow, none)"}:{}};return F?r.jsxs(M.Link,{className:C.cn(N,"datatable-link-column no-underline text-inherit"),style:V,to:w??"",onClick:k,children:[g&&r.jsx(H,{isFirstElement:j}),S(),T()]}):r.jsxs("div",{className:N,style:V,onClick:k,children:[g&&r.jsx(H,{isFirstElement:j}),S(),T(),z&&r.jsx(M.Link,{className:"absolute inset-0",to:w??""})]})}function H({isFirstElement:b}){return r.jsx("span",{className:"absolute top-1/2 -translate-y-1/2 flex items-center justify-center p-2.5",style:{left:b?0:-10},"aria-description":"datatable dnd icon",children:r.jsx(te.default,{className:"h-4 w-4 text-gray-blue"})})}const ne=A.observer(le);exports.Cell=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),A=require("mobx-react-lite"),X=require("mobx"),M=require("react-router-dom"),G=require("@ikas/ui"),C=require("./index3.cjs"),a=require("./index8.cjs"),W=require("./index131.cjs"),_=require("./index132.cjs"),J=require("./index133.cjs"),Q=require("./index134.cjs"),Y=require("./index135.cjs"),Z=require("./index136.cjs"),$=require("./index137.cjs"),ee=require("./index11.cjs"),te=require("./index138.cjs"),re=require("./index63.cjs");function le(b){var I,D;const{model:l,columnDefinition:e,rowData:t,isHeader:c,isSummary:d,isSelected:P,index:K,expandableCellProps:i}=b,v=l.displayedColumnDefinitions.findIndex(n=>n.columnKey===e.columnKey),O=!!l.isSelectable&&v===0,m=c?e.headerAlignment??e.alignment:e.alignment,f=l.isStickyColumnEnabled&&v===0?l.isSelectable?40:0:void 0,U=t&&e.isDisabled?e.isDisabled(t):!1,p=X.action(n=>{const{setValue:s}=e;s&&(l.selectedData.length&&P?l.selectedData.forEach(u=>s(u,n)):t&&s(t,n))}),k=n=>{c||d||l.onCellClick&&t&&(n.preventDefault(),l.onCellClick(t,e))},E=t?t[l.idKey]+""+e.columnKey:void 0,o=E?(I=l.validator)==null?void 0:I.results[E]:void 0,B=!!((D=o==null?void 0:o.messages)!=null&&D.length),L=()=>{var n,s,u,y,R;if(c)return r.jsx(W.HeaderCell,{model:l,columnDefinition:e,alignment:m});if(d)return r.jsx(_.SummaryCell,{columnDefinition:e,alignment:m});switch(e.type){case a.CellType.TEXT:return r.jsx(J.TextCell,{value:(n=e.getValue)==null?void 0:n.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.NUMBER:return r.jsx(Q.NumberCell,{value:(s=e.getValue)==null?void 0:s.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.PRICE:return r.jsx(Y.PriceCell,{value:(u=e.getValue)==null?void 0:u.call(e,t),rowData:t,columnDefinition:e});case a.CellType.SELECT:return r.jsx(Z.SelectCell,{value:(y=e.getValue)==null?void 0:y.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.IMAGE_SELECT:return r.jsx($.ImageSelectCell,{value:(R=e.getValue)==null?void 0:R.call(e,t),rowData:t,columnDefinition:e,onValueChange:p});case a.CellType.PRODUCT:return r.jsx(ee.ProductCell,{rowData:t,columnDefinition:e});case a.CellType.CUSTOM:return e.render(t);default:return r.jsx("div",{})}},h=n=>{const s=r.jsx("div",{className:C.cn("w-full",(o==null?void 0:o.status)==="error"&&"has-error"),children:n});return B?r.jsx(G.Tooltip,{title:r.jsx("div",{className:"text-center",children:o==null?void 0:o.messages.map((u,y)=>r.jsxs("div",{className:"mb-1.5 last:mb-0 relative pl-2",children:[r.jsx("span",{className:"absolute left-0 text-base",children:"*"}),u]},y))}),color:"error",children:s}):s},T=()=>{if(c||d)return L();const n=L(),s=e.type;return s===a.CellType.TEXT&&e.inputMode||s===a.CellType.NUMBER&&e.inputMode||s===a.CellType.SELECT||s===a.CellType.PRICE?h(n):n},S=()=>i?!i.isExpandable&&i.paddingLeft?r.jsx("div",{style:{marginRight:6}}):i.isExpandable?r.jsx("div",{className:"flex items-start h-full",children:r.jsx("div",{className:"w-4 h-4 relative z-[699] mr-1.5 cursor-pointer",style:{top:3},onClick:n=>{n.stopPropagation(),i.changeExpandStatus()},children:r.jsx(re.default,{className:C.cn("h-4 w-4 text-gray-blue-5 transition-transform duration-300 ease-in-out -rotate-90 cursor-pointer",i.isExpanded&&"rotate-0")})})}):null:null;let x=0;const j=!l.isSelectable;let g=l.isDraggable&&K===0&&!c&&!d;g&&e.isDragDisabled&&t&&(g=!e.isDragDisabled(t),x+=j?48:38),typeof(i==null?void 0:i.paddingLeft)=="number"&&(x+=i.paddingLeft);const F=e.isLinkEnabled&&e.isLinkCoverContent&&l.getRowLink&&t,z=e.isLinkEnabled&&!e.isLinkCoverContent&&l.getRowLink&&t,w=t&&l.getRowLink?l.getRowLink(t):void 0,q=c||d,N=C.cn("flex items-center flex-wrap relative w-full",q?C.cn("min-h-[40px] py-0 px-3",l.hideHeaderBackgroundColor?"bg-white":"bg-gray-blue-1"):"min-h-[54px] py-4 px-3 bg-white",O&&"pl-0",U&&!q&&"opacity-50 pointer-events-none",e.borderLeft&&"border-l border-gray-blue-2",e.borderRight&&"border-r border-gray-blue-2",f!=null&&"datatable-sticky-column"),V={justifyContent:m??"flex-start",paddingLeft:x>0?x:void 0,...f!=null?{position:"sticky",left:f,zIndex:2,transition:"box-shadow 0.3s",boxShadow:"var(--datatable-sticky-shadow, none)"}:{}};return F?r.jsxs(M.Link,{className:C.cn(N,"datatable-link-column no-underline text-inherit"),style:V,to:w??"",onClick:k,children:[g&&r.jsx(H,{isFirstElement:j}),S(),T()]}):r.jsxs("div",{className:N,style:V,onClick:k,children:[g&&r.jsx(H,{isFirstElement:j}),S(),T(),z&&r.jsx(M.Link,{className:"absolute inset-0",to:w??""})]})}function H({isFirstElement:b}){return r.jsx("span",{className:"absolute top-1/2 -translate-y-1/2 flex items-center justify-center p-2.5",style:{left:b?0:-10},"aria-description":"datatable dnd icon",children:r.jsx(te.default,{className:"h-4 w-4 text-gray-blue"})})}const ne=A.observer(le);exports.Cell=ne;
package/dist/index121.js CHANGED
@@ -5,15 +5,15 @@ import { Link as P } from "react-router-dom";
5
5
  import { Tooltip as _ } from "@ikas/ui";
6
6
  import { cn as m } from "./index3.js";
7
7
  import { CellType as s } from "./index8.js";
8
- import { HeaderCell as q } from "./index135.js";
9
- import { SummaryCell as J } from "./index136.js";
10
- import { TextCell as Q } from "./index137.js";
11
- import { NumberCell as Y } from "./index138.js";
12
- import { PriceCell as Z } from "./index139.js";
13
- import { SelectCell as $ } from "./index140.js";
14
- import { ImageSelectCell as ee } from "./index141.js";
8
+ import { HeaderCell as q } from "./index131.js";
9
+ import { SummaryCell as J } from "./index132.js";
10
+ import { TextCell as Q } from "./index133.js";
11
+ import { NumberCell as Y } from "./index134.js";
12
+ import { PriceCell as Z } from "./index135.js";
13
+ import { SelectCell as $ } from "./index136.js";
14
+ import { ImageSelectCell as ee } from "./index137.js";
15
15
  import { ProductCell as te } from "./index11.js";
16
- import re from "./index142.js";
16
+ import re from "./index138.js";
17
17
  import ne from "./index63.js";
18
18
  function ae(C) {
19
19
  var M, R;
package/dist/index130.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index131.cjs"),r=require("./index192.cjs");var t=r.__require();const o=e.getDefaultExportFromCjs(t);module.exports=o;
1
+ "use strict";const e=require("./index142.cjs"),r=require("./index192.cjs");var t=r.__require();const o=e.getDefaultExportFromCjs(t);module.exports=o;
package/dist/index130.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getDefaultExportFromCjs as e } from "./index131.js";
1
+ import { getDefaultExportFromCjs as e } from "./index142.js";
2
2
  import { __require as r } from "./index192.js";
3
3
  var t = r();
4
4
  const a = /* @__PURE__ */ e(t);
package/dist/index131.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}exports.getDefaultExportFromCjs=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),C=require("mobx-react-lite"),j=require("@ikas/ui"),l=require("./index3.cjs"),d=require("./index8.cjs"),w=require("./index145.cjs"),q=require("./index63.cjs"),H=require("./index69.cjs");function N(m){var u,x;const{model:o,columnDefinition:e,alignment:r}=m,s=o.columnDefinitions.findIndex(n=>n.columnKey===e.columnKey),h=s===0,f=s===o.columnDefinitions.length-1,i=e.columnKey===o.sortColumnKey,g=i&&o.sortDirection==="asc",p=i&&o.sortDirection==="desc",y=n=>{n.stopPropagation(),e.isSortable&&o.onHeaderClick(e)},b=(u=e.headerTooltipProps)==null?void 0:u.isShowHeaderTextTooltip,T=((x=e.headerTooltipProps)==null?void 0:x.tooltipText)??e.headerText,c=r===d.ColumnAlignment.CENTER?"center":r===d.ColumnAlignment.RIGHT?"right":"left",a=t.jsx("span",{className:"text-sm font-medium text-gray-blue-6 truncate flex-none",style:{textAlign:c},children:e.headerText}),v=()=>{var n;return b?t.jsx(j.Tooltip,{title:T,children:t.jsxs("div",{className:"flex items-center justify-center overflow-hidden",children:[a,((n=e.headerTooltipProps)==null?void 0:n.showTooltipIcon)&&t.jsx(H.default,{className:"h-4 w-4 text-gray-blue-6 flex-shrink-0 ml-2"})]})}):a};return t.jsxs("div",{className:l.cn("w-full h-full flex items-center select-none cursor-pointer","text-gray-blue-6",o.hideHeaderBackgroundColor?"bg-white":"bg-gray-blue-1",(h||f)&&"rounded"),style:{justifyContent:r??"flex-start",textAlign:c},onClick:y,children:[v(),e.isSortable&&t.jsxs("div",{className:"w-4 flex-none flex flex-col items-center relative ml-1.5",children:[t.jsx(w.default,{className:l.cn("w-2.5 h-5 relative -bottom-[7px]",g?"text-gray-blue-9":"text-gray-blue hover:text-gray-blue-9")}),t.jsx(q.default,{className:l.cn("w-2.5 h-5 relative -top-[7px]",p?"text-gray-blue-9":"text-gray-blue hover:text-gray-blue-9")})]})]})}const S=C.observer(N);exports.HeaderCell=S;
package/dist/index131.js CHANGED
@@ -1,6 +1,73 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1
+ import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
+ import { observer as w } from "mobx-react-lite";
3
+ import { Tooltip as N } from "@ikas/ui";
4
+ import { cn as i } from "./index3.js";
5
+ import { ColumnAlignment as u } from "./index8.js";
6
+ import D from "./index145.js";
7
+ import H from "./index63.js";
8
+ import I from "./index69.js";
9
+ function S(f) {
10
+ var d, x;
11
+ const { model: t, columnDefinition: e, alignment: n } = f, s = t.columnDefinitions.findIndex(
12
+ (o) => o.columnKey === e.columnKey
13
+ ), p = s === 0, h = s === t.columnDefinitions.length - 1, c = e.columnKey === t.sortColumnKey, g = c && t.sortDirection === "asc", y = c && t.sortDirection === "desc", b = (o) => {
14
+ o.stopPropagation(), e.isSortable && t.onHeaderClick(e);
15
+ }, T = (d = e.headerTooltipProps) == null ? void 0 : d.isShowHeaderTextTooltip, C = ((x = e.headerTooltipProps) == null ? void 0 : x.tooltipText) ?? e.headerText, a = n === u.CENTER ? "center" : n === u.RIGHT ? "right" : "left", m = /* @__PURE__ */ r(
16
+ "span",
17
+ {
18
+ className: "text-sm font-medium text-gray-blue-6 truncate flex-none",
19
+ style: { textAlign: a },
20
+ children: e.headerText
21
+ }
22
+ ), v = () => {
23
+ var o;
24
+ return T ? /* @__PURE__ */ r(N, { title: C, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-center overflow-hidden", children: [
25
+ m,
26
+ ((o = e.headerTooltipProps) == null ? void 0 : o.showTooltipIcon) && /* @__PURE__ */ r(I, { className: "h-4 w-4 text-gray-blue-6 flex-shrink-0 ml-2" })
27
+ ] }) }) : m;
28
+ };
29
+ return /* @__PURE__ */ l(
30
+ "div",
31
+ {
32
+ className: i(
33
+ "w-full h-full flex items-center select-none cursor-pointer",
34
+ "text-gray-blue-6",
35
+ // Original: white bg when hideHeaderBackgroundColor is set
36
+ t.hideHeaderBackgroundColor ? "bg-white" : "bg-gray-blue-1",
37
+ (p || h) && "rounded"
38
+ ),
39
+ style: {
40
+ justifyContent: n ?? "flex-start",
41
+ textAlign: a
42
+ },
43
+ onClick: b,
44
+ children: [
45
+ v(),
46
+ e.isSortable && /* @__PURE__ */ l("div", { className: "w-4 flex-none flex flex-col items-center relative ml-1.5", children: [
47
+ /* @__PURE__ */ r(
48
+ D,
49
+ {
50
+ className: i(
51
+ "w-2.5 h-5 relative -bottom-[7px]",
52
+ g ? "text-gray-blue-9" : "text-gray-blue hover:text-gray-blue-9"
53
+ )
54
+ }
55
+ ),
56
+ /* @__PURE__ */ r(
57
+ H,
58
+ {
59
+ className: i(
60
+ "w-2.5 h-5 relative -top-[7px]",
61
+ y ? "text-gray-blue-9" : "text-gray-blue hover:text-gray-blue-9"
62
+ )
63
+ }
64
+ )
65
+ ] })
66
+ ]
67
+ }
68
+ );
3
69
  }
70
+ const F = w(S);
4
71
  export {
5
- e as getDefaultExportFromCjs
72
+ F as HeaderCell
6
73
  };
package/dist/index132.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const o=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),t={randomUUID:o};module.exports=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("mobx-react-lite"),n=require("./index8.cjs");function m(l){const{columnDefinition:r,alignment:e}=l,s=e===n.ColumnAlignment.CENTER?"center":e===n.ColumnAlignment.RIGHT?"right":"left";return t.jsx("div",{className:"w-full h-full flex items-center bg-gray-blue-1 select-none cursor-pointer",style:{justifyContent:e??"flex-start",textAlign:s},children:t.jsx("span",{className:"text-sm font-medium text-black flex-none",children:r.summaryText})})}const o=i.observer(m);exports.SummaryCell=o;
package/dist/index132.js CHANGED
@@ -1,6 +1,21 @@
1
- const o = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), t = {
2
- randomUUID: o
3
- };
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { observer as o } from "mobx-react-lite";
3
+ import { ColumnAlignment as n } from "./index8.js";
4
+ function i(l) {
5
+ const { columnDefinition: r, alignment: e } = l, m = e === n.CENTER ? "center" : e === n.RIGHT ? "right" : "left";
6
+ return /* @__PURE__ */ t(
7
+ "div",
8
+ {
9
+ className: "w-full h-full flex items-center bg-gray-blue-1 select-none cursor-pointer",
10
+ style: {
11
+ justifyContent: e ?? "flex-start",
12
+ textAlign: m
13
+ },
14
+ children: /* @__PURE__ */ t("span", { className: "text-sm font-medium text-black flex-none", children: r.summaryText })
15
+ }
16
+ );
17
+ }
18
+ const u = o(i);
4
19
  export {
5
- t as default
20
+ u as SummaryCell
6
21
  };
package/dist/index133.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";let t;const e=new Uint8Array(16);function o(){if(!t&&(t=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}module.exports=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("mobx-react-lite"),s=require("@ikas/ui"),c=require("./index8.cjs");function m(u){const{value:n,rowData:o,columnDefinition:t,onValueChange:a}=u,l=t.alignment,r=l===c.ColumnAlignment.CENTER?"center":l===c.ColumnAlignment.RIGHT?"right":"left",i=o&&t.getSecondLineValue?t.getSecondLineValue(o):void 0;return t.inputMode?e.jsx("div",{className:"w-full h-full flex items-center",style:{justifyContent:l,textAlign:r},children:e.jsx(s.Input,{size:"sm",value:n??"",onChange:x=>a(x.target.value),style:{textAlign:"inherit"}})}):e.jsxs("div",{className:"h-full w-full overflow-hidden flex flex-col justify-center",style:{textAlign:r},children:[e.jsx(s.Tooltip,{title:n,children:e.jsx("span",{className:"text-sm text-gray-blue-9 truncate block",children:n})}),i&&e.jsx(s.Tooltip,{title:i,children:e.jsx("span",{className:"text-xs text-gray-blue-6 truncate block",children:i})})]})}const g=d.observer(m);exports.TextCell=g;
package/dist/index133.js CHANGED
@@ -1,10 +1,37 @@
1
- let t;
2
- const e = new Uint8Array(16);
3
- function o() {
4
- if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
5
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- return t(e);
1
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
+ import { observer as d } from "mobx-react-lite";
3
+ import { Input as x, Tooltip as s } from "@ikas/ui";
4
+ import { ColumnAlignment as a } from "./index8.js";
5
+ function g(c) {
6
+ const { value: l, rowData: o, columnDefinition: t, onValueChange: u } = c, n = t.alignment, r = n === a.CENTER ? "center" : n === a.RIGHT ? "right" : "left", i = o && t.getSecondLineValue ? t.getSecondLineValue(o) : void 0;
7
+ return t.inputMode ? /* @__PURE__ */ e(
8
+ "div",
9
+ {
10
+ className: "w-full h-full flex items-center",
11
+ style: { justifyContent: n, textAlign: r },
12
+ children: /* @__PURE__ */ e(
13
+ x,
14
+ {
15
+ size: "sm",
16
+ value: l ?? "",
17
+ onChange: (m) => u(m.target.value),
18
+ style: { textAlign: "inherit" }
19
+ }
20
+ )
21
+ }
22
+ ) : /* @__PURE__ */ f(
23
+ "div",
24
+ {
25
+ className: "h-full w-full overflow-hidden flex flex-col justify-center",
26
+ style: { textAlign: r },
27
+ children: [
28
+ /* @__PURE__ */ e(s, { title: l, children: /* @__PURE__ */ e("span", { className: "text-sm text-gray-blue-9 truncate block", children: l }) }),
29
+ i && /* @__PURE__ */ e(s, { title: i, children: /* @__PURE__ */ e("span", { className: "text-xs text-gray-blue-6 truncate block", children: i }) })
30
+ ]
31
+ }
32
+ );
7
33
  }
34
+ const C = d(g);
8
35
  export {
9
- o as default
36
+ C as TextCell
10
37
  };
package/dist/index134.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=[];for(let i=0;i<256;++i)n.push((i+256).toString(16).slice(1));function c(i,u=0){return n[i[u+0]]+n[i[u+1]]+n[i[u+2]]+n[i[u+3]]+"-"+n[i[u+4]]+n[i[u+5]]+"-"+n[i[u+6]]+n[i[u+7]]+"-"+n[i[u+8]]+n[i[u+9]]+"-"+n[i[u+10]]+n[i[u+11]]+n[i[u+12]]+n[i[u+13]]+n[i[u+14]]+n[i[u+15]]}exports.unsafeStringify=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),f=require("mobx-react-lite"),p=require("@ikas/ui"),d=require("./index8.cjs");function b(e){const t={};return e.thousandSeparator!==void 0&&(t.thousandsSeparatorSymbol=e.thousandSeparator),e.decimalSeparator!==void 0&&(t.decimalSymbol=e.decimalSeparator),e.decimalCount!==void 0&&(t.decimalLimit=e.decimalCount),e.symbol&&(e.symbolPosition==="right"?t.suffix=e.symbol:t.prefix=e.symbol),t}function x(e,t){if(e==null)return"";const{thousandSeparator:s=",",decimalSeparator:i=".",decimalCount:m=2,symbol:o="",symbolPosition:l="left"}=t,a=e.toFixed(m).split(".");let n=a[0];const u=a[1];s&&(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,s));let r=u?`${n}${i}${u}`:n;return o&&(r=l==="right"?`${r} ${o}`:`${o} ${r}`),r}function y(e){const{value:t,rowData:s,columnDefinition:i,onValueChange:m}=e,o=i.alignment,l=s&&i.maskOptions?i.maskOptions(s):null;if(i.inputMode)return c.jsx("div",{className:"inline-flex items-center w-full",children:c.jsx(p.PriceInput,{size:"sm",value:t??null,maskOptions:l?b(l):void 0,onChange:r=>m(r??0)})});const a=t==null;let n;l&&!a?n=x(t,l):n=t!=null?String(t):"";const u=o===d.ColumnAlignment.CENTER?"center":o===d.ColumnAlignment.RIGHT?"flex-end":"flex-start";return c.jsx("div",{className:"inline-flex items-center min-w-0",style:{justifyContent:u},children:c.jsx("span",{className:"text-sm text-gray-blue-9 truncate",children:n})})}const g=f.observer(y);exports.NumberCell=g;
package/dist/index134.js CHANGED
@@ -1,9 +1,52 @@
1
- const i = [];
2
- for (let n = 0; n < 256; ++n)
3
- i.push((n + 256).toString(16).slice(1));
4
- function c(n, u = 0) {
5
- return i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]];
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { observer as f } from "mobx-react-lite";
3
+ import { PriceInput as p } from "@ikas/ui";
4
+ import { ColumnAlignment as d } from "./index8.js";
5
+ function h(t) {
6
+ const e = {};
7
+ return t.thousandSeparator !== void 0 && (e.thousandsSeparatorSymbol = t.thousandSeparator), t.decimalSeparator !== void 0 && (e.decimalSymbol = t.decimalSeparator), t.decimalCount !== void 0 && (e.decimalLimit = t.decimalCount), t.symbol && (t.symbolPosition === "right" ? e.suffix = t.symbol : e.prefix = t.symbol), e;
6
8
  }
9
+ function b(t, e) {
10
+ if (t == null) return "";
11
+ const {
12
+ thousandSeparator: s = ",",
13
+ decimalSeparator: n = ".",
14
+ decimalCount: u = 2,
15
+ symbol: o = "",
16
+ symbolPosition: l = "left"
17
+ } = e, a = t.toFixed(u).split(".");
18
+ let i = a[0];
19
+ const m = a[1];
20
+ s && (i = i.replace(/\B(?=(\d{3})+(?!\d))/g, s));
21
+ let r = m ? `${i}${n}${m}` : i;
22
+ return o && (r = l === "right" ? `${r} ${o}` : `${o} ${r}`), r;
23
+ }
24
+ function x(t) {
25
+ const { value: e, rowData: s, columnDefinition: n, onValueChange: u } = t, o = n.alignment, l = s && n.maskOptions ? n.maskOptions(s) : null;
26
+ if (n.inputMode)
27
+ return /* @__PURE__ */ c("div", { className: "inline-flex items-center w-full", children: /* @__PURE__ */ c(
28
+ p,
29
+ {
30
+ size: "sm",
31
+ value: e ?? null,
32
+ maskOptions: l ? h(l) : void 0,
33
+ onChange: (r) => u(r ?? 0)
34
+ }
35
+ ) });
36
+ const a = e == null;
37
+ let i;
38
+ l && !a ? i = b(e, l) : i = e != null ? String(e) : "";
39
+ const m = o === d.CENTER ? "center" : o === d.RIGHT ? "flex-end" : "flex-start";
40
+ return /* @__PURE__ */ c(
41
+ "div",
42
+ {
43
+ className: "inline-flex items-center min-w-0",
44
+ style: { justifyContent: m },
45
+ children: /* @__PURE__ */ c("span", { className: "text-sm text-gray-blue-9 truncate", children: i })
46
+ }
47
+ );
48
+ }
49
+ const v = f(x);
7
50
  export {
8
- c as unsafeStringify
51
+ v as NumberCell
9
52
  };
package/dist/index135.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),C=require("mobx-react-lite"),j=require("@ikas/ui"),l=require("./index3.cjs"),d=require("./index8.cjs"),w=require("./index145.cjs"),q=require("./index63.cjs"),H=require("./index69.cjs");function N(m){var u,x;const{model:o,columnDefinition:e,alignment:r}=m,s=o.columnDefinitions.findIndex(n=>n.columnKey===e.columnKey),h=s===0,f=s===o.columnDefinitions.length-1,i=e.columnKey===o.sortColumnKey,g=i&&o.sortDirection==="asc",p=i&&o.sortDirection==="desc",y=n=>{n.stopPropagation(),e.isSortable&&o.onHeaderClick(e)},b=(u=e.headerTooltipProps)==null?void 0:u.isShowHeaderTextTooltip,T=((x=e.headerTooltipProps)==null?void 0:x.tooltipText)??e.headerText,c=r===d.ColumnAlignment.CENTER?"center":r===d.ColumnAlignment.RIGHT?"right":"left",a=t.jsx("span",{className:"text-sm font-medium text-gray-blue-6 truncate flex-none",style:{textAlign:c},children:e.headerText}),v=()=>{var n;return b?t.jsx(j.Tooltip,{title:T,children:t.jsxs("div",{className:"flex items-center justify-center overflow-hidden",children:[a,((n=e.headerTooltipProps)==null?void 0:n.showTooltipIcon)&&t.jsx(H.default,{className:"h-4 w-4 text-gray-blue-6 flex-shrink-0 ml-2"})]})}):a};return t.jsxs("div",{className:l.cn("w-full h-full flex items-center select-none cursor-pointer","text-gray-blue-6",o.hideHeaderBackgroundColor?"bg-white":"bg-gray-blue-1",(h||f)&&"rounded"),style:{justifyContent:r??"flex-start",textAlign:c},onClick:y,children:[v(),e.isSortable&&t.jsxs("div",{className:"w-4 flex-none flex flex-col items-center relative ml-1.5",children:[t.jsx(w.default,{className:l.cn("w-2.5 h-5 relative -bottom-[7px]",g?"text-gray-blue-9":"text-gray-blue hover:text-gray-blue-9")}),t.jsx(q.default,{className:l.cn("w-2.5 h-5 relative -top-[7px]",p?"text-gray-blue-9":"text-gray-blue hover:text-gray-blue-9")})]})]})}const S=C.observer(N);exports.HeaderCell=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),y=require("mobx-react-lite"),j=require("@ikas/ui"),g=require("./index8.cjs");function P(o,r,c){const i=c??2,t=o.toFixed(i).split(".");let e=t[0];const n=t[1];e=e.replace(/\B(?=(\d{3})+(?!\d))/g,",");const l=n?`${e}.${n}`:e;return`${r} ${l}`}function C(o){const{value:r,columnDefinition:c}=o;if(!r)return null;const{sellPrice:i,discountPrice:t,currencySymbol:e,currencyDecimalDigits:n}=r,l=c.alignment,f=l===g.ColumnAlignment.CENTER?"center":l===g.ColumnAlignment.RIGHT?"right":"left",u=t!=null&&t!==i,p=c.ellipsis,a=P(i,e,n),b=(u?P(t,e,n):null)??a,m=(d,h)=>{const x=s.jsx("span",{className:h?"text-sm text-gray-blue-5 line-through":"text-sm text-black font-normal",children:d});return p?s.jsx(j.Tooltip,{title:d,children:s.jsx("span",{className:"truncate block",children:x})}):x};return s.jsxs("div",{className:"flex flex-col",style:{textAlign:f},children:[u&&m(a,!0),m(b)]})}const T=y.observer(C);exports.PriceCell=T;
package/dist/index135.js CHANGED
@@ -1,73 +1,42 @@
1
- import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
- import { observer as w } from "mobx-react-lite";
3
- import { Tooltip as N } from "@ikas/ui";
4
- import { cn as i } from "./index3.js";
5
- import { ColumnAlignment as u } from "./index8.js";
6
- import D from "./index145.js";
7
- import H from "./index63.js";
8
- import I from "./index69.js";
9
- function S(f) {
10
- var d, x;
11
- const { model: t, columnDefinition: e, alignment: n } = f, s = t.columnDefinitions.findIndex(
12
- (o) => o.columnKey === e.columnKey
13
- ), p = s === 0, h = s === t.columnDefinitions.length - 1, c = e.columnKey === t.sortColumnKey, g = c && t.sortDirection === "asc", y = c && t.sortDirection === "desc", b = (o) => {
14
- o.stopPropagation(), e.isSortable && t.onHeaderClick(e);
15
- }, T = (d = e.headerTooltipProps) == null ? void 0 : d.isShowHeaderTextTooltip, C = ((x = e.headerTooltipProps) == null ? void 0 : x.tooltipText) ?? e.headerText, a = n === u.CENTER ? "center" : n === u.RIGHT ? "right" : "left", m = /* @__PURE__ */ r(
16
- "span",
17
- {
18
- className: "text-sm font-medium text-gray-blue-6 truncate flex-none",
19
- style: { textAlign: a },
20
- children: e.headerText
21
- }
22
- ), v = () => {
23
- var o;
24
- return T ? /* @__PURE__ */ r(N, { title: C, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-center overflow-hidden", children: [
25
- m,
26
- ((o = e.headerTooltipProps) == null ? void 0 : o.showTooltipIcon) && /* @__PURE__ */ r(I, { className: "h-4 w-4 text-gray-blue-6 flex-shrink-0 ml-2" })
27
- ] }) }) : m;
1
+ import { jsxs as y, jsx as s } from "react/jsx-runtime";
2
+ import { observer as C } from "mobx-react-lite";
3
+ import { Tooltip as D } from "@ikas/ui";
4
+ import { ColumnAlignment as p } from "./index8.js";
5
+ function x(o, r, c) {
6
+ const i = c ?? 2, e = o.toFixed(i).split(".");
7
+ let t = e[0];
8
+ const n = e[1];
9
+ t = t.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
10
+ const l = n ? `${t}.${n}` : t;
11
+ return `${r} ${l}`;
12
+ }
13
+ function F(o) {
14
+ const { value: r, columnDefinition: c } = o;
15
+ if (!r)
16
+ return null;
17
+ const { sellPrice: i, discountPrice: e, currencySymbol: t, currencyDecimalDigits: n } = r, l = c.alignment, P = l === p.CENTER ? "center" : l === p.RIGHT ? "right" : "left", a = e != null && e !== i, g = c.ellipsis, m = x(i, t, n), h = (a ? x(e, t, n) : null) ?? m, u = (d, b) => {
18
+ const f = /* @__PURE__ */ s(
19
+ "span",
20
+ {
21
+ className: b ? "text-sm text-gray-blue-5 line-through" : "text-sm text-black font-normal",
22
+ children: d
23
+ }
24
+ );
25
+ return g ? /* @__PURE__ */ s(D, { title: d, children: /* @__PURE__ */ s("span", { className: "truncate block", children: f }) }) : f;
28
26
  };
29
- return /* @__PURE__ */ l(
27
+ return /* @__PURE__ */ y(
30
28
  "div",
31
29
  {
32
- className: i(
33
- "w-full h-full flex items-center select-none cursor-pointer",
34
- "text-gray-blue-6",
35
- // Original: white bg when hideHeaderBackgroundColor is set
36
- t.hideHeaderBackgroundColor ? "bg-white" : "bg-gray-blue-1",
37
- (p || h) && "rounded"
38
- ),
39
- style: {
40
- justifyContent: n ?? "flex-start",
41
- textAlign: a
42
- },
43
- onClick: b,
30
+ className: "flex flex-col",
31
+ style: { textAlign: P },
44
32
  children: [
45
- v(),
46
- e.isSortable && /* @__PURE__ */ l("div", { className: "w-4 flex-none flex flex-col items-center relative ml-1.5", children: [
47
- /* @__PURE__ */ r(
48
- D,
49
- {
50
- className: i(
51
- "w-2.5 h-5 relative -bottom-[7px]",
52
- g ? "text-gray-blue-9" : "text-gray-blue hover:text-gray-blue-9"
53
- )
54
- }
55
- ),
56
- /* @__PURE__ */ r(
57
- H,
58
- {
59
- className: i(
60
- "w-2.5 h-5 relative -top-[7px]",
61
- y ? "text-gray-blue-9" : "text-gray-blue hover:text-gray-blue-9"
62
- )
63
- }
64
- )
65
- ] })
33
+ a && u(m, !0),
34
+ u(h)
66
35
  ]
67
36
  }
68
37
  );
69
38
  }
70
- const F = w(S);
39
+ const k = C(F);
71
40
  export {
72
- F as HeaderCell
41
+ k as PriceCell
73
42
  };
package/dist/index136.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("mobx-react-lite"),n=require("./index8.cjs");function m(l){const{columnDefinition:r,alignment:e}=l,s=e===n.ColumnAlignment.CENTER?"center":e===n.ColumnAlignment.RIGHT?"right":"left";return t.jsx("div",{className:"w-full h-full flex items-center bg-gray-blue-1 select-none cursor-pointer",style:{justifyContent:e??"flex-start",textAlign:s},children:t.jsx("span",{className:"text-sm font-medium text-black flex-none",children:r.summaryText})})}const o=i.observer(m);exports.SummaryCell=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),y=require("mobx-react-lite"),o=require("@ikas/ui");function p(i){return i.map(e=>({label:e.label,value:String(e.value)}))}function w(i){return i.map(e=>({key:String(e.value),title:e.label,value:String(e.value),children:e.children?w(e.children):void 0}))}function C(i){const{value:e,rowData:m,columnDefinition:l,onValueChange:c}=i,[v,f]=s.useState(null),[u,g]=s.useState(!1),h=s.useRef(),n=!!l.searchOptions,d=n?v??[]:m?l.getOptions(m):[],S=s.useCallback(t=>{l.searchOptions&&(h.current&&clearTimeout(h.current),h.current=setTimeout(async()=>{if(!t){f([]);return}try{g(!0);const r=await l.searchOptions(t);f(r)}catch{}finally{g(!1)}},600))},[l]);return l.isTree?a.jsx("div",{className:"flex items-center min-w-0 w-full",children:a.jsx(o.TreeSelect,{style:{width:"100%"},treeData:w(d),treeCheckable:!0,showCheckedStrategy:o.TreeSelect.SHOW_ALL,value:Array.isArray(e)?e.map(String):e!=null?[String(e)]:void 0,onChange:t=>{const r=(Array.isArray(t)?t:[t]).map(Number);c(r)},onSearch:n?S:void 0,filterTreeNode:n?()=>!0:void 0,loading:u,maxTagCount:2,placeholder:"-"})}):l.isMultiple?a.jsx("div",{className:"flex items-center min-w-0 w-full",children:a.jsx(o.Select,{style:{width:"100%"},mode:"multiple",value:Array.isArray(e)?e.map(String):e!=null?[String(e)]:void 0,options:p(d),onChange:t=>{const r=(Array.isArray(t)?t:[t]).map(Number);c(r)},onSearch:n?S:void 0,filterOption:n?()=>!0:(t,r)=>r?String(r.label??"").toLowerCase().includes(t.toLowerCase()):!1,loading:u,allowClear:!0,showSearch:!0,placeholder:"-"})}):a.jsx("div",{className:"flex items-center min-w-0 w-full",children:a.jsx(o.Select,{style:{width:"100%"},value:e!=null?String(e):void 0,options:p(d),onChange:t=>c(Number(t)),onSearch:n?S:void 0,filterOption:n?()=>!0:(t,r)=>r?String(r.label??"").toLowerCase().includes(t.toLowerCase()):!1,loading:u,allowClear:!0,showSearch:!0,placeholder:"-"})})}const b=y.observer(C);exports.SelectCell=b;
package/dist/index136.js CHANGED
@@ -1,21 +1,94 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { observer as o } from "mobx-react-lite";
3
- import { ColumnAlignment as n } from "./index8.js";
4
- function i(l) {
5
- const { columnDefinition: r, alignment: e } = l, m = e === n.CENTER ? "center" : e === n.RIGHT ? "right" : "left";
6
- return /* @__PURE__ */ t(
7
- "div",
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useState as S, useRef as C, useCallback as b } from "react";
3
+ import { observer as O } from "mobx-react-lite";
4
+ import { TreeSelect as p, Select as g } from "@ikas/ui";
5
+ function w(i) {
6
+ return i.map((e) => ({
7
+ label: e.label,
8
+ value: String(e.value)
9
+ }));
10
+ }
11
+ function v(i) {
12
+ return i.map((e) => ({
13
+ key: String(e.value),
14
+ title: e.label,
15
+ value: String(e.value),
16
+ children: e.children ? v(e.children) : void 0
17
+ }));
18
+ }
19
+ function A(i) {
20
+ const { value: e, rowData: h, columnDefinition: l, onValueChange: o } = i, [y, d] = S(null), [s, f] = S(!1), c = C(), n = !!l.searchOptions, u = n ? y ?? [] : h ? l.getOptions(h) : [], m = b(
21
+ (r) => {
22
+ l.searchOptions && (c.current && clearTimeout(c.current), c.current = setTimeout(async () => {
23
+ if (!r) {
24
+ d([]);
25
+ return;
26
+ }
27
+ try {
28
+ f(!0);
29
+ const t = await l.searchOptions(r);
30
+ d(t);
31
+ } catch {
32
+ } finally {
33
+ f(!1);
34
+ }
35
+ }, 600));
36
+ },
37
+ [l]
38
+ );
39
+ return l.isTree ? /* @__PURE__ */ a("div", { className: "flex items-center min-w-0 w-full", children: /* @__PURE__ */ a(
40
+ p,
8
41
  {
9
- className: "w-full h-full flex items-center bg-gray-blue-1 select-none cursor-pointer",
10
- style: {
11
- justifyContent: e ?? "flex-start",
12
- textAlign: m
42
+ style: { width: "100%" },
43
+ treeData: v(u),
44
+ treeCheckable: !0,
45
+ showCheckedStrategy: p.SHOW_ALL,
46
+ value: Array.isArray(e) ? e.map(String) : e != null ? [String(e)] : void 0,
47
+ onChange: (r) => {
48
+ const t = (Array.isArray(r) ? r : [r]).map(Number);
49
+ o(t);
13
50
  },
14
- children: /* @__PURE__ */ t("span", { className: "text-sm font-medium text-black flex-none", children: r.summaryText })
51
+ onSearch: n ? m : void 0,
52
+ filterTreeNode: n ? () => !0 : void 0,
53
+ loading: s,
54
+ maxTagCount: 2,
55
+ placeholder: "-"
15
56
  }
16
- );
57
+ ) }) : l.isMultiple ? /* @__PURE__ */ a("div", { className: "flex items-center min-w-0 w-full", children: /* @__PURE__ */ a(
58
+ g,
59
+ {
60
+ style: { width: "100%" },
61
+ mode: "multiple",
62
+ value: Array.isArray(e) ? e.map(String) : e != null ? [String(e)] : void 0,
63
+ options: w(u),
64
+ onChange: (r) => {
65
+ const t = (Array.isArray(r) ? r : [r]).map(Number);
66
+ o(t);
67
+ },
68
+ onSearch: n ? m : void 0,
69
+ filterOption: n ? () => !0 : (r, t) => t ? String(t.label ?? "").toLowerCase().includes(r.toLowerCase()) : !1,
70
+ loading: s,
71
+ allowClear: !0,
72
+ showSearch: !0,
73
+ placeholder: "-"
74
+ }
75
+ ) }) : /* @__PURE__ */ a("div", { className: "flex items-center min-w-0 w-full", children: /* @__PURE__ */ a(
76
+ g,
77
+ {
78
+ style: { width: "100%" },
79
+ value: e != null ? String(e) : void 0,
80
+ options: w(u),
81
+ onChange: (r) => o(Number(r)),
82
+ onSearch: n ? m : void 0,
83
+ filterOption: n ? () => !0 : (r, t) => t ? String(t.label ?? "").toLowerCase().includes(r.toLowerCase()) : !1,
84
+ loading: s,
85
+ allowClear: !0,
86
+ showSearch: !0,
87
+ placeholder: "-"
88
+ }
89
+ ) });
17
90
  }
18
- const u = o(i);
91
+ const R = O(A);
19
92
  export {
20
- u as SummaryCell
93
+ R as SelectCell
21
94
  };
package/dist/index137.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("mobx-react-lite"),s=require("@ikas/ui"),c=require("./index8.cjs");function m(u){const{value:n,rowData:o,columnDefinition:t,onValueChange:a}=u,l=t.alignment,r=l===c.ColumnAlignment.CENTER?"center":l===c.ColumnAlignment.RIGHT?"right":"left",i=o&&t.getSecondLineValue?t.getSecondLineValue(o):void 0;return t.inputMode?e.jsx("div",{className:"w-full h-full flex items-center",style:{justifyContent:l,textAlign:r},children:e.jsx(s.Input,{size:"sm",value:n??"",onChange:x=>a(x.target.value),style:{textAlign:"inherit"}})}):e.jsxs("div",{className:"h-full w-full overflow-hidden flex flex-col justify-center",style:{textAlign:r},children:[e.jsx(s.Tooltip,{title:n,children:e.jsx("span",{className:"text-sm text-gray-blue-9 truncate block",children:n})}),i&&e.jsx(s.Tooltip,{title:i,children:e.jsx("span",{className:"text-xs text-gray-blue-6 truncate block",children:i})})]})}const g=d.observer(m);exports.TextCell=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("react"),j=require("mobx-react-lite"),C=require("./index37.cjs"),v=require("./index55.cjs"),U=require("./index80.cjs");function V(m){var i;const{value:o,rowData:a,columnDefinition:e,onValueChange:u}=m,[x,c]=h.useState(!1),p=a&&e.getDrawerTitle?e.getDrawerTitle(a):void 0,w=a&&e.getGalleryImages?e.getGalleryImages(a):void 0,I=a&&e.disableUpload?e.disableUpload(a):void 0,d=a&&e.productImages?e.productImages(a):void 0,b=d==null?void 0:d.map(r=>({imageId:r.id??null,fileName:r.name??null})),f=r=>{var l;r.stopPropagation(),c(!0),a&&((l=e.onDrawerToggle)==null||l.call(e,a,!0))},S=()=>{var r;c(!1),a&&((r=e.onDrawerToggle)==null||r.call(e,a,!1))},y=e.onImageNameSave?r=>{var n;const l=o==null?void 0:o.find(N=>N.id===r.imageId);a&&l&&((n=e.onImageNameSave)==null||n.call(e,a,l,r.name??""))}:void 0,s=o!=null&&o.length?o.find(r=>!(r!=null&&r.isVideo)):void 0,g=(s==null?void 0:s.thumbnailSrc)||(s==null?void 0:s.url)||(s==null?void 0:s.src);return t.jsxs("div",{className:"flex items-center",children:[t.jsx("button",{type:"button",className:"flex-shrink-0 w-9 h-9 flex items-center justify-center rounded border border-solid border-gray-blue-2 bg-gray-blue-0 cursor-pointer overflow-hidden outline-none",onClick:f,children:g?t.jsx("img",{src:g,alt:(s==null?void 0:s.name)??"",className:"w-full h-full object-cover"}):o!=null&&o.length&&e.allowVideoUpload?t.jsx(v.default,{className:"h-[18px] w-[18px] text-gray-blue-7"}):t.jsx(U.default,{className:"h-[18px] w-[18px] text-gray-blue-7"})}),a&&((i=e.rightContent)==null?void 0:i.call(e,a)),t.jsx(C.DrawerImageSelect,{allowVideoUpload:e.allowVideoUpload,title:p,visible:x,images:o,galleryImages:w,disableUpload:I,onChange:r=>u(r),onClose:S,onImageNameSave:y,imageNameMaxLength:e.imageNameMaxLength,productImages:b})]})}const q=j.observer(V);exports.ImageSelectCell=q;