@happeouikit/form-elements 3.0.0-alpha.0 → 3.0.0-alpha.2
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/DatePicker.styles.d.ts +5 -1
- package/dist/dateLocale.d.ts +19 -1
- package/dist/index.cjs.js +150 -143
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +6676 -6608
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
* so MonthDayPicker does not load DatePicker's moment.js imports.
|
|
4
4
|
*/
|
|
5
5
|
export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, {
|
|
6
|
+
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, {
|
|
7
|
+
$hasError?: boolean | undefined;
|
|
8
|
+
}, never>;
|
|
9
|
+
/** Below the input, same error-message convention as form-elements' own `Input` component. */
|
|
10
|
+
export declare const ValidationErrorContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
11
|
export declare const OverlayContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
12
|
export declare const YearMonthSelectContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
13
|
export declare const MonthUl: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
package/dist/dateLocale.d.ts
CHANGED
|
@@ -5,15 +5,27 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** Explicit locale if valid, else the browser/OS regional locale (same as `new Date().toLocaleDateString()`). */
|
|
7
7
|
export declare const resolveLocale: (locale?: string) => string;
|
|
8
|
-
/** Placeholder like "DD/MM/YYYY" matching the locale's part order and
|
|
8
|
+
/** Placeholder like "DD/MM/YYYY" matching the locale's part order, separators, and padding. */
|
|
9
9
|
export declare const getDateFormatPattern: (locale?: string) => string;
|
|
10
10
|
/** Same output as `date.toLocaleDateString(locale)` for a calendar date. */
|
|
11
11
|
export declare const formatDate: (value: Date | number | string | undefined, locale?: string) => string | null;
|
|
12
12
|
/**
|
|
13
13
|
* Parse typed input in the locale's day/month/year order.
|
|
14
14
|
* Accepts 1-2 digit day/month and a 4-digit year. Returns null if it doesn't match.
|
|
15
|
+
*
|
|
16
|
+
* Only ASCII digits (0-9) are accepted — a native-script digit (Devanagari,
|
|
17
|
+
* Arabic-Indic, Persian, etc.) is never converted, it simply fails to match
|
|
18
|
+
* here like any other malformed input, so the caller can surface a
|
|
19
|
+
* validation error instead of silently accepting a converted value.
|
|
15
20
|
*/
|
|
16
21
|
export declare const parseDate: (input: string, locale?: string) => Date | null;
|
|
22
|
+
/**
|
|
23
|
+
* Parses a `DisabledDays` boundary (`Date | string | number`) consistently as
|
|
24
|
+
* local time. A bare "YYYY-MM-DD" string is read as local midnight — matching
|
|
25
|
+
* how a user reads "disable before 2024-03-01" — rather than the UTC midnight
|
|
26
|
+
* `new Date("2024-03-01")` would parse it as.
|
|
27
|
+
*/
|
|
28
|
+
export declare const toLocalDate: (value: Date | string | number) => Date;
|
|
17
29
|
/**
|
|
18
30
|
* Long/short written month names for calendar UI (e.g. "December" / "Dec").
|
|
19
31
|
* Unlike `resolveLocale`, this never falls back to the OS/browser locale:
|
|
@@ -26,3 +38,9 @@ export declare const getMonthNames: (locale?: string) => {
|
|
|
26
38
|
long: string;
|
|
27
39
|
short: string;
|
|
28
40
|
}[];
|
|
41
|
+
/**
|
|
42
|
+
* Short written weekday names for a calendar's header row (e.g. "Sun", "Mon"),
|
|
43
|
+
* indexed like `Date#getDay()` (0 = Sunday). Same English-only-unless-vouched-for
|
|
44
|
+
* fallback as `getMonthNames`.
|
|
45
|
+
*/
|
|
46
|
+
export declare const getWeekdayNames: (locale?: string) => string[];
|