@webiny/admin-ui 6.5.0 → 6.5.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatePicker/DatePicker.stories.d.ts +10 -0
- package/DatePicker/DatePicker.stories.js +44 -1
- package/DatePicker/DatePicker.stories.js.map +1 -1
- package/DatePicker/primitives/BirthdayPicker.d.ts +13 -0
- package/DatePicker/primitives/BirthdayPicker.js +355 -0
- package/DatePicker/primitives/BirthdayPicker.js.map +1 -0
- package/DatePicker/primitives/BirthdayPickerCell.d.ts +14 -0
- package/DatePicker/primitives/BirthdayPickerCell.js +19 -0
- package/DatePicker/primitives/BirthdayPickerCell.js.map +1 -0
- package/DatePicker/primitives/BirthdayPickerSegments.d.ts +9 -0
- package/DatePicker/primitives/BirthdayPickerSegments.js +43 -0
- package/DatePicker/primitives/BirthdayPickerSegments.js.map +1 -0
- package/DatePicker/primitives/DatePickerPrimitive.js +3 -0
- package/DatePicker/primitives/DatePickerPrimitive.js.map +1 -1
- package/DatePicker/utils/birthdayHelpers.d.ts +77 -0
- package/DatePicker/utils/birthdayHelpers.js +145 -0
- package/DatePicker/utils/birthdayHelpers.js.map +1 -0
- package/DatePicker/utils/birthdayHelpers.test.d.ts +1 -0
- package/DatePicker/utils/birthdayHelpers.test.js +394 -0
- package/DatePicker/utils/birthdayHelpers.test.js.map +1 -0
- package/DatePicker/utils/index.d.ts +1 -0
- package/DatePicker/utils/index.js +1 -0
- package/DatePicker/utils/types.d.ts +13 -2
- package/Switch/Switch.d.ts +4 -4
- package/Switch/Switch.js +21 -7
- package/Switch/Switch.js.map +1 -1
- package/Switch/domains/SwitchItemDto.d.ts +1 -1
- package/Switch/primitives/SwitchPrimitive.js +4 -3
- package/Switch/primitives/SwitchPrimitive.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { buttonVariants } from "../../Button/index.js";
|
|
3
|
+
import { cn } from "../../utils.js";
|
|
4
|
+
const BirthdayPickerCell = ({ selected, disabled, tabbable, onClick, children })=>/*#__PURE__*/ react.createElement("button", {
|
|
5
|
+
type: "button",
|
|
6
|
+
disabled: disabled,
|
|
7
|
+
"aria-disabled": disabled,
|
|
8
|
+
"aria-pressed": selected,
|
|
9
|
+
"data-selected": selected,
|
|
10
|
+
tabIndex: tabbable && !disabled ? 0 : -1,
|
|
11
|
+
onClick: onClick,
|
|
12
|
+
className: cn(buttonVariants({
|
|
13
|
+
variant: selected ? "primary" : "ghost",
|
|
14
|
+
size: "md"
|
|
15
|
+
}), "w-full tabular-nums")
|
|
16
|
+
}, children);
|
|
17
|
+
export { BirthdayPickerCell };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=BirthdayPickerCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker/primitives/BirthdayPickerCell.js","sources":["../../../src/DatePicker/primitives/BirthdayPickerCell.tsx"],"sourcesContent":["import React from \"react\";\nimport { buttonVariants } from \"~/Button/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface BirthdayPickerCellProps {\n selected: boolean;\n disabled?: boolean;\n tabbable: boolean;\n onClick: () => void;\n children: React.ReactNode;\n}\n\n/**\n * One day, month or year in a step's grid. It reads as a button: a ghost one, or a primary one\n * for the picked value, the same as the month and year grids of the other pickers.\n */\nconst BirthdayPickerCell = ({\n selected,\n disabled,\n tabbable,\n onClick,\n children\n}: BirthdayPickerCellProps) => (\n <button\n type=\"button\"\n disabled={disabled}\n aria-disabled={disabled}\n aria-pressed={selected}\n data-selected={selected}\n tabIndex={tabbable && !disabled ? 0 : -1}\n onClick={onClick}\n className={cn(\n buttonVariants({ variant: selected ? \"primary\" : \"ghost\", size: \"md\" }),\n \"w-full tabular-nums\"\n )}\n >\n {children}\n </button>\n);\n\nexport { BirthdayPickerCell };\n"],"names":["BirthdayPickerCell","selected","disabled","tabbable","onClick","children","cn","buttonVariants"],"mappings":";;;AAgBA,MAAMA,qBAAqB,CAAC,EACxBC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACc,iBACtB,oBAAC;QACG,MAAK;QACL,UAAUH;QACV,iBAAeA;QACf,gBAAcD;QACd,iBAAeA;QACf,UAAUE,YAAY,CAACD,WAAW,IAAI;QACtC,SAASE;QACT,WAAWE,GACPC,eAAe;YAAE,SAASN,WAAW,YAAY;YAAS,MAAM;QAAK,IACrE;OAGHI"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type BirthdayParts, type BirthdayStep } from "../utils/birthdayHelpers.js";
|
|
3
|
+
interface BirthdayPickerSegmentsProps {
|
|
4
|
+
parts: BirthdayParts;
|
|
5
|
+
activeStep?: BirthdayStep;
|
|
6
|
+
onStepClick?: (step: BirthdayStep) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const BirthdayPickerSegments: ({ parts, activeStep, onStepClick }: BirthdayPickerSegmentsProps) => React.JSX.Element;
|
|
9
|
+
export { BirthdayPickerSegments };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { cn } from "../../utils.js";
|
|
3
|
+
import { pad } from "../utils/birthdayHelpers.js";
|
|
4
|
+
const BirthdayPickerSegments = ({ parts, activeStep, onStepClick })=>{
|
|
5
|
+
const segments = [
|
|
6
|
+
{
|
|
7
|
+
step: "day",
|
|
8
|
+
text: parts.day ? pad(parts.day) : "DD",
|
|
9
|
+
filled: !!parts.day
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
step: "month",
|
|
13
|
+
text: parts.month ? pad(parts.month) : "MM",
|
|
14
|
+
filled: !!parts.month
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
step: "year",
|
|
18
|
+
text: parts.year ? String(parts.year) : "YYYY",
|
|
19
|
+
filled: !!parts.year
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
return /*#__PURE__*/ react.createElement("span", {
|
|
23
|
+
className: "flex items-center gap-xs tabular-nums whitespace-nowrap"
|
|
24
|
+
}, segments.map((segment, index)=>{
|
|
25
|
+
const className = cn("transition-colors", !segment.filled && "text-neutral-dimmed", activeStep === segment.step && "text-accent-primary");
|
|
26
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, {
|
|
27
|
+
key: segment.step
|
|
28
|
+
}, index > 0 ? /*#__PURE__*/ react.createElement("span", {
|
|
29
|
+
className: "text-neutral-dimmed"
|
|
30
|
+
}, "/") : null, onStepClick ? /*#__PURE__*/ react.createElement("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
tabIndex: -1,
|
|
33
|
+
"data-step": segment.step,
|
|
34
|
+
className: cn(className, "cursor-pointer outline-none"),
|
|
35
|
+
onClick: ()=>onStepClick(segment.step)
|
|
36
|
+
}, segment.text) : /*#__PURE__*/ react.createElement("span", {
|
|
37
|
+
className: className
|
|
38
|
+
}, segment.text));
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
export { BirthdayPickerSegments };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=BirthdayPickerSegments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker/primitives/BirthdayPickerSegments.js","sources":["../../../src/DatePicker/primitives/BirthdayPickerSegments.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"~/utils.js\";\nimport { type BirthdayParts, type BirthdayStep, pad } from \"../utils/birthdayHelpers.js\";\n\ninterface BirthdayPickerSegmentsProps {\n parts: BirthdayParts;\n activeStep?: BirthdayStep;\n onStepClick?: (step: BirthdayStep) => void;\n}\n\nconst BirthdayPickerSegments = ({\n parts,\n activeStep,\n onStepClick\n}: BirthdayPickerSegmentsProps) => {\n const segments: Array<{ step: BirthdayStep; text: string; filled: boolean }> = [\n { step: \"day\", text: parts.day ? pad(parts.day) : \"DD\", filled: !!parts.day },\n { step: \"month\", text: parts.month ? pad(parts.month) : \"MM\", filled: !!parts.month },\n { step: \"year\", text: parts.year ? String(parts.year) : \"YYYY\", filled: !!parts.year }\n ];\n\n return (\n <span className=\"flex items-center gap-xs tabular-nums whitespace-nowrap\">\n {segments.map((segment, index) => {\n // A filled part takes the input's value colour; an empty one reads as its placeholder.\n const className = cn(\n \"transition-colors\",\n !segment.filled && \"text-neutral-dimmed\",\n activeStep === segment.step && \"text-accent-primary\"\n );\n return (\n <React.Fragment key={segment.step}>\n {index > 0 ? <span className=\"text-neutral-dimmed\">/</span> : null}\n {onStepClick ? (\n <button\n type=\"button\"\n tabIndex={-1}\n data-step={segment.step}\n className={cn(className, \"cursor-pointer outline-none\")}\n onClick={() => onStepClick(segment.step)}\n >\n {segment.text}\n </button>\n ) : (\n <span className={className}>{segment.text}</span>\n )}\n </React.Fragment>\n );\n })}\n </span>\n );\n};\n\nexport { BirthdayPickerSegments };\n"],"names":["BirthdayPickerSegments","parts","activeStep","onStepClick","segments","pad","String","segment","index","className","cn","React"],"mappings":";;;AAUA,MAAMA,yBAAyB,CAAC,EAC5BC,KAAK,EACLC,UAAU,EACVC,WAAW,EACe;IAC1B,MAAMC,WAAyE;QAC3E;YAAE,MAAM;YAAO,MAAMH,MAAM,GAAG,GAAGI,IAAIJ,MAAM,GAAG,IAAI;YAAM,QAAQ,CAAC,CAACA,MAAM,GAAG;QAAC;QAC5E;YAAE,MAAM;YAAS,MAAMA,MAAM,KAAK,GAAGI,IAAIJ,MAAM,KAAK,IAAI;YAAM,QAAQ,CAAC,CAACA,MAAM,KAAK;QAAC;QACpF;YAAE,MAAM;YAAQ,MAAMA,MAAM,IAAI,GAAGK,OAAOL,MAAM,IAAI,IAAI;YAAQ,QAAQ,CAAC,CAACA,MAAM,IAAI;QAAC;KACxF;IAED,OAAO,WAAP,GACI,oBAAC;QAAK,WAAU;OACXG,SAAS,GAAG,CAAC,CAACG,SAASC;QAEpB,MAAMC,YAAYC,GACd,qBACA,CAACH,QAAQ,MAAM,IAAI,uBACnBL,eAAeK,QAAQ,IAAI,IAAI;QAEnC,OAAO,WAAP,GACI,oBAACI,MAAAA,QAAc;YAAC,KAAKJ,QAAQ,IAAI;WAC5BC,QAAQ,IAAI,WAAJ,GAAI,oBAAC;YAAK,WAAU;WAAsB,OAAW,MAC7DL,cAAc,WAAdA,GACG,oBAAC;YACG,MAAK;YACL,UAAU;YACV,aAAWI,QAAQ,IAAI;YACvB,WAAWG,GAAGD,WAAW;YACzB,SAAS,IAAMN,YAAYI,QAAQ,IAAI;WAEtCA,QAAQ,IAAI,kBAGjB,oBAAC;YAAK,WAAWE;WAAYF,QAAQ,IAAI;IAIzD;AAGZ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { makeDecoratable } from "../../utils.js";
|
|
3
3
|
import { DateOnlyPicker } from "./DateOnlyPicker.js";
|
|
4
|
+
import { BirthdayPicker } from "./BirthdayPicker.js";
|
|
4
5
|
import { TimeOnlyPicker } from "./TimeOnlyPicker.js";
|
|
5
6
|
import { DateTimePicker } from "./DateTimePicker.js";
|
|
6
7
|
import { MonthPicker } from "./MonthPicker.js";
|
|
@@ -14,6 +15,8 @@ const DecoratableDatePickerPrimitive = (props)=>{
|
|
|
14
15
|
switch(props.type){
|
|
15
16
|
case "date":
|
|
16
17
|
return /*#__PURE__*/ react.createElement(DateOnlyPicker, props);
|
|
18
|
+
case "birthday":
|
|
19
|
+
return /*#__PURE__*/ react.createElement(BirthdayPicker, props);
|
|
17
20
|
case "time":
|
|
18
21
|
return /*#__PURE__*/ react.createElement(TimeOnlyPicker, props);
|
|
19
22
|
case "dateTimeLocal":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker/primitives/DatePickerPrimitive.js","sources":["../../../src/DatePicker/primitives/DatePickerPrimitive.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { DatePickerPrimitiveProps } from \"../utils/types.js\";\nimport { DateOnlyPicker } from \"./DateOnlyPicker.js\";\nimport { TimeOnlyPicker } from \"./TimeOnlyPicker.js\";\nimport { DateTimePicker } from \"./DateTimePicker.js\";\nimport { MonthPicker } from \"./MonthPicker.js\";\nimport { WeekPicker } from \"./WeekPicker.js\";\nimport { YearPicker } from \"./YearPicker.js\";\nimport { DateRangePicker } from \"./DateRangePicker.js\";\nimport { MultipleDatesPicker } from \"./MultipleDatesPicker.js\";\nimport { MultipleMonthsPicker } from \"./MultipleMonthsPicker.js\";\nimport { MultipleYearsPicker } from \"./MultipleYearsPicker.js\";\n\nconst DecoratableDatePickerPrimitive = (props: DatePickerPrimitiveProps) => {\n switch (props.type) {\n case \"date\":\n return <DateOnlyPicker {...props} />;\n case \"time\":\n return <TimeOnlyPicker {...props} />;\n case \"dateTimeLocal\":\n return <DateTimePicker {...props} withTimezone={false} />;\n case \"dateTimeTz\":\n return <DateTimePicker {...props} withTimezone={true} />;\n case \"month\":\n return <MonthPicker {...props} />;\n case \"week\":\n return <WeekPicker {...props} />;\n case \"year\":\n return <YearPicker {...props} />;\n case \"dateRange\":\n return <DateRangePicker {...props} />;\n case \"multipleDates\":\n return <MultipleDatesPicker {...props} />;\n case \"multipleMonths\":\n return <MultipleMonthsPicker {...props} />;\n case \"multipleYears\":\n return <MultipleYearsPicker {...props} />;\n }\n};\n\nconst DatePickerPrimitive = makeDecoratable(\"DatePickerPrimitive\", DecoratableDatePickerPrimitive);\n\nexport { DatePickerPrimitive, type DatePickerPrimitiveProps };\n"],"names":["DecoratableDatePickerPrimitive","props","DateOnlyPicker","TimeOnlyPicker","DateTimePicker","MonthPicker","WeekPicker","YearPicker","DateRangePicker","MultipleDatesPicker","MultipleMonthsPicker","MultipleYearsPicker","DatePickerPrimitive","makeDecoratable"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker/primitives/DatePickerPrimitive.js","sources":["../../../src/DatePicker/primitives/DatePickerPrimitive.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { DatePickerPrimitiveProps } from \"../utils/types.js\";\nimport { DateOnlyPicker } from \"./DateOnlyPicker.js\";\nimport { BirthdayPicker } from \"./BirthdayPicker.js\";\nimport { TimeOnlyPicker } from \"./TimeOnlyPicker.js\";\nimport { DateTimePicker } from \"./DateTimePicker.js\";\nimport { MonthPicker } from \"./MonthPicker.js\";\nimport { WeekPicker } from \"./WeekPicker.js\";\nimport { YearPicker } from \"./YearPicker.js\";\nimport { DateRangePicker } from \"./DateRangePicker.js\";\nimport { MultipleDatesPicker } from \"./MultipleDatesPicker.js\";\nimport { MultipleMonthsPicker } from \"./MultipleMonthsPicker.js\";\nimport { MultipleYearsPicker } from \"./MultipleYearsPicker.js\";\n\nconst DecoratableDatePickerPrimitive = (props: DatePickerPrimitiveProps) => {\n switch (props.type) {\n case \"date\":\n return <DateOnlyPicker {...props} />;\n case \"birthday\":\n return <BirthdayPicker {...props} />;\n case \"time\":\n return <TimeOnlyPicker {...props} />;\n case \"dateTimeLocal\":\n return <DateTimePicker {...props} withTimezone={false} />;\n case \"dateTimeTz\":\n return <DateTimePicker {...props} withTimezone={true} />;\n case \"month\":\n return <MonthPicker {...props} />;\n case \"week\":\n return <WeekPicker {...props} />;\n case \"year\":\n return <YearPicker {...props} />;\n case \"dateRange\":\n return <DateRangePicker {...props} />;\n case \"multipleDates\":\n return <MultipleDatesPicker {...props} />;\n case \"multipleMonths\":\n return <MultipleMonthsPicker {...props} />;\n case \"multipleYears\":\n return <MultipleYearsPicker {...props} />;\n }\n};\n\nconst DatePickerPrimitive = makeDecoratable(\"DatePickerPrimitive\", DecoratableDatePickerPrimitive);\n\nexport { DatePickerPrimitive, type DatePickerPrimitiveProps };\n"],"names":["DecoratableDatePickerPrimitive","props","DateOnlyPicker","BirthdayPicker","TimeOnlyPicker","DateTimePicker","MonthPicker","WeekPicker","YearPicker","DateRangePicker","MultipleDatesPicker","MultipleMonthsPicker","MultipleYearsPicker","DatePickerPrimitive","makeDecoratable"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,iCAAiC,CAACC;IACpC,OAAQA,MAAM,IAAI;QACd,KAAK;YACD,OAAO,WAAP,GAAO,oBAACC,gBAAmBD;QAC/B,KAAK;YACD,OAAO,WAAP,GAAO,oBAACE,gBAAmBF;QAC/B,KAAK;YACD,OAAO,WAAP,GAAO,oBAACG,gBAAmBH;QAC/B,KAAK;YACD,OAAO,WAAP,GAAO,oBAACI,gBAAcA;gBAAE,GAAGJ,KAAK;gBAAE,cAAc;;QACpD,KAAK;YACD,OAAO,WAAP,GAAO,oBAACI,gBAAcA;gBAAE,GAAGJ,KAAK;gBAAE,cAAc;;QACpD,KAAK;YACD,OAAO,WAAP,GAAO,oBAACK,aAAgBL;QAC5B,KAAK;YACD,OAAO,WAAP,GAAO,oBAACM,YAAeN;QAC3B,KAAK;YACD,OAAO,WAAP,GAAO,oBAACO,YAAeP;QAC3B,KAAK;YACD,OAAO,WAAP,GAAO,oBAACQ,iBAAoBR;QAChC,KAAK;YACD,OAAO,WAAP,GAAO,oBAACS,qBAAwBT;QACpC,KAAK;YACD,OAAO,WAAP,GAAO,oBAACU,sBAAyBV;QACrC,KAAK;YACD,OAAO,WAAP,GAAO,oBAACW,qBAAwBX;IACxC;AACJ;AAEA,MAAMY,sBAAsBC,gBAAgB,uBAAuBd"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logic for the step-by-step birthday picker: the date is picked as day, then month, then year.
|
|
3
|
+
* Months are 1-based throughout (1 = January).
|
|
4
|
+
*/
|
|
5
|
+
export interface BirthdayParts {
|
|
6
|
+
day?: number;
|
|
7
|
+
month?: number;
|
|
8
|
+
year?: number;
|
|
9
|
+
}
|
|
10
|
+
export type BirthdayStep = "day" | "month" | "year";
|
|
11
|
+
export declare const DEFAULT_BIRTHDAY_YEARS_BACK = 120;
|
|
12
|
+
/** The first and last date the picker may produce. Either may be left open. */
|
|
13
|
+
export interface BirthdayLimits {
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
maxDate?: Date;
|
|
16
|
+
}
|
|
17
|
+
/** The dates the picker may produce: one of the offered years, within the limits. */
|
|
18
|
+
export interface BirthdayRange extends BirthdayLimits {
|
|
19
|
+
years: number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reads the day, month and year from a `YYYY-MM-DD` value. A value that carries a time
|
|
23
|
+
* (`2026-05-01T00:00:00.000Z`) still yields its date part. Anything else yields no parts.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseBirthdayValue(value: string | undefined | null): BirthdayParts;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the `YYYY-MM-DD` value, or `undefined` while any part is still missing.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatBirthdayValue(parts: BirthdayParts): string | undefined;
|
|
30
|
+
export declare function pad(value: number): string;
|
|
31
|
+
export declare function isLeapYear(year: number): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Days in a month. Without a year, February counts 29 days, because the year is picked
|
|
34
|
+
* after the month and a leap year may still be chosen.
|
|
35
|
+
*/
|
|
36
|
+
export declare function daysInMonth(month: number, year?: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the range holds a date with every part set in `parts`. An unset year is looked
|
|
39
|
+
* for among the offered years; an unset month or day can be any.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isInBirthdayRange(parts: BirthdayParts, range: BirthdayRange): boolean;
|
|
42
|
+
/** A day is unavailable when no date in the range falls on it. */
|
|
43
|
+
export declare function isDayDisabled(day: number, range?: BirthdayRange): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* A month is unavailable when it can't hold the chosen day (31 rules out the 30-day months
|
|
46
|
+
* and February), or when no date in the range has the chosen day in that month.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isMonthDisabled(month: number, parts: BirthdayParts, range?: BirthdayRange): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* A year is unavailable when it can't hold the chosen day and month (29 February in a
|
|
51
|
+
* non-leap year), or when the date it makes falls outside the range.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isYearDisabled(year: number, parts: BirthdayParts, range?: BirthdayRange): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Picking a day clears whatever comes after it that can no longer hold it: the month when
|
|
56
|
+
* the month is too short or the range has no such date, otherwise the year when only the
|
|
57
|
+
* year is the problem (29 February, or a date past a limit).
|
|
58
|
+
*/
|
|
59
|
+
export declare function pickDay(parts: BirthdayParts, day: number, range?: BirthdayRange): BirthdayParts;
|
|
60
|
+
/**
|
|
61
|
+
* Picking a month keeps the day (only months that hold it can be picked) and clears the
|
|
62
|
+
* year when that year can't hold the date.
|
|
63
|
+
*/
|
|
64
|
+
export declare function pickMonth(parts: BirthdayParts, month: number, range?: BirthdayRange): BirthdayParts;
|
|
65
|
+
export declare function pickYear(parts: BirthdayParts, year: number): BirthdayParts;
|
|
66
|
+
/**
|
|
67
|
+
* The step to show after a pick, or `undefined` when the picker should close. A missing part
|
|
68
|
+
* comes first. Once the date is complete, the picker walks on to the steps after `current`
|
|
69
|
+
* that weren't picked while it was open, so editing a saved date still goes day, month, year.
|
|
70
|
+
*/
|
|
71
|
+
export declare function nextBirthdayStep(parts: BirthdayParts, current: BirthdayStep, picked: ReadonlySet<BirthdayStep>): BirthdayStep | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* The years to offer, newest first. The default runs from this year back
|
|
74
|
+
* `DEFAULT_BIRTHDAY_YEARS_BACK` years, moved and cut to fit the limits. A year already set
|
|
75
|
+
* outside the range is added, so an existing value is never hidden.
|
|
76
|
+
*/
|
|
77
|
+
export declare function birthdayYears(yearRange?: [number, number], includeYear?: number, limits?: BirthdayLimits): number[];
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const DEFAULT_BIRTHDAY_YEARS_BACK = 120;
|
|
2
|
+
const ALL_MONTHS = Array.from({
|
|
3
|
+
length: 12
|
|
4
|
+
}, (_, index)=>index + 1);
|
|
5
|
+
function parseBirthdayValue(value) {
|
|
6
|
+
if (!value) return {};
|
|
7
|
+
const match = String(value).match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
8
|
+
if (!match) return {};
|
|
9
|
+
const year = Number(match[1]);
|
|
10
|
+
const month = Number(match[2]);
|
|
11
|
+
const day = Number(match[3]);
|
|
12
|
+
if (month < 1 || month > 12 || day < 1 || day > daysInMonth(month, year)) return {};
|
|
13
|
+
return {
|
|
14
|
+
day,
|
|
15
|
+
month,
|
|
16
|
+
year
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function formatBirthdayValue(parts) {
|
|
20
|
+
const { day, month, year } = parts;
|
|
21
|
+
if (void 0 === day || void 0 === month || void 0 === year) return;
|
|
22
|
+
return `${String(year).padStart(4, "0")}-${pad(month)}-${pad(day)}`;
|
|
23
|
+
}
|
|
24
|
+
function pad(value) {
|
|
25
|
+
return String(value).padStart(2, "0");
|
|
26
|
+
}
|
|
27
|
+
function isLeapYear(year) {
|
|
28
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
29
|
+
}
|
|
30
|
+
function daysInMonth(month, year) {
|
|
31
|
+
if (2 === month) return void 0 === year || isLeapYear(year) ? 29 : 28;
|
|
32
|
+
return [
|
|
33
|
+
4,
|
|
34
|
+
6,
|
|
35
|
+
9,
|
|
36
|
+
11
|
|
37
|
+
].includes(month) ? 30 : 31;
|
|
38
|
+
}
|
|
39
|
+
function dateKey(year, month, day) {
|
|
40
|
+
return 10000 * year + 100 * month + day;
|
|
41
|
+
}
|
|
42
|
+
function limitKey(date, open) {
|
|
43
|
+
if (!date || isNaN(date.getTime())) return open;
|
|
44
|
+
return dateKey(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
45
|
+
}
|
|
46
|
+
function limitYear(date) {
|
|
47
|
+
return date && !isNaN(date.getTime()) ? date.getFullYear() : void 0;
|
|
48
|
+
}
|
|
49
|
+
function isInBirthdayRange(parts, range) {
|
|
50
|
+
const min = limitKey(range.minDate, -1 / 0);
|
|
51
|
+
const max = limitKey(range.maxDate, 1 / 0);
|
|
52
|
+
const years = void 0 !== parts.year ? [
|
|
53
|
+
parts.year
|
|
54
|
+
] : range.years;
|
|
55
|
+
const months = void 0 !== parts.month ? [
|
|
56
|
+
parts.month
|
|
57
|
+
] : ALL_MONTHS;
|
|
58
|
+
for (const year of years)if (!(dateKey(year, 12, 31) < min || dateKey(year, 1, 1) > max)) for (const month of months){
|
|
59
|
+
const last = daysInMonth(month, year);
|
|
60
|
+
const first = parts.day ?? 1;
|
|
61
|
+
const final = parts.day ?? last;
|
|
62
|
+
if (!(final > last)) {
|
|
63
|
+
if (dateKey(year, month, final) >= min && dateKey(year, month, first) <= max) return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
function isDayDisabled(day, range) {
|
|
69
|
+
return void 0 !== range && !isInBirthdayRange({
|
|
70
|
+
day
|
|
71
|
+
}, range);
|
|
72
|
+
}
|
|
73
|
+
function isMonthDisabled(month, parts, range) {
|
|
74
|
+
if (void 0 !== parts.day && parts.day > daysInMonth(month)) return true;
|
|
75
|
+
return void 0 !== range && !isInBirthdayRange({
|
|
76
|
+
day: parts.day,
|
|
77
|
+
month
|
|
78
|
+
}, range);
|
|
79
|
+
}
|
|
80
|
+
function isYearDisabled(year, parts, range) {
|
|
81
|
+
if (void 0 !== parts.day && void 0 !== parts.month && parts.day > daysInMonth(parts.month, year)) return true;
|
|
82
|
+
return void 0 !== range && !isInBirthdayRange({
|
|
83
|
+
day: parts.day,
|
|
84
|
+
month: parts.month,
|
|
85
|
+
year
|
|
86
|
+
}, range);
|
|
87
|
+
}
|
|
88
|
+
function pickDay(parts, day, range) {
|
|
89
|
+
const next = {
|
|
90
|
+
...parts,
|
|
91
|
+
day
|
|
92
|
+
};
|
|
93
|
+
if (void 0 !== next.month && isMonthDisabled(next.month, next, range)) next.month = void 0;
|
|
94
|
+
if (void 0 !== next.year && isYearDisabled(next.year, next, range)) next.year = void 0;
|
|
95
|
+
return next;
|
|
96
|
+
}
|
|
97
|
+
function pickMonth(parts, month, range) {
|
|
98
|
+
const next = {
|
|
99
|
+
...parts,
|
|
100
|
+
month
|
|
101
|
+
};
|
|
102
|
+
if (void 0 !== next.year && isYearDisabled(next.year, next, range)) next.year = void 0;
|
|
103
|
+
return next;
|
|
104
|
+
}
|
|
105
|
+
function pickYear(parts, year) {
|
|
106
|
+
return {
|
|
107
|
+
...parts,
|
|
108
|
+
year
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const BIRTHDAY_STEPS = [
|
|
112
|
+
"day",
|
|
113
|
+
"month",
|
|
114
|
+
"year"
|
|
115
|
+
];
|
|
116
|
+
function nextBirthdayStep(parts, current, picked) {
|
|
117
|
+
const missing = BIRTHDAY_STEPS.find((step)=>void 0 === parts[step]);
|
|
118
|
+
if (missing) return missing;
|
|
119
|
+
return BIRTHDAY_STEPS.slice(BIRTHDAY_STEPS.indexOf(current) + 1).find((step)=>!picked.has(step));
|
|
120
|
+
}
|
|
121
|
+
function birthdayYears(yearRange, includeYear, limits) {
|
|
122
|
+
const [from, to] = yearRange ?? defaultBirthdayYearRange(limits);
|
|
123
|
+
let start = Math.min(from, to);
|
|
124
|
+
let end = Math.max(from, to);
|
|
125
|
+
if (void 0 !== includeYear) {
|
|
126
|
+
start = Math.min(start, includeYear);
|
|
127
|
+
end = Math.max(end, includeYear);
|
|
128
|
+
}
|
|
129
|
+
const years = [];
|
|
130
|
+
for(let year = end; year >= start; year--)years.push(year);
|
|
131
|
+
return years;
|
|
132
|
+
}
|
|
133
|
+
function defaultBirthdayYearRange(limits) {
|
|
134
|
+
const minYear = limitYear(limits?.minDate);
|
|
135
|
+
const maxYear = limitYear(limits?.maxDate);
|
|
136
|
+
const to = maxYear ?? Math.max(new Date().getFullYear(), minYear ?? -1 / 0);
|
|
137
|
+
const from = minYear ?? to - DEFAULT_BIRTHDAY_YEARS_BACK;
|
|
138
|
+
return [
|
|
139
|
+
from,
|
|
140
|
+
to
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
export { DEFAULT_BIRTHDAY_YEARS_BACK, birthdayYears, daysInMonth, formatBirthdayValue, isDayDisabled, isInBirthdayRange, isLeapYear, isMonthDisabled, isYearDisabled, nextBirthdayStep, pad, parseBirthdayValue, pickDay, pickMonth, pickYear };
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=birthdayHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker/utils/birthdayHelpers.js","sources":["../../../src/DatePicker/utils/birthdayHelpers.ts"],"sourcesContent":["/**\n * Logic for the step-by-step birthday picker: the date is picked as day, then month, then year.\n * Months are 1-based throughout (1 = January).\n */\n\nexport interface BirthdayParts {\n day?: number;\n month?: number;\n year?: number;\n}\n\nexport type BirthdayStep = \"day\" | \"month\" | \"year\";\n\nexport const DEFAULT_BIRTHDAY_YEARS_BACK = 120;\n\n/** The first and last date the picker may produce. Either may be left open. */\nexport interface BirthdayLimits {\n minDate?: Date;\n maxDate?: Date;\n}\n\n/** The dates the picker may produce: one of the offered years, within the limits. */\nexport interface BirthdayRange extends BirthdayLimits {\n years: number[];\n}\n\nconst ALL_MONTHS = Array.from({ length: 12 }, (_, index) => index + 1);\n\n/**\n * Reads the day, month and year from a `YYYY-MM-DD` value. A value that carries a time\n * (`2026-05-01T00:00:00.000Z`) still yields its date part. Anything else yields no parts.\n */\nexport function parseBirthdayValue(value: string | undefined | null): BirthdayParts {\n if (!value) {\n return {};\n }\n const match = String(value).match(/^(\\d{4})-(\\d{2})-(\\d{2})/);\n if (!match) {\n return {};\n }\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n if (month < 1 || month > 12 || day < 1 || day > daysInMonth(month, year)) {\n return {};\n }\n return { day, month, year };\n}\n\n/**\n * Returns the `YYYY-MM-DD` value, or `undefined` while any part is still missing.\n */\nexport function formatBirthdayValue(parts: BirthdayParts): string | undefined {\n const { day, month, year } = parts;\n if (day === undefined || month === undefined || year === undefined) {\n return undefined;\n }\n return `${String(year).padStart(4, \"0\")}-${pad(month)}-${pad(day)}`;\n}\n\nexport function pad(value: number): string {\n return String(value).padStart(2, \"0\");\n}\n\nexport function isLeapYear(year: number): boolean {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\n/**\n * Days in a month. Without a year, February counts 29 days, because the year is picked\n * after the month and a leap year may still be chosen.\n */\nexport function daysInMonth(month: number, year?: number): number {\n if (month === 2) {\n return year === undefined || isLeapYear(year) ? 29 : 28;\n }\n return [4, 6, 9, 11].includes(month) ? 30 : 31;\n}\n\nfunction dateKey(year: number, month: number, day: number): number {\n return year * 10000 + month * 100 + day;\n}\n\n/** The calendar day of a limit, in local time, the same day the calendar picker compares. */\nfunction limitKey(date: Date | undefined, open: number): number {\n if (!date || isNaN(date.getTime())) {\n return open;\n }\n return dateKey(date.getFullYear(), date.getMonth() + 1, date.getDate());\n}\n\nfunction limitYear(date: Date | undefined): number | undefined {\n return date && !isNaN(date.getTime()) ? date.getFullYear() : undefined;\n}\n\n/**\n * Whether the range holds a date with every part set in `parts`. An unset year is looked\n * for among the offered years; an unset month or day can be any.\n */\nexport function isInBirthdayRange(parts: BirthdayParts, range: BirthdayRange): boolean {\n const min = limitKey(range.minDate, -Infinity);\n const max = limitKey(range.maxDate, Infinity);\n const years = parts.year !== undefined ? [parts.year] : range.years;\n const months = parts.month !== undefined ? [parts.month] : ALL_MONTHS;\n for (const year of years) {\n if (dateKey(year, 12, 31) < min || dateKey(year, 1, 1) > max) {\n continue;\n }\n for (const month of months) {\n const last = daysInMonth(month, year);\n const first = parts.day ?? 1;\n const final = parts.day ?? last;\n if (final > last) {\n continue;\n }\n if (dateKey(year, month, final) >= min && dateKey(year, month, first) <= max) {\n return true;\n }\n }\n }\n return false;\n}\n\n/** A day is unavailable when no date in the range falls on it. */\nexport function isDayDisabled(day: number, range?: BirthdayRange): boolean {\n return range !== undefined && !isInBirthdayRange({ day }, range);\n}\n\n/**\n * A month is unavailable when it can't hold the chosen day (31 rules out the 30-day months\n * and February), or when no date in the range has the chosen day in that month.\n */\nexport function isMonthDisabled(\n month: number,\n parts: BirthdayParts,\n range?: BirthdayRange\n): boolean {\n if (parts.day !== undefined && parts.day > daysInMonth(month)) {\n return true;\n }\n return range !== undefined && !isInBirthdayRange({ day: parts.day, month }, range);\n}\n\n/**\n * A year is unavailable when it can't hold the chosen day and month (29 February in a\n * non-leap year), or when the date it makes falls outside the range.\n */\nexport function isYearDisabled(year: number, parts: BirthdayParts, range?: BirthdayRange): boolean {\n if (\n parts.day !== undefined &&\n parts.month !== undefined &&\n parts.day > daysInMonth(parts.month, year)\n ) {\n return true;\n }\n return (\n range !== undefined &&\n !isInBirthdayRange({ day: parts.day, month: parts.month, year }, range)\n );\n}\n\n/**\n * Picking a day clears whatever comes after it that can no longer hold it: the month when\n * the month is too short or the range has no such date, otherwise the year when only the\n * year is the problem (29 February, or a date past a limit).\n */\nexport function pickDay(parts: BirthdayParts, day: number, range?: BirthdayRange): BirthdayParts {\n const next: BirthdayParts = { ...parts, day };\n if (next.month !== undefined && isMonthDisabled(next.month, next, range)) {\n next.month = undefined;\n }\n if (next.year !== undefined && isYearDisabled(next.year, next, range)) {\n next.year = undefined;\n }\n return next;\n}\n\n/**\n * Picking a month keeps the day (only months that hold it can be picked) and clears the\n * year when that year can't hold the date.\n */\nexport function pickMonth(\n parts: BirthdayParts,\n month: number,\n range?: BirthdayRange\n): BirthdayParts {\n const next: BirthdayParts = { ...parts, month };\n if (next.year !== undefined && isYearDisabled(next.year, next, range)) {\n next.year = undefined;\n }\n return next;\n}\n\nexport function pickYear(parts: BirthdayParts, year: number): BirthdayParts {\n return { ...parts, year };\n}\n\nconst BIRTHDAY_STEPS: BirthdayStep[] = [\"day\", \"month\", \"year\"];\n\n/**\n * The step to show after a pick, or `undefined` when the picker should close. A missing part\n * comes first. Once the date is complete, the picker walks on to the steps after `current`\n * that weren't picked while it was open, so editing a saved date still goes day, month, year.\n */\nexport function nextBirthdayStep(\n parts: BirthdayParts,\n current: BirthdayStep,\n picked: ReadonlySet<BirthdayStep>\n): BirthdayStep | undefined {\n const missing = BIRTHDAY_STEPS.find(step => parts[step] === undefined);\n if (missing) {\n return missing;\n }\n return BIRTHDAY_STEPS.slice(BIRTHDAY_STEPS.indexOf(current) + 1).find(\n step => !picked.has(step)\n );\n}\n\n/**\n * The years to offer, newest first. The default runs from this year back\n * `DEFAULT_BIRTHDAY_YEARS_BACK` years, moved and cut to fit the limits. A year already set\n * outside the range is added, so an existing value is never hidden.\n */\nexport function birthdayYears(\n yearRange?: [number, number],\n includeYear?: number,\n limits?: BirthdayLimits\n): number[] {\n const [from, to] = yearRange ?? defaultBirthdayYearRange(limits);\n let start = Math.min(from, to);\n let end = Math.max(from, to);\n if (includeYear !== undefined) {\n start = Math.min(start, includeYear);\n end = Math.max(end, includeYear);\n }\n const years: number[] = [];\n for (let year = end; year >= start; year--) {\n years.push(year);\n }\n return years;\n}\n\n/**\n * From the latest allowed year down to the earliest. Without an upper limit the list starts at\n * this year (or the lower limit's year, if that's later); without a lower limit it ends\n * `DEFAULT_BIRTHDAY_YEARS_BACK` years before its start.\n */\nfunction defaultBirthdayYearRange(limits?: BirthdayLimits): [number, number] {\n const minYear = limitYear(limits?.minDate);\n const maxYear = limitYear(limits?.maxDate);\n const to = maxYear ?? Math.max(new Date().getFullYear(), minYear ?? -Infinity);\n const from = minYear ?? to - DEFAULT_BIRTHDAY_YEARS_BACK;\n return [from, to];\n}\n"],"names":["DEFAULT_BIRTHDAY_YEARS_BACK","ALL_MONTHS","Array","_","index","parseBirthdayValue","value","match","String","year","Number","month","day","daysInMonth","formatBirthdayValue","parts","undefined","pad","isLeapYear","dateKey","limitKey","date","open","isNaN","limitYear","isInBirthdayRange","range","min","max","Infinity","years","months","last","first","final","isDayDisabled","isMonthDisabled","isYearDisabled","pickDay","next","pickMonth","pickYear","BIRTHDAY_STEPS","nextBirthdayStep","current","picked","missing","step","birthdayYears","yearRange","includeYear","limits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