hazo_collab_forms 6.0.7 → 6.1.1
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/CHANGE_LOG.md +17 -0
- package/README.md +27 -0
- package/dist/components/_internal_form_set.d.ts +5 -0
- package/dist/components/_internal_form_set.d.ts.map +1 -1
- package/dist/components/_internal_form_set.js +1 -1
- package/dist/components/_internal_form_set.js.map +1 -1
- package/dist/components/hazo_collab_form_combo.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_combo.js +1 -1
- package/dist/components/hazo_collab_form_combo.js.map +1 -1
- package/dist/components/hazo_collab_form_currency.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_currency.js +1 -1
- package/dist/components/hazo_collab_form_currency.js.map +1 -1
- package/dist/components/hazo_collab_form_date.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_date.js +1 -1
- package/dist/components/hazo_collab_form_date.js.map +1 -1
- package/dist/components/hazo_collab_form_inputbox.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_inputbox.js +1 -1
- package/dist/components/hazo_collab_form_inputbox.js.map +1 -1
- package/dist/components/hazo_collab_form_masked.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_masked.js +1 -1
- package/dist/components/hazo_collab_form_masked.js.map +1 -1
- package/dist/components/hazo_collab_form_percentage.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_percentage.js +1 -1
- package/dist/components/hazo_collab_form_percentage.js.map +1 -1
- package/dist/components/hazo_collab_form_textarea.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_textarea.js +1 -1
- package/dist/components/hazo_collab_form_textarea.js.map +1 -1
- package/dist/components/hazo_collab_form_view/context.d.ts.map +1 -1
- package/dist/components/hazo_collab_form_view/context.js +6 -0
- package/dist/components/hazo_collab_form_view/context.js.map +1 -1
- package/dist/components/hazo_collab_form_view/types.d.ts +7 -0
- package/dist/components/hazo_collab_form_view/types.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_editor.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_editor.js +24 -5
- package/dist/components/hazo_validation_rule_editor/components/rule_editor.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_list.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_list.js +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_list.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/context.d.ts +3 -1
- package/dist/components/hazo_validation_rule_editor/context.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/context.js +8 -2
- package/dist/components/hazo_validation_rule_editor/context.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.d.ts +18 -0
- package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.js +64 -8
- package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/types.d.ts +15 -0
- package/dist/components/hazo_validation_rule_editor/types.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.d.ts +1 -1
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.js +2 -2
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.js.map +1 -1
- package/dist/components/shared/use_base_form_field.d.ts +2 -0
- package/dist/components/shared/use_base_form_field.d.ts.map +1 -1
- package/dist/components/shared/use_base_form_field.js +8 -0
- package/dist/components/shared/use_base_form_field.js.map +1 -1
- package/dist/components/thread_form/components/key_info_drawer.d.ts +5 -0
- package/dist/components/thread_form/components/key_info_drawer.d.ts.map +1 -1
- package/dist/components/thread_form/components/key_info_drawer.js +2 -2
- package/dist/components/thread_form/components/key_info_drawer.js.map +1 -1
- package/dist/components/thread_form/thread_form.d.ts.map +1 -1
- package/dist/components/thread_form/thread_form.js +2 -2
- package/dist/components/thread_form/thread_form.js.map +1 -1
- package/dist/components/thread_form/types.d.ts +6 -0
- package/dist/components/thread_form/types.d.ts.map +1 -1
- package/dist/components/thread_form/types.js.map +1 -1
- package/dist/types/validation.d.ts +8 -0
- package/dist/types/validation.d.ts.map +1 -1
- package/dist/utils/date_format.d.ts +8 -30
- package/dist/utils/date_format.d.ts.map +1 -1
- package/dist/utils/date_format.js +6 -64
- package/dist/utils/date_format.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,67 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Date formatting utilities
|
|
3
|
-
*
|
|
2
|
+
* Date formatting utilities — re-exported from hazo_core.
|
|
3
|
+
*
|
|
4
|
+
* Canonical location moved to hazo_core/src/utils/dates.ts.
|
|
5
|
+
* This re-export maintains backward compatibility for existing hazo_collab_forms consumers.
|
|
6
|
+
* Will be removed in hazo_collab_forms v7 — import from 'hazo_core' directly.
|
|
4
7
|
*/
|
|
5
|
-
|
|
6
|
-
* Default date format
|
|
7
|
-
*/
|
|
8
|
-
export const DEFAULT_DATE_FORMAT = 'iso';
|
|
9
|
-
/**
|
|
10
|
-
* Format a date according to the specified format
|
|
11
|
-
* @param date - Date object, ISO string, or undefined
|
|
12
|
-
* @param format - Format type (iso, dmy, mdy, locale)
|
|
13
|
-
* @returns Formatted date string, or empty string if date is invalid
|
|
14
|
-
*/
|
|
15
|
-
export function format_date(date, format = DEFAULT_DATE_FORMAT) {
|
|
16
|
-
if (!date)
|
|
17
|
-
return '';
|
|
18
|
-
// Parse date if string
|
|
19
|
-
let date_obj;
|
|
20
|
-
if (typeof date === 'string') {
|
|
21
|
-
// Handle ISO date strings by adding time component to avoid timezone issues
|
|
22
|
-
date_obj = new Date(date.includes('T') ? date : date + 'T00:00:00');
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
date_obj = date;
|
|
26
|
-
}
|
|
27
|
-
// Validate date
|
|
28
|
-
if (isNaN(date_obj.getTime())) {
|
|
29
|
-
return typeof date === 'string' ? date : '';
|
|
30
|
-
}
|
|
31
|
-
// Get date components
|
|
32
|
-
const year = date_obj.getFullYear();
|
|
33
|
-
const month = String(date_obj.getMonth() + 1).padStart(2, '0');
|
|
34
|
-
const day = String(date_obj.getDate()).padStart(2, '0');
|
|
35
|
-
switch (format) {
|
|
36
|
-
case 'iso':
|
|
37
|
-
return `${year}-${month}-${day}`;
|
|
38
|
-
case 'dmy':
|
|
39
|
-
return `${day}/${month}/${year}`;
|
|
40
|
-
case 'mdy':
|
|
41
|
-
return `${month}/${day}/${year}`;
|
|
42
|
-
case 'locale':
|
|
43
|
-
// Use locale formatting (not SSR-safe)
|
|
44
|
-
return date_obj.toLocaleDateString();
|
|
45
|
-
default:
|
|
46
|
-
return `${year}-${month}-${day}`;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Format a date range according to the specified format
|
|
51
|
-
* @param from - Start date
|
|
52
|
-
* @param to - End date
|
|
53
|
-
* @param format - Format type
|
|
54
|
-
* @returns Formatted date range string
|
|
55
|
-
*/
|
|
56
|
-
export function format_date_range(from, to, format = DEFAULT_DATE_FORMAT) {
|
|
57
|
-
const from_str = format_date(from, format);
|
|
58
|
-
const to_str = format_date(to, format);
|
|
59
|
-
if (from_str && to_str)
|
|
60
|
-
return `${from_str} - ${to_str}`;
|
|
61
|
-
if (from_str)
|
|
62
|
-
return `From ${from_str}`;
|
|
63
|
-
if (to_str)
|
|
64
|
-
return `To ${to_str}`;
|
|
65
|
-
return '';
|
|
66
|
-
}
|
|
8
|
+
export { format_date, format_date_range, DEFAULT_DATE_FORMAT, } from 'hazo_core';
|
|
67
9
|
//# sourceMappingURL=date_format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date_format.js","sourceRoot":"","sources":["../../src/utils/date_format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"date_format.js","sourceRoot":"","sources":["../../src/utils/date_format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_collab_forms",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Collaboration form elements",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.client.js",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@dnd-kit/sortable": "^10.0.0",
|
|
96
96
|
"@dnd-kit/utilities": "^3.2.2",
|
|
97
97
|
"@radix-ui/react-switch": "^1.2.6",
|
|
98
|
-
"hazo_audit": "^2.0.
|
|
98
|
+
"hazo_audit": "^2.0.2",
|
|
99
99
|
"@testing-library/jest-dom": "^6.6.3",
|
|
100
100
|
"@testing-library/react": "^15.0.7",
|
|
101
101
|
"@types/node": "^20.14.10",
|
|
@@ -122,18 +122,18 @@
|
|
|
122
122
|
"@radix-ui/react-dialog": "^1.0.0",
|
|
123
123
|
"@radix-ui/react-label": "^2.0.0",
|
|
124
124
|
"@radix-ui/react-popover": "^1.0.0",
|
|
125
|
-
"hazo_audit": "^2.0.
|
|
126
|
-
"hazo_auth": "^
|
|
127
|
-
"hazo_chat": "^5.2.
|
|
128
|
-
"hazo_config": "^2.1.
|
|
129
|
-
"hazo_connect": "^2.
|
|
130
|
-
"hazo_files": "^1.
|
|
131
|
-
"hazo_ihelp": "^2.
|
|
132
|
-
"hazo_llm_api": "^1.
|
|
133
|
-
"hazo_logs": "^
|
|
134
|
-
"hazo_notes": "^1.
|
|
135
|
-
"hazo_pdf": "^1.7.
|
|
136
|
-
"hazo_ui": "^
|
|
125
|
+
"hazo_audit": "^2.0.2",
|
|
126
|
+
"hazo_auth": "^8.0.1",
|
|
127
|
+
"hazo_chat": "^5.2.4",
|
|
128
|
+
"hazo_config": "^2.1.5",
|
|
129
|
+
"hazo_connect": "^2.7.3",
|
|
130
|
+
"hazo_files": "^2.1.1",
|
|
131
|
+
"hazo_ihelp": "^2.1.0",
|
|
132
|
+
"hazo_llm_api": "^1.3.0",
|
|
133
|
+
"hazo_logs": "^2.0.0",
|
|
134
|
+
"hazo_notes": "^1.2.0",
|
|
135
|
+
"hazo_pdf": "^1.7.1",
|
|
136
|
+
"hazo_ui": "^3.0.1",
|
|
137
137
|
"lucide-react": "^0.553.0",
|
|
138
138
|
"react": "^18.0.0 || ^19.0.0",
|
|
139
139
|
"react-dom": "^18.0.0 || ^19.0.0",
|