@thx/controls 17.3.5 → 17.3.6
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/esm/date/DatePicker/styles.css.js +7 -0
- package/dist/esm/date/DatePicker/styles.css.js.map +1 -0
- package/dist/esm/date/LocalDatePicker/LocalDatePicker.js +151 -0
- package/dist/esm/date/LocalDatePicker/LocalDatePicker.js.map +1 -0
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js +22 -0
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js.map +1 -0
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js +43 -0
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js.map +1 -0
- package/dist/esm/date/LocalTimePicker/LocalTimePicker.js +96 -0
- package/dist/esm/date/LocalTimePicker/LocalTimePicker.js.map +1 -0
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js +22 -0
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js.map +1 -0
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js +86 -0
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js.map +1 -0
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js +73 -0
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js.map +1 -0
- package/dist/esm/date/YearSelect/YearSelect.js +62 -0
- package/dist/esm/date/YearSelect/YearSelect.js.map +1 -0
- package/dist/esm/external/style-inject/dist/style-inject.es.js +29 -0
- package/dist/esm/external/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/esm/form/TForm/TForm.js +29 -0
- package/dist/esm/form/TForm/TForm.js.map +1 -0
- package/dist/esm/form/TForm/useTForm.js +90 -0
- package/dist/esm/form/TForm/useTForm.js.map +1 -0
- package/dist/esm/index.js +34 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js +71 -0
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js.map +1 -0
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js +76 -0
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js.map +1 -0
- package/dist/esm/inputs/CreditCardInput/styles.css.js +7 -0
- package/dist/esm/inputs/CreditCardInput/styles.css.js.map +1 -0
- package/dist/esm/inputs/MaskedInput/MaskedInput.js +26 -0
- package/dist/esm/inputs/MaskedInput/MaskedInput.js.map +1 -0
- package/dist/esm/inputs/MaskedInput/useMaskedInput.js +57 -0
- package/dist/esm/inputs/MaskedInput/useMaskedInput.js.map +1 -0
- package/dist/esm/inputs/PhoneInput/PhoneInput.js +59 -0
- package/dist/esm/inputs/PhoneInput/PhoneInput.js.map +1 -0
- package/dist/esm/inputs/RadioGroup/RadioGroup.js +25 -0
- package/dist/esm/inputs/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/esm/inputs/SinInput/SinInput.js +54 -0
- package/dist/esm/inputs/SinInput/SinInput.js.map +1 -0
- package/dist/esm/inputs/TableInput/CheckboxEditCell.js +32 -0
- package/dist/esm/inputs/TableInput/CheckboxEditCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/DropdownCell.js +26 -0
- package/dist/esm/inputs/TableInput/DropdownCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/HoverCell.js +20 -0
- package/dist/esm/inputs/TableInput/HoverCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/LocalDateCell.js +13 -0
- package/dist/esm/inputs/TableInput/LocalDateCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/LocalDateEditCell.js +33 -0
- package/dist/esm/inputs/TableInput/LocalDateEditCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/LocalTimeEditCell.js +31 -0
- package/dist/esm/inputs/TableInput/LocalTimeEditCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/MoneyCell.js +13 -0
- package/dist/esm/inputs/TableInput/MoneyCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/MoneyEditCell.js +37 -0
- package/dist/esm/inputs/TableInput/MoneyEditCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/MoneySumFooter.js +20 -0
- package/dist/esm/inputs/TableInput/MoneySumFooter.js.map +1 -0
- package/dist/esm/inputs/TableInput/NumberEditCell.js +35 -0
- package/dist/esm/inputs/TableInput/NumberEditCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/StringEditCell.js +34 -0
- package/dist/esm/inputs/TableInput/StringEditCell.js.map +1 -0
- package/dist/esm/inputs/TableInput/TableInput.js +79 -0
- package/dist/esm/inputs/TableInput/TableInput.js.map +1 -0
- package/dist/esm/inputs/TableInput/addRowOnTab.js +13 -0
- package/dist/esm/inputs/TableInput/addRowOnTab.js.map +1 -0
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js +51 -0
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js.map +1 -0
- package/dist/esm/money/MoneyInput/MoneyInput.js +31 -0
- package/dist/esm/money/MoneyInput/MoneyInput.js.map +1 -0
- package/dist/esm/money/useMoneyInput.js +75 -0
- package/dist/esm/money/useMoneyInput.js.map +1 -0
- package/dist/esm/step/FormStep.js +17 -0
- package/dist/esm/step/FormStep.js.map +1 -0
- package/dist/esm/step/Step.js +10 -0
- package/dist/esm/step/Step.js.map +1 -0
- package/dist/esm/step/StepProvider.js +95 -0
- package/dist/esm/step/StepProvider.js.map +1 -0
- package/dist/esm/step/stepContext.js +10 -0
- package/dist/esm/step/stepContext.js.map +1 -0
- package/dist/esm/step/useStep.js +10 -0
- package/dist/esm/step/useStep.js.map +1 -0
- package/dist/stats.html +2689 -0
- package/dist/stats.txt +92 -0
- package/dist/types/date/DatePicker/index.d.ts +3 -0
- package/dist/types/date/LocalDatePicker/LocalDatePicker.d.ts +20 -0
- package/dist/types/date/LocalDatePicker/MaskedDateInput.d.ts +13 -0
- package/dist/types/date/LocalDatePicker/index.d.ts +2 -0
- package/dist/types/date/LocalMonthSelect/LocalMonthSelect.d.ts +11 -0
- package/dist/types/date/LocalMonthSelect/index.d.ts +2 -0
- package/dist/types/date/LocalTimePicker/LocalTimePicker.d.ts +13 -0
- package/dist/types/date/LocalTimePicker/MaskedTimeInput.d.ts +12 -0
- package/dist/types/date/LocalTimePicker/index.d.ts +2 -0
- package/dist/types/date/MonthDayPicker/MonthDayPicker.d.ts +13 -0
- package/dist/types/date/MonthDayPicker/index.d.ts +2 -0
- package/dist/types/date/MonthYearPicker/MonthYearPicker.d.ts +15 -0
- package/dist/types/date/MonthYearPicker/index.d.ts +2 -0
- package/dist/types/date/YearSelect/YearSelect.d.ts +10 -0
- package/dist/types/date/YearSelect/index.d.ts +2 -0
- package/dist/types/form/TForm/TForm.d.ts +3 -0
- package/dist/types/form/TForm/index.d.ts +3 -0
- package/dist/types/form/TForm/types.d.ts +32 -0
- package/dist/types/form/TForm/useTForm.d.ts +57 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/inputs/CreditCardInput/CreditCardInput.d.ts +15 -0
- package/dist/types/inputs/CreditCardInput/CreditCardNumberInput.d.ts +7 -0
- package/dist/types/inputs/CreditCardInput/index.d.ts +2 -0
- package/dist/types/inputs/MaskedInput/MaskedInput.d.ts +11 -0
- package/dist/types/inputs/MaskedInput/index.d.ts +3 -0
- package/dist/types/inputs/MaskedInput/useMaskedInput.d.ts +7 -0
- package/dist/types/inputs/PhoneInput/PhoneInput.d.ts +6 -0
- package/dist/types/inputs/PhoneInput/index.d.ts +2 -0
- package/dist/types/inputs/RadioGroup/RadioGroup.d.ts +7 -0
- package/dist/types/inputs/RadioGroup/index.d.ts +2 -0
- package/dist/types/inputs/SinInput/SinInput.d.ts +6 -0
- package/dist/types/inputs/SinInput/index.d.ts +2 -0
- package/dist/types/inputs/TableInput/CheckboxEditCell.d.ts +11 -0
- package/dist/types/inputs/TableInput/DropdownCell.d.ts +3 -0
- package/dist/types/inputs/TableInput/HoverCell.d.ts +6 -0
- package/dist/types/inputs/TableInput/LocalDateCell.d.ts +10 -0
- package/dist/types/inputs/TableInput/LocalDateEditCell.d.ts +3 -0
- package/dist/types/inputs/TableInput/LocalTimeEditCell.d.ts +3 -0
- package/dist/types/inputs/TableInput/MoneyCell.d.ts +8 -0
- package/dist/types/inputs/TableInput/MoneyEditCell.d.ts +10 -0
- package/dist/types/inputs/TableInput/MoneySumFooter.d.ts +6 -0
- package/dist/types/inputs/TableInput/NumberEditCell.d.ts +11 -0
- package/dist/types/inputs/TableInput/StringEditCell.d.ts +11 -0
- package/dist/types/inputs/TableInput/TableInput.d.ts +32 -0
- package/dist/types/inputs/TableInput/addRowOnTab.d.ts +10 -0
- package/dist/types/inputs/TableInput/index.d.ts +14 -0
- package/dist/types/money/MoneyCurrencyInput/MoneyCurrencyInput.d.ts +10 -0
- package/dist/types/money/MoneyCurrencyInput/index.d.ts +2 -0
- package/dist/types/money/MoneyInput/MoneyInput.d.ts +14 -0
- package/dist/types/money/MoneyInput/index.d.ts +2 -0
- package/dist/types/money/useMoneyInput.d.ts +13 -0
- package/dist/types/step/FormStep.d.ts +8 -0
- package/dist/types/step/Step.d.ts +8 -0
- package/dist/types/step/StepProvider.d.ts +9 -0
- package/dist/types/step/index.d.ts +4 -0
- package/dist/types/step/stepContext.d.ts +4 -0
- package/dist/types/step/useStep.d.ts +1 -0
- package/package.json +4 -4
package/dist/stats.txt
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
-----------------------------
|
|
2
|
+
Rollup File Analysis
|
|
3
|
+
-----------------------------
|
|
4
|
+
bundle size: 43.205 KB
|
|
5
|
+
original size: 63.985 KB
|
|
6
|
+
code reduction: 32.48 %
|
|
7
|
+
module count: 42
|
|
8
|
+
|
|
9
|
+
/src/step/StepProvider.tsx
|
|
10
|
+
████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8.17 % (3.529 KB)
|
|
11
|
+
/src/date/LocalDatePicker/LocalDatePicker.tsx
|
|
12
|
+
███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 7.32 % (3.161 KB)
|
|
13
|
+
/src/form/TForm/useTForm.tsx
|
|
14
|
+
███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.78 % (2.93 KB)
|
|
15
|
+
/src/inputs/TableInput/TableInput.tsx
|
|
16
|
+
███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.69 % (2.891 KB)
|
|
17
|
+
/src/inputs/CreditCardInput/CreditCardInput.tsx
|
|
18
|
+
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.38 % (2.324 KB)
|
|
19
|
+
/src/money/useMoneyInput.ts
|
|
20
|
+
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.99 % (2.155 KB)
|
|
21
|
+
/src/date/MonthDayPicker/MonthDayPicker.tsx
|
|
22
|
+
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.55 % (1.965 KB)
|
|
23
|
+
/src/inputs/CreditCardInput/CreditCardNumberInput.tsx
|
|
24
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.96 % (1.713 KB)
|
|
25
|
+
/src/date/LocalTimePicker/LocalTimePicker.tsx
|
|
26
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.76 % (1.624 KB)
|
|
27
|
+
/src/money/MoneyCurrencyInput/MoneyCurrencyInput.tsx
|
|
28
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.65 % (1.575 KB)
|
|
29
|
+
/src/date/YearSelect/YearSelect.tsx
|
|
30
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.59 % (1.553 KB)
|
|
31
|
+
/src/inputs/MaskedInput/useMaskedInput.ts
|
|
32
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.44 % (1.487 KB)
|
|
33
|
+
/src/date/MonthYearPicker/MonthYearPicker.tsx
|
|
34
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.84 % (1.229 KB)
|
|
35
|
+
/src/inputs/SinInput/SinInput.tsx
|
|
36
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.65 % (1.144 KB)
|
|
37
|
+
/src/date/LocalMonthSelect/LocalMonthSelect.tsx
|
|
38
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.63 % (1.135 KB)
|
|
39
|
+
/src/inputs/PhoneInput/PhoneInput.tsx
|
|
40
|
+
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.1 % (908 Bytes)
|
|
41
|
+
/src/inputs/TableInput/MoneyEditCell.tsx
|
|
42
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.9 % (820 Bytes)
|
|
43
|
+
/src/inputs/TableInput/NumberEditCell.tsx
|
|
44
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.81 % (782 Bytes)
|
|
45
|
+
/src/money/MoneyInput/MoneyInput.tsx
|
|
46
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.8 % (778 Bytes)
|
|
47
|
+
/src/inputs/TableInput/StringEditCell.tsx
|
|
48
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.66 % (717 Bytes)
|
|
49
|
+
/src/inputs/TableInput/CheckboxEditCell.tsx
|
|
50
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.62 % (702 Bytes)
|
|
51
|
+
/src/inputs/TableInput/LocalDateEditCell.tsx
|
|
52
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.61 % (695 Bytes)
|
|
53
|
+
/home/artemis/GitHub/thr-addons/node_modules/style-inject/dist/style-inject.es.js
|
|
54
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.47 % (636 Bytes)
|
|
55
|
+
/src/inputs/TableInput/LocalTimeEditCell.tsx
|
|
56
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.44 % (622 Bytes)
|
|
57
|
+
/src/form/TForm/TForm.tsx
|
|
58
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.39 % (600 Bytes)
|
|
59
|
+
/src/inputs/RadioGroup/RadioGroup.tsx
|
|
60
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.3 % (561 Bytes)
|
|
61
|
+
/src/date/DatePicker/styles.css
|
|
62
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.25 % (538 Bytes)
|
|
63
|
+
/src/inputs/MaskedInput/MaskedInput.tsx
|
|
64
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.19 % (513 Bytes)
|
|
65
|
+
/src/inputs/TableInput/DropdownCell.tsx
|
|
66
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.12 % (483 Bytes)
|
|
67
|
+
/src/step/FormStep.tsx
|
|
68
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.02 % (440 Bytes)
|
|
69
|
+
/src/date/LocalDatePicker/MaskedDateInput.tsx
|
|
70
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.99 % (426 Bytes)
|
|
71
|
+
/src/date/LocalTimePicker/MaskedTimeInput.tsx
|
|
72
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.98 % (424 Bytes)
|
|
73
|
+
/src/inputs/TableInput/MoneySumFooter.tsx
|
|
74
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.96 % (414 Bytes)
|
|
75
|
+
/src/inputs/TableInput/HoverCell.tsx
|
|
76
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.93 % (403 Bytes)
|
|
77
|
+
/src/inputs/TableInput/addRowOnTab.ts
|
|
78
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.72 % (312 Bytes)
|
|
79
|
+
/src/inputs/TableInput/LocalDateCell.tsx
|
|
80
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.66 % (285 Bytes)
|
|
81
|
+
/src/inputs/TableInput/MoneyCell.tsx
|
|
82
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.59 % (257 Bytes)
|
|
83
|
+
/src/step/Step.tsx
|
|
84
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.47 % (203 Bytes)
|
|
85
|
+
/src/step/useStep.ts
|
|
86
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.26 % (113 Bytes)
|
|
87
|
+
/src/step/stepContext.ts
|
|
88
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.19 % (80 Bytes)
|
|
89
|
+
/src/inputs/CreditCardInput/styles.css
|
|
90
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.18 % (78 Bytes)
|
|
91
|
+
/src/index.ts
|
|
92
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0 % (0 Byte)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LocalDate } from '@js-joda/core';
|
|
2
|
+
import type { ReactDatePickerProps } from 'react-datepicker';
|
|
3
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
4
|
+
import '../DatePicker/styles.css';
|
|
5
|
+
interface ILocalDatePicker {
|
|
6
|
+
value?: LocalDate | number | null;
|
|
7
|
+
onChange?: (value: LocalDate | null) => void;
|
|
8
|
+
onChangeRaw?: () => void;
|
|
9
|
+
minDate?: LocalDate;
|
|
10
|
+
maxDate?: LocalDate;
|
|
11
|
+
icon?: boolean;
|
|
12
|
+
openOnFocus?: boolean;
|
|
13
|
+
startFocused?: boolean;
|
|
14
|
+
startSelected?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type InputPropsOmitted = Omit<InputProps, 'onChange'>;
|
|
17
|
+
type ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange' | 'minDate' | 'maxDate' | 'icon'>;
|
|
18
|
+
export type LocalDatePickerProps = ILocalDatePicker & InputPropsOmitted & ReactDatePickerPropsOmitted;
|
|
19
|
+
export declare function LocalDatePicker(props: LocalDatePickerProps): JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MaskedInputProps } from '../../inputs/MaskedInput';
|
|
2
|
+
import type { MaskedInputRef } from '../../inputs/MaskedInput/MaskedInput';
|
|
3
|
+
export type MaskedDateInputRef = MaskedInputRef;
|
|
4
|
+
export interface MaskedDateInputValue {
|
|
5
|
+
target: {
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface MaskedDateInputProps {
|
|
10
|
+
name?: string;
|
|
11
|
+
onChange?: (value: MaskedDateInputValue) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const MaskedDateInput: import("react").ForwardRefExoticComponent<Pick<MaskedDateInputProps & Omit<MaskedInputProps, "onChange">, string | number> & import("react").RefAttributes<MaskedInputRef>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LocalDate } from '@js-joda/core';
|
|
2
|
+
import { type SelectProps } from 'semantic-ui-react';
|
|
3
|
+
interface ILocalMonthSelectProps {
|
|
4
|
+
onChange?: (value: LocalDate | null) => void;
|
|
5
|
+
value?: LocalDate | null;
|
|
6
|
+
year?: number;
|
|
7
|
+
handleBlur?: (event: any) => void;
|
|
8
|
+
}
|
|
9
|
+
export type LocalMonthSelectProps = ILocalMonthSelectProps & Omit<SelectProps, 'options'>;
|
|
10
|
+
export declare function LocalMonthSelect(props: LocalMonthSelectProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LocalTime } from '@js-joda/core';
|
|
2
|
+
import type { ReactDatePickerProps } from 'react-datepicker';
|
|
3
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
4
|
+
interface ILocalTimePicker {
|
|
5
|
+
value?: LocalTime | number | null;
|
|
6
|
+
onChange?: (value: LocalTime | null) => void;
|
|
7
|
+
onChangeRaw?: () => void;
|
|
8
|
+
}
|
|
9
|
+
type InputPropsOmitted = Omit<InputProps, 'onChange'>;
|
|
10
|
+
type ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange'>;
|
|
11
|
+
export type LocalTimePickerProps = ILocalTimePicker & InputPropsOmitted & ReactDatePickerPropsOmitted;
|
|
12
|
+
export declare function LocalTimePicker(props: LocalTimePickerProps): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MaskedInputProps } from '../../inputs/MaskedInput';
|
|
2
|
+
import type { MaskedInputRef } from '../../inputs/MaskedInput/MaskedInput';
|
|
3
|
+
export type MaskedTimeInputRef = MaskedInputRef;
|
|
4
|
+
export interface MaskedTimeInputValue {
|
|
5
|
+
target: {
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface MaskedTimeInputProps {
|
|
10
|
+
onChange?: (value: MaskedTimeInputValue) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const MaskedTimeInput: import("react").ForwardRefExoticComponent<Pick<MaskedTimeInputProps & Omit<MaskedInputProps, "onChange">, string | number> & import("react").RefAttributes<MaskedInputRef>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LocalDate } from '@js-joda/core';
|
|
2
|
+
import type { ReactDatePickerProps } from 'react-datepicker';
|
|
3
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
4
|
+
interface IMonthDayPickerProps {
|
|
5
|
+
value?: LocalDate | number | null;
|
|
6
|
+
onChange?: (value: LocalDate | null) => void;
|
|
7
|
+
onChangeRaw?: () => void;
|
|
8
|
+
}
|
|
9
|
+
type InputPropsOmitted = Omit<InputProps, 'onChange'>;
|
|
10
|
+
type ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange'>;
|
|
11
|
+
export type MonthDayPickerProps = IMonthDayPickerProps & InputPropsOmitted & ReactDatePickerPropsOmitted;
|
|
12
|
+
export declare function MonthDayPicker(props: MonthDayPickerProps): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LocalDate } from '@js-joda/core';
|
|
2
|
+
import type { ReactDatePickerProps } from 'react-datepicker';
|
|
3
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
4
|
+
interface IMonthYearPickerProps {
|
|
5
|
+
value?: LocalDate | number | undefined;
|
|
6
|
+
onChange?: (value: LocalDate | undefined) => void;
|
|
7
|
+
onChangeRaw?: () => void;
|
|
8
|
+
minDate?: LocalDate | undefined;
|
|
9
|
+
maxDate?: LocalDate | undefined;
|
|
10
|
+
}
|
|
11
|
+
type InputPropsOmitted = Omit<InputProps, 'onChange'>;
|
|
12
|
+
type ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value' | 'minDate' | 'maxDate'>, 'onChange'>;
|
|
13
|
+
export type MonthYearPickerProps = IMonthYearPickerProps & InputPropsOmitted & ReactDatePickerPropsOmitted;
|
|
14
|
+
export declare function MonthYearPicker(props: MonthYearPickerProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SegmentProps } from 'semantic-ui-react';
|
|
2
|
+
export interface YearSelectProps {
|
|
3
|
+
onChange?: (value: number) => void;
|
|
4
|
+
onBlur?: (ev: any) => void;
|
|
5
|
+
value: number;
|
|
6
|
+
minYear?: number;
|
|
7
|
+
maxYear?: number;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function YearSelect(props: YearSelectProps & Omit<SegmentProps, 'onChange'>): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FormikConfig, FormikProps } from 'formik';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export interface TFormProps<Values> extends FormikProps<Values> {
|
|
4
|
+
hasErrors: boolean;
|
|
5
|
+
hasWarnings: boolean;
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
submitDisabled: boolean;
|
|
9
|
+
errorMarkedCleared: boolean;
|
|
10
|
+
formError: boolean;
|
|
11
|
+
renderWarnings: () => JSX.Element | null;
|
|
12
|
+
fieldError: (fieldName: keyof Values | string | number) => boolean;
|
|
13
|
+
handleSubmit: (e?: React.FormEvent<HTMLFormElement>) => void;
|
|
14
|
+
}
|
|
15
|
+
interface ApolloError {
|
|
16
|
+
message?: string;
|
|
17
|
+
graphQLErrors?: {
|
|
18
|
+
message?: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export interface TFormConfig<Values, InitialValues = any> extends Omit<FormikConfig<Values>, 'component' | 'render' | 'children' | 'initialValues'> {
|
|
22
|
+
component?: React.ComponentType<TFormProps<Values>> | React.ReactNode;
|
|
23
|
+
render?: (props: TFormProps<Values>) => React.ReactNode;
|
|
24
|
+
children?: ((props: TFormProps<Values>) => React.ReactNode) | React.ReactNode;
|
|
25
|
+
initialValues: InitialValues;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
error?: ApolloError;
|
|
28
|
+
onValidate?: (isValid: boolean) => void;
|
|
29
|
+
getSubmitFn?: (submitFormFn: () => Promise<void> | Promise<any>) => void;
|
|
30
|
+
onChange?: (values: Values) => void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type FormikValues, type FormikErrors, type FormikTouched } from 'formik';
|
|
2
|
+
import { type FormEvent } from 'react';
|
|
3
|
+
import type { TFormConfig } from './types';
|
|
4
|
+
export declare function useTForm<Values extends FormikValues = FormikValues, InitialValues = any>(config: TFormConfig<Values, InitialValues>): {
|
|
5
|
+
hasErrors: boolean;
|
|
6
|
+
hasWarnings: boolean;
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
submitDisabled: boolean;
|
|
10
|
+
errorMarkedCleared: boolean;
|
|
11
|
+
formError: boolean;
|
|
12
|
+
renderWarnings: () => JSX.Element | null;
|
|
13
|
+
fieldError: (fieldName: keyof Values | string | number) => boolean;
|
|
14
|
+
handleSubmit: (e?: FormEvent<HTMLFormElement>) => void;
|
|
15
|
+
initialValues: Values;
|
|
16
|
+
initialErrors: FormikErrors<unknown>;
|
|
17
|
+
initialTouched: FormikTouched<unknown>;
|
|
18
|
+
initialStatus: any;
|
|
19
|
+
handleBlur: {
|
|
20
|
+
(e: React.FocusEvent<any>): void;
|
|
21
|
+
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
|
22
|
+
};
|
|
23
|
+
handleChange: {
|
|
24
|
+
(e: React.ChangeEvent<any>): void;
|
|
25
|
+
<T_1 = string | React.ChangeEvent<any>>(field: T_1): T_1 extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
|
|
26
|
+
};
|
|
27
|
+
handleReset: (e: any) => void;
|
|
28
|
+
resetForm: (nextState?: Partial<import("formik").FormikState<Values>> | undefined) => void;
|
|
29
|
+
setErrors: (errors: FormikErrors<Values>) => void;
|
|
30
|
+
setFormikState: (stateOrCb: import("formik").FormikState<Values> | ((state: import("formik").FormikState<Values>) => import("formik").FormikState<Values>)) => void;
|
|
31
|
+
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean | undefined) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
32
|
+
setFieldValue: (field: string, value: any, shouldValidate?: boolean | undefined) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
33
|
+
setFieldError: (field: string, value: string | undefined) => void;
|
|
34
|
+
setStatus: (status: any) => void;
|
|
35
|
+
setSubmitting: (isSubmitting: boolean) => void;
|
|
36
|
+
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean | undefined) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
37
|
+
setValues: (values: import("react").SetStateAction<Values>, shouldValidate?: boolean | undefined) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
38
|
+
submitForm: () => Promise<any>;
|
|
39
|
+
validateForm: (values?: Values | undefined) => Promise<FormikErrors<Values>>;
|
|
40
|
+
validateField: (name: string) => Promise<void> | Promise<string | undefined>;
|
|
41
|
+
dirty: boolean;
|
|
42
|
+
unregisterField: (name: string) => void;
|
|
43
|
+
registerField: (name: string, { validate }: any) => void;
|
|
44
|
+
getFieldProps: (nameOrOptions: any) => import("formik").FieldInputProps<any>;
|
|
45
|
+
getFieldMeta: (name: string) => import("formik").FieldMetaProps<any>;
|
|
46
|
+
getFieldHelpers: (name: string) => import("formik").FieldHelperProps<any>;
|
|
47
|
+
validateOnBlur: boolean;
|
|
48
|
+
validateOnChange: boolean;
|
|
49
|
+
validateOnMount: boolean;
|
|
50
|
+
values: Values;
|
|
51
|
+
errors: FormikErrors<Values>;
|
|
52
|
+
touched: FormikTouched<Values>;
|
|
53
|
+
isSubmitting: boolean;
|
|
54
|
+
isValidating: boolean;
|
|
55
|
+
status?: any;
|
|
56
|
+
submitCount: number;
|
|
57
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type { DatePicker } from './date/DatePicker';
|
|
2
|
+
export { LocalDatePicker } from './date/LocalDatePicker';
|
|
3
|
+
export type { LocalDatePickerProps } from './date/LocalDatePicker';
|
|
4
|
+
export { LocalMonthSelect } from './date/LocalMonthSelect';
|
|
5
|
+
export type { LocalMonthSelectProps } from './date/LocalMonthSelect';
|
|
6
|
+
export { LocalTimePicker } from './date/LocalTimePicker';
|
|
7
|
+
export type { LocalTimePickerProps } from './date/LocalTimePicker';
|
|
8
|
+
export { MonthDayPicker } from './date/MonthDayPicker';
|
|
9
|
+
export type { MonthDayPickerProps } from './date/MonthDayPicker';
|
|
10
|
+
export { MonthYearPicker } from './date/MonthYearPicker';
|
|
11
|
+
export type { MonthYearPickerProps } from './date/MonthYearPicker';
|
|
12
|
+
export { YearSelect } from './date/YearSelect';
|
|
13
|
+
export type { YearSelectProps } from './date/YearSelect';
|
|
14
|
+
export { useTForm, TForm } from './form/TForm';
|
|
15
|
+
export type { TFormProps } from './form/TForm';
|
|
16
|
+
export { MaskedInput } from './inputs/MaskedInput';
|
|
17
|
+
export type { MaskedInputProps } from './inputs/MaskedInput';
|
|
18
|
+
export { RadioGroup } from './inputs/RadioGroup';
|
|
19
|
+
export type { RadioGroupProps } from './inputs/RadioGroup';
|
|
20
|
+
export { PhoneInput } from './inputs/PhoneInput';
|
|
21
|
+
export type { PhoneInputProps } from './inputs/PhoneInput';
|
|
22
|
+
export { CreditCardInput } from './inputs/CreditCardInput';
|
|
23
|
+
export type { CreditCardInputProps } from './inputs/CreditCardInput';
|
|
24
|
+
export { SinInput } from './inputs/SinInput';
|
|
25
|
+
export type { SinInputProps } from './inputs/SinInput';
|
|
26
|
+
export { TableInput, MoneyCell, MoneyEditCell, CheckboxEditCell, LocalDateCell, LocalDateEditCell, LocalTimeEditCell, MoneySumFooter, NumberEditCell, StringEditCell, DropdownCell, HoverCell, addRowOnTab, } from './inputs/TableInput';
|
|
27
|
+
export type { AddRowOnTabIf } from './inputs/TableInput';
|
|
28
|
+
export { MoneyInput } from './money/MoneyInput';
|
|
29
|
+
export type { MoneyInputProps } from './money/MoneyInput';
|
|
30
|
+
export { MoneyCurrencyInput } from './money/MoneyCurrencyInput';
|
|
31
|
+
export type { MoneyCurrencyInputProps } from './money/MoneyCurrencyInput';
|
|
32
|
+
export { FormStep, StepProvider, useStep, Step } from './step';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LocalDate } from '@js-joda/core';
|
|
2
|
+
import 'react-credit-cards/es/styles-compiled.css';
|
|
3
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
4
|
+
import './styles.css';
|
|
5
|
+
export interface CreditCardData {
|
|
6
|
+
number?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
cvc?: string;
|
|
9
|
+
expiry?: LocalDate;
|
|
10
|
+
}
|
|
11
|
+
export type CreditCardInputProps = {
|
|
12
|
+
value?: CreditCardData;
|
|
13
|
+
onChange?: (data: CreditCardData) => void;
|
|
14
|
+
} & Pick<InputProps, 'disabled' | 'onBlur'>;
|
|
15
|
+
export declare function CreditCardInput(props: CreditCardInputProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
2
|
+
interface CreditCardNumberInputProps {
|
|
3
|
+
onChange?: (value: string | undefined) => void;
|
|
4
|
+
value?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function CreditCardNumberInput(props: CreditCardNumberInputProps & Omit<InputProps, 'onChange'>): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InputProps } from 'semantic-ui-react';
|
|
2
|
+
import { type UseMaskedInputProps } from './useMaskedInput';
|
|
3
|
+
export interface MaskedInputRef {
|
|
4
|
+
focus: () => void;
|
|
5
|
+
select: () => void;
|
|
6
|
+
}
|
|
7
|
+
export type MaskedInputProps = {
|
|
8
|
+
name?: string;
|
|
9
|
+
onBlur?: (event: any) => void;
|
|
10
|
+
} & UseMaskedInputProps & Omit<InputProps, 'onChange'>;
|
|
11
|
+
export declare const MaskedInput: import("react").ForwardRefExoticComponent<Pick<MaskedInputProps, string | number> & import("react").RefAttributes<MaskedInputRef>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface UseMaskedInputProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
onChange?: (value?: string) => void;
|
|
4
|
+
mask?: Inputmask.Options;
|
|
5
|
+
onSet?: (value?: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useMaskedInput(props: UseMaskedInputProps): import("react").MutableRefObject<HTMLInputElement | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type MaskedInputProps } from '../MaskedInput';
|
|
2
|
+
export interface PhoneInputProps {
|
|
3
|
+
extension?: boolean;
|
|
4
|
+
onChange?: (value?: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function PhoneInput(props: PhoneInputProps & Omit<MaskedInputProps, 'mask' | 'onChange'>): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormGroupProps } from 'semantic-ui-react';
|
|
2
|
+
export interface RadioGroupProps {
|
|
3
|
+
children?: JSX.Element[] | JSX.Element;
|
|
4
|
+
onChange?: (value?: string | number) => void;
|
|
5
|
+
value?: string | number;
|
|
6
|
+
}
|
|
7
|
+
export declare function RadioGroup(props: RadioGroupProps & Omit<FormGroupProps, 'children'>): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CheckboxProps } from 'semantic-ui-react';
|
|
2
|
+
import type { TableCellProps } from './TableInput';
|
|
3
|
+
import type { AddRowOnTabIf } from './addRowOnTab';
|
|
4
|
+
interface CheckboxEditCellOptions<D extends Record<string, unknown>> {
|
|
5
|
+
/** Override SemanticUI Input props */
|
|
6
|
+
inputProps?: CheckboxProps;
|
|
7
|
+
/** If function is present, and returns true, will add a new row if tab is pressed on the last row */
|
|
8
|
+
addRowOnTabIf?: AddRowOnTabIf<D, boolean>;
|
|
9
|
+
}
|
|
10
|
+
export declare function CheckboxEditCell<D extends Record<string, unknown>>(options?: CheckboxEditCellOptions<D>): (props: TableCellProps<D, boolean>) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CellProps, Renderer } from 'react-table';
|
|
2
|
+
interface HoverCellOptions<D extends Record<string, unknown>> {
|
|
3
|
+
Action: Renderer<CellProps<D>>;
|
|
4
|
+
}
|
|
5
|
+
export declare function HoverCell<D extends Record<string, unknown>>(options: HoverCellOptions<D>): (props: CellProps<D>) => JSX.Element | null;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LocalDate } from '@js-joda/core';
|
|
2
|
+
import { type FormatDateParams } from '@thx/date';
|
|
3
|
+
import type { CellProps } from 'react-table';
|
|
4
|
+
interface LocalDateCellOptions<D extends Record<string, unknown>> {
|
|
5
|
+
/** If provided, this function will override the LocalDate value displayed */
|
|
6
|
+
overrideValue?: (props: CellProps<D, LocalDate>) => LocalDate;
|
|
7
|
+
dateFormat?: FormatDateParams;
|
|
8
|
+
}
|
|
9
|
+
export declare function LocalDateCell<D extends Record<string, unknown>>(options?: LocalDateCellOptions<D>): (props: CellProps<D, LocalDate>) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type Money from 'js-money';
|
|
2
|
+
import type { CellProps } from 'react-table';
|
|
3
|
+
interface MoneyCellOptions<D extends Record<string, unknown>> {
|
|
4
|
+
/** If provided, this function will override the Money value displayed */
|
|
5
|
+
overrideValue?: (props: CellProps<D, Money>) => Money;
|
|
6
|
+
}
|
|
7
|
+
export declare function MoneyCell<D extends Record<string, unknown>>(options?: MoneyCellOptions<D>): (props: CellProps<D, Money>) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type Money from 'js-money';
|
|
2
|
+
import type { TableCellProps } from './TableInput';
|
|
3
|
+
import type { AddRowOnTabIf } from './addRowOnTab';
|
|
4
|
+
interface MoneyEditCellOptions<D extends Record<string, unknown>> {
|
|
5
|
+
/** If function is present, and returns true, will add a new row if tab is pressed on the last row */
|
|
6
|
+
addRowOnTabIf?: AddRowOnTabIf<D, Money | undefined>;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function MoneyEditCell<D extends Record<string, unknown>>(moneyEditCellProps?: MoneyEditCellOptions<D>): (props: TableCellProps<D, Money | undefined>) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IdType, TableInstance } from 'react-table';
|
|
2
|
+
interface MoneySumFooterOptions<A extends Record<string, unknown>> {
|
|
3
|
+
id: IdType<A>;
|
|
4
|
+
}
|
|
5
|
+
export declare function MoneySumFooter<A extends Record<string, unknown>>(options: MoneySumFooterOptions<A>): (info: TableInstance<A>) => JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
2
|
+
import type { TableCellProps } from './TableInput';
|
|
3
|
+
import type { AddRowOnTabIf } from './addRowOnTab';
|
|
4
|
+
interface NumberEditCellOptions<D extends Record<number, unknown>> {
|
|
5
|
+
/** Override SemanticUI Input props */
|
|
6
|
+
inputProps?: InputProps;
|
|
7
|
+
/** If function is present, and returns true, will add a new row if tab is pressed on the last row */
|
|
8
|
+
addRowOnTabIf?: AddRowOnTabIf<D, number>;
|
|
9
|
+
}
|
|
10
|
+
export declare function NumberEditCell<D extends Record<number, unknown>>(options?: NumberEditCellOptions<D>): (props: TableCellProps<D, number>) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type InputProps } from 'semantic-ui-react';
|
|
2
|
+
import type { TableCellProps } from './TableInput';
|
|
3
|
+
import type { AddRowOnTabIf } from './addRowOnTab';
|
|
4
|
+
interface StringEditCellOptions<D extends Record<string, unknown>> {
|
|
5
|
+
/** Override SemanticUI Input props */
|
|
6
|
+
inputProps?: InputProps;
|
|
7
|
+
/** If function is present, and returns true, will add a new row if tab is pressed on the last row */
|
|
8
|
+
addRowOnTabIf?: AddRowOnTabIf<D, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare function StringEditCell<D extends Record<string, unknown>>(options?: StringEditCellOptions<D>): (props: TableCellProps<D, string>) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FieldArrayRenderProps } from 'formik';
|
|
2
|
+
import { type CellPropGetter, type CellProps, type Column, type FooterGroupPropGetter, type FooterPropGetter, type HeaderGroupPropGetter, type HeaderPropGetter, type RowPropGetter, type TableBodyPropGetter } from 'react-table';
|
|
3
|
+
import { type TableProps } from 'semantic-ui-react';
|
|
4
|
+
type DefaultTableType = Record<string, unknown>;
|
|
5
|
+
interface TableInputProps<A extends DefaultTableType> {
|
|
6
|
+
name: string;
|
|
7
|
+
values: A[];
|
|
8
|
+
columns: Column<A>[];
|
|
9
|
+
setFieldValue: (field: string, value: any, shouldValidate?: boolean | undefined) => void;
|
|
10
|
+
createRow?: () => A;
|
|
11
|
+
tableProps?: TableProps;
|
|
12
|
+
headerRowProps?: HeaderGroupPropGetter<A>;
|
|
13
|
+
headerCellProps?: HeaderPropGetter<A>;
|
|
14
|
+
footerRowProps?: FooterGroupPropGetter<A>;
|
|
15
|
+
footerCellProps?: FooterPropGetter<A>;
|
|
16
|
+
bodyProps?: TableBodyPropGetter<A>;
|
|
17
|
+
rowProps?: RowPropGetter<A>;
|
|
18
|
+
cellProps?: CellPropGetter<A>;
|
|
19
|
+
}
|
|
20
|
+
export interface TableCellProps<D extends DefaultTableType, V = any> extends CellProps<D, V> {
|
|
21
|
+
arrayHelpers: FieldArrayRenderProps;
|
|
22
|
+
addRow: () => void;
|
|
23
|
+
updateData: (index: number, id: string, value: V) => void;
|
|
24
|
+
hoverRow: string | number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Can be used in a TForm as a Table Input.
|
|
28
|
+
* @param props
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
export declare function TableInput<A extends DefaultTableType>(props: TableInputProps<A>): JSX.Element;
|
|
32
|
+
export {};
|