@sunggang/ui-lib 0.4.8 → 0.4.10

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/index.esm.js CHANGED
@@ -23,6 +23,7 @@ export { C as CustomSelect } from './CustomSelect.esm.js';
23
23
  import '@radix-ui/react-slot';
24
24
  import 'class-variance-authority';
25
25
  import 'tailwind-merge';
26
+ import 'next/dynamic';
26
27
  import './setPrototypeOf.esm.js';
27
28
  import './memoize-one.esm.esm.js';
28
29
  import '@emotion/react';
@@ -35,6 +36,7 @@ import './Modal.esm.js';
35
36
  import '@radix-ui/react-select';
36
37
  import 'flatpickr';
37
38
  import 'flatpickr/dist/l10n/zh-tw.js';
39
+ import 'flatpickr/dist/flatpickr.min.css';
38
40
 
39
41
  function _define_property$7(obj, key, value) {
40
42
  if (key in obj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "main": "./index.cjs.js",
5
5
  "module": "./index.esm.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FormItem, FormType } from '../types';
3
- import '../../../assets/css/flatpickr.min.css';
3
+ import 'flatpickr/dist/flatpickr.min.css';
4
4
  interface FlatpickrProps extends FormType {
5
5
  item: FormItem;
6
6
  }
@@ -22,9 +22,38 @@ export declare const config: (getValues: (name: string) => unknown) => (FormItem
22
22
  time_24hr: boolean;
23
23
  enableTime: boolean;
24
24
  dateFormat: string;
25
+ noCalendar?: undefined;
25
26
  };
26
- option?: undefined;
27
+ id?: undefined;
28
+ errorText?: undefined;
27
29
  placeholder?: undefined;
30
+ flatpickrType?: undefined;
31
+ option?: undefined;
32
+ noDataText?: undefined;
33
+ hiddenText?: undefined;
34
+ hiddenSearch?: undefined;
35
+ dropStyle?: undefined;
36
+ className?: undefined;
37
+ } | {
38
+ type: string;
39
+ icon: string;
40
+ name: string;
41
+ label: string;
42
+ id: string;
43
+ errorText: string;
44
+ placeholder: string;
45
+ flatpickrType: string;
46
+ validateOption: {
47
+ required: string;
48
+ };
49
+ flatpickrOptions: {
50
+ dateFormat: string;
51
+ enableTime: boolean;
52
+ mode: string;
53
+ noCalendar: boolean;
54
+ time_24hr: boolean;
55
+ };
56
+ option?: undefined;
28
57
  noDataText?: undefined;
29
58
  hiddenText?: undefined;
30
59
  hiddenSearch?: undefined;
@@ -55,6 +84,9 @@ export declare const config: (getValues: (name: string) => unknown) => (FormItem
55
84
  className: string;
56
85
  icon?: undefined;
57
86
  flatpickrOptions?: undefined;
87
+ id?: undefined;
88
+ errorText?: undefined;
89
+ flatpickrType?: undefined;
58
90
  })[] | {
59
91
  type: string;
60
92
  name: string;
@@ -1,5 +1,4 @@
1
1
  import type { FC } from 'react';
2
- import React from 'react';
3
2
  import { FormItem, FormType } from './types';
4
3
  export interface FormModule {
5
4
  Fields: FC<{
@@ -7,7 +6,6 @@ export interface FormModule {
7
6
  }>;
8
7
  Row: FC<{
9
8
  rowItems: FormItem[];
10
- loadedComponents?: Record<string, React.ComponentType<any>>;
11
9
  }>;
12
10
  TextField: FC<{
13
11
  item: FormItem;
@@ -41,7 +39,7 @@ export interface FormModule {
41
39
  }>;
42
40
  BaseCkeditor: FC<{
43
41
  item: FormItem;
44
- config?: any;
42
+ config: any;
45
43
  }>;
46
44
  BaseSelect: FC<{
47
45
  item: FormItem;
@@ -66,8 +64,7 @@ export declare const Fields: ({ formConfig, fieldsClass }: {
66
64
  export declare const CustomUploadField: ({ item }: {
67
65
  item: any;
68
66
  }) => import("react/jsx-runtime").JSX.Element;
69
- export declare const Row: ({ rowItems, loadedComponents }: {
67
+ export declare const Row: ({ rowItems }: {
70
68
  rowItems: any;
71
- loadedComponents?: {} | undefined;
72
69
  }) => any;
73
70
  export declare const Form: FormModule;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { FormItem } from './types';
3
- type ComponentType = React.ComponentType<any>;
4
- export declare function analyzeUsedTypes(formConfig: FormItem[][]): Set<string>;
5
- export declare function useDynamicComponents(formConfig: FormItem[][]): {
6
- loadedComponents: Record<string, ComponentType>;
7
- isLoading: boolean;
8
- };
9
- export declare function createDynamicComponent(type: string, loadedComponents: Record<string, ComponentType>): ComponentType | null;
10
- export {};
@@ -1,66 +0,0 @@
1
- import { FormItem } from './types';
2
- export declare const Regex: {
3
- phone: RegExp;
4
- };
5
- export declare const checkboxConfig: FormItem;
6
- export declare const checkboxGroupConfig: FormItem;
7
- export declare const radioConfig: FormItem;
8
- export declare const configWithoutCkEditor: (getValues: (name: string) => unknown) => FormItem[][];
9
- export declare const config: (getValues: (name: string) => unknown) => (FormItem[] | ({
10
- type: string;
11
- name: string;
12
- label: string;
13
- validateOption: {
14
- required: string;
15
- };
16
- icon: string;
17
- flatpickrOptions: {
18
- mode: string;
19
- time_24hr: boolean;
20
- enableTime: boolean;
21
- dateFormat: string;
22
- };
23
- option?: undefined;
24
- placeholder?: undefined;
25
- noDataText?: undefined;
26
- hiddenText?: undefined;
27
- hiddenSearch?: undefined;
28
- dropStyle?: undefined;
29
- className?: undefined;
30
- } | {
31
- type: string;
32
- name: string;
33
- label: string;
34
- option: {
35
- name: string;
36
- value: string;
37
- }[];
38
- validateOption: {
39
- required: string;
40
- };
41
- placeholder: string;
42
- noDataText: string;
43
- hiddenText: boolean;
44
- hiddenSearch: boolean;
45
- dropStyle: {
46
- bgClass: string;
47
- hoverClass: string;
48
- selectedClass: string;
49
- borderColor: string;
50
- textColor: string;
51
- };
52
- className: string;
53
- icon?: undefined;
54
- flatpickrOptions?: undefined;
55
- })[] | {
56
- type: string;
57
- name: string;
58
- label: string;
59
- imageStyleType: string;
60
- noticeLabel: string;
61
- errorText: string;
62
- validateOption: {
63
- required: boolean;
64
- };
65
- limitSize: number;
66
- }[])[];