@medusajs/dashboard 3.0.0-snapshot-20251216103925 → 3.0.0-snapshot-20251216135612
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.
- package/dist/{add-campaign-promotions-PHAHMGXP.mjs → add-campaign-promotions-OYPGISTF.mjs} +4 -4
- package/dist/{api-key-management-detail-NRGL7HHX.mjs → api-key-management-detail-6RCDH73M.mjs} +5 -5
- package/dist/{api-key-management-list-LJSWRAGE.mjs → api-key-management-list-KC5GOWAU.mjs} +5 -5
- package/dist/{api-key-management-sales-channels-3GRNDBZ4.mjs → api-key-management-sales-channels-LUB5G6RC.mjs} +5 -5
- package/dist/app.js +3752 -133
- package/dist/app.mjs +2 -2
- package/dist/{campaign-detail-22Q6XWGL.mjs → campaign-detail-5Q4BYCPX.mjs} +5 -5
- package/dist/{campaign-list-OH566KWW.mjs → campaign-list-PEOTTWBA.mjs} +6 -6
- package/dist/{category-detail-RRKJPMEG.mjs → category-detail-S5IPXMHX.mjs} +4 -4
- package/dist/{category-list-4HZP4FRE.mjs → category-list-QBYJ4T3R.mjs} +4 -4
- package/dist/{category-products-EFZRTCSF.mjs → category-products-KPW6BA5J.mjs} +4 -4
- package/dist/{chunk-LCEKY54O.mjs → chunk-27MGH3HR.mjs} +1 -1
- package/dist/{chunk-KQ4LC2YV.mjs → chunk-2DULKOPN.mjs} +1 -1
- package/dist/{chunk-SUYYSKCB.mjs → chunk-535OVBXR.mjs} +8 -1
- package/dist/{chunk-32FPYJ3S.mjs → chunk-AHZLMCZF.mjs} +1 -1
- package/dist/{chunk-5IFK2ZTA.mjs → chunk-APGDAT7X.mjs} +2 -2
- package/dist/{chunk-2X25XWOW.mjs → chunk-BTYBTKWK.mjs} +1 -1
- package/dist/{chunk-DNUVCBN7.mjs → chunk-CCQD65EY.mjs} +160 -58
- package/dist/{chunk-RL5EYTP6.mjs → chunk-CVHJAKLQ.mjs} +1 -1
- package/dist/{chunk-DZWH2RV6.mjs → chunk-DFFLVEZ5.mjs} +1 -1
- package/dist/{chunk-YTN73JYH.mjs → chunk-DTZXEQXZ.mjs} +1 -1
- package/dist/{chunk-7R743WZ6.mjs → chunk-EHU67PIM.mjs} +1 -1
- package/dist/{chunk-VX2HE7O5.mjs → chunk-FBYTX6K7.mjs} +1 -1
- package/dist/{chunk-RMDYKRWW.mjs → chunk-KFYQTOGB.mjs} +1 -1
- package/dist/{chunk-GA3UMQMZ.mjs → chunk-O7JNIATG.mjs} +1 -1
- package/dist/{chunk-OHY2N2Q4.mjs → chunk-OL24RDYM.mjs} +3 -3
- package/dist/{chunk-M4Q5Q4I3.mjs → chunk-PA3T6IWL.mjs} +2 -2
- package/dist/{chunk-NL376WAO.mjs → chunk-QISH26J3.mjs} +1 -1
- package/dist/{chunk-PVW6M64S.mjs → chunk-QOCJPBRB.mjs} +1 -1
- package/dist/{chunk-2GWGNMAA.mjs → chunk-R4ZOO4ON.mjs} +1 -1
- package/dist/{chunk-43X7ZR3P.mjs → chunk-RS7DWLEP.mjs} +1 -1
- package/dist/{chunk-ROKB75YP.mjs → chunk-VT2JJ5C2.mjs} +1 -1
- package/dist/{chunk-DK7IWUMK.mjs → chunk-WYATCUOM.mjs} +3 -3
- package/dist/{chunk-CV65NY6Y.mjs → chunk-YFIYCS7F.mjs} +1 -1
- package/dist/{chunk-O7WJSSQR.mjs → chunk-YKYVCQRS.mjs} +3346 -93
- package/dist/{chunk-GU5PJRPM.mjs → chunk-ZQJPHZKI.mjs} +1 -1
- package/dist/{collection-add-products-XUMV6XR7.mjs → collection-add-products-FU2BS3D3.mjs} +4 -4
- package/dist/{collection-detail-ONRBKJLN.mjs → collection-detail-VJE7XHLV.mjs} +4 -4
- package/dist/{collection-list-XCC4SIPJ.mjs → collection-list-IGA6SCNF.mjs} +4 -4
- package/dist/{customer-detail-FR6J37ZC.mjs → customer-detail-MOV2T3LF.mjs} +6 -6
- package/dist/{customer-group-add-customers-DM4VLTNB.mjs → customer-group-add-customers-XMR2WBXX.mjs} +6 -6
- package/dist/{customer-group-detail-YSKSNETG.mjs → customer-group-detail-6T7OXGQD.mjs} +6 -6
- package/dist/{customer-group-list-XBCD4FZH.mjs → customer-group-list-AJEAF5D2.mjs} +3 -3
- package/dist/{customer-list-TG4D4QOT.mjs → customer-list-UI5EQDII.mjs} +6 -6
- package/dist/{customers-add-customer-group-Q7FMR2Y5.mjs → customers-add-customer-group-QVTVSQYM.mjs} +4 -4
- package/dist/{inventory-create-3XONKYMZ.mjs → inventory-create-ANYUM4P5.mjs} +1 -1
- package/dist/{inventory-detail-6A6GOLB6.mjs → inventory-detail-ZPSEMYI2.mjs} +4 -4
- package/dist/{inventory-list-2CJLAK3X.mjs → inventory-list-RXJPSVZE.mjs} +4 -4
- package/dist/{inventory-stock-S3ZYYCMZ.mjs → inventory-stock-FD4ZM4BB.mjs} +2 -2
- package/dist/{location-fulfillment-providers-WM6DT252.mjs → location-fulfillment-providers-7ZUJAGNY.mjs} +4 -4
- package/dist/{location-sales-channels-WLVTMU4Z.mjs → location-sales-channels-P3QJTFDT.mjs} +5 -5
- package/dist/{location-service-zone-create-3FWF3DG5.mjs → location-service-zone-create-J43WN6G4.mjs} +5 -5
- package/dist/{location-service-zone-manage-areas-YFEAZUUN.mjs → location-service-zone-manage-areas-6ZPMKMSX.mjs} +5 -5
- package/dist/{location-service-zone-shipping-option-create-MJPH3WKX.mjs → location-service-zone-shipping-option-create-ZJ4GIBTJ.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-pricing-6IRNPWJY.mjs → location-service-zone-shipping-option-pricing-CR4BVYG3.mjs} +2 -2
- package/dist/{order-create-claim-GUYTLVPB.mjs → order-create-claim-SCDJGM46.mjs} +4 -4
- package/dist/{order-create-edit-ODIN6GRW.mjs → order-create-edit-JIE3HDHP.mjs} +4 -4
- package/dist/{order-create-exchange-ZT5RBRKL.mjs → order-create-exchange-LQU4YN7F.mjs} +4 -4
- package/dist/{order-create-return-E2KILJX2.mjs → order-create-return-52GHGW5Z.mjs} +4 -4
- package/dist/{order-detail-HFJONELJ.mjs → order-detail-PVPGEWGY.mjs} +2 -2
- package/dist/{order-export-4MZUPMGD.mjs → order-export-LE363ZLB.mjs} +3 -3
- package/dist/{order-list-ACSFGIPD.mjs → order-list-GRLQWN4L.mjs} +7 -7
- package/dist/{price-list-configuration-IHPSUNZJ.mjs → price-list-configuration-6S3MLNXQ.mjs} +5 -5
- package/dist/{price-list-create-YHXRQSC3.mjs → price-list-create-MFRUQADC.mjs} +7 -7
- package/dist/{price-list-detail-FR3FQR3H.mjs → price-list-detail-Q5VG5VGW.mjs} +5 -5
- package/dist/{price-list-list-YSEM6IAI.mjs → price-list-list-DG5YEZ44.mjs} +4 -4
- package/dist/{price-list-prices-add-GJVI47OY.mjs → price-list-prices-add-SDU5YZAT.mjs} +6 -6
- package/dist/{price-list-prices-edit-E4Q5TQPM.mjs → price-list-prices-edit-5USQR4D4.mjs} +2 -2
- package/dist/{product-attributes-QD3BWV5V.mjs → product-attributes-EFIRUBRO.mjs} +2 -2
- package/dist/{product-create-E2GZYQX4.mjs → product-create-K6EWZHIT.mjs} +7 -7
- package/dist/{product-create-variant-KEBN5OR7.mjs → product-create-variant-ERKHTEJZ.mjs} +1 -1
- package/dist/{product-detail-QBGGKRZ2.mjs → product-detail-DKPZDEIY.mjs} +4 -4
- package/dist/{product-edit-YP4KOQ4T.mjs → product-edit-55YXTIGO.mjs} +2 -2
- package/dist/{product-export-WUZYHPS5.mjs → product-export-5AD7NELI.mjs} +3 -3
- package/dist/{product-image-variants-edit-Y363J5NG.mjs → product-image-variants-edit-M6QF2RLE.mjs} +4 -4
- package/dist/{product-list-DNTS7WUN.mjs → product-list-EUWZIFTM.mjs} +7 -7
- package/dist/{product-organization-H557PLLB.mjs → product-organization-N3VBRXF4.mjs} +2 -2
- package/dist/{product-prices-JOG6IIQ7.mjs → product-prices-4C36AG4R.mjs} +1 -1
- package/dist/{product-sales-channels-ANCFZZ5S.mjs → product-sales-channels-PPXUG4KT.mjs} +5 -5
- package/dist/{product-stock-NYUFMEVG.mjs → product-stock-VEGE6SUZ.mjs} +2 -2
- package/dist/{product-tag-detail-EHBB3WUB.mjs → product-tag-detail-I3MBZX7U.mjs} +10 -10
- package/dist/{product-tag-list-LSW5FFVN.mjs → product-tag-list-JUWSOMB7.mjs} +10 -10
- package/dist/{product-type-detail-3VB6AWUW.mjs → product-type-detail-RKHT5NBL.mjs} +4 -4
- package/dist/{product-type-list-FD3TGPNP.mjs → product-type-list-QQKAHBJ3.mjs} +6 -6
- package/dist/{product-variant-detail-43T33AQP.mjs → product-variant-detail-XAYG5CKE.mjs} +4 -4
- package/dist/{profile-detail-BMC7IZBY.mjs → profile-detail-FRZ74HAF.mjs} +1 -1
- package/dist/{profile-edit-YZCUGEXF.mjs → profile-edit-ZNXO6WME.mjs} +1 -1
- package/dist/{promotion-detail-VJB55PJK.mjs → promotion-detail-QC36KXB3.mjs} +3 -3
- package/dist/{promotion-list-TMWKPLMJ.mjs → promotion-list-L22GJE3P.mjs} +4 -4
- package/dist/{refund-reason-list-URYYYEK6.mjs → refund-reason-list-OJYYEYJE.mjs} +8 -8
- package/dist/{region-add-countries-7U4J5RW6.mjs → region-add-countries-2VAVXMJQ.mjs} +4 -4
- package/dist/{region-create-IUGX33M5.mjs → region-create-NA7Y2LN4.mjs} +4 -4
- package/dist/{region-detail-D3JBW34A.mjs → region-detail-3BARMXUE.mjs} +4 -4
- package/dist/{region-list-JAQXIBYD.mjs → region-list-V4R2REMH.mjs} +4 -4
- package/dist/{reservation-list-2DN3YHIJ.mjs → reservation-list-B47DXTA7.mjs} +5 -5
- package/dist/{return-reason-list-IFFIDA5O.mjs → return-reason-list-SCBGTOEI.mjs} +10 -10
- package/dist/{sales-channel-add-products-VH5T3GDA.mjs → sales-channel-add-products-F7YV4MO5.mjs} +4 -4
- package/dist/{sales-channel-detail-I2ZHVXMG.mjs → sales-channel-detail-MXIPZCGA.mjs} +4 -4
- package/dist/{sales-channel-list-3FV4S2NN.mjs → sales-channel-list-RLGL7FM3.mjs} +5 -5
- package/dist/{shipping-option-type-list-ZMZMXFME.mjs → shipping-option-type-list-DIOX7VG7.mjs} +5 -5
- package/dist/{shipping-profiles-list-H3CBZKRH.mjs → shipping-profiles-list-WRPIJBZZ.mjs} +4 -4
- package/dist/{store-add-currencies-ZFS3WZHG.mjs → store-add-currencies-OX2WXFMS.mjs} +4 -4
- package/dist/{store-add-locales-IZOZP5C6.mjs → store-add-locales-VJ4RJ7UI.mjs} +4 -4
- package/dist/{store-detail-4IBAEVSD.mjs → store-detail-JSNPOB2F.mjs} +4 -4
- package/dist/{tax-region-detail-O2T7BI3V.mjs → tax-region-detail-2AE2EFI3.mjs} +13 -13
- package/dist/{tax-region-province-detail-2W7RXAM5.mjs → tax-region-province-detail-4ERSEQFF.mjs} +13 -13
- package/dist/{tax-region-tax-override-create-7IM4ZVPH.mjs → tax-region-tax-override-create-PHCGEF7V.mjs} +11 -11
- package/dist/{tax-region-tax-override-edit-3ZT5IZYR.mjs → tax-region-tax-override-edit-SMRPSILC.mjs} +12 -12
- package/dist/{translation-list-IAKEB7MY.mjs → translation-list-S5Z6PG2R.mjs} +8 -5
- package/dist/translations-edit-HUNKY7CO.mjs +708 -0
- package/dist/{user-invite-XB635N26.mjs → user-invite-GAGIM5DO.mjs} +4 -4
- package/dist/{user-list-YYUOQKQY.mjs → user-list-YTZQNYSO.mjs} +4 -4
- package/dist/{workflow-execution-list-IZVF2XMJ.mjs → workflow-execution-list-C3EJMVSZ.mjs} +4 -4
- package/package.json +9 -9
- package/src/components/data-grid/components/data-grid-cell-container.tsx +16 -4
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +16 -3
- package/src/components/data-grid/components/data-grid-root.tsx +19 -4
- package/src/components/data-grid/components/data-grid-text-cell.tsx +79 -9
- package/src/i18n/languages.ts +7 -0
- package/src/i18n/translations/index.ts +4 -0
- package/src/i18n/translations/zhTW.json +3249 -0
- package/src/routes/translations/translation-list/translation-list.tsx +9 -8
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +388 -90
- package/src/routes/translations/translations-edit/translations-edit.tsx +0 -1
- package/dist/translations-edit-QKLE4L5B.mjs +0 -458
|
@@ -2,15 +2,15 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
_DataTable,
|
|
4
4
|
useDataTable
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DTZXEQXZ.mjs";
|
|
6
6
|
import "./chunk-HQKGZADC.mjs";
|
|
7
7
|
import "./chunk-EMIHDNB7.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useUserInviteTableQuery
|
|
10
10
|
} from "./chunk-FHSC5X62.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-ZQJPHZKI.mjs";
|
|
12
12
|
import "./chunk-C76H5USB.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-DFFLVEZ5.mjs";
|
|
14
14
|
import {
|
|
15
15
|
KeyboundForm
|
|
16
16
|
} from "./chunk-6HTZNHPT.mjs";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-OZPB6JBL.mjs";
|
|
28
28
|
import "./chunk-OC7BQLYI.mjs";
|
|
29
29
|
import "./chunk-S4DMV3ZT.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-535OVBXR.mjs";
|
|
31
31
|
import {
|
|
32
32
|
Form
|
|
33
33
|
} from "./chunk-OBQI23QM.mjs";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDataTableDateColumns
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BTYBTKWK.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SingleColumnPage
|
|
6
6
|
} from "./chunk-GIZFNLKK.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDataTableDateFilters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-R4ZOO4ON.mjs";
|
|
10
10
|
import {
|
|
11
11
|
DataTable
|
|
12
12
|
} from "./chunk-KCWP7RF5.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useQueryParams
|
|
15
15
|
} from "./chunk-C76H5USB.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-DFFLVEZ5.mjs";
|
|
17
17
|
import "./chunk-G4BWCU5P.mjs";
|
|
18
18
|
import {
|
|
19
19
|
useExtension
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import "./chunk-OZPB6JBL.mjs";
|
|
22
22
|
import "./chunk-OC7BQLYI.mjs";
|
|
23
23
|
import "./chunk-S4DMV3ZT.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-535OVBXR.mjs";
|
|
25
25
|
import {
|
|
26
26
|
useUsers
|
|
27
27
|
} from "./chunk-5BQQRHQS.mjs";
|
|
@@ -9,23 +9,23 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
9
9
|
import {
|
|
10
10
|
_DataTable,
|
|
11
11
|
useDataTable
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DTZXEQXZ.mjs";
|
|
13
13
|
import "./chunk-HQKGZADC.mjs";
|
|
14
14
|
import "./chunk-EMIHDNB7.mjs";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-ZQJPHZKI.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SingleColumnPage
|
|
18
18
|
} from "./chunk-GIZFNLKK.mjs";
|
|
19
19
|
import {
|
|
20
20
|
useQueryParams
|
|
21
21
|
} from "./chunk-C76H5USB.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-DFFLVEZ5.mjs";
|
|
23
23
|
import {
|
|
24
24
|
useExtension
|
|
25
25
|
} from "./chunk-C5P5PL3E.mjs";
|
|
26
26
|
import "./chunk-LPEUYMRK.mjs";
|
|
27
27
|
import "./chunk-S4DMV3ZT.mjs";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-535OVBXR.mjs";
|
|
29
29
|
import {
|
|
30
30
|
useWorkflowExecutions
|
|
31
31
|
} from "./chunk-KI7TOXBR.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/dashboard",
|
|
3
|
-
"version": "3.0.0-snapshot-
|
|
3
|
+
"version": "3.0.0-snapshot-20251216135612",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
|
6
6
|
"dev": "../../../node_modules/.bin/vite",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
47
47
|
"@hookform/error-message": "^2.0.1",
|
|
48
48
|
"@hookform/resolvers": "3.4.2",
|
|
49
|
-
"@medusajs/admin-shared": "3.0.0-snapshot-
|
|
50
|
-
"@medusajs/icons": "3.0.0-snapshot-
|
|
51
|
-
"@medusajs/js-sdk": "3.0.0-snapshot-
|
|
52
|
-
"@medusajs/ui": "4.0.31-snapshot-
|
|
49
|
+
"@medusajs/admin-shared": "3.0.0-snapshot-20251216135612",
|
|
50
|
+
"@medusajs/icons": "3.0.0-snapshot-20251216135612",
|
|
51
|
+
"@medusajs/js-sdk": "3.0.0-snapshot-20251216135612",
|
|
52
|
+
"@medusajs/ui": "4.0.31-snapshot-20251216135612",
|
|
53
53
|
"@radix-ui/react-dialog": "1.1.4",
|
|
54
54
|
"@radix-ui/react-dismissable-layer": "1.1.4",
|
|
55
55
|
"@tanstack/react-query": "5.64.2",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"zod": "3.25.76"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@medusajs/admin-shared": "3.0.0-snapshot-
|
|
84
|
-
"@medusajs/admin-vite-plugin": "3.0.0-snapshot-
|
|
85
|
-
"@medusajs/types": "3.0.0-snapshot-
|
|
86
|
-
"@medusajs/ui-preset": "3.0.0-snapshot-
|
|
83
|
+
"@medusajs/admin-shared": "3.0.0-snapshot-20251216135612",
|
|
84
|
+
"@medusajs/admin-vite-plugin": "3.0.0-snapshot-20251216135612",
|
|
85
|
+
"@medusajs/types": "3.0.0-snapshot-20251216135612",
|
|
86
|
+
"@medusajs/ui-preset": "3.0.0-snapshot-20251216135612"
|
|
87
87
|
},
|
|
88
88
|
"packageManager": "yarn@3.2.1"
|
|
89
89
|
}
|
|
@@ -20,16 +20,23 @@ export const DataGridCellContainer = ({
|
|
|
20
20
|
errors,
|
|
21
21
|
rowErrors,
|
|
22
22
|
outerComponent,
|
|
23
|
-
|
|
23
|
+
isMultiLine,
|
|
24
|
+
}: DataGridCellContainerProps & DataGridErrorRenderProps<any> & { isMultiLine?: boolean }) => {
|
|
24
25
|
const error = get(errors, field)
|
|
25
26
|
const hasError = !!error
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
|
-
<div
|
|
29
|
+
<div
|
|
30
|
+
className={clx("group/container relative w-full", {
|
|
31
|
+
"h-full": !isMultiLine,
|
|
32
|
+
})}
|
|
33
|
+
>
|
|
29
34
|
<div
|
|
30
35
|
className={clx(
|
|
31
|
-
"bg-ui-bg-base group/cell relative flex
|
|
36
|
+
"bg-ui-bg-base group/cell relative flex w-full gap-x-2 px-4 py-2.5 outline-none",
|
|
32
37
|
{
|
|
38
|
+
"h-full items-center": !isMultiLine,
|
|
39
|
+
"items-start": isMultiLine,
|
|
33
40
|
"bg-ui-tag-red-bg text-ui-tag-red-text":
|
|
34
41
|
hasError && !isAnchor && !isSelected && !isDragSelected,
|
|
35
42
|
"ring-ui-bg-interactive ring-2 ring-inset": isAnchor,
|
|
@@ -54,7 +61,12 @@ export const DataGridCellContainer = ({
|
|
|
54
61
|
)
|
|
55
62
|
}}
|
|
56
63
|
/>
|
|
57
|
-
<div
|
|
64
|
+
<div
|
|
65
|
+
className={clx("relative z-[1] flex w-full", {
|
|
66
|
+
"h-full items-center justify-center": !isMultiLine,
|
|
67
|
+
"items-start": isMultiLine,
|
|
68
|
+
})}
|
|
69
|
+
>
|
|
58
70
|
<RenderChildren isAnchor={isAnchor} placeholder={placeholder}>
|
|
59
71
|
{children}
|
|
60
72
|
</RenderChildren>
|
|
@@ -9,24 +9,37 @@ type DataGridReadonlyCellProps<TData, TValue = any> = PropsWithChildren<
|
|
|
9
9
|
DataGridCellProps<TData, TValue>
|
|
10
10
|
> & {
|
|
11
11
|
color?: "muted" | "normal"
|
|
12
|
+
isMultiLine?: boolean
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const DataGridReadonlyCell = <TData, TValue = any>({
|
|
15
16
|
context,
|
|
16
17
|
color = "muted",
|
|
17
18
|
children,
|
|
19
|
+
isMultiLine = false,
|
|
18
20
|
}: DataGridReadonlyCellProps<TData, TValue>) => {
|
|
19
21
|
const { rowErrors } = useDataGridCellError({ context })
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
24
|
<div
|
|
23
25
|
className={clx(
|
|
24
|
-
"txt-compact-small text-ui-fg-subtle flex
|
|
26
|
+
"txt-compact-small text-ui-fg-subtle flex w-full cursor-not-allowed justify-between overflow-hidden px-4 py-2.5 outline-none",
|
|
25
27
|
color === "muted" && "bg-ui-bg-subtle",
|
|
26
|
-
color === "normal" && "bg-ui-bg-base"
|
|
28
|
+
color === "normal" && "bg-ui-bg-base",
|
|
29
|
+
{
|
|
30
|
+
"h-full items-center": !isMultiLine,
|
|
31
|
+
"items-start": isMultiLine,
|
|
32
|
+
}
|
|
27
33
|
)}
|
|
28
34
|
>
|
|
29
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
className={clx("flex-1", {
|
|
37
|
+
truncate: !isMultiLine,
|
|
38
|
+
"whitespace-pre-wrap break-words": isMultiLine,
|
|
39
|
+
})}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
30
43
|
<DataGridRowErrorIndicator rowErrors={rowErrors} />
|
|
31
44
|
</div>
|
|
32
45
|
)
|
|
@@ -15,7 +15,11 @@ import {
|
|
|
15
15
|
getCoreRowModel,
|
|
16
16
|
useReactTable,
|
|
17
17
|
} from "@tanstack/react-table"
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
VirtualItem,
|
|
20
|
+
Virtualizer,
|
|
21
|
+
useVirtualizer,
|
|
22
|
+
} from "@tanstack/react-virtual"
|
|
19
23
|
import React, {
|
|
20
24
|
CSSProperties,
|
|
21
25
|
ReactNode,
|
|
@@ -188,6 +192,12 @@ export const DataGridRoot = <
|
|
|
188
192
|
count: effectiveRowCount,
|
|
189
193
|
estimateSize: () => ROW_HEIGHT,
|
|
190
194
|
getScrollElement: () => containerRef.current,
|
|
195
|
+
// Measure actual row heights for dynamic sizing (disabled in Firefox due to measurement issues). Taken from Tanstack
|
|
196
|
+
measureElement:
|
|
197
|
+
typeof window !== "undefined" &&
|
|
198
|
+
navigator.userAgent.indexOf("Firefox") === -1
|
|
199
|
+
? (element) => element?.getBoundingClientRect().height
|
|
200
|
+
: undefined,
|
|
191
201
|
overscan: 5,
|
|
192
202
|
rangeExtractor: (range) => {
|
|
193
203
|
const toRender = new Set(
|
|
@@ -763,6 +773,7 @@ export const DataGridRoot = <
|
|
|
763
773
|
row={row}
|
|
764
774
|
rowIndex={rowIndex}
|
|
765
775
|
virtualRow={virtualRow}
|
|
776
|
+
rowVirtualizer={rowVirtualizer}
|
|
766
777
|
flatColumns={flatColumns}
|
|
767
778
|
virtualColumns={virtualColumns}
|
|
768
779
|
anchor={anchor}
|
|
@@ -937,11 +948,11 @@ const DataGridCell = <TData,>({
|
|
|
937
948
|
data-row-index={rowIndex}
|
|
938
949
|
data-column-index={columnIndex}
|
|
939
950
|
className={clx(
|
|
940
|
-
"relative flex items-
|
|
951
|
+
"relative flex items-stretch border-b border-r p-0 outline-none"
|
|
941
952
|
)}
|
|
942
953
|
tabIndex={-1}
|
|
943
954
|
>
|
|
944
|
-
<div className="relative
|
|
955
|
+
<div className="relative w-full">
|
|
945
956
|
{flexRender(cell.column.columnDef.cell, {
|
|
946
957
|
...cell.getContext(),
|
|
947
958
|
columnIndex,
|
|
@@ -967,6 +978,7 @@ type DataGridRowProps<TData> = {
|
|
|
967
978
|
row: Row<TData>
|
|
968
979
|
rowIndex: number
|
|
969
980
|
virtualRow: VirtualItem
|
|
981
|
+
rowVirtualizer: Virtualizer<HTMLDivElement, Element>
|
|
970
982
|
virtualPaddingLeft?: number
|
|
971
983
|
virtualPaddingRight?: number
|
|
972
984
|
virtualColumns: VirtualItem[]
|
|
@@ -980,6 +992,7 @@ const DataGridRow = <TData,>({
|
|
|
980
992
|
row,
|
|
981
993
|
rowIndex,
|
|
982
994
|
virtualRow,
|
|
995
|
+
rowVirtualizer,
|
|
983
996
|
virtualPaddingLeft,
|
|
984
997
|
virtualPaddingRight,
|
|
985
998
|
virtualColumns,
|
|
@@ -994,10 +1007,12 @@ const DataGridRow = <TData,>({
|
|
|
994
1007
|
<div
|
|
995
1008
|
role="row"
|
|
996
1009
|
aria-rowindex={virtualRow.index}
|
|
1010
|
+
data-index={virtualRow.index}
|
|
1011
|
+
ref={(node) => rowVirtualizer.measureElement(node)}
|
|
997
1012
|
style={{
|
|
998
1013
|
transform: `translateY(${virtualRow.start}px)`,
|
|
999
1014
|
}}
|
|
1000
|
-
className="bg-ui-bg-subtle txt-compact-small absolute flex h-10 w-full"
|
|
1015
|
+
className="bg-ui-bg-subtle txt-compact-small absolute flex min-h-10 w-full"
|
|
1001
1016
|
>
|
|
1002
1017
|
{virtualPaddingLeft ? (
|
|
1003
1018
|
<div
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clx } from "@medusajs/ui"
|
|
2
|
-
import { useEffect, useState } from "react"
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react"
|
|
3
3
|
import { Controller, ControllerRenderProps } from "react-hook-form"
|
|
4
4
|
|
|
5
5
|
import { useCombinedRefs } from "../../../hooks/use-combined-refs"
|
|
@@ -7,9 +7,17 @@ import { useDataGridCell, useDataGridCellError } from "../hooks"
|
|
|
7
7
|
import { DataGridCellProps, InputProps } from "../types"
|
|
8
8
|
import { DataGridCellContainer } from "./data-grid-cell-container"
|
|
9
9
|
|
|
10
|
+
type DataGridTextCellProps<TData, TValue = any> = DataGridCellProps<
|
|
11
|
+
TData,
|
|
12
|
+
TValue
|
|
13
|
+
> & {
|
|
14
|
+
isMultiLine?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
export const DataGridTextCell = <TData, TValue = any>({
|
|
11
18
|
context,
|
|
12
|
-
|
|
19
|
+
isMultiLine = false,
|
|
20
|
+
}: DataGridTextCellProps<TData, TValue>) => {
|
|
13
21
|
const { field, control, renderProps } = useDataGridCell({
|
|
14
22
|
context,
|
|
15
23
|
})
|
|
@@ -23,8 +31,12 @@ export const DataGridTextCell = <TData, TValue = any>({
|
|
|
23
31
|
name={field}
|
|
24
32
|
render={({ field }) => {
|
|
25
33
|
return (
|
|
26
|
-
<DataGridCellContainer
|
|
27
|
-
|
|
34
|
+
<DataGridCellContainer
|
|
35
|
+
{...container}
|
|
36
|
+
{...errorProps}
|
|
37
|
+
isMultiLine={isMultiLine}
|
|
38
|
+
>
|
|
39
|
+
<Inner field={field} inputProps={input} isMultiLine={isMultiLine} />
|
|
28
40
|
</DataGridCellContainer>
|
|
29
41
|
)
|
|
30
42
|
}}
|
|
@@ -35,37 +47,95 @@ export const DataGridTextCell = <TData, TValue = any>({
|
|
|
35
47
|
const Inner = ({
|
|
36
48
|
field,
|
|
37
49
|
inputProps,
|
|
50
|
+
isMultiLine,
|
|
38
51
|
}: {
|
|
39
52
|
field: ControllerRenderProps<any, string>
|
|
40
53
|
inputProps: InputProps
|
|
54
|
+
isMultiLine: boolean
|
|
41
55
|
}) => {
|
|
42
56
|
const { onChange: _, onBlur, ref, value, ...rest } = field
|
|
43
57
|
const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps
|
|
44
58
|
|
|
45
59
|
const [localValue, setLocalValue] = useState(value)
|
|
60
|
+
const textareaRef = useRef<HTMLTextAreaElement>(null)
|
|
46
61
|
|
|
47
62
|
useEffect(() => {
|
|
48
63
|
setLocalValue(value)
|
|
49
64
|
}, [value])
|
|
50
65
|
|
|
51
66
|
const combinedRefs = useCombinedRefs(inputRef, ref)
|
|
67
|
+
const textareaCombinedRefs = useCombinedRefs(inputRef, ref, textareaRef)
|
|
68
|
+
|
|
69
|
+
const adjustTextareaHeight = useCallback(() => {
|
|
70
|
+
const textarea = textareaRef.current
|
|
71
|
+
if (textarea) {
|
|
72
|
+
// Reset height to 0 to get accurate scrollHeight
|
|
73
|
+
textarea.style.height = "0px"
|
|
74
|
+
// Set the height to match content (minimum 24px for min visible height)
|
|
75
|
+
const newHeight = Math.max(textarea.scrollHeight, 24)
|
|
76
|
+
textarea.style.height = `${newHeight}px`
|
|
77
|
+
}
|
|
78
|
+
}, [])
|
|
79
|
+
|
|
80
|
+
// Adjust height when value changes
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (isMultiLine) {
|
|
83
|
+
adjustTextareaHeight()
|
|
84
|
+
}
|
|
85
|
+
}, [localValue, isMultiLine, adjustTextareaHeight])
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (isMultiLine) {
|
|
89
|
+
// Immediate adjustment
|
|
90
|
+
adjustTextareaHeight()
|
|
91
|
+
// Delayed adjustment to handle any layout shifts
|
|
92
|
+
const timeoutId = setTimeout(adjustTextareaHeight, 50)
|
|
93
|
+
return () => clearTimeout(timeoutId)
|
|
94
|
+
}
|
|
95
|
+
}, [isMultiLine, adjustTextareaHeight])
|
|
96
|
+
|
|
97
|
+
if (isMultiLine) {
|
|
98
|
+
return (
|
|
99
|
+
<textarea
|
|
100
|
+
className={clx(
|
|
101
|
+
"txt-compact-small text-ui-fg-subtle flex w-full cursor-pointer bg-transparent outline-none",
|
|
102
|
+
"focus:cursor-text",
|
|
103
|
+
"resize-none overflow-hidden py-2"
|
|
104
|
+
)}
|
|
105
|
+
autoComplete="off"
|
|
106
|
+
tabIndex={-1}
|
|
107
|
+
value={localValue ?? ""}
|
|
108
|
+
onChange={(e) => {
|
|
109
|
+
setLocalValue(e.target.value)
|
|
110
|
+
adjustTextareaHeight()
|
|
111
|
+
}}
|
|
112
|
+
ref={textareaCombinedRefs}
|
|
113
|
+
onBlur={() => {
|
|
114
|
+
onBlur()
|
|
115
|
+
onInputBlur()
|
|
116
|
+
onChange(localValue, value)
|
|
117
|
+
}}
|
|
118
|
+
{...input}
|
|
119
|
+
{...rest}
|
|
120
|
+
/>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
52
123
|
|
|
53
124
|
return (
|
|
54
125
|
<input
|
|
55
126
|
className={clx(
|
|
56
|
-
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer
|
|
57
|
-
"focus:cursor-text"
|
|
127
|
+
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer bg-transparent outline-none",
|
|
128
|
+
"focus:cursor-text",
|
|
129
|
+
"items-center justify-center"
|
|
58
130
|
)}
|
|
59
131
|
autoComplete="off"
|
|
60
132
|
tabIndex={-1}
|
|
61
|
-
value={localValue}
|
|
133
|
+
value={localValue ?? ""}
|
|
62
134
|
onChange={(e) => setLocalValue(e.target.value)}
|
|
63
135
|
ref={combinedRefs}
|
|
64
136
|
onBlur={() => {
|
|
65
137
|
onBlur()
|
|
66
138
|
onInputBlur()
|
|
67
|
-
|
|
68
|
-
// We propagate the change to the field only when the input is blurred
|
|
69
139
|
onChange(localValue, value)
|
|
70
140
|
}}
|
|
71
141
|
{...input}
|
package/src/i18n/languages.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
uk,
|
|
30
30
|
vi,
|
|
31
31
|
zhCN,
|
|
32
|
+
zhTW,
|
|
32
33
|
} from "date-fns/locale"
|
|
33
34
|
import { Language } from "./types"
|
|
34
35
|
|
|
@@ -213,4 +214,10 @@ export const languages: Language[] = [
|
|
|
213
214
|
ltr: true,
|
|
214
215
|
date_locale: nl,
|
|
215
216
|
},
|
|
217
|
+
{
|
|
218
|
+
code: "zhTW",
|
|
219
|
+
display_name: "繁體中文(臺灣)",
|
|
220
|
+
ltr: true,
|
|
221
|
+
date_locale: zhTW,
|
|
222
|
+
},
|
|
216
223
|
]
|
|
@@ -28,6 +28,7 @@ import ko from "./ko.json"
|
|
|
28
28
|
import nl from "./nl.json"
|
|
29
29
|
import bs from "./bs.json"
|
|
30
30
|
import id from "./id.json"
|
|
31
|
+
import zhTW from "./zhTW.json"
|
|
31
32
|
export default {
|
|
32
33
|
bs: {
|
|
33
34
|
translation: bs,
|
|
@@ -119,4 +120,7 @@ export default {
|
|
|
119
120
|
id: {
|
|
120
121
|
translation: id,
|
|
121
122
|
},
|
|
123
|
+
zhTW: {
|
|
124
|
+
translation: zhTW,
|
|
125
|
+
},
|
|
122
126
|
}
|