react-luna-form 0.0.40 → 0.0.42

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.
Files changed (33) hide show
  1. package/dist/client/cjs/index.js +1 -1
  2. package/dist/client/esm/index.js +1 -1
  3. package/dist/server/cjs/index.js +1 -1
  4. package/dist/server/esm/index.js +1 -1
  5. package/dist/timezone/cjs/index.js +1 -0
  6. package/dist/timezone/esm/chunk-6YOSEW3U.js +1 -0
  7. package/dist/timezone/esm/chunk-AJTG6FUX.js +1 -0
  8. package/dist/timezone/esm/chunk-EFQWCKYQ.js +818 -0
  9. package/dist/timezone/esm/chunk-JRS2SJNX.js +818 -0
  10. package/dist/timezone/esm/index.js +1 -0
  11. package/dist/timezone/esm/input-timezone-3TSHVJH7.js +766 -0
  12. package/dist/timezone/esm/input-timezone-D6UUK3LG.js +1 -0
  13. package/dist/timezone/esm/input-timezone-E45Y56W6.js +766 -0
  14. package/dist/timezone/esm/input-timezone-K27DM6BM.js +1 -0
  15. package/dist/timezone/esm/timezone-data-G5A3C2I7.js +1 -0
  16. package/dist/timezone/esm/timezone-data-LPD7JMNB.js +412 -0
  17. package/dist/timezone/esm/timezone-data-STGETEL3.js +1 -0
  18. package/dist/timezone/esm/timezone-data-XTIMFTET.js +412 -0
  19. package/dist/types/luna-react/src/client/component/input-base.d.ts +7 -0
  20. package/dist/types/luna-react/src/client/component/input-create.d.ts +3 -0
  21. package/dist/types/luna-react/src/client/component/input-dateable.d.ts +1 -0
  22. package/dist/types/luna-react/src/client/component/input-registry.d.ts +8 -0
  23. package/dist/types/luna-react/src/client/component/input-selectable.d.ts +1 -0
  24. package/dist/types/luna-react/src/client/component/input-strategies.d.ts +29 -0
  25. package/dist/types/luna-react/src/client/component/input-textable.d.ts +1 -0
  26. package/dist/types/luna-react/src/client/component/input-timezone.d.ts +2 -0
  27. package/dist/types/luna-react/src/client/component/input.d.ts +2 -16
  28. package/dist/types/luna-react/src/client/hook/use-input-core.d.ts +42 -0
  29. package/dist/types/luna-react/src/client/hook/use-timezone-options.d.ts +7 -0
  30. package/dist/types/luna-react/src/client/hook/use-write-only-source.d.ts +7 -0
  31. package/dist/types/luna-react/src/timezone/index.d.ts +3 -0
  32. package/package.json +12 -3
  33. package/dist/types/luna-react/src/client/component/input-date.d.ts +0 -16
@@ -0,0 +1,29 @@
1
+ import type { DataSource, Field, Nullable } from '@luna-form/core';
2
+ import type { Config } from '../../type';
3
+ type SetSource = (target: string, source?: DataSource) => void;
4
+ type SkipChangeCtx = Readonly<{
5
+ shouldSkipOnChange: () => boolean;
6
+ hasClickable: boolean;
7
+ inputValue: string;
8
+ valueRef: React.RefObject<unknown>;
9
+ }>;
10
+ type DispatchChangeCtx = Readonly<{
11
+ applyChangeEventsRef: React.RefObject<((s: unknown) => void) | null>;
12
+ data: Nullable<unknown[]>;
13
+ entity?: string;
14
+ inputValue: string;
15
+ setTimeoutRef: (cb: () => void, ms: number) => void;
16
+ }>;
17
+ export type InputStrategies = Readonly<{
18
+ useSource: (field: Field, config: Config, value?: Nullable<Record<string, unknown>>) => {
19
+ data: Nullable<unknown[]>;
20
+ setSource: SetSource;
21
+ };
22
+ getValue: (event: React.ChangeEvent<HTMLInputElement>, field: Field) => string;
23
+ shouldSkipChange: (ctx: SkipChangeCtx) => boolean;
24
+ dispatchChange: (ctx: DispatchChangeCtx) => void;
25
+ buildInitialSelected: (defaultValue: unknown, data: Nullable<unknown[]>, entity: string | undefined) => unknown;
26
+ isInitialReady: (field: Field, defaultValue: unknown, data: Nullable<unknown[]>) => boolean;
27
+ useExtraProps?: (field: Field) => Record<string, unknown> | undefined;
28
+ }>;
29
+ export {};
@@ -0,0 +1 @@
1
+ export declare const InputTextable: (props: import("../hook/use-input-core").InputCoreProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ declare const InputTimezone: (props: import("../hook/use-input-core").InputCoreProps) => import("react/jsx-runtime").JSX.Element;
2
+ export default InputTimezone;
@@ -1,16 +1,2 @@
1
- import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Nullable, type Schema } from '@luna-form/core';
2
- import type { Config, InputChange } from '../../type';
3
- export declare function Input(props: Readonly<{
4
- ariaAttributes?: AriaAttributes;
5
- commonProps: CommonProps;
6
- config: Config;
7
- context?: Record<string, unknown>;
8
- dataAttributes?: DataAttributes;
9
- field: Field;
10
- horizontal?: boolean;
11
- onMount: (name: string, schema: Schema, field: Field) => void;
12
- onUnmount: (name: string) => void;
13
- onValueChange?: (input: InputChange) => void;
14
- translations?: Record<string, string>;
15
- value?: Nullable<Record<string, unknown>>;
16
- }>): import("react").ReactNode;
1
+ import type { InputCoreProps } from '../hook/use-input-core';
2
+ export declare function Input(props: InputCoreProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { type AriaAttributes, type CommonProps, type DataAttributes, type DataSource, type Field, type Nullable, type Schema } from '@luna-form/core';
2
+ import type { Config, InputChange } from '../../type';
3
+ type SetSource = (target: string, source?: DataSource) => void;
4
+ export type InputCoreProps = Readonly<{
5
+ ariaAttributes?: AriaAttributes;
6
+ commonProps: CommonProps;
7
+ config: Config;
8
+ context?: Record<string, unknown>;
9
+ dataAttributes?: DataAttributes;
10
+ field: Field;
11
+ horizontal?: boolean;
12
+ onMount: (name: string, schema: Schema, field: Field) => void;
13
+ onUnmount: (name: string) => void;
14
+ onValueChange?: (input: InputChange) => void;
15
+ translations?: Record<string, string>;
16
+ value?: Nullable<Record<string, unknown>>;
17
+ }>;
18
+ type InputCoreDeps = Readonly<{
19
+ setValue: (value: unknown) => void;
20
+ shouldSkipOnChange: () => boolean;
21
+ value: unknown;
22
+ setSource: SetSource;
23
+ }>;
24
+ export declare function useInputCore(props: InputCoreProps, deps: InputCoreDeps): {
25
+ readonly applyChangeEventsRef: import("react").RefObject<((selected: unknown) => void) | null>;
26
+ readonly commonProps: {
27
+ placeholder: string;
28
+ disabled?: boolean;
29
+ id?: string;
30
+ name?: string;
31
+ required?: boolean;
32
+ };
33
+ readonly entity: string | undefined;
34
+ readonly hasClickable: boolean;
35
+ readonly onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
36
+ readonly onValueChangeRef: import("react").RefObject<((value: unknown) => void) | null>;
37
+ readonly setTimeoutRef: (callback: () => void, delay: number) => void;
38
+ readonly shouldSkipOnChange: () => boolean;
39
+ readonly validated: (value: string) => void;
40
+ readonly valueRef: import("react").RefObject<unknown>;
41
+ };
42
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { DataSource, Field, Nullable } from '@luna-form/core';
2
+ type SetSource = (target: string, source?: DataSource) => void;
3
+ export declare function useTimezoneOptions(field: Field): {
4
+ data: Nullable<unknown[]>;
5
+ setSource: SetSource;
6
+ };
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { DataSource, Field, Nullable } from '@luna-form/core';
2
+ type SetSource = (target: string, source?: DataSource) => void;
3
+ export declare function useWriteOnlySource(field: Field): {
4
+ data: Nullable<unknown[]>;
5
+ setSource: SetSource;
6
+ };
7
+ export {};
@@ -0,0 +1,3 @@
1
+ export { loadTimezones } from '@luna-form/core/load-timezones';
2
+ export { getUserTimezone } from '@luna-form/core';
3
+ export type { TimezoneGroup } from '@luna-form/core';
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "react-luna-form",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "A React library for building forms based on JSON",
5
5
  "main": "./dist/client/cjs/index.js",
6
6
  "module": "./dist/client/esm/index.js",
7
7
  "types": "./dist/types/luna-react/src/client/index.d.ts",
8
8
  "type": "module",
9
- "sideEffects": false,
9
+ "sideEffects": [
10
+ "./dist/timezone/esm/index.js",
11
+ "./dist/timezone/cjs/index.js"
12
+ ],
10
13
  "keywords": [
11
14
  "event",
12
15
  "forms",
@@ -34,7 +37,7 @@
34
37
  "eslint-plugin-react": "7.37.5",
35
38
  "eslint-plugin-react-hooks": "7.0.1",
36
39
  "eslint-plugin-react-refresh": "0.5.2",
37
- "@luna-form/core": "0.0.40"
40
+ "@luna-form/core": "0.0.42"
38
41
  },
39
42
  "license": "Apache-2.0",
40
43
  "repository": {
@@ -61,6 +64,12 @@
61
64
  "import": "./dist/config/esm/index.js",
62
65
  "require": "./dist/config/cjs/index.js",
63
66
  "default": "./dist/config/cjs/index.js"
67
+ },
68
+ "./timezone": {
69
+ "types": "./dist/types/luna-react/src/timezone/index.d.ts",
70
+ "import": "./dist/timezone/esm/index.js",
71
+ "require": "./dist/timezone/cjs/index.js",
72
+ "default": "./dist/timezone/cjs/index.js"
64
73
  }
65
74
  },
66
75
  "scripts": {
@@ -1,16 +0,0 @@
1
- import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Nullable, type Schema } from '@luna-form/core';
2
- import type { Config, InputChange } from '../../type';
3
- export declare function InputDate(props: Readonly<{
4
- ariaAttributes?: AriaAttributes;
5
- commonProps: CommonProps;
6
- config: Config;
7
- context?: Record<string, unknown>;
8
- dataAttributes?: DataAttributes;
9
- field: Field;
10
- horizontal?: boolean;
11
- onMount: (name: string, schema: Schema, field: Field) => void;
12
- onUnmount: (name: string) => void;
13
- onValueChange?: (input: InputChange) => void;
14
- translations?: Record<string, string>;
15
- value?: Nullable<Record<string, unknown>>;
16
- }>): import("react").ReactNode;