@teamco/ischeduler-core 2.0.14 → 2.0.15
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/handlers/day.handler.d.ts +2 -1
- package/dist/handlers/day.handler.d.ts.map +1 -1
- package/dist/handlers/month.handler.d.ts +3 -1
- package/dist/handlers/month.handler.d.ts.map +1 -1
- package/dist/handlers/week.handler.d.ts +3 -1
- package/dist/handlers/week.handler.d.ts.map +1 -1
- package/dist/handlers/year.handler.d.ts +3 -1
- package/dist/handlers/year.handler.d.ts.map +1 -1
- package/dist/handlers.d.ts +8 -7
- package/dist/handlers.d.ts.map +1 -1
- package/dist/hooks/useColumnsToggle.d.ts +3 -3
- package/dist/hooks/useColumnsToggle.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en-US.d.ts +1 -1
- package/dist/i18n/locales/en-US.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4 -4
- package/dist/provider/SchedulerContext.d.ts +3 -3
- package/dist/provider/SchedulerContext.d.ts.map +1 -1
- package/dist/provider/SchedulerProvider.d.ts +3 -3
- package/dist/provider/SchedulerProvider.d.ts.map +1 -1
- package/dist/types/index.d.ts +12 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/colors.util.d.ts.map +1 -1
- package/dist/utils/form.util.d.ts +1 -1
- package/dist/utils/form.util.d.ts.map +1 -1
- package/dist/utils/format.util.d.ts +2 -2
- package/dist/utils/format.util.d.ts.map +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/types/less.d.ts +0 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { TFn } from '../i18n';
|
|
2
3
|
export declare const dayHandler: (durationValue: number, extender: string, setOccurs: Dispatch<SetStateAction<string>>, t: TFn) => void;
|
|
3
4
|
//# sourceMappingURL=day.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"day.handler.d.ts","sourceRoot":"","sources":["day.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"day.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/day.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAGnC,eAAO,MAAM,UAAU,GACrB,eAAe,MAAM,EACrB,UAAU,MAAM,EAChB,WAAW,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAC3C,GAAG,GAAG,SAOP,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { TFn } from '../i18n';
|
|
3
|
+
import { IScheduler } from '../types';
|
|
2
4
|
export declare const monthHandler: (durationValue: number, scheduler: IScheduler, setOccurs: Dispatch<SetStateAction<string>>, t: TFn) => void;
|
|
3
5
|
//# sourceMappingURL=month.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"month.handler.d.ts","sourceRoot":"","sources":["month.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"month.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/month.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,YAAY,GACvB,eAAe,MAAM,EACrB,WAAW,UAAU,EACrB,WAAW,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAC3C,GAAG,GAAG,SAsBP,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { TFn } from '../i18n';
|
|
3
|
+
import { IScheduler } from '../types';
|
|
2
4
|
export declare const weekHandler: (durationValue: number, scheduler: IScheduler, setOccurs: Dispatch<SetStateAction<string>>, t: TFn) => void;
|
|
3
5
|
//# sourceMappingURL=week.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"week.handler.d.ts","sourceRoot":"","sources":["week.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"week.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/week.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,WAAW,GACtB,eAAe,MAAM,EACrB,WAAW,UAAU,EACrB,WAAW,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAC3C,GAAG,GAAG,SAkBP,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { TFn } from '../i18n';
|
|
3
|
+
import { IScheduler } from '../types';
|
|
2
4
|
export declare const yearHandler: (durationValue: number, scheduler: IScheduler, setOccurs: Dispatch<SetStateAction<string>>, t: TFn) => void;
|
|
3
5
|
//# sourceMappingURL=year.handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"year.handler.d.ts","sourceRoot":"","sources":["year.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"year.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/year.handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,WAAW,GACtB,eAAe,MAAM,EACrB,WAAW,UAAU,EACrB,WAAW,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAC3C,GAAG,GAAG,SA2BP,CAAC"}
|
package/dist/handlers.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import { IScheduler, TSchedulerDuration } from './types';
|
|
4
|
+
import { TFn } from './i18n';
|
|
5
|
+
import { IFormInstance } from './utils/form.util';
|
|
5
6
|
export declare const handleMsg: (singular: string, plural: string, value: number, t: TFn) => string;
|
|
6
7
|
export declare const handleDurationValueChange: (duration: TSchedulerDuration, scheduler: IScheduler, setOccurs: Dispatch<SetStateAction<string>>, t: TFn, extender?: string) => void;
|
|
7
8
|
export declare const handleChangeStartDate: (value: Dayjs, setStartAt: Dispatch<SetStateAction<string | null>>) => void;
|
|
8
9
|
export declare const handleSelectWeeklyDay: (durationValue: number, scheduler: IScheduler, setOccurs: Dispatch<SetStateAction<string>>, t: TFn, extra?: {
|
|
9
|
-
msg?: string
|
|
10
|
-
}
|
|
10
|
+
msg?: string;
|
|
11
|
+
}) => void;
|
|
11
12
|
export declare const handleMultipleDurations: (values: string[] | undefined, t: TFn) => string;
|
|
12
|
-
export
|
|
13
|
+
export type THandleSchedulerForm = {
|
|
13
14
|
disabled: boolean;
|
|
14
15
|
formRef: IFormInstance;
|
|
15
16
|
entity: IScheduler;
|
package/dist/handlers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["handlers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAMtD,OAAO,EAAiC,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,EAAE,GAAG,GAAG,WAMhF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,UAAU,kBAAkB,EAC5B,WAAW,UAAU,EACrB,WAAW,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAC3C,GAAG,GAAG,EACN,WAAU,MAAW,SAYtB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,KAAK,EACZ,YAAY,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,SAcpD,CAAC;AAEF,eAAO,MAAM,qB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import { ICommonDataType } from '../types';
|
|
3
3
|
export interface ISelectItemProps {
|
|
4
4
|
label: string;
|
|
5
5
|
value: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type TColumn = ICommonDataType & {
|
|
9
9
|
concealable?: boolean;
|
|
10
10
|
title?: React.ReactNode;
|
|
11
11
|
label?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColumnsToggle.d.ts","sourceRoot":"","sources":["useColumnsToggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,
|
|
1
|
+
{"version":3,"file":"useColumnsToggle.d.ts","sourceRoot":"","sources":["../../src/hooks/useColumnsToggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,OAAO,GAAG,eAAe,GAAG;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAeF,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,EAAE,EAAE,iBAAiB,MAAM,EAAE,KAAG,OAAO,EAInF,CAAC;AAEN,eAAO,MAAM,gBAAgB,GAC3B,SAAS,OAAO,EAAE,EAClB,kBAAiB,MAAM,EAAO,KAC7B;IACD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnE,eAAe,EAAE,OAAO,EAAE,CAAC;CAqC5B,CAAC"}
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type SchedulerTranslations = Record<string, string>;
|
|
2
|
+
export type TFn = (key: string, params?: Record<string, string | number>) => string;
|
|
3
3
|
export declare const defaultTranslations: SchedulerTranslations;
|
|
4
4
|
export declare const createTranslationFn: (translations: SchedulerTranslations) => TFn;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/i18n/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAEpF,eAAO,MAAM,mBAAmB,EAAE,qBAA4B,CAAC;AAE/D,eAAO,MAAM,mBAAmB,GAAI,cAAc,qBAAqB,KAAG,GAMzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["en-US.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,QAAA,MAAM,IAAI,EAAE,qBA2FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/en-US.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,QAAA,MAAM,IAAI,EAAE,qBA2FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`dayjs`);c=s(c);let l=require(`react`);l=s(l);let u=require(`react/jsx-runtime`);var d=(e,t)=>Object.keys(e).find(n=>e[n]===t),f=function(e){return e.ACTIVE=`ACTIVE`,e.DEACTIVATED=`DEACTIVATED`,e.DELETED=`DELETED`,e.PROCESSING=`PROCESSING`,e.PENDING=`PENDING`,e.APPROVED=`APPROVED`,e.PUBLISHED=`PUBLISHED`,e}({}),p=function(e){return e.HOUR=`Hour`,e.DAY=`Day`,e.WEEK=`Week`,e.MONTH=`Month`,e.YEAR=`Year`,e.FOREVER=`Forever`,e}({}),m=`price`,h=`duration`,g=`discount`,_=`trialPeriod`,v=function(e){return e.USD=`USD`,e.EUR=`EUR`,e}({}),y=function(e){return e.PERCENT=`Percent`,e.FIXED=`Fixed`,e}({}),b={PERCENT:`%`,FIXED:v},x=function(e){return e.DATE=`Date`,e.NUMBER=`Number`,e.FOREVER=`Forever`,e}({}),S=function(e){return e.SUNDAY=`Sunday`,e.MONDAY=`Monday`,e.TUESDAY=`Tuesday`,e.WEDNESDAY=`Wednesday`,e.THURSDAY=`Thursday`,e.FRIDAY=`Friday`,e.SATURDAY=`Saturday`,e}({}),ee=function(e){return e.JANUARY=`January`,e.FEBRUARY=`February`,e.MARCH=`March`,e.APRIL=`April`,e.MAY=`May`,e.JUNE=`June`,e.JULY=`July`,e.AUGUST=`AUGUST`,e.SEPTEMBER=`September`,e.OCTOBER=`October`,e.NOVEMBER=`November`,e.DECEMBER=`December`,e}({}),C=function(e){return e.FIRST=`First`,e.SECOND=`Second`,e.THIRD=`Third`,e.FOURTH=`Fourth`,e.LAST=`Last`,e}({}),w=function(e){return e.SALE=`sale`,e.DISCOUNT=`discount`,e.TRIAL_DISCOUNT=`trialDiscount`,e}({}),te=function(e){return e.MONTH=`monthly`,e.YEAR=`yearly`,e.WEEK=`weekly`,e.DAY=`daily`,e}({}),ne=`scheduler`,T=[x.DATE,x.NUMBER,x.FOREVER],re=1,ie=5,E={duration:{type:`MONTH`,period:7},repeat:{weekly:{days:[d(S,Object.values(S)[1])]},monthly:{weekDay:`SECOND`,monthDay:2,type:`PERIOD`},yearly:{months:[`JANUARY`]}},range:{startedAt:(0,c.default)(new Date),endReason:{type:T[2],expiredAt:null}},status:f.PROCESSING},D={...E,type:w.SALE,[g]:null},O={...E,type:w.DISCOUNT,[g]:{type:`PERCENT`,value:1}},k={scheduler:`Scheduler`,"scheduler.info":`Scheduler Info`,"scheduler.header.title":`{{entity}} Scheduler ({{count}})`,"scheduler.result":`Occurs <strong>{{occurs}}</strong>, starting {{startAt}}.`,"scheduler.startedAt":`Started at`,"scheduler.updatedAt":`Updated at`,"scheduler.status":`Status`,"scheduler.duration":`Repeat Every`,"scheduler.occurrences":`Occurrences`,"scheduler.weekdays.sunday":`Sunday`,"scheduler.weekdays.monday":`Monday`,"scheduler.weekdays.tuesday":`Tuesday`,"scheduler.weekdays.wednesday":`Wednesday`,"scheduler.weekdays.thursday":`Thursday`,"scheduler.weekdays.friday":`Friday`,"scheduler.weekdays.saturday":`Saturday`,"scheduler.weekdays.short.sunday":`Sun`,"scheduler.weekdays.short.monday":`Mon`,"scheduler.weekdays.short.tuesday":`Tue`,"scheduler.weekdays.short.wednesday":`Wed`,"scheduler.weekdays.short.thursday":`Thu`,"scheduler.weekdays.short.friday":`Fri`,"scheduler.weekdays.short.saturday":`Sat`,"scheduler.duration.end":`End Reason`,"scheduler.duration.endDate":`End Date`,"scheduler.duration.end.day":`On this day`,"scheduler.duration.end.after":`After`,"scheduler.duration.end.no":`No end day`,"scheduler.separator.and":` and`,"scheduler.separator.on":`on`,"scheduler.separator.day":`day`,"scheduler.separator.every":`every`,"scheduler.separator.of":`of`,"scheduler.separator.the":`the`,"scheduler.day.first":`First`,"scheduler.day.second":`Second`,"scheduler.day.third":`Third`,"scheduler.day.fourth":`Fourth`,"scheduler.day.last":`Last`,"scheduler.weekday":`Weekday`,"scheduler.weekend":`Weekend Day`,"scheduler.day":`Day`,"scheduler.days":`Days`,"scheduler.week":`Week`,"scheduler.weeks":`Weeks`,"scheduler.year":`Year`,"scheduler.years":`Years`,"scheduler.monthDay":`Month Day`,"scheduler.month":`Month`,"scheduler.months":`Months`,"scheduler.months.january":`January`,"scheduler.months.february":`February`,"scheduler.months.march":`March`,"scheduler.months.april":`April`,"scheduler.months.may":`May`,"scheduler.months.june":`June`,"scheduler.months.july":`July`,"scheduler.months.august":`August`,"scheduler.months.september":`September`,"scheduler.months.october":`October`,"scheduler.months.november":`November`,"scheduler.months.december":`December`,"scheduler.months.short.january":`Jan`,"scheduler.months.short.february":`Feb`,"scheduler.months.short.march":`Mar`,"scheduler.months.short.april":`Apr`,"scheduler.months.short.may":`May`,"scheduler.months.short.june":`Jun`,"scheduler.months.short.july":`Jul`,"scheduler.months.short.august":`Aug`,"scheduler.months.short.september":`Sep`,"scheduler.months.short.october":`Oct`,"scheduler.months.short.november":`Nov`,"scheduler.months.short.december":`Dec`,"scheduler.actions.manage":`Manage Scheduler`,"scheduler.meta.assignedTo":`Assigned To`,"scheduler.meta.duration":`Duration`,"scheduler.meta.discount":`Discount`,"scheduler.meta.period":`Period`,"scheduler.limited":`The Scheduler is limited to: {{limit}}`,"scheduler.info.helper":`Set the scheduler to set a sale period.`,"table.actions":`Actions`,"actions.edit":`Edit`,"actions.delete":`Delete`,"actions.save":`Save`,"actions.update":`Update`,"actions.cancel":`Cancel`,"actions.confirm.delete":`Are you sure you want to delete this scheduler?`,"table.hideColumns":`Hide Columns`,"toolbar.refresh":`Refresh`},A=e=>(t,n)=>{let r=e[t]??k[t]??t;return n?r.replace(/\{\{(\w+)}}/g,(e,t)=>String(n[t]??``)):r},ae=(e,...t)=>[...e&&e.length>0?[...e]:[],...t],oe=(e,t=!0)=>({required:t,message:`${e} is required`}),se=(e,t=`input`)=>t===`select`?`Select ${e}`:`Enter ${e}`,j=(e,t)=>t.includes(e),M=(e,t,n)=>{let r=Array.isArray(t)?t:[t],i=e.getFieldsValue(!0),a=i;for(let e=0;e<r.length-1;e++){let t=r[e];(a[t]===void 0||a[t]===null||typeof a[t]!=`object`)&&(a[t]={}),a=a[t]}a[r[r.length-1]]=n,e.setFieldsValue(i)},N=(e,t)=>{let n=Array.isArray(t)?t:t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r},P=`YYYY-MM-DD HH:mm`,F=`YYYY-MM-DD`,I=`—`,L=(e,t)=>{try{return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:2}).format(e)}catch{return`${e} ${t}`}},R=e=>(isNaN(new Date(e).getDate())&&(e=parseInt(e?.toString(),10)),new Date(e)),z=e=>e?R(e).toLocaleDateString():`—`,B=e=>e?R(e).toLocaleTimeString():`—`,V=e=>{let t;return e==null||(t=c.default.isDayjs(e)||e?.seconds&&e?.nanoseconds?e.toDate():e),t?`${z(t)} ${B(t)}`:`—`},H=(e,t)=>{let n=t||(0,c.default)().startOf(`day`);return e.isBefore(n,`day`)},U={danger:`#ff4d4f`,disabled:`#d9d9d9`,warning:`#FFBF00`,success:`#52c41a`,tags:{magenta:`magenta`,red:`red`,volcano:`volcano`,orange:`orange`,gold:`gold`,lime:`lime`,green:`green`,cyan:`cyan`,blue:`blue`,geekblue:`geekblue`,purple:`purple`,processing:`processing`,success:`success`,error:`error`,warning:`warning`,default:`default`}},W=(e,t,n,r)=>{n(`${t}${`${r(`scheduler.separator.every`)} ${K(`scheduler.day`,`scheduler.days`,e,r)}`}`)},G=(e,t,n,r)=>{let i=t.repeat?.weekly?.days,a=K(`scheduler.month`,`scheduler.months`,e,r),o=t.repeat?.monthly;if(o?.type===`DAY`)Y(t.duration.period,t,n,r,{msg:a});else if(o?.type===`PERIOD`){let e=r(`scheduler.separator.the`),t=r(`scheduler.separator.of`),s=r(`scheduler.separator.every`),c=o.weekDay;n(`${e} ${c} ${X(i,r)} ${t} ${s} ${a}`)}},ce=(e,t,n,r)=>{let i=t.repeat?.weekly?.days||[],a=K(`scheduler.week`,`scheduler.weeks`,e,r),o=r(`scheduler.separator.day`),s=r(`scheduler.separator.on`),c=r(`scheduler.separator.every`),l=i?.length===7?o:X(i,r);n(e===1?`${c} ${l}`:`${c} ${a} ${s} ${l}`)},le=(e,t,n,r)=>{let i=K(`scheduler.year`,`scheduler.years`,e,r),a=t.repeat?.yearly?.months;if(a){let e=r(`scheduler.separator.every`),o=r(`scheduler.separator.the`),s=r(`scheduler.separator.of`),c=X(a,r),l=X(t.repeat?.weekly?.days,r),u=t.duration?.period>1?` ${s} ${e} ${i}`:``;u=t.repeat?.monthly?.type===`PERIOD`?`${o} ${t.repeat?.monthly?.weekDay} ${l} ${s} ${e} ${c}`+u:`${e} ${c} ${t.repeat?.monthly?.monthDay}`+u,n(u)}},K=(e,t,n,r)=>{let i=`${n} ${r(t)}`;return n===1&&(i=r(e)),i},q=(e,t,n,r,i=``)=>{switch(e.type){case`DAY`:return W(e.period,i,n,r);case`WEEK`:return ce(e.period,t,n,r);case`MONTH`:return G(e.period,t,n,r);case`YEAR`:return le(e.period,t,n,r)}},J=(e,t)=>{let n=(0,c.default)(e);t([n.format(`dddd`),`${n.date()} ${n.format(`MMMM`)} ${n.format(`YYYY`)}`,`at ${n.hour()}:${n.minute()}`].join(`, `))},Y=(e,t,n,r,i)=>{let a=r(`scheduler.separator.day`),o=r(`scheduler.separator.of`),s=r(`scheduler.separator.every`),c=`${a} ${t?.repeat?.monthly?.monthDay} ${o} ${s} `;i?.msg?n(`${c} ${i?.msg}`):q({type:t.duration.type,period:e},t,n,r,c)},X=(e=[],t)=>{let n=t(`scheduler.separator.and`),r=e.join(`, `),i=r.lastIndexOf(`,`);return i===-1?r:r.slice(0,i)+n+r.slice(i+1)},ue=({disabled:e,formRef:t,entity:n,handlers:{onSave:r,setLoading:i,setOpenDrawer:a,setConfigDrawer:o,setOnRefreshDrawer:s},options:{title:c,loading:l,schedulerType:u,isEdit:d,isDirty:f,prefix:m=[],readOnlyFields:h=[],t:g}})=>{if(e)return;let _=Object.keys(p),v=Object.keys(y);i(!0),a(!0);let b=()=>{i(!0),o({size:600,schedulerType:u,durationTypes:_,discountTypes:v,readOnlyFields:h,prefix:m,entity:n,formRef:t,title:c,isEdit:d,isDirty:f,loading:l,onSave:r,disabled:e,t:g}),i(!1)};s(b),b()},Z=(0,l.createContext)(null),de=()=>{let e=(0,l.useContext)(Z);if(!e)throw Error(`useSchedulerContext must be used within a SchedulerProvider`);return e},fe=e=>{let{schedulers:t,loading:n=!1,disabled:r=!1,locale:i,limit:a,onCreate:o,onUpdate:s,onDelete:c,permissions:d,translations:f,children:p}=e,[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)({}),v=(0,l.useMemo)(()=>({...k,...f??{}}),[f]),y=(0,l.useMemo)(()=>A(v),[v]),b=(0,l.useMemo)(()=>({schedulers:t,loading:n,disabled:r,locale:i,limit:a,t:y,permissions:{canCreate:d?.canCreate??!0,canUpdate:d?.canUpdate??!0,canDelete:d?.canDelete??!0},onCreate:o,onUpdate:s,onDelete:c,drawerOpen:m,setDrawerOpen:h,drawerConfig:g,setDrawerConfig:_}),[t,n,r,i,a,y,d,o,s,c,m,g]);return(0,u.jsx)(Z.Provider,{value:b,children:p})},Q=e=>{let t=e.key,n=e.dataIndex;return String(t||n)},pe=e=>{let t=e.title??e.label,n=Q(e);return typeof t==`string`||typeof t==`number`?String(t):n},$=(e,t)=>e.map(e=>({...e,hidden:e.concealable&&!t.includes(Q(e))})),me=(e,t=[])=>{let[n,r]=(0,l.useState)([]),i=(0,l.useRef)(!1),a=(0,l.useMemo)(()=>e.filter(e=>e.concealable).map(e=>({label:pe(e),value:Q(e)})),[e]);return(0,l.useEffect)(()=>{if(!i.current&&a.length>0){let e=new Set(t.map(String));r(a.map(e=>e.value).filter(t=>!e.has(t))),i.current=!0}},[a,t]),{columnsList:a,selectedColumns:n,setSelectedColumns:r,filteredColumns:(0,l.useMemo)(()=>$(e,n),[e,n])}};exports.CDiscountTypeValues=b,exports.CEndReasonTypes=T,exports.CFirstDayIdx=re,exports.CNsDiscount=g,exports.CNsDuration=h,exports.CNsPrice=m,exports.CNsTrial=_,exports.COLORS=U,exports.CScheduler=ne,exports.DEFAULT_DATE_FORMAT=F,exports.DEFAULT_DATE_TIME_FORMAT=P,exports.DEFAULT_DISCOUNT_SCHEDULER=O,exports.DEFAULT_SALE_SCHEDULER=D,exports.DEFAULT_SCHEDULERS_LIMIT=ie,exports.ECurrency=v,exports.EDays=S,exports.EDiscountType=y,exports.EDurationTypes=p,exports.EEndReasonType=x,exports.EMonths=ee,exports.ESchedulerPrefix=w,exports.ESchedulerTypeTransform=te,exports.EStatus=f,exports.EWeekDays=C,exports.NADate=I,exports.SchedulerContext=Z,exports.SchedulerProvider=fe,exports.createTranslationFn=A,exports.defaultTranslations=k,exports.filterOutColumns=$,exports.findFieldValue=N,exports.getDisabledDate=H,exports.getKeyFromEnum=d,exports.handleChangeStartDate=J,exports.handleDurationValueChange=q,exports.handleMsg=K,exports.handleMultipleDurations=X,exports.handleSchedulerForm=ue,exports.handleSelectWeeklyDay=Y,exports.isReadOnlyField=j,exports.mergeNames=ae,exports.numberToCurrency=L,exports.placeholderField=se,exports.requiredField=oe,exports.setNestedDynamicFields=M,exports.tsToDate=z,exports.tsToLocaleDateTime=V,exports.tsToTime=B,exports.useColumnsToggle=me,exports.useSchedulerContext=de;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`dayjs`);c=s(c,1);let l=require(`react`);l=s(l,1);let u=require(`react/jsx-runtime`);var d=(e,t)=>Object.keys(e).find(n=>e[n]===t),f=function(e){return e.ACTIVE=`ACTIVE`,e.DEACTIVATED=`DEACTIVATED`,e.DELETED=`DELETED`,e.PROCESSING=`PROCESSING`,e.PENDING=`PENDING`,e.APPROVED=`APPROVED`,e.PUBLISHED=`PUBLISHED`,e}({}),p=function(e){return e.HOUR=`Hour`,e.DAY=`Day`,e.WEEK=`Week`,e.MONTH=`Month`,e.YEAR=`Year`,e.FOREVER=`Forever`,e}({}),m=`price`,h=`duration`,g=`discount`,_=`trialPeriod`,v=function(e){return e.USD=`USD`,e.EUR=`EUR`,e}({}),y=function(e){return e.PERCENT=`Percent`,e.FIXED=`Fixed`,e}({}),b={PERCENT:`%`,FIXED:v},x=function(e){return e.DATE=`Date`,e.NUMBER=`Number`,e.FOREVER=`Forever`,e}({}),S=function(e){return e.SUNDAY=`Sunday`,e.MONDAY=`Monday`,e.TUESDAY=`Tuesday`,e.WEDNESDAY=`Wednesday`,e.THURSDAY=`Thursday`,e.FRIDAY=`Friday`,e.SATURDAY=`Saturday`,e}({}),ee=function(e){return e.JANUARY=`January`,e.FEBRUARY=`February`,e.MARCH=`March`,e.APRIL=`April`,e.MAY=`May`,e.JUNE=`June`,e.JULY=`July`,e.AUGUST=`AUGUST`,e.SEPTEMBER=`September`,e.OCTOBER=`October`,e.NOVEMBER=`November`,e.DECEMBER=`December`,e}({}),C=function(e){return e.FIRST=`First`,e.SECOND=`Second`,e.THIRD=`Third`,e.FOURTH=`Fourth`,e.LAST=`Last`,e}({}),w=function(e){return e.SALE=`sale`,e.DISCOUNT=`discount`,e.TRIAL_DISCOUNT=`trialDiscount`,e}({}),te=function(e){return e.MONTH=`monthly`,e.YEAR=`yearly`,e.WEEK=`weekly`,e.DAY=`daily`,e}({}),ne=`scheduler`,T=[x.DATE,x.NUMBER,x.FOREVER],re=1,ie=5,E={duration:{type:`MONTH`,period:7},repeat:{weekly:{days:[d(S,Object.values(S)[1])]},monthly:{weekDay:`SECOND`,monthDay:2,type:`PERIOD`},yearly:{months:[`JANUARY`]}},range:{startedAt:(0,c.default)(new Date),endReason:{type:T[2],expiredAt:null}},status:f.PROCESSING},D={...E,type:w.SALE,[g]:null},O={...E,type:w.DISCOUNT,[g]:{type:`PERCENT`,value:1}},k={scheduler:`Scheduler`,"scheduler.info":`Scheduler Info`,"scheduler.header.title":`{{entity}} Scheduler ({{count}})`,"scheduler.result":`Occurs <strong>{{occurs}}</strong>, starting {{startAt}}.`,"scheduler.startedAt":`Started at`,"scheduler.updatedAt":`Updated at`,"scheduler.status":`Status`,"scheduler.duration":`Repeat Every`,"scheduler.occurrences":`Occurrences`,"scheduler.weekdays.sunday":`Sunday`,"scheduler.weekdays.monday":`Monday`,"scheduler.weekdays.tuesday":`Tuesday`,"scheduler.weekdays.wednesday":`Wednesday`,"scheduler.weekdays.thursday":`Thursday`,"scheduler.weekdays.friday":`Friday`,"scheduler.weekdays.saturday":`Saturday`,"scheduler.weekdays.short.sunday":`Sun`,"scheduler.weekdays.short.monday":`Mon`,"scheduler.weekdays.short.tuesday":`Tue`,"scheduler.weekdays.short.wednesday":`Wed`,"scheduler.weekdays.short.thursday":`Thu`,"scheduler.weekdays.short.friday":`Fri`,"scheduler.weekdays.short.saturday":`Sat`,"scheduler.duration.end":`End Reason`,"scheduler.duration.endDate":`End Date`,"scheduler.duration.end.day":`On this day`,"scheduler.duration.end.after":`After`,"scheduler.duration.end.no":`No end day`,"scheduler.separator.and":` and`,"scheduler.separator.on":`on`,"scheduler.separator.day":`day`,"scheduler.separator.every":`every`,"scheduler.separator.of":`of`,"scheduler.separator.the":`the`,"scheduler.day.first":`First`,"scheduler.day.second":`Second`,"scheduler.day.third":`Third`,"scheduler.day.fourth":`Fourth`,"scheduler.day.last":`Last`,"scheduler.weekday":`Weekday`,"scheduler.weekend":`Weekend Day`,"scheduler.day":`Day`,"scheduler.days":`Days`,"scheduler.week":`Week`,"scheduler.weeks":`Weeks`,"scheduler.year":`Year`,"scheduler.years":`Years`,"scheduler.monthDay":`Month Day`,"scheduler.month":`Month`,"scheduler.months":`Months`,"scheduler.months.january":`January`,"scheduler.months.february":`February`,"scheduler.months.march":`March`,"scheduler.months.april":`April`,"scheduler.months.may":`May`,"scheduler.months.june":`June`,"scheduler.months.july":`July`,"scheduler.months.august":`August`,"scheduler.months.september":`September`,"scheduler.months.october":`October`,"scheduler.months.november":`November`,"scheduler.months.december":`December`,"scheduler.months.short.january":`Jan`,"scheduler.months.short.february":`Feb`,"scheduler.months.short.march":`Mar`,"scheduler.months.short.april":`Apr`,"scheduler.months.short.may":`May`,"scheduler.months.short.june":`Jun`,"scheduler.months.short.july":`Jul`,"scheduler.months.short.august":`Aug`,"scheduler.months.short.september":`Sep`,"scheduler.months.short.october":`Oct`,"scheduler.months.short.november":`Nov`,"scheduler.months.short.december":`Dec`,"scheduler.actions.manage":`Manage Scheduler`,"scheduler.meta.assignedTo":`Assigned To`,"scheduler.meta.duration":`Duration`,"scheduler.meta.discount":`Discount`,"scheduler.meta.period":`Period`,"scheduler.limited":`The Scheduler is limited to: {{limit}}`,"scheduler.info.helper":`Set the scheduler to set a sale period.`,"table.actions":`Actions`,"actions.edit":`Edit`,"actions.delete":`Delete`,"actions.save":`Save`,"actions.update":`Update`,"actions.cancel":`Cancel`,"actions.confirm.delete":`Are you sure you want to delete this scheduler?`,"table.hideColumns":`Hide Columns`,"toolbar.refresh":`Refresh`},A=e=>(t,n)=>{let r=e[t]??k[t]??t;return n?r.replace(/\{\{(\w+)}}/g,(e,t)=>String(n[t]??``)):r},ae=(e,...t)=>[...e&&e.length>0?[...e]:[],...t],oe=(e,t=!0)=>({required:t,message:`${e} is required`}),se=(e,t=`input`)=>t===`select`?`Select ${e}`:`Enter ${e}`,j=(e,t)=>t.includes(e),M=(e,t,n)=>{let r=Array.isArray(t)?t:[t],i=e.getFieldsValue(!0),a=i;for(let e=0;e<r.length-1;e++){let t=r[e];(a[t]===void 0||a[t]===null||typeof a[t]!=`object`)&&(a[t]={}),a=a[t]}a[r[r.length-1]]=n,e.setFieldsValue(i)},N=(e,t)=>{let n=Array.isArray(t)?t:t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r},P=`YYYY-MM-DD HH:mm`,F=`YYYY-MM-DD`,I=`—`,L=(e,t)=>{try{return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:2}).format(e)}catch{return`${e} ${t}`}},R=e=>(isNaN(new Date(e).getDate())&&(e=parseInt(e?.toString(),10)),new Date(e)),z=e=>e?R(e).toLocaleDateString():`—`,B=e=>e?R(e).toLocaleTimeString():`—`,V=e=>{let t;return e==null||(t=c.default.isDayjs(e)||e?.seconds&&e?.nanoseconds?e.toDate():e),t?`${z(t)} ${B(t)}`:`—`},H=(e,t)=>{let n=t||(0,c.default)().startOf(`day`);return e.isBefore(n,`day`)},U={danger:`#ff4d4f`,disabled:`#d9d9d9`,warning:`#FFBF00`,success:`#52c41a`,tags:{magenta:`magenta`,red:`red`,volcano:`volcano`,orange:`orange`,gold:`gold`,lime:`lime`,green:`green`,cyan:`cyan`,blue:`blue`,geekblue:`geekblue`,purple:`purple`,processing:`processing`,success:`success`,error:`error`,warning:`warning`,default:`default`}},W=(e,t,n,r)=>{n(`${t}${`${r(`scheduler.separator.every`)} ${K(`scheduler.day`,`scheduler.days`,e,r)}`}`)},G=(e,t,n,r)=>{let i=t.repeat?.weekly?.days,a=K(`scheduler.month`,`scheduler.months`,e,r),o=t.repeat?.monthly;if(o?.type===`DAY`)Y(t.duration.period,t,n,r,{msg:a});else if(o?.type===`PERIOD`){let e=r(`scheduler.separator.the`),t=r(`scheduler.separator.of`),s=r(`scheduler.separator.every`),c=o.weekDay;n(`${e} ${c} ${X(i,r)} ${t} ${s} ${a}`)}},ce=(e,t,n,r)=>{let i=t.repeat?.weekly?.days||[],a=K(`scheduler.week`,`scheduler.weeks`,e,r),o=r(`scheduler.separator.day`),s=r(`scheduler.separator.on`),c=r(`scheduler.separator.every`),l=i?.length===7?o:X(i,r);n(e===1?`${c} ${l}`:`${c} ${a} ${s} ${l}`)},le=(e,t,n,r)=>{let i=K(`scheduler.year`,`scheduler.years`,e,r),a=t.repeat?.yearly?.months;if(a){let e=r(`scheduler.separator.every`),o=r(`scheduler.separator.the`),s=r(`scheduler.separator.of`),c=X(a,r),l=X(t.repeat?.weekly?.days,r),u=t.duration?.period>1?` ${s} ${e} ${i}`:``;u=t.repeat?.monthly?.type===`PERIOD`?`${o} ${t.repeat?.monthly?.weekDay} ${l} ${s} ${e} ${c}`+u:`${e} ${c} ${t.repeat?.monthly?.monthDay}`+u,n(u)}},K=(e,t,n,r)=>{let i=`${n} ${r(t)}`;return n===1&&(i=r(e)),i},q=(e,t,n,r,i=``)=>{switch(e.type){case`DAY`:return W(e.period,i,n,r);case`WEEK`:return ce(e.period,t,n,r);case`MONTH`:return G(e.period,t,n,r);case`YEAR`:return le(e.period,t,n,r)}},J=(e,t)=>{let n=e=>(e<10?`0`+e:e).toString(),r=(0,c.default)(e),i=r.hour(),a=r.minute();t([r.format(`dddd`),`${r.date()} ${r.format(`MMMM`)} ${r.format(`YYYY`)}`,`at ${n(i)}:${n(a)}`].join(`, `))},Y=(e,t,n,r,i)=>{let a=r(`scheduler.separator.day`),o=r(`scheduler.separator.of`),s=r(`scheduler.separator.every`),c=`${a} ${t?.repeat?.monthly?.monthDay} ${o} ${s} `;i?.msg?n(`${c} ${i?.msg}`):q({type:t.duration.type,period:e},t,n,r,c)},X=(e=[],t)=>{let n=t(`scheduler.separator.and`),r=e.join(`, `),i=r.lastIndexOf(`,`);return i===-1?r:r.slice(0,i)+n+r.slice(i+1)},ue=({disabled:e,formRef:t,entity:n,handlers:{onSave:r,setLoading:i,setOpenDrawer:a,setConfigDrawer:o,setOnRefreshDrawer:s},options:{title:c,loading:l,schedulerType:u,isEdit:d,isDirty:f,prefix:m=[],readOnlyFields:h=[],t:g}})=>{if(e)return;let _=Object.keys(p),v=Object.keys(y);i(!0),a(!0);let b=()=>{i(!0),o({size:600,schedulerType:u,durationTypes:_,discountTypes:v,readOnlyFields:h,prefix:m,entity:n,formRef:t,title:c,isEdit:d,isDirty:f,loading:l,onSave:r,disabled:e,t:g}),i(!1)};s(b),b()},Z=(0,l.createContext)(null),de=()=>{let e=(0,l.useContext)(Z);if(!e)throw Error(`useSchedulerContext must be used within a SchedulerProvider`);return e},fe=e=>{let{schedulers:t,loading:n=!1,disabled:r=!1,locale:i,limit:a,onCreate:o,onUpdate:s,onDelete:c,permissions:d,translations:f,children:p}=e,[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)({}),v=(0,l.useMemo)(()=>({...k,...f??{}}),[f]),y=(0,l.useMemo)(()=>A(v),[v]),b=(0,l.useMemo)(()=>({schedulers:t,loading:n,disabled:r,locale:i,limit:a,t:y,permissions:{canCreate:d?.canCreate??!0,canUpdate:d?.canUpdate??!0,canDelete:d?.canDelete??!0},onCreate:o,onUpdate:s,onDelete:c,drawerOpen:m,setDrawerOpen:h,drawerConfig:g,setDrawerConfig:_}),[t,n,r,i,a,y,d,o,s,c,m,g]);return(0,u.jsx)(Z.Provider,{value:b,children:p})},Q=e=>{let t=e.key,n=e.dataIndex;return String(t||n)},pe=e=>{let t=e.title??e.label,n=Q(e);return typeof t==`string`||typeof t==`number`?String(t):n},$=(e,t)=>e.map(e=>({...e,hidden:e.concealable&&!t.includes(Q(e))})),me=(e,t=[])=>{let[n,r]=(0,l.useState)([]),i=(0,l.useRef)(!1),a=(0,l.useMemo)(()=>e.filter(e=>e.concealable).map(e=>({label:pe(e),value:Q(e)})),[e]);return(0,l.useEffect)(()=>{if(!i.current&&a.length>0){let e=new Set(t.map(String));r(a.map(e=>e.value).filter(t=>!e.has(t))),i.current=!0}},[a,t]),{columnsList:a,selectedColumns:n,setSelectedColumns:r,filteredColumns:(0,l.useMemo)(()=>$(e,n),[e,n])}};exports.CDiscountTypeValues=b,exports.CEndReasonTypes=T,exports.CFirstDayIdx=re,exports.CNsDiscount=g,exports.CNsDuration=h,exports.CNsPrice=m,exports.CNsTrial=_,exports.COLORS=U,exports.CScheduler=ne,exports.DEFAULT_DATE_FORMAT=F,exports.DEFAULT_DATE_TIME_FORMAT=P,exports.DEFAULT_DISCOUNT_SCHEDULER=O,exports.DEFAULT_SALE_SCHEDULER=D,exports.DEFAULT_SCHEDULERS_LIMIT=ie,exports.ECurrency=v,exports.EDays=S,exports.EDiscountType=y,exports.EDurationTypes=p,exports.EEndReasonType=x,exports.EMonths=ee,exports.ESchedulerPrefix=w,exports.ESchedulerTypeTransform=te,exports.EStatus=f,exports.EWeekDays=C,exports.NADate=I,exports.SchedulerContext=Z,exports.SchedulerProvider=fe,exports.createTranslationFn=A,exports.defaultTranslations=k,exports.filterOutColumns=$,exports.findFieldValue=N,exports.getDisabledDate=H,exports.getKeyFromEnum=d,exports.handleChangeStartDate=J,exports.handleDurationValueChange=q,exports.handleMsg=K,exports.handleMultipleDurations=X,exports.handleSchedulerForm=ue,exports.handleSelectWeeklyDay=Y,exports.isReadOnlyField=j,exports.mergeNames=ae,exports.numberToCurrency=L,exports.placeholderField=se,exports.requiredField=oe,exports.setNestedDynamicFields=M,exports.tsToDate=z,exports.tsToLocaleDateTime=V,exports.tsToTime=B,exports.useColumnsToggle=me,exports.useSchedulerContext=de;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AAGxB,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACpF,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AAGxB,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACpF,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -242,11 +242,11 @@ var c = (e, t) => Object.keys(e).find((n) => e[n] === t), l = /* @__PURE__ */ fu
|
|
|
242
242
|
case "YEAR": return G(e.period, t, n, r);
|
|
243
243
|
}
|
|
244
244
|
}, se = (t, n) => {
|
|
245
|
-
let r = e(t);
|
|
245
|
+
let r = (e) => (e < 10 ? "0" + e : e).toString(), i = e(t), a = i.hour(), o = i.minute();
|
|
246
246
|
n([
|
|
247
|
-
|
|
248
|
-
`${
|
|
249
|
-
`at ${r
|
|
247
|
+
i.format("dddd"),
|
|
248
|
+
`${i.date()} ${i.format("MMMM")} ${i.format("YYYY")}`,
|
|
249
|
+
`at ${r(a)}:${r(o)}`
|
|
250
250
|
].join(", "));
|
|
251
251
|
}, J = (e, t, n, r, i) => {
|
|
252
252
|
let a = r("scheduler.separator.day"), o = r("scheduler.separator.of"), s = r("scheduler.separator.every"), c = `${a} ${t?.repeat?.monthly?.monthDay} ${o} ${s} `;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TFn } from '../i18n/index';
|
|
2
|
+
import { ESchedulerPrefix, IScheduler } from '../types/index';
|
|
3
3
|
export interface SchedulerContextValue {
|
|
4
4
|
/** Scheduler data grouped by type */
|
|
5
5
|
schedulers: Record<ESchedulerPrefix, IScheduler[]>;
|
|
@@ -34,6 +34,6 @@ export interface SchedulerContextValue {
|
|
|
34
34
|
/** Update the drawer config */
|
|
35
35
|
setDrawerConfig: (config: Record<string, unknown>) => void;
|
|
36
36
|
}
|
|
37
|
-
export declare const SchedulerContext: import(
|
|
37
|
+
export declare const SchedulerContext: import('react').Context<SchedulerContextValue | null>;
|
|
38
38
|
export declare const useSchedulerContext: () => SchedulerContextValue;
|
|
39
39
|
//# sourceMappingURL=SchedulerContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchedulerContext.d.ts","sourceRoot":"","sources":["SchedulerContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,UAAU,EAAE,CAAC,CAAC;IACnD,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,WAAW,EAAE;QACX,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,8EAA8E;IAC9E,CAAC,EAAE,GAAG,CAAC;IACP,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,mCAAmC;IACnC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,CAAC,I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AAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,mCAAmC;IACnC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAG1E,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,+BAA+B;IAC/B,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC5D;AAED,eAAO,MAAM,gBAAgB,uDAAoD,CAAC;AAElF,eAAO,MAAM,mBAAmB,QAAO,qBAMtC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SchedulerTranslations } from '../i18n';
|
|
3
|
+
import { ESchedulerPrefix, IScheduler } from '../types';
|
|
4
4
|
export interface SchedulerProviderProps {
|
|
5
5
|
/** Scheduler data grouped by type (SALE, DISCOUNT, TRIAL_DISCOUNT) */
|
|
6
6
|
schedulers: Record<ESchedulerPrefix, IScheduler[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchedulerProvider.d.ts","sourceRoot":"","sources":["SchedulerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,EAAE,qBAAqB,EAA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 -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { default as dayjs } from 'dayjs';
|
|
2
2
|
export declare const getKeyFromEnum: <T extends object>(enumObj: T, value: T[keyof T]) => keyof T | undefined;
|
|
3
3
|
export declare enum EStatus {
|
|
4
4
|
ACTIVE = "ACTIVE",
|
|
@@ -17,7 +17,7 @@ export declare enum EDurationTypes {
|
|
|
17
17
|
YEAR = "Year",
|
|
18
18
|
FOREVER = "Forever"
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type TDuration = {
|
|
21
21
|
type: keyof typeof EDurationTypes;
|
|
22
22
|
period: number;
|
|
23
23
|
};
|
|
@@ -37,8 +37,8 @@ export declare const CDiscountTypeValues: {
|
|
|
37
37
|
readonly PERCENT: "%";
|
|
38
38
|
readonly FIXED: typeof ECurrency;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
41
|
-
export
|
|
40
|
+
export type TDiscountType = keyof typeof EDiscountType;
|
|
41
|
+
export type TDiscount = {
|
|
42
42
|
type: TDiscountType;
|
|
43
43
|
value: number;
|
|
44
44
|
};
|
|
@@ -92,11 +92,11 @@ export declare const CScheduler = "scheduler";
|
|
|
92
92
|
export declare const CEndReasonTypes: EEndReasonType[];
|
|
93
93
|
export declare const CFirstDayIdx = 1;
|
|
94
94
|
export declare const DEFAULT_SCHEDULERS_LIMIT = 5;
|
|
95
|
-
export
|
|
95
|
+
export type TSchedulerDuration = {
|
|
96
96
|
type: keyof typeof EDurationTypes;
|
|
97
97
|
period: number;
|
|
98
98
|
};
|
|
99
|
-
export
|
|
99
|
+
export type TSchedulerRange = {
|
|
100
100
|
startedAt: dayjs.Dayjs | string;
|
|
101
101
|
endReason: {
|
|
102
102
|
type: EEndReasonType;
|
|
@@ -104,7 +104,7 @@ export declare type TSchedulerRange = {
|
|
|
104
104
|
occurrences?: number;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
|
-
export
|
|
107
|
+
export type TSchedulerRepeat = {
|
|
108
108
|
weekly: {
|
|
109
109
|
days: (keyof typeof EDays)[];
|
|
110
110
|
};
|
|
@@ -133,19 +133,19 @@ export interface IScheduler {
|
|
|
133
133
|
status?: EStatus;
|
|
134
134
|
metadata?: ISchedulerMetadata;
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
type TConditionalDiscount<P extends ESchedulerPrefix> = P extends ESchedulerPrefix.SALE ? {
|
|
137
137
|
[CNsDiscount]?: null;
|
|
138
138
|
} : {
|
|
139
139
|
[CNsDiscount]?: TDiscount;
|
|
140
140
|
};
|
|
141
|
-
export
|
|
142
|
-
export
|
|
141
|
+
export type TScheduler<P extends ESchedulerPrefix> = IScheduler & TConditionalDiscount<P>;
|
|
142
|
+
export type RequiredSchedulers = {
|
|
143
143
|
[K in Exclude<ESchedulerPrefix, ESchedulerPrefix.TRIAL_DISCOUNT>]: TScheduler<K>[];
|
|
144
144
|
};
|
|
145
|
-
export
|
|
145
|
+
export type OptionalSchedulers = {
|
|
146
146
|
[ESchedulerPrefix.TRIAL_DISCOUNT]?: TScheduler<ESchedulerPrefix.TRIAL_DISCOUNT>[];
|
|
147
147
|
};
|
|
148
|
-
export
|
|
148
|
+
export type TSchedulers = {
|
|
149
149
|
[CScheduler]: RequiredSchedulers & OptionalSchedulers;
|
|
150
150
|
};
|
|
151
151
|
export interface IObjectId {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAC7C,SAAS,CAAC,EACV,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,KAChB,MAAM,CAAC,GAAG,SAC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CACnF,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,UAAU,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,CAAC;CACvD,CAAC;AAMF,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAiCD,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAI7E,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAOrF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.util.d.ts","sourceRoot":"","sources":["colors.util.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAuBlB,CAAC"}
|
|
1
|
+
{"version":3,"file":"colors.util.d.ts","sourceRoot":"","sources":["../../src/utils/colors.util.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAuBlB,CAAC"}
|
|
@@ -22,7 +22,7 @@ export declare const requiredField: (field: string, required?: boolean) => {
|
|
|
22
22
|
/**
|
|
23
23
|
* Return a placeholder string for a form field.
|
|
24
24
|
*/
|
|
25
|
-
export declare const placeholderField: (field: string, fieldType?:
|
|
25
|
+
export declare const placeholderField: (field: string, fieldType?: "input" | "select") => string;
|
|
26
26
|
/**
|
|
27
27
|
* Check if a field is in the read-only list.
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.util.d.ts","sourceRoot":"","sources":["form.util.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,M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O,MAAM,EAAE,YAAW,OAAO,GAAG,QAAkB,WACxB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,gBAAgB,MAAM,EAAE,KAAG,OAC1C,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,aAAa,EACtB,OAAO,MAAM,GAAG,MAAM,EAAE,EACxB,OAAO,OAAO,KACb,IAaF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,MAAM,EAAE,KAAG,OAUxE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
1
|
+
import { default as dayjs } from 'dayjs';
|
|
2
2
|
export declare const DEFAULT_DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm";
|
|
3
3
|
export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
4
4
|
export declare const NADate = "\u2014";
|
|
@@ -12,5 +12,5 @@ export declare const tsToLocaleDateTime: (ts: Date | string | number | dayjs.Day
|
|
|
12
12
|
/**
|
|
13
13
|
* Return true if the given date should be disabled (before today or before min).
|
|
14
14
|
*/
|
|
15
|
-
export declare const getDisabledDate: (current: dayjs.Dayjs, min?:
|
|
15
|
+
export declare const getDisabledDate: (current: dayjs.Dayjs, min?: dayjs.Dayjs) => boolean;
|
|
16
16
|
//# sourceMappingURL=format.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.util.d.ts","sourceRoot":"","sources":["format.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAC3D,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,MAAM,WAAM,CAAC;AAG1B;;GAEG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"format.util.d.ts","sourceRoot":"","sources":["../../src/utils/format.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAC3D,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,MAAM,WAAM,CAAC;AAG1B;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,MAWlE,CAAC;AAcF,eAAO,MAAM,QAAQ,GAAI,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,KAAG,MACnB,CAAC;AAChD,eAAO,MAAM,QAAQ,GAAI,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,KAAG,MACnB,CAAC;AAChD,eAAO,MAAM,kBAAkB,GAC7B,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,SAAS,KACnD,MAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,KAAK,KAAG,OAGzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamco/ischeduler-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "Headless core for iScheduler — types, utils, handlers, i18n, provider",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"dayjs": "^1.11.20",
|
|
57
57
|
"jsdom": "^29.0.0",
|
|
58
58
|
"less": "^4.6.4",
|
|
59
|
-
"vite": "^8.0.
|
|
60
|
-
"vite-plugin-dts": "^
|
|
59
|
+
"vite": "^8.0.9",
|
|
60
|
+
"vite-plugin-dts": "^4.5.4",
|
|
61
61
|
"vitest": "^4.1.0"
|
|
62
62
|
}
|
|
63
63
|
}
|