@kingteza/crud-component 1.0.22 → 1.0.24

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 (203) hide show
  1. package/package.json +19 -19
  2. package/dist/App.d.ts +0 -2
  3. package/dist/components/common/DatePicker/DatePicker.cjs +0 -1
  4. package/dist/components/common/DatePicker/DatePicker.d.ts +0 -37
  5. package/dist/components/common/DatePicker/DatePicker.js +0 -88
  6. package/dist/components/common/DatePicker/TimePicker.cjs +0 -1
  7. package/dist/components/common/DatePicker/TimePicker.d.ts +0 -34
  8. package/dist/components/common/DatePicker/TimePicker.js +0 -78
  9. package/dist/components/common/DatePicker/index.d.ts +0 -3
  10. package/dist/components/common/appearance/Hider.cjs +0 -1
  11. package/dist/components/common/appearance/Hider.d.ts +0 -6
  12. package/dist/components/common/appearance/Hider.js +0 -5
  13. package/dist/components/common/appearance/index.d.ts +0 -0
  14. package/dist/components/common/button/Button.cjs +0 -1
  15. package/dist/components/common/button/Button.d.ts +0 -12
  16. package/dist/components/common/button/Button.js +0 -79
  17. package/dist/components/common/button/CloneButtonTable.cjs +0 -1
  18. package/dist/components/common/button/CloneButtonTable.d.ts +0 -6
  19. package/dist/components/common/button/CloneButtonTable.js +0 -20
  20. package/dist/components/common/button/DeleteButtonTable.cjs +0 -1
  21. package/dist/components/common/button/DeleteButtonTable.d.ts +0 -13
  22. package/dist/components/common/button/DeleteButtonTable.js +0 -68
  23. package/dist/components/common/button/ExportButton.cjs +0 -1
  24. package/dist/components/common/button/ExportButton.d.ts +0 -4
  25. package/dist/components/common/button/ExportButton.js +0 -27
  26. package/dist/components/common/button/HideButtonTable.cjs +0 -1
  27. package/dist/components/common/button/HideButtonTable.d.ts +0 -13
  28. package/dist/components/common/button/HideButtonTable.js +0 -68
  29. package/dist/components/common/button/ImportButton.cjs +0 -1
  30. package/dist/components/common/button/ImportButton.d.ts +0 -9
  31. package/dist/components/common/button/ImportButton.js +0 -56
  32. package/dist/components/common/button/NewButton.cjs +0 -1
  33. package/dist/components/common/button/NewButton.d.ts +0 -12
  34. package/dist/components/common/button/NewButton.js +0 -24
  35. package/dist/components/common/button/PrintButton.cjs +0 -1
  36. package/dist/components/common/button/PrintButton.d.ts +0 -12
  37. package/dist/components/common/button/PrintButton.js +0 -26
  38. package/dist/components/common/button/RefreshButton.cjs +0 -1
  39. package/dist/components/common/button/RefreshButton.d.ts +0 -11
  40. package/dist/components/common/button/RefreshButton.js +0 -24
  41. package/dist/components/common/button/UnHideButton.cjs +0 -1
  42. package/dist/components/common/button/UnHideButton.d.ts +0 -14
  43. package/dist/components/common/button/UnHideButton.js +0 -70
  44. package/dist/components/common/button/UpdateButtonTable.cjs +0 -1
  45. package/dist/components/common/button/UpdateButtonTable.d.ts +0 -6
  46. package/dist/components/common/button/UpdateButtonTable.js +0 -20
  47. package/dist/components/common/button/ViewButtonTable.cjs +0 -1
  48. package/dist/components/common/button/ViewButtonTable.d.ts +0 -6
  49. package/dist/components/common/button/ViewButtonTable.js +0 -20
  50. package/dist/components/common/button/index.d.ts +0 -14
  51. package/dist/components/common/check-box/CheckBox.cjs +0 -1
  52. package/dist/components/common/check-box/CheckBox.d.ts +0 -9
  53. package/dist/components/common/check-box/CheckBox.js +0 -40
  54. package/dist/components/common/check-box/index.d.ts +0 -2
  55. package/dist/components/common/description/DescList.cjs +0 -1
  56. package/dist/components/common/description/DescList.d.ts +0 -18
  57. package/dist/components/common/description/DescList.js +0 -16
  58. package/dist/components/common/description/DescriptionComponent.d.ts +0 -7
  59. package/dist/components/common/description/index.d.ts +0 -3
  60. package/dist/components/common/index.d.ts +0 -22
  61. package/dist/components/common/layout/VerticalSpace.cjs +0 -1
  62. package/dist/components/common/layout/VerticalSpace.d.ts +0 -5
  63. package/dist/components/common/layout/VerticalSpace.js +0 -6
  64. package/dist/components/common/layout/index.d.ts +0 -2
  65. package/dist/components/common/loading/LoadingIndicator.cjs +0 -1
  66. package/dist/components/common/loading/LoadingIndicator.d.ts +0 -6
  67. package/dist/components/common/loading/LoadingIndicator.js +0 -24
  68. package/dist/components/common/loading/index.d.ts +0 -2
  69. package/dist/components/common/picker/ImagePicker.cjs +0 -1
  70. package/dist/components/common/picker/ImagePicker.d.ts +0 -56
  71. package/dist/components/common/picker/ImagePicker.js +0 -282
  72. package/dist/components/common/picker/index.d.ts +0 -2
  73. package/dist/components/common/radio/RadioGroupComponent.cjs +0 -1
  74. package/dist/components/common/radio/RadioGroupComponent.d.ts +0 -18
  75. package/dist/components/common/radio/RadioGroupComponent.js +0 -19
  76. package/dist/components/common/radio/index.d.ts +0 -2
  77. package/dist/components/common/report/SelectFieldInReport.cjs +0 -1
  78. package/dist/components/common/report/SelectFieldInReport.d.ts +0 -16
  79. package/dist/components/common/report/SelectFieldInReport.js +0 -30
  80. package/dist/components/common/report/index.d.ts +0 -3
  81. package/dist/components/common/select/CustomSelectOption.cjs +0 -1
  82. package/dist/components/common/select/CustomSelectOption.d.ts +0 -7
  83. package/dist/components/common/select/CustomSelectOption.js +0 -13
  84. package/dist/components/common/select/SelectComponent.cjs +0 -1
  85. package/dist/components/common/select/SelectComponent.d.ts +0 -21
  86. package/dist/components/common/select/SelectComponent.js +0 -89
  87. package/dist/components/common/select/index.d.ts +0 -3
  88. package/dist/components/common/show-more/index.cjs +0 -1
  89. package/dist/components/common/show-more/index.d.ts +0 -4
  90. package/dist/components/common/show-more/index.js +0 -8
  91. package/dist/components/common/tab/TabViewWithRoute.cjs +0 -1
  92. package/dist/components/common/tab/TabViewWithRoute.d.ts +0 -13
  93. package/dist/components/common/tab/TabViewWithRoute.js +0 -38
  94. package/dist/components/common/tab/index.d.ts +0 -2
  95. package/dist/components/common/table/index.d.ts +0 -3
  96. package/dist/components/common/table/table.cjs +0 -1
  97. package/dist/components/common/table/table.d.ts +0 -19
  98. package/dist/components/common/table/table.js +0 -40
  99. package/dist/components/common/tag/StatusTag.cjs +0 -1
  100. package/dist/components/common/tag/StatusTag.d.ts +0 -14
  101. package/dist/components/common/tag/StatusTag.js +0 -30
  102. package/dist/components/common/tag/index.d.ts +0 -2
  103. package/dist/components/common/text/index.cjs +0 -1
  104. package/dist/components/common/text/index.d.ts +0 -3
  105. package/dist/components/common/text/index.js +0 -5
  106. package/dist/components/common/text/title/TitleWithHeadTitle.d.ts +0 -7
  107. package/dist/components/common/text/title/index.cjs +0 -1
  108. package/dist/components/common/text/title/index.d.ts +0 -1
  109. package/dist/components/common/text/title/index.js +0 -5
  110. package/dist/components/common/text-field/NumberField.cjs +0 -1
  111. package/dist/components/common/text-field/NumberField.d.ts +0 -13
  112. package/dist/components/common/text-field/NumberField.js +0 -83
  113. package/dist/components/common/text-field/PhoneNumberField.cjs +0 -1
  114. package/dist/components/common/text-field/PhoneNumberField.d.ts +0 -4
  115. package/dist/components/common/text-field/PhoneNumberField.js +0 -18
  116. package/dist/components/common/text-field/TextArea.cjs +0 -1
  117. package/dist/components/common/text-field/TextArea.d.ts +0 -17
  118. package/dist/components/common/text-field/TextArea.js +0 -47
  119. package/dist/components/common/text-field/TextField.cjs +0 -1
  120. package/dist/components/common/text-field/TextField.d.ts +0 -27
  121. package/dist/components/common/text-field/TextField.js +0 -73
  122. package/dist/components/common/text-field/index.d.ts +0 -5
  123. package/dist/components/common/tooltip/TooltipComponent.cjs +0 -1
  124. package/dist/components/common/tooltip/TooltipComponent.d.ts +0 -5
  125. package/dist/components/common/tooltip/TooltipComponent.js +0 -9
  126. package/dist/components/common/tooltip/index.d.ts +0 -2
  127. package/dist/components/common/wizard/WizardResult.cjs +0 -1
  128. package/dist/components/common/wizard/WizardResult.d.ts +0 -16
  129. package/dist/components/common/wizard/WizardResult.js +0 -60
  130. package/dist/components/common/wizard/WizardViewForm.cjs +0 -1
  131. package/dist/components/common/wizard/WizardViewForm.d.ts +0 -24
  132. package/dist/components/common/wizard/WizardViewForm.js +0 -74
  133. package/dist/components/common/wizard/index.d.ts +0 -3
  134. package/dist/components/crud/CrudComponent.cjs +0 -1
  135. package/dist/components/crud/CrudComponent.d.ts +0 -237
  136. package/dist/components/crud/CrudComponent.js +0 -210
  137. package/dist/components/crud/CrudField.cjs +0 -1
  138. package/dist/components/crud/CrudField.d.ts +0 -4
  139. package/dist/components/crud/CrudField.js +0 -459
  140. package/dist/components/crud/CrudForm.cjs +0 -1
  141. package/dist/components/crud/CrudForm.d.ts +0 -14
  142. package/dist/components/crud/CrudForm.js +0 -91
  143. package/dist/components/crud/CrudFormWizard.cjs +0 -1
  144. package/dist/components/crud/CrudFormWizard.d.ts +0 -14
  145. package/dist/components/crud/CrudFormWizard.js +0 -140
  146. package/dist/components/crud/CrudReportComponent.cjs +0 -4
  147. package/dist/components/crud/CrudReportComponent.d.ts +0 -44
  148. package/dist/components/crud/CrudReportComponent.js +0 -255
  149. package/dist/components/crud/CrudSearchComponent.cjs +0 -1
  150. package/dist/components/crud/CrudSearchComponent.d.ts +0 -21
  151. package/dist/components/crud/CrudSearchComponent.js +0 -95
  152. package/dist/components/crud/FileCrudField.cjs +0 -1
  153. package/dist/components/crud/FileCrudField.d.ts +0 -25
  154. package/dist/components/crud/FileCrudField.js +0 -220
  155. package/dist/components/crud/ImageCrudField.cjs +0 -1
  156. package/dist/components/crud/ImageCrudField.d.ts +0 -38
  157. package/dist/components/crud/ImageCrudField.js +0 -113
  158. package/dist/components/crud/import/CrudImportButton.cjs +0 -1
  159. package/dist/components/crud/import/CrudImportButton.d.ts +0 -3
  160. package/dist/components/crud/import/CrudImportButton.js +0 -31
  161. package/dist/components/crud/import/CrudImportComponent.cjs +0 -2
  162. package/dist/components/crud/import/CrudImportComponent.d.ts +0 -14
  163. package/dist/components/crud/import/CrudImportComponent.js +0 -223
  164. package/dist/components/crud/index.d.ts +0 -15
  165. package/dist/components/crud/view/CrudDecListView.cjs +0 -1
  166. package/dist/components/crud/view/CrudDecListView.d.ts +0 -14
  167. package/dist/components/crud/view/CrudDecListView.js +0 -42
  168. package/dist/components/crud/view/CrudViewer.cjs +0 -1
  169. package/dist/components/crud/view/CrudViewer.d.ts +0 -43
  170. package/dist/components/crud/view/CrudViewer.js +0 -217
  171. package/dist/components/crud/view/CrudViewerUtil.cjs +0 -1
  172. package/dist/components/crud/view/CrudViewerUtil.d.ts +0 -2
  173. package/dist/components/crud/view/CrudViewerUtil.js +0 -57
  174. package/dist/components/crud/view/index.d.ts +0 -5
  175. package/dist/index.cjs +0 -1
  176. package/dist/index.d.ts +0 -4
  177. package/dist/index.js +0 -32
  178. package/dist/locale/hooks/translation-constants.cjs +0 -1
  179. package/dist/locale/hooks/translation-constants.d.ts +0 -1
  180. package/dist/locale/hooks/translation-constants.js +0 -4
  181. package/dist/locale/index.cjs +0 -1
  182. package/dist/locale/index.d.ts +0 -74
  183. package/dist/locale/index.js +0 -37
  184. package/dist/locale/translations/en.cjs +0 -1
  185. package/dist/locale/translations/en.d.ts +0 -58
  186. package/dist/locale/translations/en.js +0 -60
  187. package/dist/main.d.ts +0 -0
  188. package/dist/util/DateUtil.cjs +0 -1
  189. package/dist/util/DateUtil.d.ts +0 -7
  190. package/dist/util/DateUtil.js +0 -6
  191. package/dist/util/ImageUtil.cjs +0 -1
  192. package/dist/util/ImageUtil.d.ts +0 -14
  193. package/dist/util/ImageUtil.js +0 -63
  194. package/dist/util/NumberUtil.cjs +0 -1
  195. package/dist/util/NumberUtil.d.ts +0 -17
  196. package/dist/util/NumberUtil.js +0 -60
  197. package/dist/util/ValidationUtil.cjs +0 -1
  198. package/dist/util/ValidationUtil.d.ts +0 -14
  199. package/dist/util/ValidationUtil.js +0 -60
  200. package/dist/util/index.cjs +0 -1
  201. package/dist/util/index.d.ts +0 -4
  202. package/dist/util/index.js +0 -10
  203. package/dist/vite-env.d.ts +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.0.22",
4
+ "version": "1.0.24",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",
@@ -11,7 +11,7 @@
11
11
  "types",
12
12
  "typings"
13
13
  ],
14
- "types": "./dist/index.d.ts",
14
+ "types": "./index.d.ts",
15
15
  "author": "Kingteza",
16
16
  "license": "MIT",
17
17
  "repository": {
@@ -19,39 +19,39 @@
19
19
  "url": "https://github.com/kingteza/crud-component"
20
20
  },
21
21
  "files": [
22
- "dist/*.js",
23
- "dist/*.cjs",
24
- "dist/*.d.ts",
25
- "dist/components/",
26
- "dist/util/",
27
- "dist/locale/",
28
- "README.md"
22
+ "/*.js",
23
+ "/*.cjs",
24
+ "/*.d.ts",
25
+ "/components/",
26
+ "/util/",
27
+ "/locale/",
28
+ "../README.md"
29
29
  ],
30
30
  "type": "module",
31
31
  "sideEffects": false,
32
32
  "scripts": {
33
33
  "dev": "vite",
34
34
  "clean": "rm -rf dist",
35
- "build": "npm run clean && tsc && vite build",
35
+ "build": "npm run clean && tsc && vite build && cp package.json dist/",
36
36
  "prepublishOnly": "npm run clean && npm run build",
37
37
  "lint": "eslint .",
38
38
  "preview": "vite preview"
39
39
  },
40
40
  "exports": {
41
41
  ".": {
42
- "types": "./dist/index.d.ts",
43
- "import": "./dist/index.js",
44
- "require": "./dist/index.cjs"
42
+ "types": "./index.d.ts",
43
+ "import": "./index.js",
44
+ "require": "./index.cjs"
45
45
  },
46
46
  "./common": {
47
- "types": "./dist/components/common/index.d.ts",
48
- "import": "./dist/components/common/index.js",
49
- "require": "./dist/components/common/index.cjs"
47
+ "types": "./components/common/index.d.ts",
48
+ "import": "./components/common/index.js",
49
+ "require": "./components/common/index.cjs"
50
50
  },
51
51
  "./util": {
52
- "types": "./dist/util/index.d.ts",
53
- "import": "./dist/util/index.js",
54
- "require": "./dist/util/index.cjs"
52
+ "types": "./util/index.d.ts",
53
+ "import": "./util/index.js",
54
+ "require": "./util/index.cjs"
55
55
  }
56
56
  },
57
57
  "publishConfig": {
package/dist/App.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare function App(): import("react/jsx-runtime").JSX.Element;
2
- export default App;
@@ -1 +0,0 @@
1
- "use strict";const d=require("react/jsx-runtime"),s=require("antd"),t=require("dayjs"),E=require("dayjs/plugin/advancedFormat"),F=require("dayjs/plugin/customParseFormat"),I=require("dayjs/plugin/localeData"),v=require("dayjs/plugin/weekday"),S=require("dayjs/plugin/weekOfYear"),T=require("dayjs/plugin/weekYear"),Y=require("../../../locale/hooks/translation-constants.cjs"),$=require("react"),L=require("react-i18next");t.extend(F);t.extend(E);t.extend(v);t.extend(I);t.extend(S);t.extend(T);const M=({type:_,required:q,label:o,rules:x=[],placeholder:a,disabledPastDays:c=!1,disableToday:i=!1,onEnter:z,disabled:f,nextFocus:B,onChange:r,range:m,showTime:l,disabledFutureDays:u,picker:k,defaultValue:O,value:y,format:P,autoComplete:G="off",enabledDates:H=[],renderExtraFooter:j,...p})=>{const{t:w}=L.useTranslation(Y.TRANSLATION_NAMESPACE),A=m?s.DatePicker.RangePicker:s.DatePicker,D=$.useCallback(e=>{if(!e)return!1;const n=t(),N=c&&e<n.startOf("day"),R=u&&e>n.endOf("day"),C=i&&e<n.endOf("day")&&n.startOf("day")<e;return N||R||C},[c,u,i]);return d.jsx(s.Form.Item,{...p,label:o,rules:[{required:q,message:`${o??a??""} ${w("err.validation.required")}`},...x],children:d.jsx(A,{renderExtraFooter:j,value:y,picker:k,defaultValue:O,format:P,onChange:e=>r==null?void 0:r(e),disabledDate:D,disabled:f,className:"w-100",placeholder:a,showTime:l})})};module.exports=M;
@@ -1,37 +0,0 @@
1
- import { FormItemProps } from 'antd/lib/form';
2
- import { Dayjs } from 'dayjs';
3
- import { default as React, FC } from 'react';
4
- export type DateRange = [Dayjs | null, Dayjs | null];
5
- export interface DatePickerComponentProps extends FormItemProps<any> {
6
- type?: any;
7
- placeholder?: string;
8
- onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
9
- nextFocus?: string;
10
- disableToday?: boolean;
11
- autoComplete?: string;
12
- disabled?: boolean;
13
- enabledDates?: Date[];
14
- disabledPastDays?: boolean;
15
- disabledFutureDays?: boolean;
16
- renderExtraFooter?: () => React.ReactElement;
17
- }
18
- export interface DateRangePickerProps extends DatePickerComponentProps {
19
- onChange?: (date: DateRange) => void;
20
- range: true;
21
- defaultValue?: DateRange | boolean;
22
- value?: DateRange;
23
- format?: string;
24
- picker?: string;
25
- showTime?: boolean;
26
- }
27
- export interface DatePickerProps extends DatePickerComponentProps {
28
- onChange?: (date: Dayjs | null) => void;
29
- defaultValue?: Dayjs;
30
- value?: Dayjs;
31
- range?: false;
32
- format?: string;
33
- picker?: string;
34
- showTime?: never;
35
- }
36
- declare const DatePickerComponent: FC<DateRangePickerProps | DatePickerProps>;
37
- export default DatePickerComponent;
@@ -1,88 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { DatePicker as d, Form as C } from "antd";
3
- import e from "dayjs";
4
- import I from "dayjs/plugin/advancedFormat";
5
- import R from "dayjs/plugin/customParseFormat";
6
- import S from "dayjs/plugin/localeData";
7
- import T from "dayjs/plugin/weekday";
8
- import Y from "dayjs/plugin/weekOfYear";
9
- import $ from "dayjs/plugin/weekYear";
10
- import { TRANSLATION_NAMESPACE as q } from "../../../locale/hooks/translation-constants.js";
11
- import { useCallback as L } from "react";
12
- import { useTranslation as M } from "react-i18next";
13
- e.extend(R);
14
- e.extend(I);
15
- e.extend(T);
16
- e.extend(S);
17
- e.extend(Y);
18
- e.extend($);
19
- const et = ({
20
- type: _,
21
- required: c,
22
- label: m,
23
- rules: p = [],
24
- placeholder: a,
25
- disabledPastDays: n = !1,
26
- disableToday: f = !1,
27
- onEnter: z,
28
- disabled: l,
29
- nextFocus: B,
30
- onChange: r,
31
- range: x,
32
- showTime: k,
33
- disabledFutureDays: s,
34
- picker: O,
35
- defaultValue: u,
36
- value: y,
37
- format: w,
38
- autoComplete: G = "off",
39
- enabledDates: H = [],
40
- renderExtraFooter: A,
41
- ...N
42
- }) => {
43
- const { t: P } = M(q), D = x ? d.RangePicker : d, E = L(
44
- (t) => {
45
- if (!t)
46
- return !1;
47
- const o = e(), F = n && t < o.startOf("day"), j = s && t > o.endOf("day"), v = f && t < o.endOf("day") && o.startOf("day") < t;
48
- return F || j || v;
49
- },
50
- [n, s, f]
51
- // Dependencies for useCallback
52
- );
53
- return /* @__PURE__ */ i(
54
- C.Item,
55
- {
56
- ...N,
57
- label: m,
58
- rules: [
59
- {
60
- required: c,
61
- message: `${m ?? a ?? ""} ${P(
62
- "err.validation.required"
63
- )}`
64
- },
65
- ...p
66
- ],
67
- children: /* @__PURE__ */ i(
68
- D,
69
- {
70
- renderExtraFooter: A,
71
- value: y,
72
- picker: O,
73
- defaultValue: u,
74
- format: w,
75
- onChange: (t) => r == null ? void 0 : r(t),
76
- disabledDate: E,
77
- disabled: l,
78
- className: "w-100",
79
- placeholder: a,
80
- showTime: k
81
- }
82
- )
83
- }
84
- );
85
- };
86
- export {
87
- et as default
88
- };
@@ -1 +0,0 @@
1
- "use strict";const l=require("react/jsx-runtime"),c=require("antd"),C=require("dayjs"),q=require("react"),F=require("react-i18next"),M=require("../../../locale/hooks/translation-constants.cjs"),$=({type:v,required:T,label:r,rules:f=[],placeholder:t,disabledPast:i=!1,disableCurrent:m=!1,onEnter:w,disabled:x,use12Hours:k,nextFocus:D,onChange:s,range:n,disabledFuture:a,defaultValue:j,value:p,format:A,autoComplete:H="off",renderExtraFooter:N,...P})=>{const{t:R}=F.useTranslation(M.TRANSLATION_NAMESPACE),u=q.useMemo(()=>t||(n?["From","To"]:"Select time"),[t,n]);console.log(u);const y=n?c.TimePicker.RangePicker:c.TimePicker,E=q.useCallback(e=>{if(!e)return!1;const o=C(),I=i&&e<o,S=a&&e>o,d=m&&e<o&&o<e;return I||S||d},[m,a,i]);return l.jsx(c.Form.Item,{...P,label:r,rules:[{required:T,message:`${r??t??""} ${R("err.validation.required")}`},...f],children:l.jsx(y,{use12Hours:k,renderExtraFooter:N,value:p,defaultValue:j,format:A,onChange:e=>s==null?void 0:s(e),disabledDate:E,disabled:x,className:"w-100",placeholder:u})})};module.exports=$;
@@ -1,34 +0,0 @@
1
- import { FormItemProps } from 'antd/lib/form';
2
- import { Dayjs } from 'dayjs';
3
- import { default as React, FC } from 'react';
4
- export type DateRange = [Dayjs | null, Dayjs | null];
5
- export interface TimePickerComponentProps extends FormItemProps<any> {
6
- type?: any;
7
- onEnter?: React.KeyboardEventHandler<HTMLInputElement>;
8
- nextFocus?: string;
9
- disableCurrent?: boolean;
10
- use12Hours?: boolean;
11
- autoComplete?: string;
12
- disabled?: boolean;
13
- disabledPast?: boolean;
14
- disabledFuture?: boolean;
15
- renderExtraFooter?: () => React.ReactElement;
16
- }
17
- export interface TimeRangePickerProps extends TimePickerComponentProps {
18
- onChange?: (date: DateRange) => void;
19
- range: true;
20
- defaultValue?: DateRange;
21
- value?: DateRange;
22
- format?: string;
23
- placeholder?: [string, string];
24
- }
25
- export interface TimePickerProps extends TimePickerComponentProps {
26
- onChange?: (date: Dayjs | null) => void;
27
- range: false;
28
- defaultValue?: Dayjs;
29
- value?: Dayjs;
30
- format?: string;
31
- placeholder?: string;
32
- }
33
- declare const TimePickerComponent: FC<TimeRangePickerProps | TimePickerProps>;
34
- export default TimePickerComponent;
@@ -1,78 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { TimePicker as a, Form as M } from "antd";
3
- import R from "dayjs";
4
- import { useMemo as $, useCallback as q } from "react";
5
- import { useTranslation as v } from "react-i18next";
6
- import { TRANSLATION_NAMESPACE as w } from "../../../locale/hooks/translation-constants.js";
7
- const K = ({
8
- type: C,
9
- required: l,
10
- label: r,
11
- rules: T = [],
12
- placeholder: t,
13
- disabledPast: c = !1,
14
- disableCurrent: i = !1,
15
- onEnter: D,
16
- disabled: k,
17
- use12Hours: u,
18
- nextFocus: H,
19
- onChange: e,
20
- range: s,
21
- disabledFuture: n,
22
- defaultValue: A,
23
- value: N,
24
- format: x,
25
- autoComplete: L = "off",
26
- renderExtraFooter: y,
27
- ...E
28
- }) => {
29
- const { t: P } = v(w), f = $(
30
- () => t || (s ? ["From", "To"] : "Select time"),
31
- [t, s]
32
- );
33
- console.log(f);
34
- const S = s ? a.RangePicker : a, d = q(
35
- (o) => {
36
- if (!o)
37
- return !1;
38
- const m = R(), j = c && o < m, F = n && o > m, I = i && o < m && m < o;
39
- return j || F || I;
40
- },
41
- [i, n, c]
42
- // Dependencies for useCallback
43
- );
44
- return /* @__PURE__ */ p(
45
- M.Item,
46
- {
47
- ...E,
48
- label: r,
49
- rules: [
50
- {
51
- required: l,
52
- message: `${r ?? t ?? ""} ${P(
53
- "err.validation.required"
54
- )}`
55
- },
56
- ...T
57
- ],
58
- children: /* @__PURE__ */ p(
59
- S,
60
- {
61
- use12Hours: u,
62
- renderExtraFooter: y,
63
- value: N,
64
- defaultValue: A,
65
- format: x,
66
- onChange: (o) => e == null ? void 0 : e(o),
67
- disabledDate: d,
68
- disabled: k,
69
- className: "w-100",
70
- placeholder: f
71
- }
72
- )
73
- }
74
- );
75
- };
76
- export {
77
- K as default
78
- };
@@ -1,3 +0,0 @@
1
- import { default as DatePickerComponent } from './DatePicker';
2
- import { default as TimePickerComponent } from './TimePicker';
3
- export { DatePickerComponent, TimePickerComponent };
@@ -1 +0,0 @@
1
- "use strict";const r=require("react/jsx-runtime"),t=({children:e,hide:s})=>r.jsx("div",{className:s?"d-none":"",children:e});module.exports=t;
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- declare const Hider: FC<{
3
- children: any;
4
- hide: boolean;
5
- }>;
6
- export default Hider;
@@ -1,5 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- const t = ({ children: e, hide: r }) => /* @__PURE__ */ o("div", { className: r ? "d-none" : "", children: e });
3
- export {
4
- t as default
5
- };
File without changes
@@ -1 +0,0 @@
1
- "use strict";const y=require("react/jsx-runtime"),f=require("antd"),g=require("../../../locale/hooks/translation-constants.cjs"),l=require("react"),A=require("react-i18next");;/* empty css */const d=require("react-router-dom"),q=({className:i,to:t,onClick:n,tooltip:o,ref:x,...r})=>{var a;const{t:e}=A.useTranslation(g.TRANSLATION_NAMESPACE);let s;try{s=(a=d.useNavigate)==null?void 0:a.call(d)}catch(u){console.error(u)}const c=l.useMemo(()=>y.jsx(f.Button,{onClick:n||(t&&s?()=>s(t):void 0),className:i,...r,children:r.children||e(`button.${r.type}`)}),[i,s,n,r,e,t]);return o?y.jsx(f.Tooltip,{title:o,children:c}):c},j=({className:i,to:t,onClick:n,tooltip:o,ref:x,...r})=>{let e;try{e=d.useNavigate()}catch(h){console.error(h)}const[s,c]=l.useState(!1),a=l.useCallback(async h=>{try{return c(!0),await n(h)}finally{c(!1)}},[n]),u=l.useMemo(()=>y.jsx(f.Button,{loading:s||r.loading,onClick:n?a:t?()=>{e?e==null||e(t):window.location.href=t}:void 0,className:i,...r}),[a,i,s,e,n,r,t]);return o?y.jsx(f.Tooltip,{title:o,children:u}):u};q.Async=j;module.exports=q;
@@ -1,12 +0,0 @@
1
- import { ButtonProps } from 'antd';
2
- import { default as React } from 'react';
3
- export interface ButtonComponentProps extends ButtonProps {
4
- to?: string | number;
5
- tooltip?: string | undefined;
6
- ref?: any;
7
- }
8
- type ComponentType = React.FC<ButtonComponentProps> & {
9
- Async: React.FC<ButtonComponentProps>;
10
- };
11
- declare const _default: ComponentType;
12
- export default _default;
@@ -1,79 +0,0 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { Button as u, Tooltip as d } from "antd";
3
- import { TRANSLATION_NAMESPACE as g } from "../../../locale/hooks/translation-constants.js";
4
- import { useMemo as y, useState as b, useCallback as T } from "react";
5
- import { useTranslation as v } from "react-i18next";
6
- /* empty css */
7
- import { useNavigate as h } from "react-router-dom";
8
- const w = ({
9
- className: i,
10
- to: r,
11
- onClick: e,
12
- tooltip: a,
13
- ref: A,
14
- ...n
15
- }) => {
16
- var l;
17
- const { t } = v(g);
18
- let o;
19
- try {
20
- o = (l = h) == null ? void 0 : l();
21
- } catch (s) {
22
- console.error(s);
23
- }
24
- const c = y(
25
- () => /* @__PURE__ */ f(
26
- u,
27
- {
28
- onClick: e || (r && o ? () => o(r) : void 0),
29
- className: i,
30
- ...n,
31
- children: n.children || t(`button.${n.type}`)
32
- }
33
- ),
34
- [i, o, e, n, t, r]
35
- );
36
- return a ? /* @__PURE__ */ f(d, { title: a, children: c }) : c;
37
- }, S = ({
38
- className: i,
39
- to: r,
40
- onClick: e,
41
- tooltip: a,
42
- ref: A,
43
- ...n
44
- }) => {
45
- let t;
46
- try {
47
- t = h();
48
- } catch (m) {
49
- console.error(m);
50
- }
51
- const [o, c] = b(!1), l = T(
52
- async (m) => {
53
- try {
54
- return c(!0), await e(m);
55
- } finally {
56
- c(!1);
57
- }
58
- },
59
- [e]
60
- ), s = y(
61
- () => /* @__PURE__ */ f(
62
- u,
63
- {
64
- loading: o || n.loading,
65
- onClick: e ? l : r ? () => {
66
- t ? t == null || t(r) : window.location.href = r;
67
- } : void 0,
68
- className: i,
69
- ...n
70
- }
71
- ),
72
- [l, i, o, t, e, n, r]
73
- );
74
- return a ? /* @__PURE__ */ f(d, { title: a, children: s }) : s;
75
- };
76
- w.Async = S;
77
- export {
78
- w as default
79
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),s=require("@ant-design/icons"),r=require("./Button.cjs"),i=require("react-i18next"),c=require("../../../locale/hooks/translation-constants.cjs");function u({value:n,onClick:e}){const{t:o}=i.useTranslation(c.TRANSLATION_NAMESPACE);return t.jsx(r,{type:"link",onClick:()=>e(n),icon:t.jsx(s.CopyOutlined,{}),tooltip:o("clone")})}module.exports=u;
@@ -1,6 +0,0 @@
1
- interface Props<T> {
2
- value: T;
3
- onClick: (value: T) => void;
4
- }
5
- declare function CloneButtonTable<T>({ value, onClick }: Props<T>): import("react/jsx-runtime").JSX.Element;
6
- export default CloneButtonTable;
@@ -1,20 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { CopyOutlined as i } from "@ant-design/icons";
3
- import m from "./Button.js";
4
- import { useTranslation as e } from "react-i18next";
5
- import { TRANSLATION_NAMESPACE as p } from "../../../locale/hooks/translation-constants.js";
6
- function s({ value: t, onClick: n }) {
7
- const { t: r } = e(p);
8
- return /* @__PURE__ */ o(
9
- m,
10
- {
11
- type: "link",
12
- onClick: () => n(t),
13
- icon: /* @__PURE__ */ o(i, {}),
14
- tooltip: r("clone")
15
- }
16
- );
17
- }
18
- export {
19
- s as default
20
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),q=require("@ant-design/icons"),T=require("antd"),n=require("react"),p=require("./Button.cjs"),j=require("react-i18next"),g=require("../../../locale/hooks/translation-constants.cjs");function m({shouldConfirm:C=!0,block:r,value:i,loading:a,onClick:u,text:c,disabled:l,type:f="link"}){const{t}=j.useTranslation(g.TRANSLATION_NAMESPACE),o=n.useMemo(()=>c??t("str.delete"),[c,t]),[x,s]=n.useState(!1);n.useEffect(()=>{s(a??!1)},[a]);const d=n.useCallback(async()=>{try{s(!0),await u(i)}finally{s(!1)}},[u,i]);return C?e.jsx(T.Popconfirm,{title:t("qus.doYouWantToDelete"),okText:o.toUpperCase(),cancelText:t("str.no").toUpperCase(),onConfirm:d,children:e.jsx(p,{tooltip:o,icon:e.jsx(q.DeleteOutlined,{}),disabled:l,loading:x,type:f,danger:!0,block:r})}):e.jsx(p,{tooltip:o,icon:e.jsx(q.DeleteOutlined,{}),disabled:l,loading:x,type:f,danger:!0,block:r,onClick:d})}module.exports=m;
@@ -1,13 +0,0 @@
1
- import { ButtonType } from 'antd/es/button';
2
- interface Props<T> {
3
- value: T;
4
- onClick: (value: T) => Promise<void>;
5
- text?: string;
6
- loading?: boolean;
7
- disabled?: boolean;
8
- type?: ButtonType;
9
- block?: boolean;
10
- shouldConfirm?: boolean;
11
- }
12
- declare function DeleteButtonTable<T>({ shouldConfirm, block, value, loading, onClick, text, disabled, type, }: Props<T>): import("react/jsx-runtime").JSX.Element;
13
- export default DeleteButtonTable;
@@ -1,68 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { DeleteOutlined as c } from "@ant-design/icons";
3
- import { Popconfirm as T } from "antd";
4
- import { useMemo as g, useState as x, useEffect as A, useCallback as _ } from "react";
5
- import d from "./Button.js";
6
- import { useTranslation as k } from "react-i18next";
7
- import { TRANSLATION_NAMESPACE as D } from "../../../locale/hooks/translation-constants.js";
8
- function P({
9
- shouldConfirm: C = !0,
10
- block: n,
11
- value: i,
12
- loading: a,
13
- onClick: l,
14
- text: s,
15
- disabled: f,
16
- type: m = "link"
17
- }) {
18
- const { t: o } = k(D), e = g(() => s ?? o("str.delete"), [s, o]), [u, r] = x(!1);
19
- A(() => {
20
- r(a ?? !1);
21
- }, [a]);
22
- const p = _(
23
- async () => {
24
- try {
25
- r(!0), await l(i);
26
- } finally {
27
- r(!1);
28
- }
29
- },
30
- [l, i]
31
- );
32
- return C ? /* @__PURE__ */ t(
33
- T,
34
- {
35
- title: o("qus.doYouWantToDelete"),
36
- okText: e.toUpperCase(),
37
- cancelText: o("str.no").toUpperCase(),
38
- onConfirm: p,
39
- children: /* @__PURE__ */ t(
40
- d,
41
- {
42
- tooltip: e,
43
- icon: /* @__PURE__ */ t(c, {}),
44
- disabled: f,
45
- loading: u,
46
- type: m,
47
- danger: !0,
48
- block: n
49
- }
50
- )
51
- }
52
- ) : /* @__PURE__ */ t(
53
- d,
54
- {
55
- tooltip: e,
56
- icon: /* @__PURE__ */ t(c, {}),
57
- disabled: f,
58
- loading: u,
59
- type: m,
60
- danger: !0,
61
- block: n,
62
- onClick: p
63
- }
64
- );
65
- }
66
- export {
67
- P as default
68
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("@ant-design/icons"),r=require("react"),a=require("react-i18next"),l=require("./Button.cjs"),x=require("../../../locale/hooks/translation-constants.cjs");function p({value:t,onClick:e}){const[s,n]=r.useState(!1),{t:i}=a.useTranslation(x.TRANSLATION_NAMESPACE),c=r.useCallback(async()=>{n(!0),e(t).finally(()=>n(!1))},[e,t]);return o.jsx(l,{loading:s,type:"link",onClick:c,icon:o.jsx(u.ExportOutlined,{}),tooltip:i("str.export")})}exports.ExportButton=p;
@@ -1,4 +0,0 @@
1
- export declare function ExportButton<T>({ value, onClick, }: {
2
- value: T;
3
- onClick: (value: T) => Promise<any>;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,27 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { ExportOutlined as p } from "@ant-design/icons";
3
- import { useState as s, useCallback as l } from "react";
4
- import { useTranslation as a } from "react-i18next";
5
- import f from "./Button.js";
6
- import { TRANSLATION_NAMESPACE as c } from "../../../locale/hooks/translation-constants.js";
7
- function y({
8
- value: t,
9
- onClick: o
10
- }) {
11
- const [i, r] = s(!1), { t: e } = a(c), m = l(async () => {
12
- r(!0), o(t).finally(() => r(!1));
13
- }, [o, t]);
14
- return /* @__PURE__ */ n(
15
- f,
16
- {
17
- loading: i,
18
- type: "link",
19
- onClick: m,
20
- icon: /* @__PURE__ */ n(p, {}),
21
- tooltip: e("str.export")
22
- }
23
- );
24
- }
25
- export {
26
- y as ExportButton
27
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),C=require("@ant-design/icons"),T=require("antd"),n=require("react"),j=require("react-i18next"),g=require("../../../locale/hooks/translation-constants.cjs"),q=require("./Button.cjs");function m({shouldConfirm:p=!0,block:s,value:i,loading:c,onClick:a,text:u,disabled:l,type:d="link"}){const{t:e}=j.useTranslation(g.TRANSLATION_NAMESPACE),o=n.useMemo(()=>u??e("str.hide"),[u,e]),[f,r]=n.useState(!1);n.useEffect(()=>{r(c??!1)},[c]);const x=n.useCallback(async()=>{try{r(!0),await a(i)}finally{r(!1)}},[a,i]);return p?t.jsx(T.Popconfirm,{title:e("qus.doYouWantToHide"),okText:o.toUpperCase(),cancelText:e("str.no").toUpperCase(),onConfirm:x,children:t.jsx(q,{tooltip:o,icon:t.jsx(C.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s})}):t.jsx(q,{tooltip:o,icon:t.jsx(C.DownCircleOutlined,{}),disabled:l,loading:f,type:d,danger:!0,block:s,onClick:x})}module.exports=m;
@@ -1,13 +0,0 @@
1
- import { ButtonType } from 'antd/es/button';
2
- interface Props<T> {
3
- value: T;
4
- onClick: (value: T) => Promise<void>;
5
- text?: string;
6
- loading?: boolean;
7
- disabled?: boolean;
8
- type?: ButtonType;
9
- block?: boolean;
10
- shouldConfirm?: boolean;
11
- }
12
- declare function HideButtonTable<T>({ shouldConfirm, block, value, loading, onClick, text, disabled, type, }: Props<T>): import("react/jsx-runtime").JSX.Element;
13
- export default HideButtonTable;