@tachybase/client 1.3.19 → 1.3.20

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 (47) hide show
  1. package/es/collection-manager/Configuration/components/Summary.mjs +3 -3
  2. package/es/flag-provider/FlagProvider.d.ts +1 -0
  3. package/es/flag-provider/hooks/useFlag.mjs +1 -1
  4. package/es/schema-component/antd/color-select/ColorSelect.mjs +3 -3
  5. package/es/schema-component/antd/date-picker/util.d.ts +13 -0
  6. package/es/schema-component/antd/date-picker/util.mjs +14 -1
  7. package/es/schema-component/antd/markdown/Markdown.mjs +4 -4
  8. package/es/schema-component/antd/password/utils.d.ts +1 -1
  9. package/es/schema-settings/SchemaSettingsDefaultValue.mjs +3 -2
  10. package/es/schema-settings/VariableInput/hooks/index.d.ts +1 -0
  11. package/es/schema-settings/VariableInput/hooks/index.mjs +1 -0
  12. package/es/schema-settings/VariableInput/hooks/useExactDateVariable.d.ts +93 -0
  13. package/es/schema-settings/VariableInput/hooks/useExactDateVariable.mjs +75 -0
  14. package/es/schema-settings/VariableInput/hooks/useVariableOptions.mjs +11 -1
  15. package/es/user/ChangePassword.mjs +109 -6
  16. package/es/user/index.d.ts +1 -0
  17. package/es/user/index.mjs +2 -0
  18. package/es/variables/hooks/useBuiltinVariables.mjs +8 -2
  19. package/lib/block-provider/hooks/index.js +4 -4
  20. package/lib/built-in/acl/Configuration/MenuItemsProvider.js +2 -2
  21. package/lib/built-in/attachment-preview/previewers/file-sheet.js +2 -2
  22. package/lib/built-in/pm/index.js +1 -1
  23. package/lib/collection-manager/Configuration/components/Summary.js +3 -3
  24. package/lib/collection-manager/index.js +17 -17
  25. package/lib/flag-provider/hooks/useFlag.js +1 -1
  26. package/lib/icon/Icon.js +2 -2
  27. package/lib/locale/zh-CN.js +5 -0
  28. package/lib/schema-component/antd/action/Action.Container.js +2 -2
  29. package/lib/schema-component/antd/action/Action.Modal.js +2 -2
  30. package/lib/schema-component/antd/action/Action.Sheet.js +2 -2
  31. package/lib/schema-component/antd/color-select/ColorSelect.js +4 -4
  32. package/lib/schema-component/antd/date-picker/util.js +16 -0
  33. package/lib/schema-component/antd/form-tab/index.js +2 -2
  34. package/lib/schema-component/antd/form-v2/index.js +2 -2
  35. package/lib/schema-component/antd/markdown/Markdown.js +5 -5
  36. package/lib/schema-component/antd/scroll-area/ScrollArea.js +2 -2
  37. package/lib/schema-component/antd/table-v2/index.js +3 -3
  38. package/lib/schema-component/antd/upload/shared.js +4 -4
  39. package/lib/schema-settings/SchemaSettingsDefaultValue.js +3 -2
  40. package/lib/schema-settings/VariableInput/hooks/index.js +9 -0
  41. package/lib/schema-settings/VariableInput/hooks/useExactDateVariable.js +112 -0
  42. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +11 -1
  43. package/lib/user/ChangePassword.js +118 -5
  44. package/lib/user/index.js +24 -4
  45. package/lib/variables/VariablesProvider.js +2 -2
  46. package/lib/variables/hooks/useBuiltinVariables.js +7 -1
  47. package/package.json +10 -10
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ useExactDateVariable: ()=>useExactDateVariable,
28
+ useExactDateVariableContext: ()=>useExactDateVariableContext
29
+ });
30
+ const external_react_namespaceObject = require("react");
31
+ const external_react_i18next_namespaceObject = require("react-i18next");
32
+ const operators_js_namespaceObject = require("../../../collection-manager/interfaces/properties/operators.js");
33
+ const index_js_namespaceObject = require("../../../flag-provider/index.js");
34
+ const util_js_namespaceObject = require("../../../schema-component/antd/date-picker/util.js");
35
+ const useExactDateVariableContext = ()=>{
36
+ const exactDateTimeCtx = (0, external_react_namespaceObject.useMemo)(()=>(0, util_js_namespaceObject.getDateExact)(), []);
37
+ return {
38
+ exactDateTimeCtx
39
+ };
40
+ };
41
+ const useExactDateVariable = function() {
42
+ let { schema, targetFieldSchema } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
43
+ var _collectionField_uiSchema;
44
+ const { collectionField } = (0, index_js_namespaceObject.useFlag)();
45
+ const { dateOnly, utc, accuracy, picker } = (null == collectionField ? void 0 : null == (_collectionField_uiSchema = collectionField.uiSchema) ? void 0 : _collectionField_uiSchema['x-component-props']) || {};
46
+ const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
47
+ const exactDateTimeSettings = (0, external_react_namespaceObject.useMemo)(()=>{
48
+ const getDateKeys = (key)=>{
49
+ if (!picker) {
50
+ if ('now' === key) return 'nowLocal';
51
+ if ('today' === key) return 'todayDate';
52
+ if ('yesterday' === key) return 'yesterdayDate';
53
+ if ('tomorrow' === key) return 'tomorrowDate';
54
+ }
55
+ if (dateOnly) {
56
+ if ('now' === key) return null;
57
+ return "".concat(key, "Date");
58
+ }
59
+ return "".concat(key).concat(utc || accuracy ? 'Utc' : 'Local');
60
+ };
61
+ const dateOptions = [
62
+ {
63
+ key: 'now',
64
+ value: getDateKeys('now'),
65
+ label: t('Now'),
66
+ operators: operators_js_namespaceObject.datetime
67
+ },
68
+ {
69
+ key: 'today',
70
+ value: getDateKeys('today'),
71
+ label: t('Today'),
72
+ operators: operators_js_namespaceObject.datetime
73
+ },
74
+ {
75
+ key: 'yesterday',
76
+ value: getDateKeys('yesterday'),
77
+ label: t('Yesterday'),
78
+ operators: operators_js_namespaceObject.datetime
79
+ },
80
+ {
81
+ key: 'tomorrow',
82
+ value: getDateKeys('tomorrow'),
83
+ label: t('Tomorrow'),
84
+ operators: operators_js_namespaceObject.datetime
85
+ }
86
+ ].filter((v)=>v.value);
87
+ return {
88
+ label: t('Date variables'),
89
+ value: '$nExactDate',
90
+ key: '$nExactDate',
91
+ children: dateOptions
92
+ };
93
+ }, [
94
+ null == schema ? void 0 : schema['x-component'],
95
+ targetFieldSchema
96
+ ]);
97
+ const { exactDateTimeCtx } = useExactDateVariableContext();
98
+ return {
99
+ exactDateTimeSettings,
100
+ exactDateTimeCtx,
101
+ shouldDisplayExactDate: !!collectionField
102
+ };
103
+ };
104
+ exports.useExactDateVariable = __webpack_exports__.useExactDateVariable;
105
+ exports.useExactDateVariableContext = __webpack_exports__.useExactDateVariableContext;
106
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
107
+ "useExactDateVariable",
108
+ "useExactDateVariableContext"
109
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
110
+ Object.defineProperty(exports, '__esModule', {
111
+ value: true
112
+ });
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const external_react_namespaceObject = require("react");
30
30
  const external_useBlockCollection_js_namespaceObject = require("./useBlockCollection.js");
31
31
  const external_useDateVariable_js_namespaceObject = require("./useDateVariable.js");
32
+ const external_useExactDateVariable_js_namespaceObject = require("./useExactDateVariable.js");
32
33
  const external_useFilterVariable_js_namespaceObject = require("./useFilterVariable.js");
33
34
  const external_useFormVariable_js_namespaceObject = require("./useFormVariable.js");
34
35
  const external_useIterationVariable_js_namespaceObject = require("./useIterationVariable.js");
@@ -60,6 +61,12 @@ const useVariableOptions = (param)=>{
60
61
  schema: uiSchema,
61
62
  noDisabled
62
63
  });
64
+ const { exactDateTimeSettings, shouldDisplayExactDate } = (0, external_useExactDateVariable_js_namespaceObject.useExactDateVariable)({
65
+ operator,
66
+ schema: uiSchema,
67
+ noDisabled: true,
68
+ targetFieldSchema
69
+ });
63
70
  const { currentFormSettings, shouldDisplayCurrentForm } = (0, external_useFormVariable_js_namespaceObject.useCurrentFormVariable)({
64
71
  schema: uiSchema,
65
72
  collectionField,
@@ -102,7 +109,8 @@ const useVariableOptions = (param)=>{
102
109
  return (0, external_react_namespaceObject.useMemo)(()=>[
103
110
  currentUserSettings,
104
111
  currentRoleSettings,
105
- datetimeSettings,
112
+ !shouldDisplayExactDate && datetimeSettings,
113
+ shouldDisplayExactDate && exactDateTimeSettings,
106
114
  shouldDisplayCurrentForm && currentFormSettings,
107
115
  shouldDisplayCurrentObject && currentObjectSettings,
108
116
  shouldDisplayCurrentRecord && currentRecordSettings,
@@ -113,6 +121,8 @@ const useVariableOptions = (param)=>{
113
121
  currentUserSettings,
114
122
  currentRoleSettings,
115
123
  datetimeSettings,
124
+ exactDateTimeSettings,
125
+ shouldDisplayExactDate,
116
126
  shouldDisplayCurrentForm,
117
127
  currentFormSettings,
118
128
  shouldDisplayCurrentObject,
@@ -1,5 +1,14 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
3
12
  (()=>{
4
13
  __webpack_require__.d = (exports1, definition)=>{
5
14
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
@@ -32,6 +41,8 @@ const schema_namespaceObject = require("@tachybase/schema");
32
41
  const external_react_i18next_namespaceObject = require("react-i18next");
33
42
  const external_index_js_namespaceObject = require("../index.js");
34
43
  const index_js_namespaceObject = require("../api-client/index.js");
44
+ const external_VerificationCode_js_namespaceObject = require("./VerificationCode.js");
45
+ var external_VerificationCode_js_default = /*#__PURE__*/ __webpack_require__.n(external_VerificationCode_js_namespaceObject);
35
46
  const useCloseAction = ()=>{
36
47
  const { setVisible } = (0, external_index_js_namespaceObject.useActionContext)();
37
48
  const form = (0, schema_namespaceObject.useForm)();
@@ -77,13 +88,101 @@ const schema = {
77
88
  type: 'void',
78
89
  title: '{{t("Change password")}}',
79
90
  properties: {
91
+ verifyMethod: {
92
+ type: 'string',
93
+ required: true,
94
+ title: '{{t("Verify method")}}',
95
+ enum: [
96
+ {
97
+ label: '{{t("Use old password")}}',
98
+ value: 'password'
99
+ },
100
+ {
101
+ label: '{{t("Use verification code")}}',
102
+ value: 'code'
103
+ }
104
+ ],
105
+ 'x-component': 'Radio.Group',
106
+ 'x-decorator': 'FormItem',
107
+ 'x-reactions': [
108
+ {
109
+ dependencies: [
110
+ '.phoneExist',
111
+ '.oldPasswordExist'
112
+ ],
113
+ fulfill: {
114
+ state: {
115
+ hidden: '{{ !($deps[0] && $deps[1] && smsVerifyEnabled) }}',
116
+ value: '{{ undefined }}'
117
+ }
118
+ }
119
+ }
120
+ ]
121
+ },
122
+ phoneExist: {
123
+ type: 'boolean',
124
+ default: '{{ !!phoneNumber }}',
125
+ 'x-hidden': true
126
+ },
127
+ phone: {
128
+ type: 'string',
129
+ title: '{{t("Phone")}}',
130
+ default: '{{ phoneNumber }}',
131
+ 'x-component': 'Input',
132
+ 'x-validator': 'phone',
133
+ 'x-decorator': 'FormItem',
134
+ 'x-hidden': true
135
+ },
136
+ code: {
137
+ type: 'string',
138
+ title: '{{t("Verification code")}}',
139
+ description: "{{codeDescription}}",
140
+ 'x-component': 'VerificationCode',
141
+ 'x-component-props': {
142
+ actionType: 'auth:changePassword',
143
+ targetFieldName: 'phone'
144
+ },
145
+ required: true,
146
+ 'x-decorator': 'FormItem',
147
+ 'x-reactions': [
148
+ {
149
+ dependencies: [
150
+ '.verifyMethod',
151
+ '.phoneExist',
152
+ '.phone'
153
+ ],
154
+ fulfill: {
155
+ state: {
156
+ hidden: "{{ \n !$deps[1] || \n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) // \u6709 verifyMethod \u4F46\u672A\u9009 code\n }}"
157
+ }
158
+ }
159
+ }
160
+ ]
161
+ },
162
+ oldPasswordExist: {
163
+ type: 'boolean',
164
+ default: '{{ oldPassword }}',
165
+ 'x-hidden': true
166
+ },
80
167
  oldPassword: {
81
168
  type: 'string',
82
169
  title: '{{t("Old password")}}',
83
170
  required: true,
84
171
  'x-component': 'Password',
85
172
  'x-decorator': 'FormItem',
86
- 'x-hidden': '{{ hideOldPassword }}'
173
+ 'x-reactions': [
174
+ {
175
+ dependencies: [
176
+ '.verifyMethod',
177
+ '.oldPasswordExist'
178
+ ],
179
+ fulfill: {
180
+ state: {
181
+ hidden: "{{ \n !$deps[1] || \n (smsVerifyEnabled && $deps[0] !== 'password' && $deps[0] !== undefined)\n }}"
182
+ }
183
+ }
184
+ }
185
+ ]
87
186
  },
88
187
  newPassword: {
89
188
  type: 'string',
@@ -157,12 +256,20 @@ const schema = {
157
256
  }
158
257
  };
159
258
  const useChangePassword = ()=>{
160
- var _currentUser_data_data, _currentUser_data;
259
+ var _currentUser_data_data, _currentUser_data, _currentUser_data_data1, _currentUser_data1;
161
260
  const ctx = (0, external_react_namespaceObject.useContext)(external_index_js_namespaceObject.DropdownVisibleContext);
162
261
  const [visible, setVisible] = (0, external_react_namespaceObject.useState)(false);
163
262
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
263
+ const pm = (0, external_index_js_namespaceObject.useApp)().pluginManager;
264
+ const otp = pm.get('@tachybase/plugin-otp');
265
+ const sms = pm.get('@tachybase/plugin-auth-sms');
266
+ const smsVerifyEnabled = !!otp && !!sms;
164
267
  const currentUser = (0, external_index_js_namespaceObject.useCurrentUserContext)();
165
- const hideOldPassword = (null == currentUser ? void 0 : null == (_currentUser_data = currentUser.data) ? void 0 : null == (_currentUser_data_data = _currentUser_data.data) ? void 0 : _currentUser_data_data.password) === null;
268
+ const oldPassword = (null == currentUser ? void 0 : null == (_currentUser_data = currentUser.data) ? void 0 : null == (_currentUser_data_data = _currentUser_data.data) ? void 0 : _currentUser_data_data.password) !== null;
269
+ const phoneNumber = null == currentUser ? void 0 : null == (_currentUser_data1 = currentUser.data) ? void 0 : null == (_currentUser_data_data1 = _currentUser_data1.data) ? void 0 : _currentUser_data_data1.phone;
270
+ const codeDescription = phoneNumber ? t('Send verification code to phone: {{phoneNumber}}', {
271
+ phoneNumber
272
+ }) : t('Please fill in your mobile phone number in your personal information first');
166
273
  return (0, external_react_namespaceObject.useMemo)(()=>({
167
274
  key: 'password',
168
275
  eventKey: 'ChangePassword',
@@ -184,7 +291,13 @@ const useChangePassword = ()=>{
184
291
  scope: {
185
292
  useCloseAction,
186
293
  useSaveCurrentUserValues,
187
- hideOldPassword
294
+ oldPassword,
295
+ codeDescription,
296
+ phoneNumber,
297
+ smsVerifyEnabled
298
+ },
299
+ components: {
300
+ VerificationCode: external_VerificationCode_js_default()
188
301
  },
189
302
  schema: schema
190
303
  })
@@ -194,7 +307,7 @@ const useChangePassword = ()=>{
194
307
  })
195
308
  }), [
196
309
  visible,
197
- hideOldPassword
310
+ oldPassword
198
311
  ]);
199
312
  };
200
313
  exports.useChangePassword = __webpack_exports__.useChangePassword;
package/lib/user/index.js CHANGED
@@ -8,6 +8,9 @@ var __webpack_modules__ = {
8
8
  },
9
9
  "./CurrentUserSettingsMenuProvider": function(module) {
10
10
  module.exports = require("./CurrentUserSettingsMenuProvider.js");
11
+ },
12
+ "./VerificationCode": function(module) {
13
+ module.exports = require("./VerificationCode.js");
11
14
  }
12
15
  };
13
16
  var __webpack_module_cache__ = {};
@@ -53,26 +56,43 @@ function __webpack_require__(moduleId) {
53
56
  var __webpack_exports__ = {};
54
57
  (()=>{
55
58
  __webpack_require__.r(__webpack_exports__);
59
+ __webpack_require__.d(__webpack_exports__, {
60
+ VerificationCode: ()=>_VerificationCode__WEBPACK_IMPORTED_MODULE_3___default.a
61
+ });
56
62
  var _CurrentUser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./CurrentUser");
57
63
  var __WEBPACK_REEXPORT_OBJECT__ = {};
58
- for(var __WEBPACK_IMPORT_KEY__ in _CurrentUser__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
64
+ for(var __WEBPACK_IMPORT_KEY__ in _CurrentUser__WEBPACK_IMPORTED_MODULE_0__)if ([
65
+ "VerificationCode",
66
+ "default"
67
+ ].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
59
68
  return _CurrentUser__WEBPACK_IMPORTED_MODULE_0__[key];
60
69
  }).bind(0, __WEBPACK_IMPORT_KEY__);
61
70
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
62
71
  var _CurrentUserProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./CurrentUserProvider");
63
72
  var __WEBPACK_REEXPORT_OBJECT__ = {};
64
- for(var __WEBPACK_IMPORT_KEY__ in _CurrentUserProvider__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
73
+ for(var __WEBPACK_IMPORT_KEY__ in _CurrentUserProvider__WEBPACK_IMPORTED_MODULE_1__)if ([
74
+ "VerificationCode",
75
+ "default"
76
+ ].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
65
77
  return _CurrentUserProvider__WEBPACK_IMPORTED_MODULE_1__[key];
66
78
  }).bind(0, __WEBPACK_IMPORT_KEY__);
67
79
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
68
80
  var _CurrentUserSettingsMenuProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./CurrentUserSettingsMenuProvider");
69
81
  var __WEBPACK_REEXPORT_OBJECT__ = {};
70
- for(var __WEBPACK_IMPORT_KEY__ in _CurrentUserSettingsMenuProvider__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
82
+ for(var __WEBPACK_IMPORT_KEY__ in _CurrentUserSettingsMenuProvider__WEBPACK_IMPORTED_MODULE_2__)if ([
83
+ "VerificationCode",
84
+ "default"
85
+ ].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
71
86
  return _CurrentUserSettingsMenuProvider__WEBPACK_IMPORTED_MODULE_2__[key];
72
87
  }).bind(0, __WEBPACK_IMPORT_KEY__);
73
88
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
89
+ var _VerificationCode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./VerificationCode");
90
+ var _VerificationCode__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/ __webpack_require__.n(_VerificationCode__WEBPACK_IMPORTED_MODULE_3__);
74
91
  })();
75
- for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
92
+ exports.VerificationCode = __webpack_exports__.VerificationCode;
93
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
94
+ "VerificationCode"
95
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
76
96
  Object.defineProperty(exports, '__esModule', {
77
97
  value: true
78
98
  });
@@ -33,8 +33,8 @@ var __webpack_require__ = {};
33
33
  var __webpack_exports__ = {};
34
34
  __webpack_require__.r(__webpack_exports__);
35
35
  __webpack_require__.d(__webpack_exports__, {
36
- default: ()=>VariablesProvider,
37
- VariablesContext: ()=>VariablesContext
36
+ VariablesContext: ()=>VariablesContext,
37
+ default: ()=>VariablesProvider
38
38
  });
39
39
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
40
40
  const external_react_namespaceObject = require("react");
@@ -34,6 +34,7 @@ const useBuiltInVariables = ()=>{
34
34
  const { currentUserCtx } = (0, index_js_namespaceObject.useCurrentUserVariable)();
35
35
  const { currentRoleCtx } = (0, useRoleVariable_js_namespaceObject.useCurrentRoleVariable)();
36
36
  const { datetimeCtx } = (0, index_js_namespaceObject.useDatetimeVariable)();
37
+ const { exactDateTimeCtx } = (0, index_js_namespaceObject.useExactDateVariable)();
37
38
  const builtinVariables = (0, external_react_namespaceObject.useMemo)(()=>[
38
39
  {
39
40
  name: '$user',
@@ -58,6 +59,10 @@ const useBuiltInVariables = ()=>{
58
59
  name: '$date',
59
60
  ctx: datetimeCtx
60
61
  },
62
+ {
63
+ name: '$nExactDate',
64
+ ctx: exactDateTimeCtx
65
+ },
61
66
  {
62
67
  name: '$system',
63
68
  ctx: {
@@ -69,7 +74,8 @@ const useBuiltInVariables = ()=>{
69
74
  ctx: ()=>(0, client_namespaceObject.dayjs)().toISOString()
70
75
  }
71
76
  ], [
72
- currentUserCtx
77
+ currentUserCtx,
78
+ exactDateTimeCtx
73
79
  ]);
74
80
  return {
75
81
  builtinVariables
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/client",
3
- "version": "1.3.19",
3
+ "version": "1.3.20",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.mjs",
@@ -59,26 +59,26 @@
59
59
  "react-quill": "^2.0.0",
60
60
  "react-router": "6.28.1",
61
61
  "react-router-dom": "6.28.1",
62
- "react-svg": "^16.2.0",
62
+ "react-svg": "^16.3.0",
63
63
  "react-to-print": "^2.15.1",
64
64
  "react-transition-group": "^4.4.5",
65
65
  "react-zoom-pan-pinch": "^3.6.1",
66
66
  "sanitize-html": "2.17.0",
67
67
  "use-deep-compare-effect": "^1.8.1",
68
68
  "xlsx": "0.18.5",
69
- "@tachybase/requirejs": "1.3.19",
70
- "@tachybase/components": "1.3.19",
71
- "@tachybase/schema": "1.3.19",
72
- "@tachybase/evaluators": "1.3.19",
73
- "@tachybase/sdk": "1.3.19",
74
- "@tachybase/utils": "1.3.19"
69
+ "@tachybase/components": "1.3.20",
70
+ "@tachybase/evaluators": "1.3.20",
71
+ "@tachybase/requirejs": "1.3.20",
72
+ "@tachybase/schema": "1.3.20",
73
+ "@tachybase/sdk": "1.3.20",
74
+ "@tachybase/utils": "1.3.20"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@testing-library/react": "^16.2.0",
78
78
  "@types/flat": "^5.0.5",
79
- "@types/lodash": "^4.17.13",
79
+ "@types/lodash": "^4.17.20",
80
80
  "@types/markdown-it": "12.2.3",
81
- "@types/react-big-calendar": "^1.16.0"
81
+ "@types/react-big-calendar": "^1.16.2"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "react": ">=18.0.0",