@mercurjs/vendor 2.0.2 → 2.1.0-canary.4
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/{[id]-TLZZ53G7.js → [id]-2HRWUMSJ.js} +2 -2
- package/dist/{[id]-DCCF7277.js → [id]-57VYN5YF.js} +2 -3
- package/dist/{[id]-UAOAQVEM.js → [id]-FWI6NCSF.js} +3 -4
- package/dist/{[id]-6WYSWXWC.js → [id]-IQNYVYZU.js} +1 -2
- package/dist/{[id]-LZPT5Y55.js → [id]-KCUHMQWF.js} +1 -2
- package/dist/{[id]-PHS2WYFX.js → [id]-LCMQBEOS.js} +2 -3
- package/dist/{[id]-OGHRZ2VY.js → [id]-LJJPLKJ6.js} +5 -4
- package/dist/{[id]-VKG2WEIR.js → [id]-M3PNP527.js} +1 -2
- package/dist/{[id]-EJAHMOOE.js → [id]-MZOT4GAO.js} +2 -3
- package/dist/{[id]-ENTJSLN2.js → [id]-RKEN7EEY.js} +3 -3
- package/dist/{[province_id]-XGA44S7P.js → [province_id]-2MRNXHKU.js} +1 -2
- package/dist/{add-7ZTE42IE.js → add-BVR3LDPH.js} +2 -2
- package/dist/{add-AKC7LTK3.js → add-W7ATBCKS.js} +2 -3
- package/dist/{add-customer-groups-BRC3DKQ2.js → add-customer-groups-ZZVSJJH3.js} +1 -2
- package/dist/{add-products-ZSULNZVI.js → add-products-PINICUAZ.js} +2 -3
- package/dist/{add-promotions-TNFVT5ST.js → add-promotions-2DFXTDEJ.js} +3 -3
- package/dist/{address-3DSJESKM.js → address-RNB2WQPM.js} +1 -2
- package/dist/{breadcrumb-ZMVHXCOX.js → breadcrumb-A3XUO3R2.js} +2 -3
- package/dist/{breadcrumb-UH7FAYU2.js → breadcrumb-MPXARU5F.js} +1 -2
- package/dist/{breadcrumb-D6QNYOAO.js → breadcrumb-Q5KJBAPD.js} +1 -2
- package/dist/{chunk-JRT2U4UI.js → chunk-2DUMXTKS.js} +107 -18
- package/dist/{chunk-CUMY2VZ5.js → chunk-5LKZCG77.js} +1 -96
- package/dist/{chunk-RV5UTYBG.js → chunk-EQQ3BLQ3.js} +2 -2
- package/dist/{chunk-RMBCBXWD.js → chunk-GQFNE5VL.js} +1 -1
- package/dist/chunk-HFRHHT36.js +98 -0
- package/dist/{chunk-O7E4KQAK.js → chunk-HFW7IIO2.js} +1 -1
- package/dist/{chunk-T7LEJIIM.js → chunk-PT3UQCSN.js} +1 -1
- package/dist/{chunk-LA6XSPQG.js → chunk-QDSNLU6X.js} +287 -309
- package/dist/chunk-TLE6YHGH.js +26 -0
- package/dist/{chunk-ASEVHHCT.js → chunk-UDG47AEE.js} +1 -1
- package/dist/{chunk-573EQEW2.js → chunk-V4SZIX7Q.js} +1 -1
- package/dist/{chunk-7XC7ZRG7.js → chunk-VTHSHOX4.js} +1 -1
- package/dist/{chunk-XZG2HZYW.js → chunk-WFE6CT6M.js} +1 -1
- package/dist/{chunk-N2WKLVUX.js → chunk-XF3W2U3Q.js} +1 -1
- package/dist/{chunk-NYRRRCJS.js → chunk-ZCJ737TR.js} +66 -21
- package/dist/{chunk-FNG7ZA7N.js → chunk-ZCUUV464.js} +1 -1
- package/dist/{collections-2M4RFH4P.js → collections-NNFGWUTW.js} +2 -3
- package/dist/{create-6IRE6AMF.js → create-2BPTTXLB.js} +8 -7
- package/dist/{create-D4F457BD.js → create-GCSVAMEH.js} +1 -2
- package/dist/{create-2TUWGQ2D.js → create-N3WNCW7U.js} +1 -2
- package/dist/{create-QK2SSLZK.js → create-T73PSKIV.js} +3 -4
- package/dist/{create-OF2OZ7EI.js → create-TXBY6W3X.js} +1 -2
- package/dist/{create-IFMEEHN4.js → create-VPG7P53M.js} +2 -3
- package/dist/{create-YITFTHMA.js → create-WY4KXB66.js} +1 -2
- package/dist/{create-3WUTLUJO.js → create-YCOR6HY3.js} +1 -2
- package/dist/{edit-SGEECDCR.js → edit-2QUFOE5S.js} +1 -2
- package/dist/{edit-Z7EZRPUP.js → edit-A5ZBINLU.js} +1 -1
- package/dist/{edit-QRJIWTU2.js → edit-B245OLC7.js} +1 -2
- package/dist/{edit-PIE7Y73J.js → edit-CPVFMQEI.js} +3 -4
- package/dist/{edit-ONSN756P.js → edit-CZOV6HBW.js} +1 -1
- package/dist/{edit-J5SC7GHQ.js → edit-KWSXWWOA.js} +1 -2
- package/dist/{edit-ZEIL7EQW.js → edit-QYKH2ZZA.js} +1 -2
- package/dist/{edit-UQAQVEUI.js → edit-U5VL2UQY.js} +4 -5
- package/dist/{edit-stocks-and-prices-543AYFDJ.js → edit-stocks-and-prices-Y233WVZ3.js} +1 -2
- package/dist/{fulfillment-5LNFBSBS.js → fulfillment-FBF3MITY.js} +1 -2
- package/dist/{fulfillment-providers-U7Z7QMOQ.js → fulfillment-providers-Y2YOREHX.js} +2 -3
- package/dist/index.css +32 -26
- package/dist/index.js +86 -87
- package/dist/invite-G7WOO5RZ.js +368 -0
- package/dist/{invite-SI2KIPWI.js → invite-Y2TACGCW.js} +3 -5
- package/dist/{login-QDS5UXKV.js → login-JU7R2RNN.js} +1 -2
- package/dist/{media-RDXCLPKQ.js → media-TXY3WBR3.js} +2 -2
- package/dist/{metadata-7JKDCVYY.js → metadata-7RA6MXW7.js} +1 -2
- package/dist/{metadata-ZV5RYLKR.js → metadata-GSBDSRNM.js} +1 -2
- package/dist/{metadata-X4UIPNL6.js → metadata-JXRXW6UQ.js} +1 -2
- package/dist/{metadata-W5XIPFVU.js → metadata-QM4UGMX5.js} +1 -2
- package/dist/{metadata-UKBRUFH2.js → metadata-RODKLIDO.js} +1 -2
- package/dist/onboarding-VF7EQAAA.js +893 -0
- package/dist/{orders-IAL3JNPU.js → orders-HKUVFCTQ.js} +2 -3
- package/dist/pages/index.d.ts +140 -140
- package/dist/pages/index.js +14 -13
- package/dist/{payment-details-ATUYMVJX.js → payment-details-VWR2S32W.js} +1 -2
- package/dist/{pricing-RBESFX5P.js → pricing-6UZ6SXIE.js} +1 -2
- package/dist/{product-tags-W4BL6RWV.js → product-tags-YXVFIPGQ.js} +3 -4
- package/dist/{product-variant-detail-KU5OCL7E.js → product-variant-detail-O2NOUFFC.js} +1 -2
- package/dist/{products-3VVYJUH7.js → products-3NIIOQBB.js} +2 -3
- package/dist/{products-YYLVCOOY.js → products-Z6MD665K.js} +10 -9
- package/dist/{professional-details-6Y5K6GBL.js → professional-details-SJ4AF5TM.js} +1 -2
- package/dist/{promotions-NBJTFP6N.js → promotions-PJABWGCP.js} +4 -4
- package/dist/{register-ZLE6MNPF.js → register-PSBM4NCS.js} +3 -4
- package/dist/{reset-password-PLCDLFL4.js → reset-password-4RE5TXQ5.js} +1 -1
- package/dist/{sales-channels-UIDLFCX6.js → sales-channels-2OVI6RTV.js} +3 -2
- package/dist/{sales-channels-UWPEFKAO.js → sales-channels-BKOYQXVC.js} +3 -2
- package/dist/{settings-5MNWE5CR.js → settings-F6KJREHK.js} +3 -4
- package/dist/{shipping-profiles-O7XB2DTE.js → shipping-profiles-AQMJSXDB.js} +1 -2
- package/dist/{stock-VJAAYYW5.js → stock-4G4WQIR7.js} +1 -2
- package/dist/{stock-2CGEFBXO.js → stock-NJADHNRP.js} +1 -2
- package/dist/{store-ZBSMNWFT.js → store-HJGETE33.js} +225 -105
- package/dist/{store-closure-43FK32AQ.js → store-closure-QPK4LBBZ.js} +35 -19
- package/dist/{store-select-Q2HE572R.js → store-select-XS2APMBI.js} +1 -2
- package/dist/{team-ZLZJJWIY.js → team-DZ5CV3LG.js} +1 -2
- package/package.json +5 -5
- package/dist/chunk-STBCWNZQ.js +0 -57
- package/dist/invite-P6HTOEIV.js +0 -301
- package/dist/onboarding-DLIBZRKE.js +0 -873
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDate
|
|
3
|
+
} from "./chunk-LRD242C7.js";
|
|
4
|
+
|
|
5
|
+
// src/components/data-table/helpers/general/use-data-table-date-filters.tsx
|
|
6
|
+
import { createDataTableFilterHelper } from "@medusajs/ui";
|
|
7
|
+
import { subDays, subMonths } from "date-fns";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
10
|
+
var filterHelper = createDataTableFilterHelper();
|
|
11
|
+
var useDateFilterOptions = () => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const today = useMemo(() => {
|
|
14
|
+
const date = /* @__PURE__ */ new Date();
|
|
15
|
+
date.setHours(0, 0, 0, 0);
|
|
16
|
+
return date;
|
|
17
|
+
}, []);
|
|
18
|
+
return useMemo(() => {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
label: t("filters.date.today"),
|
|
22
|
+
value: {
|
|
23
|
+
$gte: today.toISOString()
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: t("filters.date.lastSevenDays"),
|
|
28
|
+
value: {
|
|
29
|
+
$gte: subDays(today, 7).toISOString()
|
|
30
|
+
// 7 days ago
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: t("filters.date.lastThirtyDays"),
|
|
35
|
+
value: {
|
|
36
|
+
$gte: subDays(today, 30).toISOString()
|
|
37
|
+
// 30 days ago
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: t("filters.date.lastNinetyDays"),
|
|
42
|
+
value: {
|
|
43
|
+
$gte: subDays(today, 90).toISOString()
|
|
44
|
+
// 90 days ago
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: t("filters.date.lastTwelveMonths"),
|
|
49
|
+
value: {
|
|
50
|
+
$gte: subMonths(today, 12).toISOString()
|
|
51
|
+
// 12 months ago
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
}, [today, t]);
|
|
56
|
+
};
|
|
57
|
+
var useDataTableDateFilters = (disableRangeOption) => {
|
|
58
|
+
const { t } = useTranslation();
|
|
59
|
+
const { getFullDate } = useDate();
|
|
60
|
+
const dateFilterOptions = useDateFilterOptions();
|
|
61
|
+
const rangeOptions = useMemo(() => {
|
|
62
|
+
if (disableRangeOption) {
|
|
63
|
+
return {
|
|
64
|
+
disableRangeOption: true
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
rangeOptionStartLabel: t("filters.date.starting"),
|
|
69
|
+
rangeOptionEndLabel: t("filters.date.ending"),
|
|
70
|
+
rangeOptionLabel: t("filters.date.custom"),
|
|
71
|
+
options: dateFilterOptions
|
|
72
|
+
};
|
|
73
|
+
}, [disableRangeOption, t, dateFilterOptions]);
|
|
74
|
+
return useMemo(() => {
|
|
75
|
+
return [
|
|
76
|
+
filterHelper.accessor("created_at", {
|
|
77
|
+
type: "date",
|
|
78
|
+
label: t("fields.createdAt"),
|
|
79
|
+
format: "date",
|
|
80
|
+
formatDateValue: (date) => getFullDate({ date }),
|
|
81
|
+
options: dateFilterOptions,
|
|
82
|
+
...rangeOptions
|
|
83
|
+
}),
|
|
84
|
+
filterHelper.accessor("updated_at", {
|
|
85
|
+
type: "date",
|
|
86
|
+
label: t("fields.updatedAt"),
|
|
87
|
+
format: "date",
|
|
88
|
+
formatDateValue: (date) => getFullDate({ date }),
|
|
89
|
+
options: dateFilterOptions,
|
|
90
|
+
...rangeOptions
|
|
91
|
+
})
|
|
92
|
+
];
|
|
93
|
+
}, [t, dateFilterOptions, getFullDate, rangeOptions]);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
useDataTableDateFilters
|
|
98
|
+
};
|