@vuu-ui/vuu-utils 0.8.55 → 0.8.57
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/cjs/column-utils.js +14 -11
- package/cjs/column-utils.js.map +1 -1
- package/cjs/date/{utils.js → date-utils.js} +1 -1
- package/cjs/date/date-utils.js.map +1 -0
- package/cjs/date/types.js +4 -0
- package/cjs/date/types.js.map +1 -1
- package/cjs/form-utils.js +16 -0
- package/cjs/form-utils.js.map +1 -0
- package/cjs/html-utils.js +16 -0
- package/cjs/html-utils.js.map +1 -1
- package/cjs/index.js +26 -20
- package/cjs/index.js.map +1 -1
- package/cjs/list-utils.js +11 -0
- package/cjs/list-utils.js.map +1 -0
- package/esm/column-utils.js +15 -9
- package/esm/column-utils.js.map +1 -1
- package/esm/date/{utils.js → date-utils.js} +1 -1
- package/esm/date/date-utils.js.map +1 -0
- package/esm/date/types.js +2 -1
- package/esm/date/types.js.map +1 -1
- package/esm/form-utils.js +14 -0
- package/esm/form-utils.js.map +1 -0
- package/esm/html-utils.js +15 -1
- package/esm/html-utils.js.map +1 -1
- package/esm/index.js +6 -4
- package/esm/index.js.map +1 -1
- package/esm/list-utils.js +9 -0
- package/esm/list-utils.js.map +1 -0
- package/package.json +6 -6
- package/types/array-utils.d.ts +1 -1
- package/types/column-utils.d.ts +6 -4
- package/types/date/index.d.ts +2 -2
- package/types/date/types.d.ts +6 -0
- package/types/form-utils.d.ts +6 -0
- package/types/html-utils.d.ts +3 -0
- package/types/index.d.ts +3 -0
- package/types/list-utils.d.ts +2 -0
- package/types/user-types.d.ts +4 -0
- package/cjs/date/utils.js.map +0 -1
- package/esm/date/utils.js.map +0 -1
- /package/types/date/{utils.d.ts → date-utils.d.ts} +0 -0
package/types/column-utils.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export declare function mapSortCriteria(sortCriteria: SortCriteriaItem[], column
|
|
|
17
17
|
export declare const getDefaultAlignment: (serverDataType?: VuuColumnDataType) => ColumnAlignment;
|
|
18
18
|
export declare const isValidColumnAlignment: (v: string) => v is ColumnAlignment;
|
|
19
19
|
export declare const isValidPinLocation: (v: string) => v is PinLocation;
|
|
20
|
+
export type CalculatedColumn = {
|
|
21
|
+
name: string;
|
|
22
|
+
expression: string;
|
|
23
|
+
serverDataType: VuuColumnDataType;
|
|
24
|
+
};
|
|
20
25
|
export declare const isVuuColumnDataType: (value: string | undefined | null) => value is VuuColumnDataType;
|
|
21
26
|
export declare const fromServerDataType: (serverDataType: VuuColumnDataType) => ColumnTypeSimple;
|
|
22
27
|
export declare const isNumericColumn: ({ serverDataType, type }: ColumnDescriptor) => boolean;
|
|
@@ -96,10 +101,7 @@ export declare const getTypeFormattingFromColumn: (column: ColumnDescriptor) =>
|
|
|
96
101
|
export declare const subscribedOnly: (columnNames?: string[]) => (column: ColumnDescriptor) => boolean | undefined;
|
|
97
102
|
export declare const addColumnToSubscribedColumns: (subscribedColumns: ColumnDescriptor[], availableColumns: SchemaColumn[], columnName: string) => ColumnDescriptor[];
|
|
98
103
|
export declare const isCalculatedColumn: (columnName?: string) => boolean;
|
|
99
|
-
export declare const getCalculatedColumnDetails: (column: ColumnDescriptor) =>
|
|
100
|
-
export declare const getCalculatedColumnName: (column: ColumnDescriptor) => string;
|
|
101
|
-
export declare const getCalculatedColumnType: (column: ColumnDescriptor) => VuuColumnDataType;
|
|
102
|
-
export declare const getCalculatedColumnExpression: (column: ColumnDescriptor) => string;
|
|
104
|
+
export declare const getCalculatedColumnDetails: (column: ColumnDescriptor) => Partial<CalculatedColumn>;
|
|
103
105
|
export declare const setCalculatedColumnName: (column: ColumnDescriptor, name: string) => ColumnDescriptor;
|
|
104
106
|
export declare const setCalculatedColumnType: (column: ColumnDescriptor, type: string) => ColumnDescriptor;
|
|
105
107
|
export declare const setCalculatedColumnExpression: (column: ColumnDescriptor, expression: string) => ColumnDescriptor;
|
package/types/date/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./formatter";
|
|
2
|
-
export { isDateTimePattern, type DateTimePattern, supportedDateTimePatterns, } from "./types";
|
|
3
|
-
export { toCalendarDate } from "./utils";
|
|
2
|
+
export { dateTimeLabelByType, isDatePattern, isTimePattern, isDateTimePattern, type DatePattern, type TimePattern, type DateTimePattern, supportedDateTimePatterns, } from "./types";
|
|
3
|
+
export { toCalendarDate } from "./date-utils";
|
|
4
4
|
export { dateTimePattern, defaultPatternsByType, fallbackDateTimePattern, } from "./dateTimePattern";
|
package/types/date/types.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export declare const supportedDateTimePatterns: {
|
|
|
5
5
|
date: readonly ["dd.mm.yyyy", "dd/mm/yyyy", "dd MMM yyyy", "dd MMMM yyyy", "mm/dd/yyyy", "MMM dd, yyyy", "MMMM dd, yyyy"];
|
|
6
6
|
time: readonly ["hh:mm:ss", "hh:mm:ss a"];
|
|
7
7
|
};
|
|
8
|
+
export declare const dateTimeLabelByType: {
|
|
9
|
+
readonly date: "Date";
|
|
10
|
+
readonly time: "Time";
|
|
11
|
+
};
|
|
8
12
|
export type DatePattern = (typeof supportedDatePatterns)[number];
|
|
9
13
|
export type TimePattern = (typeof supportedTimePatterns)[number];
|
|
10
14
|
export type DateTimePattern = {
|
|
@@ -14,5 +18,7 @@ export type DateTimePattern = {
|
|
|
14
18
|
date: DatePattern;
|
|
15
19
|
time?: TimePattern;
|
|
16
20
|
};
|
|
21
|
+
export declare const isDatePattern: (pattern?: string) => pattern is "dd.mm.yyyy" | "dd/mm/yyyy" | "dd MMM yyyy" | "dd MMMM yyyy" | "mm/dd/yyyy" | "MMM dd, yyyy" | "MMMM dd, yyyy";
|
|
22
|
+
export declare const isTimePattern: (pattern?: string) => pattern is "hh:mm:ss" | "hh:mm:ss a";
|
|
17
23
|
export declare const isDateTimePattern: (pattern?: ColumnTypeFormatting["pattern"]) => pattern is DateTimePattern;
|
|
18
24
|
export {};
|
package/types/html-utils.d.ts
CHANGED
|
@@ -8,8 +8,11 @@ export declare function getElementByDataIndex(c: HTMLElement | null, i: number |
|
|
|
8
8
|
export declare function getElementByDataIndex(c: HTMLElement | null, i: number | string, throwIfNotFound?: false): HTMLElement | undefined;
|
|
9
9
|
export declare const focusFirstFocusableElement: (el: HTMLElement | null, tabIndex?: number) => void;
|
|
10
10
|
export declare const isSelectableElement: (el?: HTMLElement | null) => boolean;
|
|
11
|
+
export declare const hasOpenOptionList: (el: HTMLElement | EventTarget | null) => boolean | undefined;
|
|
11
12
|
export declare function getScrollbarSize(): number;
|
|
12
13
|
export type MouseEventTypes = "dblclick" | "click";
|
|
14
|
+
export type KeyboardEventTypes = "keydown" | "keypress" | "keyup";
|
|
13
15
|
export declare const dispatchMouseEvent: (el: HTMLElement, type: MouseEventTypes) => void;
|
|
16
|
+
export declare const dispatchKeyboardEvent: (el: HTMLElement, type: KeyboardEventTypes, key: string) => void;
|
|
14
17
|
export type VuuDomEventType = "vuu-commit" | "vuu-dropped";
|
|
15
18
|
export declare const dispatchCustomEvent: (el: HTMLElement, type: VuuDomEventType) => void;
|
package/types/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./debug-utils";
|
|
|
14
14
|
export * from "./filters";
|
|
15
15
|
export * from "./html-utils";
|
|
16
16
|
export * from "./event-emitter";
|
|
17
|
+
export * from "./form-utils";
|
|
17
18
|
export * from "./formatting-utils";
|
|
18
19
|
export * from "./getUniqueId";
|
|
19
20
|
export * from "./group-utils";
|
|
@@ -23,6 +24,7 @@ export * from "./itemToString";
|
|
|
23
24
|
export * from "./json-utils";
|
|
24
25
|
export * from "./keyboard-utils";
|
|
25
26
|
export * from "./keyset";
|
|
27
|
+
export * from "./list-utils";
|
|
26
28
|
export * from "./local-storage-utils";
|
|
27
29
|
export * from "./logging-utils";
|
|
28
30
|
export * from "./menu-utils";
|
|
@@ -41,4 +43,5 @@ export * from "./ThemeProvider";
|
|
|
41
43
|
export * from "./ts-utils";
|
|
42
44
|
export * from "./url-utils";
|
|
43
45
|
export * from "./useId";
|
|
46
|
+
export * from "./user-types";
|
|
44
47
|
export * from "./useLayoutEffectSkipFirst";
|
package/cjs/date/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/date/utils.ts"],"sourcesContent":["import { CalendarDate } from \"@internationalized/date\";\n\nexport function toCalendarDate(d: Date) {\n return new CalendarDate(d.getFullYear(), d.getMonth() + 1, d.getDate());\n}\n"],"names":["CalendarDate"],"mappings":";;;;AAEO,SAAS,eAAe,CAAS,EAAA;AACtC,EAAO,OAAA,IAAIA,iBAAa,CAAA,CAAA,CAAE,WAAY,EAAA,EAAG,CAAE,CAAA,QAAA,EAAa,GAAA,CAAA,EAAG,CAAE,CAAA,OAAA,EAAS,CAAA,CAAA;AACxE;;;;"}
|
package/esm/date/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/date/utils.ts"],"sourcesContent":["import { CalendarDate } from \"@internationalized/date\";\n\nexport function toCalendarDate(d: Date) {\n return new CalendarDate(d.getFullYear(), d.getMonth() + 1, d.getDate());\n}\n"],"names":[],"mappings":";;AAEO,SAAS,eAAe,CAAS,EAAA;AACtC,EAAO,OAAA,IAAI,YAAa,CAAA,CAAA,CAAE,WAAY,EAAA,EAAG,CAAE,CAAA,QAAA,EAAa,GAAA,CAAA,EAAG,CAAE,CAAA,OAAA,EAAS,CAAA,CAAA;AACxE;;;;"}
|
|
File without changes
|