@admin-layout/tailwind-ui 10.0.9-alpha.71

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 (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +297 -0
  3. package/lib/components/ErrorHandlers/ApplicationErrorHandler.d.ts +2 -0
  4. package/lib/components/ErrorHandlers/ApplicationErrorHandler.d.ts.map +1 -0
  5. package/lib/components/ErrorHandlers/ApplicationErrorHandler.js +24 -0
  6. package/lib/components/ErrorHandlers/ApplicationErrorHandler.js.map +1 -0
  7. package/lib/components/ErrorHandlers/ErrorBoundary.d.ts +2 -0
  8. package/lib/components/ErrorHandlers/ErrorBoundary.d.ts.map +1 -0
  9. package/lib/components/ErrorHandlers/ErrorBoundary.js +48 -0
  10. package/lib/components/ErrorHandlers/ErrorBoundary.js.map +1 -0
  11. package/lib/components/ErrorHandlers/LayoutErrorBoundary.d.ts +2 -0
  12. package/lib/components/ErrorHandlers/LayoutErrorBoundary.d.ts.map +1 -0
  13. package/lib/components/ErrorHandlers/LayoutErrorBoundary.js +34 -0
  14. package/lib/components/ErrorHandlers/LayoutErrorBoundary.js.map +1 -0
  15. package/lib/components/ErrorHandlers/index.d.ts +4 -0
  16. package/lib/components/ErrorHandlers/index.d.ts.map +1 -0
  17. package/lib/components/ErrorPages/403.d.ts +2 -0
  18. package/lib/components/ErrorPages/403.d.ts.map +1 -0
  19. package/lib/components/ErrorPages/403.js +29 -0
  20. package/lib/components/ErrorPages/403.js.map +1 -0
  21. package/lib/components/ErrorPages/404.d.ts +2 -0
  22. package/lib/components/ErrorPages/404.d.ts.map +1 -0
  23. package/lib/components/ErrorPages/404.js +29 -0
  24. package/lib/components/ErrorPages/404.js.map +1 -0
  25. package/lib/components/ErrorPages/500.d.ts +2 -0
  26. package/lib/components/ErrorPages/500.d.ts.map +1 -0
  27. package/lib/components/ErrorPages/500.js +29 -0
  28. package/lib/components/ErrorPages/500.js.map +1 -0
  29. package/lib/components/ErrorPages/index.d.ts +4 -0
  30. package/lib/components/ErrorPages/index.d.ts.map +1 -0
  31. package/lib/components/OTP/OTPInput.d.ts +4 -0
  32. package/lib/components/OTP/OTPInput.d.ts.map +1 -0
  33. package/lib/components/OTP/OTPInput.js +82 -0
  34. package/lib/components/OTP/OTPInput.js.map +1 -0
  35. package/lib/components/OTP/OTPVerification.d.ts +4 -0
  36. package/lib/components/OTP/OTPVerification.d.ts.map +1 -0
  37. package/lib/components/OTP/OTPVerification.js +155 -0
  38. package/lib/components/OTP/OTPVerification.js.map +1 -0
  39. package/lib/components/OTP/SingleInput.d.ts +10 -0
  40. package/lib/components/OTP/SingleInput.d.ts.map +1 -0
  41. package/lib/components/OTP/SingleInput.js +43 -0
  42. package/lib/components/OTP/SingleInput.js.map +1 -0
  43. package/lib/components/OTP/hooks.d.ts +3 -0
  44. package/lib/components/OTP/hooks.d.ts.map +1 -0
  45. package/lib/components/OTP/hooks.js +95 -0
  46. package/lib/components/OTP/hooks.js.map +1 -0
  47. package/lib/components/OTP/index.d.ts +6 -0
  48. package/lib/components/OTP/index.d.ts.map +1 -0
  49. package/lib/components/OTP/types.d.ts +110 -0
  50. package/lib/components/OTP/types.d.ts.map +1 -0
  51. package/lib/components/OTP/utils.d.ts +26 -0
  52. package/lib/components/OTP/utils.d.ts.map +1 -0
  53. package/lib/components/OTP/utils.js +36 -0
  54. package/lib/components/OTP/utils.js.map +1 -0
  55. package/lib/components/PageContainer/PageContainer.d.ts +4 -0
  56. package/lib/components/PageContainer/PageContainer.d.ts.map +1 -0
  57. package/lib/components/PageContainer/PageContainer.js +57 -0
  58. package/lib/components/PageContainer/PageContainer.js.map +1 -0
  59. package/lib/components/PageContainer/index.d.ts +2 -0
  60. package/lib/components/PageContainer/index.d.ts.map +1 -0
  61. package/lib/components/PageContainer/types.d.ts +51 -0
  62. package/lib/components/PageContainer/types.d.ts.map +1 -0
  63. package/lib/components/PageLoading/index.d.ts +6 -0
  64. package/lib/components/PageLoading/index.d.ts.map +1 -0
  65. package/lib/components/PageLoading/index.js +9 -0
  66. package/lib/components/PageLoading/index.js.map +1 -0
  67. package/lib/components/ReactTable/Table.d.ts +18 -0
  68. package/lib/components/ReactTable/Table.d.ts.map +1 -0
  69. package/lib/components/ReactTable/Table.js +151 -0
  70. package/lib/components/ReactTable/Table.js.map +1 -0
  71. package/lib/components/ReactTable/TableFilters.d.ts +8 -0
  72. package/lib/components/ReactTable/TableFilters.d.ts.map +1 -0
  73. package/lib/components/ReactTable/TableFilters.js +58 -0
  74. package/lib/components/ReactTable/TableFilters.js.map +1 -0
  75. package/lib/components/ReactTable/index.d.ts +3 -0
  76. package/lib/components/ReactTable/index.d.ts.map +1 -0
  77. package/lib/components/Spin/index.d.ts +10 -0
  78. package/lib/components/Spin/index.d.ts.map +1 -0
  79. package/lib/components/Spin/index.js +31 -0
  80. package/lib/components/Spin/index.js.map +1 -0
  81. package/lib/components/index.d.ts +9 -0
  82. package/lib/components/index.d.ts.map +1 -0
  83. package/lib/hooks/useToast.d.ts +17 -0
  84. package/lib/hooks/useToast.d.ts.map +1 -0
  85. package/lib/hooks/useToast.js +163 -0
  86. package/lib/hooks/useToast.js.map +1 -0
  87. package/lib/icons/index.d.ts +15 -0
  88. package/lib/icons/index.d.ts.map +1 -0
  89. package/lib/icons/index.js +14 -0
  90. package/lib/icons/index.js.map +1 -0
  91. package/lib/index.d.ts +3 -0
  92. package/lib/index.d.ts.map +1 -0
  93. package/lib/index.js +1 -0
  94. package/lib/index.js.map +1 -0
  95. package/lib/machines/otpMachine.d.ts +3 -0
  96. package/lib/machines/otpMachine.d.ts.map +1 -0
  97. package/lib/machines/otpMachine.js +131 -0
  98. package/lib/machines/otpMachine.js.map +1 -0
  99. package/lib/utils/hooks/useDebounceFn/index.d.ts +8 -0
  100. package/lib/utils/hooks/useDebounceFn/index.d.ts.map +1 -0
  101. package/lib/utils/hooks/useDeepCompareEffect/index.d.ts +5 -0
  102. package/lib/utils/hooks/useDeepCompareEffect/index.d.ts.map +1 -0
  103. package/lib/utils/hooks/useDocumentTitle/index.d.ts +7 -0
  104. package/lib/utils/hooks/useDocumentTitle/index.d.ts.map +1 -0
  105. package/lib/utils/hooks/usePrevious/index.d.ts +3 -0
  106. package/lib/utils/hooks/usePrevious/index.d.ts.map +1 -0
  107. package/lib/utils/hooks/useWindowDimensions/index.d.ts +5 -0
  108. package/lib/utils/hooks/useWindowDimensions/index.d.ts.map +1 -0
  109. package/lib/utils/hooks/useWindowDimensions/index.js +21 -0
  110. package/lib/utils/hooks/useWindowDimensions/index.js.map +1 -0
  111. package/lib/utils/index.d.ts +21 -0
  112. package/lib/utils/index.d.ts.map +1 -0
  113. package/lib/utils/isBrowser/index.d.ts +3 -0
  114. package/lib/utils/isBrowser/index.d.ts.map +1 -0
  115. package/lib/utils/isDropdownValueType/index.d.ts +3 -0
  116. package/lib/utils/isDropdownValueType/index.d.ts.map +1 -0
  117. package/lib/utils/isImg/index.d.ts +4 -0
  118. package/lib/utils/isImg/index.d.ts.map +1 -0
  119. package/lib/utils/isNil/index.d.ts +3 -0
  120. package/lib/utils/isNil/index.d.ts.map +1 -0
  121. package/lib/utils/isUrl/index.d.ts +3 -0
  122. package/lib/utils/isUrl/index.d.ts.map +1 -0
  123. package/lib/utils/omitUndefined/index.d.ts +3 -0
  124. package/lib/utils/omitUndefined/index.d.ts.map +1 -0
  125. package/lib/utils/omitUndefinedAndEmptyArr/index.d.ts +3 -0
  126. package/lib/utils/omitUndefinedAndEmptyArr/index.d.ts.map +1 -0
  127. package/lib/utils/typing.d.ts +142 -0
  128. package/lib/utils/typing.d.ts.map +1 -0
  129. package/package.json +38 -0
@@ -0,0 +1,142 @@
1
+ import { ReactNode } from 'react';
2
+ import type { Options } from 'scroll-into-view-if-needed';
3
+ import type { FormInstance as RcFormInstance } from 'rc-field-form';
4
+ import type { NamePath } from 'rc-field-form/lib/interface';
5
+ export type ScrollFocusOptions = Options & {
6
+ focus?: boolean;
7
+ };
8
+ export type ScrollOptions = ScrollFocusOptions;
9
+ export type FormLabelAlign = 'left' | 'right';
10
+ export interface FormInstance<Values = any> extends RcFormInstance<Values> {
11
+ scrollToField: (name: NamePath, options?: ScrollOptions) => void;
12
+ focusField: (name: NamePath) => void;
13
+ getFieldInstance: (name: NamePath) => any;
14
+ }
15
+ type ProSchemaValueEnumType = {
16
+ /**
17
+ * @name Demonstration
18
+ */
19
+ text: ReactNode;
20
+ /**
21
+ * @name Predetermined color
22
+ */
23
+ status: string;
24
+ /**
25
+ * @name Custom color
26
+ */
27
+ color?: string;
28
+ /**
29
+ * @name Is it disabled?
30
+ */
31
+ disabled?: boolean;
32
+ };
33
+ export type ProSchemaValueEnumObj = {
34
+ [key: string]: ProSchemaValueEnumType | ReactNode;
35
+ };
36
+ /**
37
+ * @name ValueEnum type
38
+ * @description Support Map and Object
39
+ */
40
+ export type ProSchemaValueEnumMap = Map<React.ReactText, ProSchemaValueEnumType | ReactNode>;
41
+ export type SearchTransformKeyFn = (value: any, field: string, object: any) => string | {
42
+ [key: string]: any;
43
+ };
44
+ /**
45
+ * Supported deformation, not fully supported
46
+ */
47
+ export type ProSchemaComponentTypes = 'form' | 'list' | 'descriptions' | 'table' | 'cardList' | undefined;
48
+ export type ProFieldRequestData<T, U = any> = (params: U, props: T) => Promise<{
49
+ label: React.ReactNode;
50
+ value: React.ReactText;
51
+ [key: string]: any;
52
+ }[]>;
53
+ /**
54
+ * Operating type
55
+ */
56
+ export interface ProCoreActionType {
57
+ /**
58
+ * @name Refresh
59
+ */
60
+ reload: (resetPageIndex?: boolean) => void;
61
+ /**
62
+ * @name Refresh and empty
63
+ */
64
+ reloadAndRest?: () => void;
65
+ /**
66
+ * @name Reset
67
+ */
68
+ reset?: () => void;
69
+ /**
70
+ * @name 清空选择
71
+ */
72
+ clearSelected?: () => void;
73
+ }
74
+ /**
75
+ * All components public support render
76
+ */
77
+ export type ProSchema<T = unknown, U = string, Extra = unknown> = {
78
+ /**
79
+ * @name Determine the unique value of this column
80
+ */
81
+ key?: React.ReactText;
82
+ /**
83
+ * @name Key with entity mapping
84
+ * @description Support a number, [a, b] will be converted to obj.a.b
85
+ */
86
+ dataIndex?: string | number | (string | number)[];
87
+ /**
88
+ * Select how to render the corresponding mode
89
+ */
90
+ valueType?: ((entity: T, type: ProSchemaComponentTypes) => U) | U;
91
+ /**
92
+ * @name title
93
+ * @description Support for ReactNode and Method
94
+ */
95
+ title?: ((schema: ProSchema<T, U, Extra>, type: ProSchemaComponentTypes, dom: React.ReactNode) => React.ReactNode) | React.ReactNode;
96
+ /**
97
+ *@name Show an icon, hover is show some prompt information
98
+ */
99
+ tooltip?: string;
100
+ /**
101
+ * @deprecated You can use Tooltip, this change is in harmony with antd
102
+ */
103
+ tip?: string;
104
+ render?: (dom: React.ReactNode, entity: T, index: number, action: ProCoreActionType, schema: ProSchema<T, U, Extra>) => React.ReactNode;
105
+ /**
106
+ * @name Custom editing mode
107
+ * @description Returns a Node, which will automatically package value and onChange
108
+ */
109
+ renderFormItem?: (item: ProSchema<T, U, Extra>, config: {
110
+ value?: any;
111
+ onChange?: (value: any) => void;
112
+ onSelect?: (value: any) => void;
113
+ type: ProSchemaComponentTypes;
114
+ defaultRender: (newItem: ProSchema<T, U, Extra>) => JSX.Element | null;
115
+ }, form: FormInstance) => React.ReactNode;
116
+ /**
117
+ * @name Customize render
118
+ * @description Must return string
119
+ */
120
+ renderText?: (text: any, record: T, index: number, action: ProCoreActionType) => any;
121
+ fieldProps?: any;
122
+ /**
123
+ * @name Type of mapping value
124
+ */
125
+ valueEnum?: ProSchemaValueEnumObj | ProSchemaValueEnumMap;
126
+ /**
127
+ * @name Request enumeration from the server
128
+ */
129
+ request?: ProFieldRequestData<ProSchema>;
130
+ /**
131
+ * @name Parameters requested from the server, change the reload
132
+ */
133
+ params?: {
134
+ [key: string]: any;
135
+ };
136
+ /**
137
+ * @name Hidden in descriptions
138
+ */
139
+ hideInDescriptions?: boolean;
140
+ } & Extra;
141
+ export {};
142
+ //# sourceMappingURL=typing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E,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,KAAK,GAAG,CAAC;IAErF,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,qBAAqB,GAAG,qBAAqB,CAAC;IAE1D;;OAEG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAEzC;;OAEG;IACH,MAAM,CAAC,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;IACF;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,KAAK,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@admin-layout/tailwind-ui",
3
+ "version": "10.0.9-alpha.71",
4
+ "description": "Sample core for higher packages to depend on",
5
+ "license": "ISC",
6
+ "author": "CDMBase LLC",
7
+ "type": "module",
8
+ "main": "lib/index.js",
9
+ "module": "lib/index.js",
10
+ "typings": "lib/index.d.ts",
11
+ "scripts": {
12
+ "build": "npm run build:clean && npm run build:lib",
13
+ "build:clean": "rimraf lib",
14
+ "build:lib": "rollup -c rollup.config.mjs",
15
+ "build:lib:watch": "npm run build:lib -- --watch",
16
+ "jest": "./node_modules/.bin/jest",
17
+ "prepublish": "npm run build",
18
+ "test": "jest",
19
+ "test:debug": "npm test -- --runInBand",
20
+ "test:watch": "npm test -- --watch",
21
+ "watch": "npm run build:lib:watch"
22
+ },
23
+ "dependencies": {
24
+ "@admin-layout/client": "10.0.9-alpha.71"
25
+ },
26
+ "peerDependencies": {
27
+ "history": "*",
28
+ "react": ">=16",
29
+ "react-router-dom": "*"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "typescript": {
35
+ "definition": "lib/index.d.ts"
36
+ },
37
+ "gitHead": "e6c16b3733d42ccb51ead120c5e87aad49933ff5"
38
+ }