react-luna-form 0.0.37 → 0.0.39
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/client/cjs/index.js +1 -1
- package/dist/client/esm/index.js +1 -1
- package/dist/config/cjs/index.js +1 -1
- package/dist/config/esm/index.js +1 -1
- package/dist/server/cjs/index.js +1 -1
- package/dist/server/esm/index.js +1 -1
- package/dist/types/luna-react/src/client/component/input-date.d.ts +16 -0
- package/dist/types/luna-react/src/client/hook/use-format.d.ts +5 -0
- package/package.json +4 -3
- package/dist/types/luna-core/src/fetcher.d.ts +0 -2
- package/dist/types/luna-core/src/handle/proxy-event.d.ts +0 -6
- package/dist/types/luna-core/src/handle/source-event.d.ts +0 -2
- package/dist/types/luna-core/src/handle/state-event.d.ts +0 -2
- package/dist/types/luna-core/src/handle/value-event.d.ts +0 -2
- package/dist/types/luna-core/src/helper/input.d.ts +0 -54
- package/dist/types/luna-core/src/index.d.ts +0 -24
- package/dist/types/luna-core/src/type.d.ts +0 -214
- package/dist/types/luna-core/src/util/attributes.d.ts +0 -6
- package/dist/types/luna-core/src/util/build.d.ts +0 -6
- package/dist/types/luna-core/src/util/column.d.ts +0 -2
- package/dist/types/luna-core/src/util/constant.d.ts +0 -51
- package/dist/types/luna-core/src/util/date.d.ts +0 -20
- package/dist/types/luna-core/src/util/extract.d.ts +0 -16
- package/dist/types/luna-core/src/util/is-input.d.ts +0 -24
- package/dist/types/luna-core/src/util/is-type.d.ts +0 -7
- package/dist/types/luna-core/src/util/list.d.ts +0 -4
- package/dist/types/luna-core/src/util/logger.d.ts +0 -5
- package/dist/types/luna-core/src/util/operator.d.ts +0 -1
- package/dist/types/luna-core/src/util/prepare.d.ts +0 -4
- package/dist/types/luna-core/src/util/schema.d.ts +0 -14
- package/dist/types/luna-core/src/util/source.d.ts +0 -2
- package/dist/types/luna-core/src/util/string.d.ts +0 -8
- package/dist/types/luna-core/src/util/stringify.d.ts +0 -1
- package/dist/types/luna-core/src/util/style.d.ts +0 -6
- package/dist/types/luna-core/src/util/translate.d.ts +0 -1
- package/dist/types/luna-core/src/util/url.d.ts +0 -10
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { CommonProps, DataSource, Field, Nullable, Value } from '../type';
|
|
2
|
-
export declare function buildOptionChips(field: Field): {
|
|
3
|
-
value: string;
|
|
4
|
-
label: string;
|
|
5
|
-
}[] | undefined;
|
|
6
|
-
export declare function buildOptionSelect(field: Field): {
|
|
7
|
-
value: string;
|
|
8
|
-
label: string;
|
|
9
|
-
}[] | import("..").TimezoneGroup[] | undefined;
|
|
10
|
-
export declare function buildCommon(field: Field, disabled?: boolean): CommonProps;
|
|
11
|
-
export declare function resolveSource(field: Field, value?: Nullable<Record<string, unknown>>): DataSource | unknown[] | undefined;
|
|
12
|
-
export declare function getInputValue<K>(field: Field, value?: Nullable<K>): Value | undefined;
|
|
13
|
-
export declare function mergeOptionsProps(field: Field, commonProps: CommonProps, options?: Nullable<DataSource | unknown[]>): CommonProps | {
|
|
14
|
-
options: unknown[];
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
id?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
required?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare function getPreselectedValue(field: Field, commonProps: CommonProps, value?: Value): any;
|
|
22
|
-
export declare function getOptions<T>(field: Field, data?: Nullable<T[]>): (T | {
|
|
23
|
-
description?: string | undefined;
|
|
24
|
-
label: string;
|
|
25
|
-
value: string;
|
|
26
|
-
})[] | null | undefined;
|
|
27
|
-
export declare function prepareInputProps<T, K>(field: Field, commonProps: CommonProps, data?: Nullable<DataSource | T[]>, value?: Nullable<K>): {
|
|
28
|
-
commonPropsWithOptions: CommonProps | {
|
|
29
|
-
options: unknown[];
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
id?: string;
|
|
32
|
-
name?: string;
|
|
33
|
-
placeholder?: string;
|
|
34
|
-
required?: boolean;
|
|
35
|
-
};
|
|
36
|
-
defaultValue: any;
|
|
37
|
-
};
|
|
38
|
-
export declare function prepareInputValue<T>(field: Field, value?: Nullable<T>): {
|
|
39
|
-
checked: boolean | Nullable<T> | undefined;
|
|
40
|
-
value?: undefined;
|
|
41
|
-
} | {
|
|
42
|
-
value: never[] | (T & any[]);
|
|
43
|
-
checked?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
value: string | NonNullable<T>;
|
|
46
|
-
checked?: undefined;
|
|
47
|
-
};
|
|
48
|
-
export declare function prepareDefaultValue<T>(field: Field, value?: Nullable<T>): {
|
|
49
|
-
defaultChecked: boolean;
|
|
50
|
-
defaultValue?: undefined;
|
|
51
|
-
} | {
|
|
52
|
-
defaultValue: Nullable<T> | undefined;
|
|
53
|
-
defaultChecked?: undefined;
|
|
54
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export * from './fetcher';
|
|
2
|
-
export * from './handle/proxy-event';
|
|
3
|
-
export * from './handle/source-event';
|
|
4
|
-
export * from './handle/state-event';
|
|
5
|
-
export * from './handle/value-event';
|
|
6
|
-
export * from './helper/input';
|
|
7
|
-
export * from './type';
|
|
8
|
-
export * from './util/attributes';
|
|
9
|
-
export * from './util/build';
|
|
10
|
-
export * from './util/column';
|
|
11
|
-
export * from './util/constant';
|
|
12
|
-
export * from './util/date';
|
|
13
|
-
export * from './util/extract';
|
|
14
|
-
export * from './util/is-input';
|
|
15
|
-
export * from './util/is-type';
|
|
16
|
-
export * from './util/list';
|
|
17
|
-
export * from './util/logger';
|
|
18
|
-
export * from './util/prepare';
|
|
19
|
-
export * from './util/schema';
|
|
20
|
-
export * from './util/source';
|
|
21
|
-
export * from './util/string';
|
|
22
|
-
export * from './util/style';
|
|
23
|
-
export * from './util/translate';
|
|
24
|
-
export * from './util/url';
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import type { core, z, ZodObject } from 'zod';
|
|
2
|
-
export type Schema = z.ZodTypeAny;
|
|
3
|
-
export type Schemas = Record<string, Schema>;
|
|
4
|
-
export type ZodSchema = ZodObject<{
|
|
5
|
-
[x: string]: Schema;
|
|
6
|
-
}, core.$strip>;
|
|
7
|
-
export type Nullable<T> = T | null;
|
|
8
|
-
export type DataAttributes = {
|
|
9
|
-
[key: `data-${string}`]: string | number | boolean;
|
|
10
|
-
};
|
|
11
|
-
export type AriaAttributes = {
|
|
12
|
-
[key: `aria-${string}`]: string | number | boolean;
|
|
13
|
-
};
|
|
14
|
-
export type TimeFormat = 'HH:mm' | 'HH:mm:ss' | 'hh:mm a' | 'hh:mm:ss a';
|
|
15
|
-
export type DataSource = {
|
|
16
|
-
url: string;
|
|
17
|
-
body?: BodyInit | Record<string, unknown>;
|
|
18
|
-
cache?: RequestCache;
|
|
19
|
-
headers?: HeadersInit;
|
|
20
|
-
method?: string;
|
|
21
|
-
namespace?: string;
|
|
22
|
-
};
|
|
23
|
-
export type Source = {
|
|
24
|
-
[key: string]: DataSource | Array<unknown>;
|
|
25
|
-
};
|
|
26
|
-
export type Definition = Record<string, unknown>;
|
|
27
|
-
export type Orderable = {
|
|
28
|
-
order?: number;
|
|
29
|
-
};
|
|
30
|
-
export type Hideable = {
|
|
31
|
-
hidden?: boolean;
|
|
32
|
-
};
|
|
33
|
-
export type Sections = Section[];
|
|
34
|
-
export type Multiple = readonly (string | number | boolean)[];
|
|
35
|
-
export type Value = string | number | Multiple;
|
|
36
|
-
export type Option = {
|
|
37
|
-
description?: string;
|
|
38
|
-
label: string;
|
|
39
|
-
value: string;
|
|
40
|
-
};
|
|
41
|
-
export type OptionGroup = {
|
|
42
|
-
label: string;
|
|
43
|
-
items: Option[];
|
|
44
|
-
};
|
|
45
|
-
export type List = {
|
|
46
|
-
advanced?: {
|
|
47
|
-
action?: string;
|
|
48
|
-
length?: Length<number>;
|
|
49
|
-
};
|
|
50
|
-
description?: string;
|
|
51
|
-
fields: Array<Field | Column>;
|
|
52
|
-
label?: string;
|
|
53
|
-
name: string;
|
|
54
|
-
type: 'list' | (string & {});
|
|
55
|
-
} & Base;
|
|
56
|
-
export type Fields = Array<Field | Column | List>;
|
|
57
|
-
export type Base = Orderable & Hideable;
|
|
58
|
-
export type CommonProps = {
|
|
59
|
-
disabled?: boolean;
|
|
60
|
-
id?: string;
|
|
61
|
-
name?: string;
|
|
62
|
-
placeholder?: string;
|
|
63
|
-
required?: boolean;
|
|
64
|
-
};
|
|
65
|
-
export type Section = {
|
|
66
|
-
advanced?: boolean;
|
|
67
|
-
compact?: boolean;
|
|
68
|
-
description?: string;
|
|
69
|
-
fields?: Fields;
|
|
70
|
-
id?: string | number;
|
|
71
|
-
separator?: boolean;
|
|
72
|
-
title?: string;
|
|
73
|
-
} & Base;
|
|
74
|
-
export type Column = {
|
|
75
|
-
advanced?: {
|
|
76
|
-
cols?: number;
|
|
77
|
-
};
|
|
78
|
-
description?: string;
|
|
79
|
-
fields: Array<Field>;
|
|
80
|
-
type: 'column' | (string & {});
|
|
81
|
-
} & Base;
|
|
82
|
-
export type Operator = 'eq' | 'neq' | 'in' | 'nin' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
83
|
-
export type Condition = {
|
|
84
|
-
field?: string;
|
|
85
|
-
operator?: Operator;
|
|
86
|
-
value: string | number | string[];
|
|
87
|
-
};
|
|
88
|
-
export type CustomValidation = {
|
|
89
|
-
field: string;
|
|
90
|
-
message?: string;
|
|
91
|
-
operator?: Operator;
|
|
92
|
-
};
|
|
93
|
-
export type FieldState = {
|
|
94
|
-
disabled?: boolean;
|
|
95
|
-
hidden?: boolean;
|
|
96
|
-
};
|
|
97
|
-
export type ActionEvent<T> = {
|
|
98
|
-
action: T;
|
|
99
|
-
};
|
|
100
|
-
export type SourceEvent = ActionEvent<'source'> & {
|
|
101
|
-
source: DataSource;
|
|
102
|
-
target: string;
|
|
103
|
-
};
|
|
104
|
-
export type ValueEvent = ActionEvent<'value'> & {
|
|
105
|
-
value: Record<string, Value | Array<Record<string, unknown>>>;
|
|
106
|
-
};
|
|
107
|
-
export type StateEvent = ActionEvent<'state'> & {
|
|
108
|
-
state: FieldState;
|
|
109
|
-
target: string | string[];
|
|
110
|
-
when?: string | string[] | Condition;
|
|
111
|
-
};
|
|
112
|
-
export type ChangeEvent = Array<SourceEvent | ValueEvent | StateEvent>;
|
|
113
|
-
export type Validation = {
|
|
114
|
-
custom?: CustomValidation | Array<CustomValidation>;
|
|
115
|
-
email?: string;
|
|
116
|
-
length?: Length<string>;
|
|
117
|
-
required?: string;
|
|
118
|
-
};
|
|
119
|
-
export type Field = CommonProps & {
|
|
120
|
-
advanced?: {
|
|
121
|
-
aria?: AriaAttributes;
|
|
122
|
-
autocomplete?: string;
|
|
123
|
-
cols?: number;
|
|
124
|
-
data?: DataAttributes;
|
|
125
|
-
entity?: string;
|
|
126
|
-
horizontal?: boolean;
|
|
127
|
-
reverse?: boolean;
|
|
128
|
-
};
|
|
129
|
-
event?: {
|
|
130
|
-
change?: ChangeEvent;
|
|
131
|
-
};
|
|
132
|
-
description?: string;
|
|
133
|
-
fields?: never;
|
|
134
|
-
label?: string;
|
|
135
|
-
name: string;
|
|
136
|
-
readonly?: boolean;
|
|
137
|
-
type: string;
|
|
138
|
-
validation?: Validation;
|
|
139
|
-
} & Base;
|
|
140
|
-
export type Length<T> = {
|
|
141
|
-
max?: T;
|
|
142
|
-
min?: T;
|
|
143
|
-
};
|
|
144
|
-
export type Input = Field & {
|
|
145
|
-
advanced?: {
|
|
146
|
-
length?: Length<number>;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export type Select = Field & {
|
|
150
|
-
advanced?: {
|
|
151
|
-
autocomplete?: never;
|
|
152
|
-
length?: Length<number | string>;
|
|
153
|
-
options?: Option;
|
|
154
|
-
preselected?: boolean;
|
|
155
|
-
};
|
|
156
|
-
source?: DataSource | Array<unknown>;
|
|
157
|
-
};
|
|
158
|
-
export type Chips = Field & {
|
|
159
|
-
advanced?: {
|
|
160
|
-
multiple?: boolean;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
export type Time = Field & {
|
|
164
|
-
advanced?: {
|
|
165
|
-
format?: TimeFormat;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
export type Environment = {
|
|
169
|
-
[key: string]: Value;
|
|
170
|
-
};
|
|
171
|
-
export type Protocol = 'http' | 'https';
|
|
172
|
-
export type RemotePattern = {
|
|
173
|
-
hostname?: string;
|
|
174
|
-
port?: number;
|
|
175
|
-
protocol?: Protocol;
|
|
176
|
-
};
|
|
177
|
-
export type FormStateError = {
|
|
178
|
-
title: string;
|
|
179
|
-
description?: string;
|
|
180
|
-
details?: Nullable<Record<string, string[]> | string[]>;
|
|
181
|
-
};
|
|
182
|
-
export type BaseConfig<T> = {
|
|
183
|
-
env?: Environment;
|
|
184
|
-
fetcher: {
|
|
185
|
-
provider: <T>(dataSource: DataSource) => Promise<T>;
|
|
186
|
-
remotePatterns?: Array<RemotePattern>;
|
|
187
|
-
};
|
|
188
|
-
inputs: {
|
|
189
|
-
[key: string]: T;
|
|
190
|
-
};
|
|
191
|
-
style?: Style;
|
|
192
|
-
validation: {
|
|
193
|
-
blur?: boolean;
|
|
194
|
-
change?: boolean;
|
|
195
|
-
showError?: boolean;
|
|
196
|
-
submit?: boolean;
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
export type Style = {
|
|
200
|
-
compact?: boolean;
|
|
201
|
-
horizontal?: boolean;
|
|
202
|
-
showOptionalLabel?: boolean;
|
|
203
|
-
};
|
|
204
|
-
export type Filterable = Base & {
|
|
205
|
-
fields?: Filterable[];
|
|
206
|
-
};
|
|
207
|
-
export type TimezoneItem = {
|
|
208
|
-
label: string;
|
|
209
|
-
value: string;
|
|
210
|
-
};
|
|
211
|
-
export type TimezoneGroup = {
|
|
212
|
-
items: TimezoneItem[];
|
|
213
|
-
label: string;
|
|
214
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Field } from '../type';
|
|
2
|
-
export declare function getPrefixedAttributes(prefix: string, record?: Record<string, string | number | boolean>): Record<string, string | number | boolean>;
|
|
3
|
-
export declare function getAriaAttributes(record?: Record<string, string | number | boolean>): Record<string, string | number | boolean>;
|
|
4
|
-
export declare function getDataAttributes(record?: Record<string, string | number | boolean>): Record<string, string | number | boolean>;
|
|
5
|
-
export declare function buildAriaAttributes(field: Field, errors?: string[]): Record<string, string | number | boolean>;
|
|
6
|
-
export declare function buildDataAttributes(field: Field): Record<string, string | number | boolean>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Field, Nullable } from '../type';
|
|
2
|
-
export declare function buildOptions(field: Field, values?: Nullable<Record<string, unknown>>): Record<string, unknown>[] | undefined;
|
|
3
|
-
export declare function buildOrientation(field: Field): boolean;
|
|
4
|
-
export declare function buildReverse(field: Field): boolean;
|
|
5
|
-
export declare function buildDisabled(field: Field, disabled?: boolean): boolean;
|
|
6
|
-
export declare function buildSource(field: Field): import("..").DataSource | unknown[] | undefined;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export declare const INPUT = "input";
|
|
2
|
-
export declare const INPUT_EMAIL = "input/email";
|
|
3
|
-
export declare const INPUT_NUMBER = "input/number";
|
|
4
|
-
export declare const INPUT_PASSWORD = "input/password";
|
|
5
|
-
export declare const INPUT_TEL = "input/tel";
|
|
6
|
-
export declare const INPUT_TEXT = "input/text";
|
|
7
|
-
export declare const INPUT_TIME = "input/time";
|
|
8
|
-
export declare const INPUTS: string[];
|
|
9
|
-
export declare const TEXTAREA = "textarea";
|
|
10
|
-
export declare const RADIO = "radio";
|
|
11
|
-
export declare const CHECKBOX = "checkbox";
|
|
12
|
-
export declare const LIST = "list";
|
|
13
|
-
export declare const DATA_TABLE = "data-table";
|
|
14
|
-
export declare const SELECT = "select";
|
|
15
|
-
export declare const SELECT_DAY = "select/day";
|
|
16
|
-
export declare const SELECT_MONTH = "select/month";
|
|
17
|
-
export declare const SELECT_TIMEZONE = "select/timezone";
|
|
18
|
-
export declare const SELECT_YEAR = "select/year";
|
|
19
|
-
export declare const SELECTS: string[];
|
|
20
|
-
export declare const CHIPS = "chips";
|
|
21
|
-
export declare const CHIPS_DAYS = "chips/day";
|
|
22
|
-
export declare const CHIPS_MONTHS = "chips/month";
|
|
23
|
-
export declare const COLUMN = "column";
|
|
24
|
-
export declare const DESCRIPTION = "description";
|
|
25
|
-
export declare const FIELDS = "fields";
|
|
26
|
-
export declare const LABEL = "label";
|
|
27
|
-
export declare const VALUE = "value";
|
|
28
|
-
export declare const OPTIONS = "options";
|
|
29
|
-
export declare const TYPE_EMAIL = "email";
|
|
30
|
-
export declare const TYPE_NUMBER = "number";
|
|
31
|
-
export declare const TYPE_PASSWORD = "password";
|
|
32
|
-
export declare const TYPE_TEL = "tel";
|
|
33
|
-
export declare const TYPE_TEXT = "text";
|
|
34
|
-
export declare const ARIA_ERROR_MESSAGE = "aria-errormessage";
|
|
35
|
-
export declare const ARIA_INVALID = "aria-invalid";
|
|
36
|
-
export declare const DATA_INVALID = "data-invalid";
|
|
37
|
-
export declare const DATA_READONLY = "data-readonly";
|
|
38
|
-
export declare const PREFIX_ARIA = "aria";
|
|
39
|
-
export declare const PREFIX_DATA = "data";
|
|
40
|
-
export declare const MAX = "max";
|
|
41
|
-
export declare const MAX_LENGTH = "maxLength";
|
|
42
|
-
export declare const MIN = "min";
|
|
43
|
-
export declare const MIN_LENGTH = "minLength";
|
|
44
|
-
export declare const $REF = "$ref";
|
|
45
|
-
export declare const SET = "set";
|
|
46
|
-
export declare const SOURCE = "source";
|
|
47
|
-
export declare const STATE = "state";
|
|
48
|
-
export declare const COMMON_URL = "http://luna.internal";
|
|
49
|
-
export declare const HIDDEN = "hidden";
|
|
50
|
-
export declare const TYPE = "type";
|
|
51
|
-
export declare const TIMEZONE_REGIONS: Record<string, string>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Time, TimeFormat, TimezoneGroup } from '../type';
|
|
2
|
-
export declare function getMonth(): {
|
|
3
|
-
value: string;
|
|
4
|
-
label: string;
|
|
5
|
-
}[];
|
|
6
|
-
export declare function getWeekDays(): {
|
|
7
|
-
value: string;
|
|
8
|
-
label: string;
|
|
9
|
-
}[];
|
|
10
|
-
export declare function getYear(min: number, max: number): Array<{
|
|
11
|
-
value: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}>;
|
|
14
|
-
export declare function getCurrentYear(): number;
|
|
15
|
-
export declare function getUserTimezone(): string;
|
|
16
|
-
export declare function getTimezones(): TimezoneGroup[];
|
|
17
|
-
export declare function getConvert(value: string | number, current?: number): number;
|
|
18
|
-
export declare function toNativeTime(value: string, fromFormat: TimeFormat): string;
|
|
19
|
-
export declare function fromNativeTime(native: string, toFormat?: TimeFormat): string;
|
|
20
|
-
export declare function getTimeFormat(field: Time): TimeFormat;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Nullable, Option, Value } from '../type';
|
|
2
|
-
export declare function getEntity<T>(selected: string, collection?: Nullable<T[]>, entity?: string): NonNullable<T> | {
|
|
3
|
-
value: string;
|
|
4
|
-
};
|
|
5
|
-
export declare function getCurrentValue<T>(value: T, entity?: string): Value | undefined;
|
|
6
|
-
export declare function getValue<T>(value: Record<string, T>, namespace?: string): T | undefined;
|
|
7
|
-
export declare function getArray<T>(value: Record<string, T> | T[], namespace?: string): Nullable<T[]>;
|
|
8
|
-
export declare function extract<T>(value: Record<string, T>, namespace?: string): T | null;
|
|
9
|
-
export declare function toOptions<T>(data: T[], options?: Option): (T | {
|
|
10
|
-
description?: string | undefined;
|
|
11
|
-
label: string;
|
|
12
|
-
value: string;
|
|
13
|
-
})[];
|
|
14
|
-
export declare function getType(value?: string): string;
|
|
15
|
-
export declare function getFormData(formData: FormData): Record<string, unknown>;
|
|
16
|
-
export declare function unflatten(data: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Chips, Column, Field, Input, List, Nullable, Select, Time } from '../type';
|
|
2
|
-
export declare const isSelectDay: (field: Field) => boolean;
|
|
3
|
-
export declare const isSelectMonth: (field: Field) => boolean;
|
|
4
|
-
export declare const isSelectYear: (field: Field) => boolean;
|
|
5
|
-
export declare const isSelectTimezone: (field: Field) => boolean;
|
|
6
|
-
export declare const isChipsDays: (field: Field) => boolean;
|
|
7
|
-
export declare const isChipsMonths: (field: Field) => boolean;
|
|
8
|
-
export declare const isCheckbox: (field: Field) => field is Input;
|
|
9
|
-
export declare const isChips: (field: Field) => field is Chips;
|
|
10
|
-
export declare const isInput: (field: Field) => field is Input;
|
|
11
|
-
export declare const isRadio: (field: Field) => field is Select;
|
|
12
|
-
export declare const isSelect: (field: Field) => field is Select;
|
|
13
|
-
export declare const isTextArea: (field: Field) => field is Input;
|
|
14
|
-
export declare const isTime: (field: Field) => field is Time;
|
|
15
|
-
export declare const isText: (field: Field) => field is Input;
|
|
16
|
-
export declare const isEmail: (field: Field) => field is Input;
|
|
17
|
-
export declare const isNumber: (field: Field) => field is Input;
|
|
18
|
-
export declare function isClickable(field: Field): boolean;
|
|
19
|
-
export declare function isList(slot: Field | Column | List): slot is List;
|
|
20
|
-
export declare function isColumn(slot: Field | Column | List): slot is Column;
|
|
21
|
-
export declare function isField(slot: Field | Column | List): slot is Field;
|
|
22
|
-
export declare function isOptions(field: Field): field is Select;
|
|
23
|
-
export declare function isTextable(field: Field): boolean;
|
|
24
|
-
export declare function isValidValue<T>(value?: Nullable<T>): boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DataSource, Value } from '../type';
|
|
2
|
-
export declare function isObject<T>(value: unknown): value is Record<string, T>;
|
|
3
|
-
export declare function isEmpty(value: unknown): boolean;
|
|
4
|
-
export declare function isValue(value: unknown): value is Value;
|
|
5
|
-
export declare function isString(value: unknown): value is string;
|
|
6
|
-
export declare function isDataSource(value: unknown): value is DataSource;
|
|
7
|
-
export declare function isBoolean(value: unknown): value is boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { List, Nullable } from '../type';
|
|
2
|
-
export declare function isMultiFieldList(list: List): boolean;
|
|
3
|
-
export declare function getInitialList(list: List, value?: Nullable<Record<string, unknown>>): number[];
|
|
4
|
-
export declare function getLabel(list: List): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const operators: Record<string, (current: unknown, value: unknown) => boolean>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Definition, Filterable, Nullable } from '../type';
|
|
2
|
-
export declare function prepare<T extends Filterable>(base?: readonly T[], definition?: Definition): any[];
|
|
3
|
-
export declare function resolveRefs(base: unknown, definition?: Definition, cache?: Map<object, unknown>, visited?: WeakSet<object>): unknown;
|
|
4
|
-
export declare function entries<T>(values?: Nullable<Record<string, T>>): [key: string, value: T][];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { CustomValidation, Field, Input, Schemas, ZodSchema } from '../type';
|
|
3
|
-
export declare function buildSchema(schemas: Schemas, fields?: Field[], translations?: Record<string, string>): ZodSchema;
|
|
4
|
-
export declare function flatten(error: z.ZodError<Record<string, unknown>>): Record<string, string[]>;
|
|
5
|
-
export declare function getSchema(input: Input, translations?: Record<string, string>): z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
|
-
export declare function getEmail(input: Input, translations?: Record<string, string>): z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodEmail>> | z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodEmail>, z.ZodLiteral<"">]>>;
|
|
7
|
-
export declare function getBoolean(input: Input, translations?: Record<string, string>): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodCoercedBoolean<unknown>> | z.ZodNullable<z.ZodCoercedBoolean<unknown>>;
|
|
8
|
-
export declare function getRadio(input: Input, translations?: Record<string, string>): z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedString<unknown>> | z.ZodNullable<z.ZodUnion<[z.ZodCoercedString<unknown>, z.ZodLiteral<"">]>>;
|
|
9
|
-
export declare function getText(input: Input, translations?: Record<string, string>): z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedString<unknown>> | z.ZodNullable<z.ZodCoercedString<unknown>>;
|
|
10
|
-
export declare function getNumber(input: Input, translations?: Record<string, string>): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodCoercedNumber<unknown>> | z.ZodNullable<z.ZodCoercedNumber<unknown>>;
|
|
11
|
-
export declare function getYearSchema(input: Input, translations?: Record<string, string>): z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodCoercedNumber<unknown>> | z.ZodNullable<z.ZodCoercedNumber<unknown>>;
|
|
12
|
-
export declare function getMonthSchema(input: Input, translations?: Record<string, string>): z.ZodCoercedNumber<unknown> | z.ZodNullable<z.ZodCoercedNumber<unknown>>;
|
|
13
|
-
export declare function applyCustomValidation(schema: ZodSchema, fields?: Field[], translations?: Record<string, string>): ZodSchema;
|
|
14
|
-
export declare function validateCustom(value: unknown, rules: CustomValidation | Array<CustomValidation>, getValue: (name: string) => unknown, translations?: Record<string, string>): string[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Replaces placeholders in the format {key} with values from the provided object.
|
|
3
|
-
* Supports nested objects using dot notation (e.g., {user.id}).
|
|
4
|
-
*/
|
|
5
|
-
export declare function interpolate<T>(template: T, values?: Record<string, unknown>): T;
|
|
6
|
-
export declare function interpolateIfNeeded<T>(template: T, values?: Record<string, unknown>): T;
|
|
7
|
-
export declare function isInterpolated(template: unknown): boolean;
|
|
8
|
-
export declare function formatMarkdown<K>(text?: string, callback?: (index: number, url: string, text?: string) => K): (string | K)[] | string | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function stringify<T>(body: T): string | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function translate(key?: string, dictionary?: Record<string, string>): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RemotePattern } from '../type';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a URL against a list of allowed remote patterns.
|
|
4
|
-
* Internal URLs are allowed by default.
|
|
5
|
-
* If patterns is undefined, all URLs are allowed.
|
|
6
|
-
* If patterns is an empty array, all external URLs are blocked.
|
|
7
|
-
*/
|
|
8
|
-
export declare function matchRemotePattern(urlStr: string, patterns?: RemotePattern[]): boolean;
|
|
9
|
-
export declare function isExternalUrl(url: string): boolean;
|
|
10
|
-
export declare function mergeUrl(baseUrl: string, targetUrl: string): string;
|