@tachybase/client 1.3.18 → 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 (148) hide show
  1. package/es/application/CustomRouterContextProvider.mjs +1 -2
  2. package/es/application/components/AppComponent.mjs +1 -3
  3. package/es/block-provider/hooks/index.mjs +1 -1
  4. package/es/built-in/acl/Configuration/schemas/scopes.mjs +4 -5
  5. package/es/built-in/dynamic-page/DynamicPage.mjs +16 -33
  6. package/es/built-in/dynamic-page/utils.d.ts +1 -2
  7. package/es/built-in/dynamic-page/utils.mjs +0 -3
  8. package/es/built-in/page-style/CustomAdminHeader.mjs +2 -2
  9. package/es/built-in/page-style/PageStyle.provider.d.ts +2 -7
  10. package/es/built-in/page-style/PageStyle.provider.mjs +3 -8
  11. package/es/built-in/page-style/TabContent.mjs +5 -7
  12. package/es/built-in/page-style/usePageStyle.d.ts +1 -1
  13. package/es/built-in/page-style/usePageStyle.mjs +1 -1
  14. package/es/built-in/page-style/useTabSettings.d.ts +3 -4
  15. package/es/built-in/page-style/useTabSettings.mjs +7 -8
  16. package/es/built-in/quick-access/PopupActionSchemaInitializerItem.mjs +2 -2
  17. package/es/collection-manager/Configuration/components/Summary.mjs +3 -3
  18. package/es/flag-provider/FlagProvider.d.ts +1 -0
  19. package/es/flag-provider/hooks/useFlag.mjs +1 -1
  20. package/es/modules/actions/add-child/CreateChildInitializer.mjs +2 -2
  21. package/es/modules/actions/add-new/CreateActionInitializer.mjs +2 -2
  22. package/es/modules/actions/add-record/CustomizeAddRecordActionInitializer.mjs +2 -2
  23. package/es/modules/actions/associate/AssociateActionInitializer.mjs +1 -2
  24. package/es/modules/actions/submit/createSubmitActionSettings.mjs +3 -6
  25. package/es/modules/actions/view-edit-popup/PopupActionInitializer.mjs +2 -2
  26. package/es/modules/actions/view-edit-popup/UpdateActionInitializer.mjs +2 -2
  27. package/es/modules/actions/view-edit-popup/ViewActionInitializer.mjs +2 -2
  28. package/es/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.mjs +2 -2
  29. package/es/modules/fields/component/Picker/recordPickerComponentFieldSettings.mjs +2 -2
  30. package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +2 -2
  31. package/es/schema-component/antd/action/Action.Container.mjs +5 -26
  32. package/es/schema-component/antd/action/Action.Designer.mjs +3 -14
  33. package/es/schema-component/antd/action/Action.Page.mjs +1 -1
  34. package/es/schema-component/antd/action/Action.mjs +11 -56
  35. package/es/schema-component/antd/action/context.d.ts +1 -9
  36. package/es/schema-component/antd/action/context.mjs +1 -10
  37. package/es/schema-component/antd/action/hooks.d.ts +1 -2
  38. package/es/schema-component/antd/action/hooks.mjs +2 -2
  39. package/es/schema-component/antd/association-field/FileManager.mjs +2 -2
  40. package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +2 -2
  41. package/es/schema-component/antd/association-field/InternalPicker.mjs +2 -2
  42. package/es/schema-component/antd/association-field/InternalTag.mjs +2 -2
  43. package/es/schema-component/antd/association-field/InternalViewer.mjs +2 -2
  44. package/es/schema-component/antd/association-field/SubTable.mjs +2 -2
  45. package/es/schema-component/antd/color-select/ColorSelect.mjs +3 -3
  46. package/es/schema-component/antd/date-picker/util.d.ts +13 -0
  47. package/es/schema-component/antd/date-picker/util.mjs +14 -1
  48. package/es/schema-component/antd/form-item/FormItem.Settings.mjs +2 -3
  49. package/es/schema-component/antd/markdown/Markdown.mjs +4 -4
  50. package/es/schema-component/antd/page/Page.mjs +22 -27
  51. package/es/schema-component/antd/password/utils.d.ts +1 -1
  52. package/es/schema-component/antd/record-picker/InputRecordPicker.mjs +2 -2
  53. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.mjs +2 -2
  54. package/es/schema-initializer/items/SelectActionInitializer.mjs +2 -2
  55. package/es/schema-items/OpenModeSchemaItems.mjs +16 -37
  56. package/es/schema-settings/SchemaSettingsDefaultValue.mjs +3 -2
  57. package/es/schema-settings/VariableInput/hooks/index.d.ts +1 -0
  58. package/es/schema-settings/VariableInput/hooks/index.mjs +1 -0
  59. package/es/schema-settings/VariableInput/hooks/useExactDateVariable.d.ts +93 -0
  60. package/es/schema-settings/VariableInput/hooks/useExactDateVariable.mjs +75 -0
  61. package/es/schema-settings/VariableInput/hooks/useVariableOptions.mjs +11 -1
  62. package/es/schema-templates/schemas/uiSchemaTemplates.mjs +1 -1
  63. package/es/user/ChangePassword.mjs +109 -6
  64. package/es/user/index.d.ts +1 -0
  65. package/es/user/index.mjs +2 -0
  66. package/es/variables/hooks/useBuiltinVariables.mjs +8 -2
  67. package/lib/application/CustomRouterContextProvider.js +1 -2
  68. package/lib/application/components/AppComponent.js +1 -3
  69. package/lib/block-provider/hooks/index.js +7 -7
  70. package/lib/built-in/acl/Configuration/MenuItemsProvider.js +2 -2
  71. package/lib/built-in/acl/Configuration/schemas/scopes.js +3 -4
  72. package/lib/built-in/attachment-preview/previewers/file-sheet.js +2 -2
  73. package/lib/built-in/dynamic-page/DynamicPage.js +14 -31
  74. package/lib/built-in/dynamic-page/utils.js +0 -3
  75. package/lib/built-in/page-style/CustomAdminHeader.js +2 -2
  76. package/lib/built-in/page-style/PageStyle.provider.js +2 -10
  77. package/lib/built-in/page-style/TabContent.js +4 -6
  78. package/lib/built-in/page-style/usePageStyle.js +1 -1
  79. package/lib/built-in/page-style/useTabSettings.js +7 -8
  80. package/lib/built-in/pm/index.js +1 -1
  81. package/lib/built-in/quick-access/PopupActionSchemaInitializerItem.js +1 -1
  82. package/lib/collection-manager/Configuration/components/Summary.js +3 -3
  83. package/lib/collection-manager/index.js +17 -17
  84. package/lib/flag-provider/hooks/useFlag.js +1 -1
  85. package/lib/icon/Icon.js +2 -2
  86. package/lib/locale/en_US.js +0 -1
  87. package/lib/locale/zh-CN.js +5 -0
  88. package/lib/modules/actions/add-child/CreateChildInitializer.js +2 -2
  89. package/lib/modules/actions/add-new/CreateActionInitializer.js +2 -2
  90. package/lib/modules/actions/add-record/CustomizeAddRecordActionInitializer.js +2 -2
  91. package/lib/modules/actions/associate/AssociateActionInitializer.js +1 -2
  92. package/lib/modules/actions/submit/createSubmitActionSettings.js +2 -5
  93. package/lib/modules/actions/view-edit-popup/PopupActionInitializer.js +2 -2
  94. package/lib/modules/actions/view-edit-popup/UpdateActionInitializer.js +2 -2
  95. package/lib/modules/actions/view-edit-popup/ViewActionInitializer.js +2 -2
  96. package/lib/modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.js +1 -1
  97. package/lib/modules/fields/component/Picker/recordPickerComponentFieldSettings.js +1 -1
  98. package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +1 -1
  99. package/lib/schema-component/antd/action/Action.Container.js +6 -27
  100. package/lib/schema-component/antd/action/Action.Designer.js +2 -13
  101. package/lib/schema-component/antd/action/Action.Modal.js +2 -2
  102. package/lib/schema-component/antd/action/Action.Page.js +1 -1
  103. package/lib/schema-component/antd/action/Action.Sheet.js +2 -2
  104. package/lib/schema-component/antd/action/Action.js +10 -55
  105. package/lib/schema-component/antd/action/context.js +1 -13
  106. package/lib/schema-component/antd/action/hooks.js +1 -1
  107. package/lib/schema-component/antd/association-field/FileManager.js +1 -1
  108. package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
  109. package/lib/schema-component/antd/association-field/InternalPicker.js +1 -1
  110. package/lib/schema-component/antd/association-field/InternalTag.js +1 -1
  111. package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
  112. package/lib/schema-component/antd/association-field/SubTable.js +1 -1
  113. package/lib/schema-component/antd/color-select/ColorSelect.js +4 -4
  114. package/lib/schema-component/antd/date-picker/util.js +16 -0
  115. package/lib/schema-component/antd/form-item/FormItem.Settings.js +2 -3
  116. package/lib/schema-component/antd/form-tab/index.js +2 -2
  117. package/lib/schema-component/antd/form-v2/index.js +2 -2
  118. package/lib/schema-component/antd/markdown/Markdown.js +5 -5
  119. package/lib/schema-component/antd/page/Page.js +21 -26
  120. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +1 -1
  121. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
  122. package/lib/schema-component/antd/scroll-area/ScrollArea.js +2 -2
  123. package/lib/schema-component/antd/table-v2/index.js +3 -3
  124. package/lib/schema-component/antd/upload/shared.js +4 -4
  125. package/lib/schema-initializer/items/SelectActionInitializer.js +2 -2
  126. package/lib/schema-items/OpenModeSchemaItems.js +15 -36
  127. package/lib/schema-settings/SchemaSettingsDefaultValue.js +3 -2
  128. package/lib/schema-settings/VariableInput/hooks/index.js +9 -0
  129. package/lib/schema-settings/VariableInput/hooks/useExactDateVariable.js +112 -0
  130. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +11 -1
  131. package/lib/schema-templates/schemas/uiSchemaTemplates.js +1 -1
  132. package/lib/user/ChangePassword.js +118 -5
  133. package/lib/user/index.js +24 -4
  134. package/lib/variables/VariablesProvider.js +2 -2
  135. package/lib/variables/hooks/useBuiltinVariables.js +7 -1
  136. package/package.json +10 -10
  137. package/es/built-in/dynamic-page/DynamicPage.context.d.ts +0 -0
  138. package/es/built-in/dynamic-page/DynamicPage.context.mjs +0 -0
  139. package/es/built-in/dynamic-page/DynamicPage.style.d.ts +0 -3
  140. package/es/built-in/dynamic-page/DynamicPage.style.mjs +0 -26
  141. package/es/built-in/dynamic-page/PageNavBar.d.ts +0 -3
  142. package/es/built-in/dynamic-page/PageNavBar.mjs +0 -47
  143. package/es/built-in/dynamic-page/PageNavBar.style.d.ts +0 -3
  144. package/es/built-in/dynamic-page/PageNavBar.style.mjs +0 -25
  145. package/lib/built-in/dynamic-page/DynamicPage.context.js +0 -5
  146. package/lib/built-in/dynamic-page/DynamicPage.style.js +0 -60
  147. package/lib/built-in/dynamic-page/PageNavBar.js +0 -81
  148. package/lib/built-in/dynamic-page/PageNavBar.style.js +0 -59
@@ -28,14 +28,11 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  SchemaSettingOpenModeSchemaItems: ()=>SchemaSettingOpenModeSchemaItems
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_react_namespaceObject = require("react");
31
+ require("react");
32
32
  const schema_namespaceObject = require("@tachybase/schema");
33
33
  const external_antd_namespaceObject = require("antd");
34
34
  const external_react_i18next_namespaceObject = require("react-i18next");
35
35
  const index_js_namespaceObject = require("../application/index.js");
36
- const external_block_provider_index_js_namespaceObject = require("../block-provider/index.js");
37
- const PageStyle_provider_js_namespaceObject = require("../built-in/page-style/PageStyle.provider.js");
38
- const usePageStyle_js_namespaceObject = require("../built-in/page-style/usePageStyle.js");
39
36
  const external_schema_component_index_js_namespaceObject = require("../schema-component/index.js");
40
37
  const external_schema_settings_index_js_namespaceObject = require("../schema-settings/index.js");
41
38
  const SchemaInitializerOpenModeSchemaItems = (options)=>{
@@ -45,16 +42,7 @@ const SchemaInitializerOpenModeSchemaItems = (options)=>{
45
42
  const field = (0, schema_namespaceObject.useField)();
46
43
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
47
44
  const { dn } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
48
- const isMobile = (0, external_block_provider_index_js_namespaceObject.useIsMobile)();
49
- const pageStyle = (0, usePageStyle_js_namespaceObject.usePageStyle)();
50
- const defaultOpenMode = (0, external_react_namespaceObject.useMemo)(()=>{
51
- if (isMobile || pageStyle === PageStyle_provider_js_namespaceObject.PageStyle.TAB_STYLE) return external_schema_component_index_js_namespaceObject.OpenMode.PAGE;
52
- return external_schema_component_index_js_namespaceObject.OpenMode.DRAWER_MODE;
53
- }, [
54
- isMobile,
55
- pageStyle
56
- ]);
57
- const openModeValue = (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openMode']) || defaultOpenMode;
45
+ const openModeValue = (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openMode']) || 'drawer';
58
46
  var _fieldSchema_xcomponentprops_openSize;
59
47
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
60
48
  children: [
@@ -63,11 +51,11 @@ const SchemaInitializerOpenModeSchemaItems = (options)=>{
63
51
  options: [
64
52
  {
65
53
  label: t('Drawer'),
66
- value: external_schema_component_index_js_namespaceObject.OpenMode.DRAWER_MODE
54
+ value: 'drawer'
67
55
  },
68
56
  {
69
57
  label: t('Dialog'),
70
- value: external_schema_component_index_js_namespaceObject.OpenMode.MODAL
58
+ value: 'modal'
71
59
  }
72
60
  ],
73
61
  value: openModeValue,
@@ -87,8 +75,8 @@ const SchemaInitializerOpenModeSchemaItems = (options)=>{
87
75
  }
88
76
  }) : null,
89
77
  openSize && [
90
- external_schema_component_index_js_namespaceObject.OpenMode.MODAL,
91
- external_schema_component_index_js_namespaceObject.OpenMode.DRAWER_MODE
78
+ 'modal',
79
+ 'drawer'
92
80
  ].includes(openModeValue) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaInitializerItem, {
93
81
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
94
82
  style: {
@@ -115,7 +103,7 @@ const SchemaInitializerOpenModeSchemaItems = (options)=>{
115
103
  value: 'large'
116
104
  }
117
105
  ],
118
- value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops2 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops2['openMode']) === external_schema_component_index_js_namespaceObject.OpenMode.MODAL ? 'large' : 'middle',
106
+ value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops2 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops2['openMode']) == 'modal' ? 'large' : 'middle',
119
107
  onChange: (value)=>{
120
108
  field.componentProps.openSize = value;
121
109
  const schema = {
@@ -147,16 +135,7 @@ const SchemaSettingOpenModeSchemaItems = (options)=>{
147
135
  const field = (0, schema_namespaceObject.useField)();
148
136
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
149
137
  const { dn } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
150
- const pageStyle = (0, usePageStyle_js_namespaceObject.usePageStyle)();
151
- const isMobile = (0, external_block_provider_index_js_namespaceObject.useIsMobile)();
152
- const defaultOpenMode = (0, external_react_namespaceObject.useMemo)(()=>{
153
- if (isMobile || pageStyle === PageStyle_provider_js_namespaceObject.PageStyle.TAB_STYLE) return external_schema_component_index_js_namespaceObject.OpenMode.PAGE;
154
- return external_schema_component_index_js_namespaceObject.OpenMode.DRAWER_MODE;
155
- }, [
156
- isMobile,
157
- pageStyle
158
- ]);
159
- const openModeValue = (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openMode']) || defaultOpenMode;
138
+ const openModeValue = (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops['openMode']) || 'drawer';
160
139
  var _fieldSchema_xcomponentprops_openSize;
161
140
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
162
141
  children: [
@@ -165,19 +144,19 @@ const SchemaSettingOpenModeSchemaItems = (options)=>{
165
144
  options: [
166
145
  {
167
146
  label: t('Drawer'),
168
- value: external_schema_component_index_js_namespaceObject.OpenMode.DRAWER_MODE
147
+ value: 'drawer'
169
148
  },
170
149
  {
171
150
  label: t('Dialog'),
172
- value: external_schema_component_index_js_namespaceObject.OpenMode.MODAL
151
+ value: 'modal'
173
152
  },
174
153
  {
175
154
  label: t('Sheet'),
176
- value: external_schema_component_index_js_namespaceObject.OpenMode.SHEET
155
+ value: 'sheet'
177
156
  },
178
157
  {
179
158
  label: t('Page'),
180
- value: external_schema_component_index_js_namespaceObject.OpenMode.PAGE
159
+ value: 'page'
181
160
  }
182
161
  ],
183
162
  value: openModeValue,
@@ -197,8 +176,8 @@ const SchemaSettingOpenModeSchemaItems = (options)=>{
197
176
  }
198
177
  }) : null,
199
178
  openSize && [
200
- external_schema_component_index_js_namespaceObject.OpenMode.MODAL,
201
- external_schema_component_index_js_namespaceObject.OpenMode.DRAWER_MODE
179
+ 'modal',
180
+ 'drawer'
202
181
  ].includes(openModeValue) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.SchemaSettingsSelectItem, {
203
182
  title: t('Popup size'),
204
183
  options: [
@@ -215,7 +194,7 @@ const SchemaSettingOpenModeSchemaItems = (options)=>{
215
194
  value: 'large'
216
195
  }
217
196
  ],
218
- value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops2 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops2['openMode']) === external_schema_component_index_js_namespaceObject.OpenMode.MODAL ? 'large' : 'middle',
197
+ value: null != (_fieldSchema_xcomponentprops_openSize = null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1['openSize']) ? _fieldSchema_xcomponentprops_openSize : (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops2 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops2['openMode']) == 'modal' ? 'large' : 'middle',
219
198
  onChange: (value)=>{
220
199
  field.componentProps.openSize = value;
221
200
  const schema = {
@@ -126,6 +126,7 @@ const SchemaSettingsDefaultValue = function(props) {
126
126
  isInSubForm: isInSubForm,
127
127
  isInSubTable: isInSubTable,
128
128
  isInSetDefaultValueDialog: true,
129
+ collectionField: collectionField,
129
130
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VariableInput_js_namespaceObject.VariableInput, {
130
131
  ...props
131
132
  })
@@ -142,7 +143,7 @@ const SchemaSettingsDefaultValue = function(props) {
142
143
  'x-decorator': 'FormItem',
143
144
  'x-component': 'VariableInput',
144
145
  'x-component-props': {
145
- ...(null == fieldSchema ? void 0 : fieldSchema['x-component-props']) || {},
146
+ ...null == fieldSchema ? void 0 : fieldSchema['x-component-props'],
146
147
  collectionField,
147
148
  contextCollectionName: isAllowContextVariable && tableCtx.collection,
148
149
  schema: null == collectionField ? void 0 : collectionField.uiSchema,
@@ -171,7 +172,7 @@ const SchemaSettingsDefaultValue = function(props) {
171
172
  s.type = 'void';
172
173
  }
173
174
  const schema = {
174
- ...s || {},
175
+ ...s,
175
176
  'x-decorator': 'FormItem',
176
177
  'x-component-props': {
177
178
  ...s['x-component-props'],
@@ -6,6 +6,9 @@ var __webpack_modules__ = {
6
6
  "./useDateVariable": function(module) {
7
7
  module.exports = require("./useDateVariable.js");
8
8
  },
9
+ "./useExactDateVariable": function(module) {
10
+ module.exports = require("./useExactDateVariable.js");
11
+ },
9
12
  "./useUserVariable": function(module) {
10
13
  module.exports = require("./useUserVariable.js");
11
14
  }
@@ -71,6 +74,12 @@ var __webpack_exports__ = {};
71
74
  return _useUserVariable__WEBPACK_IMPORTED_MODULE_2__[key];
72
75
  }).bind(0, __WEBPACK_IMPORT_KEY__);
73
76
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
77
+ var _useExactDateVariable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./useExactDateVariable");
78
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
79
+ for(var __WEBPACK_IMPORT_KEY__ in _useExactDateVariable__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
80
+ return _useExactDateVariable__WEBPACK_IMPORTED_MODULE_3__[key];
81
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
82
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
74
83
  })();
75
84
  for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
76
85
  Object.defineProperty(exports, '__esModule', {
@@ -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,
@@ -136,7 +136,7 @@ const uiSchemaTemplatesSchema = {
136
136
  'x-action': 'update',
137
137
  'x-component': 'Action.Link',
138
138
  'x-component-props': {
139
- openMode: 'drawer-mode',
139
+ openMode: 'drawer',
140
140
  icon: 'EditOutlined'
141
141
  },
142
142
  properties: {
@@ -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