@tachybase/client 1.6.21 → 1.6.23

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 (191) hide show
  1. package/es/api-client/APIClient.d.ts +2 -1
  2. package/es/api-client/APIClient.mjs +6 -3
  3. package/es/application/Plugin.d.ts +2 -2
  4. package/es/application/hoc/withDynamicSchemaProps.mjs +1 -1
  5. package/es/application/schema-initializer/hooks/index.mjs +4 -1
  6. package/es/application/schema-settings/components/SchemaSettingsChildren.mjs +14 -14
  7. package/es/application/utils/clientModuleRegistry.d.ts +2 -0
  8. package/es/application/utils/clientModuleRegistry.mjs +9 -0
  9. package/es/application/utils/globalDeps.mjs +2 -2
  10. package/es/block-provider/BlockProvider.d.ts +1 -27
  11. package/es/block-provider/BlockProvider.mjs +1 -3
  12. package/es/block-provider/BlockRequestContext.d.ts +27 -0
  13. package/es/block-provider/BlockRequestContext.mjs +5 -0
  14. package/es/block-provider/FormBlockContext.d.ts +32 -0
  15. package/es/block-provider/FormBlockContext.mjs +5 -0
  16. package/es/block-provider/FormBlockProvider.d.ts +1 -33
  17. package/es/block-provider/FormBlockProvider.mjs +4 -5
  18. package/es/built-in/acl/ACLCollectionFieldProvider.d.ts +1 -0
  19. package/es/built-in/acl/ACLCollectionFieldProvider.mjs +42 -0
  20. package/es/built-in/acl/ACLContext.d.ts +9 -0
  21. package/es/built-in/acl/ACLContext.mjs +24 -0
  22. package/es/built-in/acl/ACLPlugin.mjs +2 -1
  23. package/es/built-in/acl/ACLProvider.d.ts +0 -11
  24. package/es/built-in/acl/ACLProvider.mjs +6 -51
  25. package/es/built-in/acl/index.d.ts +2 -0
  26. package/es/built-in/acl/index.mjs +2 -0
  27. package/es/built-in/locale/LocalePlugin.d.ts +2 -0
  28. package/es/built-in/locale/LocalePlugin.mjs +13 -4
  29. package/es/collection-manager/hooks/useCollectionManager_deprecated.mjs +2 -1
  30. package/es/collection-manager/sub-table.d.ts +1 -1
  31. package/es/data-source/data-source/DataSourceManager.d.ts +1 -2
  32. package/es/data-source/data-source/DataSourceManager.mjs +1 -2
  33. package/es/data-source/data-source/constants.d.ts +2 -0
  34. package/es/data-source/data-source/constants.mjs +3 -0
  35. package/es/data-source/utils.d.ts +2 -2
  36. package/es/data-source/utils.mjs +1 -1
  37. package/es/exports.d.ts +46 -0
  38. package/es/exports.mjs +46 -0
  39. package/es/filter-provider/utils.d.ts +2 -14
  40. package/es/filter-provider/utils.mjs +2 -57
  41. package/es/index.d.ts +1 -46
  42. package/es/index.mjs +4 -46
  43. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +2 -86
  44. package/es/record-provider/index.mjs +3 -3
  45. package/es/schema-component/antd/action/Action.mjs +7 -6
  46. package/es/schema-component/antd/action/hooks.mjs +3 -2
  47. package/es/schema-component/antd/association-field/AssociationSelect.mjs +4 -3
  48. package/es/schema-component/antd/association-field/hooks.mjs +18 -1
  49. package/es/schema-component/antd/cron/CronSet.mjs +9 -3
  50. package/es/schema-component/antd/filter/conditionUtils.d.ts +2 -0
  51. package/es/schema-component/antd/filter/conditionUtils.mjs +133 -0
  52. package/es/schema-component/antd/filter/dateValueUtils.d.ts +13 -0
  53. package/es/schema-component/antd/filter/dateValueUtils.mjs +66 -0
  54. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -4
  55. package/es/schema-component/antd/filter/useFilterActionProps.mjs +3 -181
  56. package/es/schema-component/antd/filter/useGetFilterOptions.d.ts +2 -0
  57. package/es/schema-component/antd/filter/useGetFilterOptions.mjs +54 -0
  58. package/es/schema-component/antd/form/Form.mjs +1 -1
  59. package/es/schema-component/antd/form-item/FormItem.FilterFormDesigner.mjs +1 -1
  60. package/es/schema-component/antd/form-item/FormItem.d.ts +1 -1
  61. package/es/schema-component/antd/form-item/FormItem.mjs +14 -12
  62. package/es/schema-component/antd/form-item/SchemaSettingOptions.d.ts +1 -14
  63. package/es/schema-component/antd/form-item/SchemaSettingOptions.mjs +1 -33
  64. package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.mjs +4 -3
  65. package/es/schema-component/antd/form-item/hooks/useParseDefaultValue.mjs +5 -3
  66. package/es/schema-component/antd/form-item/operatorUtils.d.ts +14 -0
  67. package/es/schema-component/antd/form-item/operatorUtils.mjs +36 -0
  68. package/es/schema-component/antd/form-v2/Form.mjs +26 -167
  69. package/es/schema-component/antd/form-v2/FormLinkageRules.d.ts +9 -0
  70. package/es/schema-component/antd/form-v2/FormLinkageRules.mjs +191 -0
  71. package/es/schema-component/antd/form-v2/Templates.mjs +1 -1
  72. package/es/schema-component/antd/grid/Grid.mjs +5 -2
  73. package/es/schema-component/antd/grid-card/GridCard.Item.mjs +2 -2
  74. package/es/schema-component/antd/icon-picker/IconFilterInput.mjs +12 -4
  75. package/es/schema-component/antd/icon-picker/IconPicker.mjs +1 -1
  76. package/es/schema-component/antd/input/Json.d.ts +1 -4
  77. package/es/schema-component/antd/input/ReadPretty.mjs +2 -2
  78. package/es/schema-component/antd/input-number/ReadPretty.mjs +1 -1
  79. package/es/schema-component/antd/markdown/Markdown.Void.Designer.mjs +2 -1
  80. package/es/schema-component/antd/markdown/Markdown.Void.mjs +10 -2
  81. package/es/schema-component/antd/markdown/Markdown.mjs +1 -1
  82. package/es/schema-component/antd/markdown/util.mjs +5 -0
  83. package/es/schema-component/antd/rich-text/RichText.mjs +1 -1
  84. package/es/schema-component/antd/select/FormulaSelect.mjs +1 -2
  85. package/es/schema-component/antd/select/ReadPretty.mjs +2 -2
  86. package/es/schema-component/antd/select/Select.mjs +1 -2
  87. package/es/schema-component/antd/select/utils.d.ts +2 -1
  88. package/es/schema-component/antd/select/utils.mjs +2 -2
  89. package/es/schema-component/antd/time-picker/ReadPretty.mjs +1 -1
  90. package/es/schema-component/antd/upload/ReadPretty.mjs +5 -5
  91. package/es/schema-component/antd/upload/Upload.mjs +6 -5
  92. package/es/schema-component/antd/variable/Input.mjs +1 -1
  93. package/es/schema-component/antd/variable/TextArea.mjs +1 -1
  94. package/es/schema-component/hooks/useDesigner.mjs +9 -3
  95. package/es/schema-component/hooks/useOptionalNavigate.d.ts +1 -0
  96. package/es/schema-component/hooks/useOptionalNavigate.mjs +2 -0
  97. package/es/schema-settings/DataTemplates/components/Designer.mjs +2 -1
  98. package/es/schema-settings/VariableInput/hooks/useBaseVariable.mjs +2 -1
  99. package/es/schema-settings/VariableInput/hooks/useBlockCollection.mjs +1 -1
  100. package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.mjs +2 -1
  101. package/es/schema-settings/VariableInput/hooks/useFormVariable.mjs +1 -1
  102. package/es/schema-settings/VariableInput/hooks/useRecordVariable.mjs +1 -1
  103. package/es/style/theme/AntdAppProvider.mjs +2 -2
  104. package/es/user/ChangePassword.d.ts +4 -1
  105. package/es/user/CurrentUserContext.d.ts +2 -0
  106. package/es/user/CurrentUserContext.mjs +5 -0
  107. package/es/user/CurrentUserProvider.d.ts +0 -3
  108. package/es/user/CurrentUserProvider.mjs +3 -5
  109. package/es/user/EditProfile.d.ts +4 -1
  110. package/es/user/LanguageSettings.d.ts +4 -1
  111. package/es/user/SwitchRole.d.ts +4 -1
  112. package/es/user/index.d.ts +1 -0
  113. package/es/user/index.mjs +1 -0
  114. package/es/variables/VariablesProvider.mjs +1 -1
  115. package/lib/api-client/APIClient.js +8 -5
  116. package/lib/application/hoc/withDynamicSchemaProps.js +3 -3
  117. package/lib/application/schema-initializer/hooks/index.js +4 -1
  118. package/lib/application/schema-settings/components/SchemaSettingsChildren.js +14 -14
  119. package/lib/application/utils/clientModuleRegistry.js +46 -0
  120. package/lib/application/utils/globalDeps.js +2 -2
  121. package/lib/block-provider/BlockProvider.js +6 -8
  122. package/lib/block-provider/BlockRequestContext.js +42 -0
  123. package/lib/block-provider/FormBlockContext.js +42 -0
  124. package/lib/block-provider/FormBlockProvider.js +13 -14
  125. package/lib/built-in/acl/ACLCollectionFieldProvider.js +76 -0
  126. package/lib/built-in/acl/ACLContext.js +70 -0
  127. package/lib/built-in/acl/ACLPlugin.js +2 -1
  128. package/lib/built-in/acl/ACLProvider.js +13 -76
  129. package/lib/built-in/acl/index.js +27 -9
  130. package/lib/built-in/locale/LocalePlugin.js +17 -5
  131. package/lib/collection-manager/hooks/useCollectionManager_deprecated.js +4 -3
  132. package/lib/data-source/data-source/DataSourceManager.js +6 -7
  133. package/lib/data-source/data-source/constants.js +40 -0
  134. package/lib/data-source/utils.js +2 -2
  135. package/lib/exports.js +769 -0
  136. package/lib/filter-provider/utils.js +7 -63
  137. package/lib/index.js +10 -714
  138. package/lib/record-provider/index.js +6 -6
  139. package/lib/schema-component/antd/action/Action.js +9 -8
  140. package/lib/schema-component/antd/action/hooks.js +3 -2
  141. package/lib/schema-component/antd/association-field/AssociationSelect.js +3 -2
  142. package/lib/schema-component/antd/association-field/hooks.js +18 -1
  143. package/lib/schema-component/antd/cron/CronSet.js +8 -2
  144. package/lib/schema-component/antd/filter/conditionUtils.js +180 -0
  145. package/lib/schema-component/antd/filter/dateValueUtils.js +116 -0
  146. package/lib/schema-component/antd/filter/useFilterActionProps.js +7 -186
  147. package/lib/schema-component/antd/filter/useGetFilterOptions.js +91 -0
  148. package/lib/schema-component/antd/form/Form.js +4 -4
  149. package/lib/schema-component/antd/form-item/FormItem.FilterFormDesigner.js +2 -2
  150. package/lib/schema-component/antd/form-item/FormItem.js +23 -20
  151. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +6 -38
  152. package/lib/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.js +9 -7
  153. package/lib/schema-component/antd/form-item/hooks/useParseDefaultValue.js +12 -8
  154. package/lib/schema-component/antd/form-item/operatorUtils.js +76 -0
  155. package/lib/schema-component/antd/form-v2/Form.js +204 -317
  156. package/lib/schema-component/antd/form-v2/FormLinkageRules.js +236 -0
  157. package/lib/schema-component/antd/form-v2/Templates.js +2 -2
  158. package/lib/schema-component/antd/grid/Grid.js +10 -7
  159. package/lib/schema-component/antd/grid-card/GridCard.Item.js +2 -2
  160. package/lib/schema-component/antd/icon-picker/IconFilterInput.js +12 -4
  161. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -1
  162. package/lib/schema-component/antd/input/ReadPretty.js +10 -10
  163. package/lib/schema-component/antd/input-number/ReadPretty.js +1 -1
  164. package/lib/schema-component/antd/markdown/Markdown.Void.Designer.js +6 -5
  165. package/lib/schema-component/antd/markdown/Markdown.Void.js +138 -111
  166. package/lib/schema-component/antd/markdown/Markdown.js +2 -2
  167. package/lib/schema-component/antd/markdown/util.js +5 -0
  168. package/lib/schema-component/antd/rich-text/RichText.js +2 -2
  169. package/lib/schema-component/antd/select/FormulaSelect.js +1 -2
  170. package/lib/schema-component/antd/select/ReadPretty.js +2 -2
  171. package/lib/schema-component/antd/select/Select.js +1 -2
  172. package/lib/schema-component/antd/select/utils.js +6 -3
  173. package/lib/schema-component/antd/time-picker/ReadPretty.js +2 -2
  174. package/lib/schema-component/antd/upload/ReadPretty.js +5 -5
  175. package/lib/schema-component/antd/upload/Upload.js +6 -5
  176. package/lib/schema-component/antd/variable/Input.js +1 -1
  177. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  178. package/lib/schema-component/hooks/useDesigner.js +57 -23
  179. package/lib/schema-component/hooks/useOptionalNavigate.js +36 -0
  180. package/lib/schema-settings/DataTemplates/components/Designer.js +4 -3
  181. package/lib/schema-settings/VariableInput/hooks/useBaseVariable.js +4 -3
  182. package/lib/schema-settings/VariableInput/hooks/useBlockCollection.js +2 -2
  183. package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.js +4 -3
  184. package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +2 -2
  185. package/lib/schema-settings/VariableInput/hooks/useRecordVariable.js +2 -2
  186. package/lib/style/theme/AntdAppProvider.js +4 -4
  187. package/lib/user/CurrentUserContext.js +42 -0
  188. package/lib/user/CurrentUserProvider.js +6 -14
  189. package/lib/user/index.js +24 -12
  190. package/lib/variables/VariablesProvider.js +2 -2
  191. package/package.json +5 -4
@@ -37,14 +37,12 @@ __webpack_require__.d(__webpack_exports__, {
37
37
  useFilterActionProps: ()=>useFilterActionProps,
38
38
  useFilterOptions: ()=>useFilterOptions,
39
39
  useFilterFieldOptions: ()=>useFilterFieldOptions,
40
- getCustomCondition: ()=>getCustomCondition,
41
- useGetFilterOptions: ()=>useGetFilterOptions,
42
- removeNullCondition: ()=>removeNullCondition,
43
- useGetFilterFieldOptions: ()=>useGetFilterFieldOptions
40
+ getCustomCondition: ()=>external_conditionUtils_js_namespaceObject.getCustomCondition,
41
+ useGetFilterOptions: ()=>external_useGetFilterOptions_js_namespaceObject.useGetFilterOptions,
42
+ removeNullCondition: ()=>external_conditionUtils_js_namespaceObject.removeNullCondition,
43
+ useGetFilterFieldOptions: ()=>external_useGetFilterOptions_js_namespaceObject.useGetFilterFieldOptions
44
44
  });
45
45
  const schema_namespaceObject = require("@tachybase/schema");
46
- const external_flat_namespaceObject = require("flat");
47
- var external_flat_default = /*#__PURE__*/ __webpack_require__.n(external_flat_namespaceObject);
48
46
  const external_lodash_namespaceObject = require("lodash");
49
47
  var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
50
48
  const external_react_i18next_namespaceObject = require("react-i18next");
@@ -52,65 +50,14 @@ const index_js_namespaceObject = require("../../../block-provider/index.js");
52
50
  const external_collection_manager_index_js_namespaceObject = require("../../../collection-manager/index.js");
53
51
  const utils_js_namespaceObject = require("../../../filter-provider/utils.js");
54
52
  const setDataLoadingModeSettingsItem_js_namespaceObject = require("../../../modules/blocks/data-blocks/details-multi/setDataLoadingModeSettingsItem.js");
55
- const util_js_namespaceObject = require("../date-picker/util.js");
56
- const external_utils_js_namespaceObject = require("./utils.js");
57
- const useGetFilterOptions = ()=>{
58
- const { getCollectionFields } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
59
- const getFilterFieldOptions = useGetFilterFieldOptions();
60
- return (collectionName, dataSource)=>{
61
- const fields = getCollectionFields(collectionName, dataSource);
62
- const options = getFilterFieldOptions(fields);
63
- return options;
64
- };
65
- };
53
+ const external_conditionUtils_js_namespaceObject = require("./conditionUtils.js");
54
+ const external_useGetFilterOptions_js_namespaceObject = require("./useGetFilterOptions.js");
66
55
  const useFilterOptions = (collectionName)=>{
67
56
  const { getCollectionFields } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
68
57
  const fields = getCollectionFields(collectionName);
69
58
  const options = useFilterFieldOptions(fields);
70
59
  return options;
71
60
  };
72
- const useGetFilterFieldOptions = ()=>{
73
- var _fieldSchema_xcomponentprops;
74
- const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
75
- const nonfilterable = (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.nonfilterable) || [];
76
- const { getCollectionFields, getInterface } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
77
- const field2option = (field, depth)=>{
78
- var _field_uiSchema, _operators_filter;
79
- if (nonfilterable.length && 1 === depth && nonfilterable.includes(field.name)) return;
80
- if (!field.interface) return;
81
- const fieldInterface = getInterface(field.interface);
82
- if (!(null == fieldInterface ? void 0 : fieldInterface.filterable)) return;
83
- const { nested, children, operators } = fieldInterface.filterable;
84
- const option = {
85
- name: field.name,
86
- type: field.type,
87
- target: field.target,
88
- title: (null == field ? void 0 : null == (_field_uiSchema = field.uiSchema) ? void 0 : _field_uiSchema.title) || field.name,
89
- schema: null == field ? void 0 : field.uiSchema,
90
- interface: field.interface,
91
- operators: (null == operators ? void 0 : null == (_operators_filter = operators.filter) ? void 0 : _operators_filter.call(operators, (operator)=>!(null == operator ? void 0 : operator.visible) || operator.visible(field))) || []
92
- };
93
- if (field.target && depth > 2) return;
94
- if (depth > 2) return option;
95
- if (null == children ? void 0 : children.length) option['children'] = children;
96
- if (nested) {
97
- const targetFields = getCollectionFields(field.target);
98
- const options = getOptions(targetFields, depth + 1).filter(Boolean);
99
- option['children'] = option['children'] || [];
100
- option['children'].push(...options);
101
- }
102
- return option;
103
- };
104
- const getOptions = (fields, depth)=>{
105
- const options = [];
106
- fields.forEach((field)=>{
107
- const option = field2option(field, depth);
108
- if (option) options.push(option);
109
- });
110
- return options;
111
- };
112
- return (fields)=>getOptions(fields, 1);
113
- };
114
61
  const useFilterFieldOptions = (fields)=>{
115
62
  var _fieldSchema_xcomponentprops;
116
63
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
@@ -152,132 +99,6 @@ const useFilterFieldOptions = (fields)=>{
152
99
  };
153
100
  return getOptions(fields, 1);
154
101
  };
155
- const isEmpty = (obj)=>Array.isArray(obj) && 0 === obj.length || obj && 0 === Object.keys(obj).length && Object.getPrototypeOf(obj) === Object.prototype;
156
- const CUSTOM_FILTER_VARIABLE_REGEXP = /^\{\{\$nFilter\.([^}]+)\}\}$/;
157
- const getCustomFilterValue = function(items, key) {
158
- let rawItems = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
159
- if (rawItems && key in rawItems) return rawItems[key];
160
- if (key in items) return items[key];
161
- const arrayItems = Object.keys(items).filter((itemKey)=>itemKey.startsWith("".concat(key, ".")) && /^\d+$/.test(itemKey.slice(key.length + 1))).sort((a, b)=>Number(a.slice(key.length + 1)) - Number(b.slice(key.length + 1))).map((itemKey)=>items[itemKey]);
162
- return arrayItems.length ? arrayItems : void 0;
163
- };
164
- const findCustomFieldSchemaInTree = (schema, key)=>{
165
- if (!schema) return null;
166
- if (schema.name === "__custom.".concat(key) || schema.name === key) return schema;
167
- const properties = schema.properties || {};
168
- for (const propertyKey of Object.keys(properties)){
169
- if (propertyKey === "__custom.".concat(key) || propertyKey === key) return properties[propertyKey];
170
- const found = findCustomFieldSchemaInTree(properties[propertyKey], key);
171
- if (found) return found;
172
- }
173
- return null;
174
- };
175
- const findCustomFieldSchema = (schema, key)=>{
176
- let current = schema;
177
- while(current){
178
- const found = findCustomFieldSchemaInTree(current, key);
179
- if (found) return found;
180
- current = current.parent;
181
- }
182
- return null;
183
- };
184
- const getDatePickerComponent = (fieldSchema)=>{
185
- var _fieldSchema_xcomponentprops;
186
- if ((null == fieldSchema ? void 0 : fieldSchema['x-component']) === 'CollectionField') {
187
- var _fieldSchema_xcomponentprops1;
188
- return null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops1.component;
189
- }
190
- return (null == fieldSchema ? void 0 : fieldSchema['x-component']) || (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.component);
191
- };
192
- const getDatePickerShowTime = (fieldSchema)=>{
193
- var _fieldSchema_xcomponentprops;
194
- return null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.showTime;
195
- };
196
- const expandArrayValueFilter = function(filterSchemaItem, filterKey, value, customFlat) {
197
- let options = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {};
198
- const pathParts = filterKey.split('.');
199
- const operator = pathParts.pop();
200
- if ('$dateBetween' === operator && Array.isArray(value)) {
201
- const valueInfo = (0, util_js_namespaceObject.resolveDatePickerRangeValueInfo)(value, {
202
- component: options.component,
203
- showTime: options.showTime,
204
- preferDateBoundaryFallback: options.useDefaultDateBoundary
205
- });
206
- filterSchemaItem[filterKey] = (0, utils_js_namespaceObject.normalizeDateBetweenValue)(value, {
207
- useDefaultDateBoundary: options.useDefaultDateBoundary,
208
- valueMode: valueInfo.mode,
209
- valueSource: valueInfo.source,
210
- preferDateBoundaryFallback: 'retained-date-boundary' === valueInfo.source
211
- });
212
- return;
213
- }
214
- if (!Array.isArray(value) || utils_js_namespaceObject.FILTER_OPERATORS_WITH_ARRAY_VALUES.has(operator || '')) {
215
- filterSchemaItem[filterKey] = value;
216
- return;
217
- }
218
- if (0 === value.length) return void delete filterSchemaItem[filterKey];
219
- let branchEndIndex = -1;
220
- for(let index = pathParts.length - 2; index >= 0; index--)if ([
221
- '$and',
222
- '$or'
223
- ].includes(pathParts[index]) && /^\d+$/.test(pathParts[index + 1])) {
224
- branchEndIndex = index;
225
- break;
226
- }
227
- const branchPath = branchEndIndex >= 0 ? pathParts.slice(0, branchEndIndex + 2).join('.') : '';
228
- const fieldPath = pathParts.slice(branchEndIndex + 2).join('.');
229
- const conditions = value.map((item)=>customFlat.unflatten({
230
- ["".concat(fieldPath, ".").concat(operator)]: item
231
- }));
232
- delete filterSchemaItem[filterKey];
233
- filterSchemaItem[branchPath ? "".concat(branchPath, ".$or") : '$or'] = conditions;
234
- };
235
- const getCustomCondition = function(filter, fieldSchema) {
236
- let customFlat = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : external_flat_default();
237
- var _filterSchema_$and, _filterSchema_$or;
238
- const filterSchema = fieldSchema ? fieldSchema['x-filter-rules'] : '';
239
- const filterSchemaItem = customFlat(filterSchema || '');
240
- const items = customFlat(filter || {});
241
- const isCustomFilter = (null == filterSchema ? void 0 : null == (_filterSchema_$and = filterSchema.$and) ? void 0 : _filterSchema_$and.length) || (null == filterSchema ? void 0 : null == (_filterSchema_$or = filterSchema.$or) ? void 0 : _filterSchema_$or.length);
242
- const isFilterCustom = isCustomFilter ? (0, external_utils_js_namespaceObject.hasDuplicateKeys)(items, filterSchemaItem) : false;
243
- if (isFilterCustom) return customFlat.unflatten(items);
244
- if (!isCustomFilter) return customFlat.unflatten({});
245
- {
246
- var _flatFieldSchema_$and, _flatFieldSchema_$or;
247
- for(const filterKey in filterSchemaItem){
248
- const match = 'string' == typeof filterSchemaItem[filterKey] && filterSchemaItem[filterKey].match(CUSTOM_FILTER_VARIABLE_REGEXP);
249
- if (!match) continue;
250
- const customFieldSchema = findCustomFieldSchema(fieldSchema, match[1]);
251
- expandArrayValueFilter(filterSchemaItem, filterKey, getCustomFilterValue(items, match[1], filter || {}), customFlat, {
252
- useDefaultDateBoundary: (0, utils_js_namespaceObject.shouldUseDefaultDateBoundary)(customFieldSchema),
253
- component: getDatePickerComponent(customFieldSchema),
254
- showTime: getDatePickerShowTime(customFieldSchema)
255
- });
256
- }
257
- for(const item in filterSchemaItem)if (!filterSchemaItem[item] || filterSchemaItem[item].includes('$nFilter')) delete filterSchemaItem[item];
258
- const flatFieldSchema = customFlat.unflatten(filterSchemaItem);
259
- flatFieldSchema['$and'] = null == flatFieldSchema ? void 0 : null == (_flatFieldSchema_$and = flatFieldSchema['$and']) ? void 0 : _flatFieldSchema_$and.filter(Boolean);
260
- flatFieldSchema['$or'] = null == flatFieldSchema ? void 0 : null == (_flatFieldSchema_$or = flatFieldSchema['$or']) ? void 0 : _flatFieldSchema_$or.filter(Boolean);
261
- return flatFieldSchema;
262
- }
263
- };
264
- const removeNullCondition = function(filter) {
265
- let customFlat = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : external_flat_default();
266
- const items = customFlat(filter || {});
267
- const values = {};
268
- for(const key in items){
269
- const value = items[key];
270
- if (null != value && !isEmpty(value)) values[key] = value;
271
- }
272
- for (const key of Object.keys(values))if (key.endsWith('$dateBetween.0')) {
273
- const key1 = key.replace(/\$dateBetween\.0$/, '$dateBetween.1');
274
- if (!(key1 in values)) values[key1] = values[key];
275
- } else if (key.endsWith('$dateBetween.1')) {
276
- const key0 = key.replace(/\$dateBetween\.1$/, '$dateBetween.0');
277
- if (!(key0 in values)) values[key0] = values[key];
278
- }
279
- return customFlat.unflatten(values);
280
- };
281
102
  const useFilterActionProps = ()=>{
282
103
  const { name } = (0, external_collection_manager_index_js_namespaceObject.useCollection_deprecated)();
283
104
  const options = useFilterOptions(name);
@@ -298,7 +119,7 @@ const useFilterFieldProps = (param)=>{
298
119
  onSubmit (values) {
299
120
  var _service_params_, _service_params, _service_params1;
300
121
  const defaultFilter = params.filter;
301
- const filter = removeNullCondition(null == values ? void 0 : values.filter);
122
+ const filter = (0, external_conditionUtils_js_namespaceObject.removeNullCondition)(null == values ? void 0 : values.filter);
302
123
  if ('manual' === dataLoadingMode && external_lodash_default().isEmpty(filter)) return service.mutate(void 0);
303
124
  const filters = (null == (_service_params = service.params) ? void 0 : null == (_service_params_ = _service_params[1]) ? void 0 : _service_params_.filters) || {};
304
125
  filters["filterAction"] = filter;
@@ -0,0 +1,91 @@
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
+ useGetFilterOptions: ()=>useGetFilterOptions,
28
+ useGetFilterFieldOptions: ()=>useGetFilterFieldOptions
29
+ });
30
+ const schema_namespaceObject = require("@tachybase/schema");
31
+ const index_js_namespaceObject = require("../../../collection-manager/index.js");
32
+ const useGetFilterFieldOptions = ()=>{
33
+ var _fieldSchema_xcomponentprops;
34
+ const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
35
+ const nonfilterable = (null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.nonfilterable) || [];
36
+ const { getCollectionFields, getInterface } = (0, index_js_namespaceObject.useCollectionManager_deprecated)();
37
+ const field2option = (field, depth)=>{
38
+ var _field_uiSchema, _operators_filter;
39
+ if (nonfilterable.length && 1 === depth && nonfilterable.includes(field.name)) return;
40
+ if (!field.interface) return;
41
+ const fieldInterface = getInterface(field.interface);
42
+ if (!(null == fieldInterface ? void 0 : fieldInterface.filterable)) return;
43
+ const { nested, children, operators } = fieldInterface.filterable;
44
+ const option = {
45
+ name: field.name,
46
+ type: field.type,
47
+ target: field.target,
48
+ title: (null == field ? void 0 : null == (_field_uiSchema = field.uiSchema) ? void 0 : _field_uiSchema.title) || field.name,
49
+ schema: null == field ? void 0 : field.uiSchema,
50
+ interface: field.interface,
51
+ operators: (null == operators ? void 0 : null == (_operators_filter = operators.filter) ? void 0 : _operators_filter.call(operators, (operator)=>!(null == operator ? void 0 : operator.visible) || operator.visible(field))) || []
52
+ };
53
+ if (field.target && depth > 2) return;
54
+ if (depth > 2) return option;
55
+ if (null == children ? void 0 : children.length) option['children'] = children;
56
+ if (nested) {
57
+ const targetFields = getCollectionFields(field.target);
58
+ const options = getOptions(targetFields, depth + 1).filter(Boolean);
59
+ option['children'] = option['children'] || [];
60
+ option['children'].push(...options);
61
+ }
62
+ return option;
63
+ };
64
+ const getOptions = (fields, depth)=>{
65
+ const options = [];
66
+ fields.forEach((field)=>{
67
+ const option = field2option(field, depth);
68
+ if (option) options.push(option);
69
+ });
70
+ return options;
71
+ };
72
+ return (fields)=>getOptions(fields, 1);
73
+ };
74
+ const useGetFilterOptions = ()=>{
75
+ const { getCollectionFields } = (0, index_js_namespaceObject.useCollectionManager_deprecated)();
76
+ const getFilterFieldOptions = useGetFilterFieldOptions();
77
+ return (collectionName, dataSource)=>{
78
+ const fields = getCollectionFields(collectionName, dataSource);
79
+ const options = getFilterFieldOptions(fields);
80
+ return options;
81
+ };
82
+ };
83
+ exports.useGetFilterFieldOptions = __webpack_exports__.useGetFilterFieldOptions;
84
+ exports.useGetFilterOptions = __webpack_exports__.useGetFilterOptions;
85
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
86
+ "useGetFilterFieldOptions",
87
+ "useGetFilterOptions"
88
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
89
+ Object.defineProperty(exports, '__esModule', {
90
+ value: true
91
+ });
@@ -31,16 +31,16 @@ const external_react_namespaceObject = require("react");
31
31
  const schema_namespaceObject = require("@tachybase/schema");
32
32
  const client_namespaceObject = require("@tego/client");
33
33
  const external_antd_namespaceObject = require("antd");
34
- const external_index_js_namespaceObject = require("../../index.js");
35
34
  const index_js_namespaceObject = require("../../../api-client/index.js");
36
35
  const external_collection_manager_index_js_namespaceObject = require("../../../collection-manager/index.js");
37
36
  const external_schema_settings_index_js_namespaceObject = require("../../../schema-settings/index.js");
38
37
  const external_schema_templates_index_js_namespaceObject = require("../../../schema-templates/index.js");
38
+ const external_hooks_index_js_namespaceObject = require("../../hooks/index.js");
39
39
  const FormComponent = (props)=>{
40
40
  const { form, children, ...others } = props;
41
41
  const field = (0, schema_namespaceObject.useField)();
42
42
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
43
- const f = (0, external_index_js_namespaceObject.useAttach)(form.createVoidField({
43
+ const f = (0, external_hooks_index_js_namespaceObject.useAttach)(form.createVoidField({
44
44
  ...field.props,
45
45
  basePath: ''
46
46
  }));
@@ -65,11 +65,11 @@ const FormDecorator = (props)=>{
65
65
  const { form, children, disabled, ...others } = props;
66
66
  const field = (0, schema_namespaceObject.useField)();
67
67
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
68
- const f = (0, external_index_js_namespaceObject.useAttach)(form.createVoidField({
68
+ const f = (0, external_hooks_index_js_namespaceObject.useAttach)(form.createVoidField({
69
69
  ...field.props,
70
70
  basePath: ''
71
71
  }));
72
- const Component = (0, external_index_js_namespaceObject.useComponent)(fieldSchema['x-component'], Def);
72
+ const Component = (0, external_hooks_index_js_namespaceObject.useComponent)(fieldSchema['x-component'], Def);
73
73
  (0, external_react_namespaceObject.useEffect)(()=>{
74
74
  form.disabled = disabled || field.disabled;
75
75
  }, [
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  require("react");
31
- const index_js_namespaceObject = require("../../../schema-settings/index.js");
32
- const FilterFormDesigner = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.GeneralSchemaDesigner, {
31
+ const GeneralSchemaDesigner_js_namespaceObject = require("../../../schema-settings/GeneralSchemaDesigner.js");
32
+ const FilterFormDesigner = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(GeneralSchemaDesigner_js_namespaceObject.GeneralSchemaDesigner, {
33
33
  schemaSettings: "FilterFormItemSettings"
34
34
  });
35
35
  exports.FilterFormDesigner = __webpack_exports__.FilterFormDesigner;
@@ -43,22 +43,24 @@ const client_namespaceObject = require("@tego/client");
43
43
  const external_antd_style_namespaceObject = require("antd-style");
44
44
  const external_classnames_namespaceObject = require("classnames");
45
45
  var external_classnames_default = /*#__PURE__*/ __webpack_require__.n(external_classnames_namespaceObject);
46
- const index_js_namespaceObject = require("../../../application/index.js");
46
+ const useApp_js_namespaceObject = require("../../../application/hooks/useApp.js");
47
47
  const useFormActiveFields_js_namespaceObject = require("../../../block-provider/hooks/useFormActiveFields.js");
48
- const acl_index_js_namespaceObject = require("../../../built-in/acl/index.js");
49
- const external_data_source_index_js_namespaceObject = require("../../../data-source/index.js");
50
- const external_schema_settings_index_js_namespaceObject = require("../../../schema-settings/index.js");
51
- const external_variables_index_js_namespaceObject = require("../../../variables/index.js");
48
+ const ACLCollectionFieldProvider_js_namespaceObject = require("../../../built-in/acl/ACLCollectionFieldProvider.js");
49
+ const CollectionFieldProvider_js_namespaceObject = require("../../../data-source/collection-field/CollectionFieldProvider.js");
50
+ const ConfigSetting_provider_js_namespaceObject = require("../../../data-source/data-block/context/ConfigSetting.provider.js");
51
+ const GeneralSchemaDesigner_js_namespaceObject = require("../../../schema-settings/GeneralSchemaDesigner.js");
52
52
  const useContextVariable_js_namespaceObject = require("../../../variables/hooks/useContextVariable.js");
53
53
  var useContextVariable_js_default = /*#__PURE__*/ __webpack_require__.n(useContextVariable_js_namespaceObject);
54
- const external_block_item_index_js_namespaceObject = require("../block-item/index.js");
54
+ const useVariables_js_namespaceObject = require("../../../variables/hooks/useVariables.js");
55
+ var useVariables_js_default = /*#__PURE__*/ __webpack_require__.n(useVariables_js_namespaceObject);
56
+ const BlockItem_js_namespaceObject = require("../block-item/BlockItem.js");
55
57
  const shared_js_namespaceObject = require("../input/shared.js");
56
58
  const external_FormItem_FilterFormDesigner_js_namespaceObject = require("./FormItem.FilterFormDesigner.js");
57
59
  const useLazyLoadDisplayAssociationFieldsOfForm_js_namespaceObject = require("./hooks/useLazyLoadDisplayAssociationFieldsOfForm.js");
58
60
  var useLazyLoadDisplayAssociationFieldsOfForm_js_default = /*#__PURE__*/ __webpack_require__.n(useLazyLoadDisplayAssociationFieldsOfForm_js_namespaceObject);
59
61
  const useParseDefaultValue_js_namespaceObject = require("./hooks/useParseDefaultValue.js");
60
62
  var useParseDefaultValue_js_default = /*#__PURE__*/ __webpack_require__.n(useParseDefaultValue_js_namespaceObject);
61
- const external_SchemaSettingOptions_js_namespaceObject = require("./SchemaSettingOptions.js");
63
+ const external_operatorUtils_js_namespaceObject = require("./operatorUtils.js");
62
64
  function _tagged_template_literal(strings, raw) {
63
65
  if (!raw) raw = strings.slice(0);
64
66
  return Object.freeze(Object.defineProperties(strings, {
@@ -109,11 +111,11 @@ const FormItem = (props)=>{
109
111
  const field = (0, schema_namespaceObject.useField)();
110
112
  const schema = (0, schema_namespaceObject.useFieldSchema)();
111
113
  const contextVariable = useContextVariable_js_default()();
112
- const variables = (0, external_variables_index_js_namespaceObject.useVariables)();
114
+ const variables = useVariables_js_default()();
113
115
  const { addActiveFieldName } = (0, useFormActiveFields_js_namespaceObject.useFormActiveFields)() || {};
114
- const { layoutDirection } = (0, external_data_source_index_js_namespaceObject.useContextConfigSetting)();
116
+ const { layoutDirection } = (0, ConfigSetting_provider_js_namespaceObject.useContextConfigSetting)();
115
117
  const finishLayoutDirection = null != selfLayoutDirection ? selfLayoutDirection : layoutDirection;
116
- (0, external_SchemaSettingOptions_js_namespaceObject.useEnsureOperatorsValid)();
118
+ (0, external_operatorUtils_js_namespaceObject.useEnsureOperatorsValid)();
117
119
  (0, external_react_namespaceObject.useEffect)(()=>{
118
120
  null == variables || variables.registerVariable(contextVariable);
119
121
  }, [
@@ -151,28 +153,29 @@ const FormItem = (props)=>{
151
153
  }), [
152
154
  showTitle
153
155
  ]);
154
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_data_source_index_js_namespaceObject.CollectionFieldProvider, {
156
+ const item = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.FormItem, {
157
+ className: className,
158
+ ...props,
159
+ extra: extra
160
+ });
161
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CollectionFieldProvider_js_namespaceObject.CollectionFieldProvider, {
155
162
  allowNull: true,
156
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_block_item_index_js_namespaceObject.BlockItem, {
163
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BlockItem_js_namespaceObject.BlockItem, {
157
164
  className: 'tb-form-item',
158
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(acl_index_js_namespaceObject.ACLCollectionFieldProvider, {
159
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.FormItem, {
160
- className: className,
161
- ...props,
162
- extra: extra
163
- })
165
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ACLCollectionFieldProvider_js_namespaceObject.ACLCollectionFieldProvider, {
166
+ children: item
164
167
  })
165
168
  })
166
169
  });
167
170
  };
168
171
  FormItem.displayName = 'FormItem';
169
172
  FormItem.Designer = function() {
170
- const app = (0, index_js_namespaceObject.useApp)();
173
+ const app = (0, useApp_js_namespaceObject.useApp)();
171
174
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
172
175
  const settingsName = "FormItemSettings:".concat(fieldSchema['x-interface']);
173
176
  const defaultActionSettings = 'FormItemSettings';
174
177
  const hasFieldItem = app.schemaSettingsManager.has(settingsName);
175
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.GeneralSchemaDesigner, {
178
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(GeneralSchemaDesigner_js_namespaceObject.GeneralSchemaDesigner, {
176
179
  schemaSettings: hasFieldItem ? settingsName : defaultActionSettings
177
180
  });
178
181
  };
@@ -37,9 +37,9 @@ __webpack_require__.d(__webpack_exports__, {
37
37
  EditComponent: ()=>EditComponent,
38
38
  EditRequired: ()=>EditRequired,
39
39
  EditValidationRules: ()=>EditValidationRules,
40
- findFilterOperators: ()=>findFilterOperators,
41
- getDefaultFilterOperatorValue: ()=>getDefaultFilterOperatorValue,
42
- useEnsureOperatorsValid: ()=>useEnsureOperatorsValid,
40
+ findFilterOperators: ()=>external_operatorUtils_js_namespaceObject.findFilterOperators,
41
+ getDefaultFilterOperatorValue: ()=>external_operatorUtils_js_namespaceObject.getDefaultFilterOperatorValue,
42
+ useEnsureOperatorsValid: ()=>external_operatorUtils_js_namespaceObject.useEnsureOperatorsValid,
43
43
  EditTooltip: ()=>EditTooltip,
44
44
  EditTitleField: ()=>EditTitleField,
45
45
  EditOperator: ()=>EditOperator,
@@ -61,33 +61,7 @@ const isPatternDisabled_js_namespaceObject = require("../../../schema-settings/i
61
61
  const external_hooks_index_js_namespaceObject = require("../../hooks/index.js");
62
62
  const useOperators_js_namespaceObject = require("../filter/useOperators.js");
63
63
  const external_FormItem_js_namespaceObject = require("./FormItem.js");
64
- const findFilterOperators = (schema)=>{
65
- while(schema){
66
- if (schema['x-filter-operators']) return {
67
- operators: schema['x-filter-operators'],
68
- uid: schema['x-uid']
69
- };
70
- schema = schema.parent;
71
- }
72
- return {};
73
- };
74
- const getSchemaFilterComponent = (schema)=>{
75
- var _schema_xcomponentprops;
76
- return (null == schema ? void 0 : null == (_schema_xcomponentprops = schema['x-component-props']) ? void 0 : _schema_xcomponentprops.component) || (null == schema ? void 0 : schema['x-component']);
77
- };
78
- const getDefaultFilterOperatorValue = function(schema) {
79
- let operatorList = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
80
- var _operatorList_find, _operatorList_;
81
- const component = getSchemaFilterComponent(schema);
82
- if (component) {
83
- const matched = operatorList.find((item)=>{
84
- var _item_schema;
85
- return (null == item ? void 0 : null == (_item_schema = item.schema) ? void 0 : _item_schema['x-component']) === component;
86
- });
87
- if (null == matched ? void 0 : matched.value) return matched.value;
88
- }
89
- return (null == (_operatorList_find = operatorList.find((item)=>null == item ? void 0 : item.selected)) ? void 0 : _operatorList_find.value) || (null == (_operatorList_ = operatorList[0]) ? void 0 : _operatorList_.value);
90
- };
64
+ const external_operatorUtils_js_namespaceObject = require("./operatorUtils.js");
91
65
  const EditTitle = ()=>{
92
66
  var _collectionField_uiSchema;
93
67
  const { getCollectionJoinField } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
@@ -491,12 +465,6 @@ const EditPattern = ()=>{
491
465
  }
492
466
  }, "pattern");
493
467
  };
494
- const useEnsureOperatorsValid = ()=>{
495
- const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
496
- const operatorList = (0, useOperators_js_namespaceObject.useOperatorList)();
497
- const { operators: storedOperators } = findFilterOperators(fieldSchema);
498
- if (storedOperators && operatorList.length && !storedOperators[fieldSchema.name]) storedOperators[fieldSchema.name] = getDefaultFilterOperatorValue(fieldSchema, operatorList);
499
- };
500
468
  const EditOperator = ()=>{
501
469
  const compile = (0, external_hooks_index_js_namespaceObject.useCompile)();
502
470
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
@@ -504,8 +472,8 @@ const EditOperator = ()=>{
504
472
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
505
473
  const { dn } = (0, external_hooks_index_js_namespaceObject.useDesignable)();
506
474
  const operatorList = (0, useOperators_js_namespaceObject.useOperatorList)();
507
- const { operators: storedOperators = {}, uid } = findFilterOperators(fieldSchema);
508
- if (operatorList.length && !storedOperators[fieldSchema.name]) storedOperators[fieldSchema.name] = getDefaultFilterOperatorValue(fieldSchema, operatorList);
475
+ const { operators: storedOperators = {}, uid } = (0, external_operatorUtils_js_namespaceObject.findFilterOperators)(fieldSchema);
476
+ if (operatorList.length && !storedOperators[fieldSchema.name]) storedOperators[fieldSchema.name] = (0, external_operatorUtils_js_namespaceObject.getDefaultFilterOperatorValue)(fieldSchema, operatorList);
509
477
  return operatorList.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_settings_index_js_namespaceObject.SchemaSettingsSelectItem, {
510
478
  title: t('Operator'),
511
479
  value: storedOperators[fieldSchema.name],
@@ -41,24 +41,26 @@ const client_namespaceObject = require("@tego/client");
41
41
  const external_lodash_namespaceObject = require("lodash");
42
42
  var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
43
43
  const index_js_namespaceObject = require("../../../../block-provider/hooks/index.js");
44
- const external_collection_manager_index_js_namespaceObject = require("../../../../collection-manager/index.js");
44
+ const useCollection_deprecated_js_namespaceObject = require("../../../../collection-manager/hooks/useCollection_deprecated.js");
45
+ const useCollectionManager_deprecated_js_namespaceObject = require("../../../../collection-manager/hooks/useCollectionManager_deprecated.js");
45
46
  const CollectionRecordProvider_js_namespaceObject = require("../../../../data-source/collection-record/CollectionRecordProvider.js");
46
- const external_flag_provider_index_js_namespaceObject = require("../../../../flag-provider/index.js");
47
- const external_variables_index_js_namespaceObject = require("../../../../variables/index.js");
47
+ const useFlag_js_namespaceObject = require("../../../../flag-provider/hooks/useFlag.js");
48
+ const useVariables_js_namespaceObject = require("../../../../variables/hooks/useVariables.js");
49
+ var useVariables_js_default = /*#__PURE__*/ __webpack_require__.n(useVariables_js_namespaceObject);
48
50
  const transformVariableValue_js_namespaceObject = require("../../../../variables/utils/transformVariableValue.js");
49
51
  const hooks_js_namespaceObject = require("../../association-field/hooks.js");
50
52
  const external_utils_js_namespaceObject = require("../utils.js");
51
53
  const useLazyLoadDisplayAssociationFieldsOfForm_useLazyLoadDisplayAssociationFieldsOfForm = ()=>{
52
54
  var _sourceCollectionFieldRef_current;
53
- const { name } = (0, external_collection_manager_index_js_namespaceObject.useCollection_deprecated)();
54
- const { getCollectionJoinField } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
55
+ const { name } = (0, useCollection_deprecated_js_namespaceObject.useCollection_deprecated)();
56
+ const { getCollectionJoinField } = (0, useCollectionManager_deprecated_js_namespaceObject.useCollectionManager_deprecated)();
55
57
  const form = (0, schema_namespaceObject.useForm)();
56
58
  const recordData = (0, CollectionRecordProvider_js_namespaceObject.useCollectionRecordData)();
57
59
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
58
- const variables = (0, external_variables_index_js_namespaceObject.useVariables)();
60
+ const variables = useVariables_js_default()();
59
61
  const field = (0, schema_namespaceObject.useField)();
60
62
  const { formValue: subFormValue } = (0, hooks_js_namespaceObject.useSubFormValue)();
61
- const { isInSubForm, isInSubTable } = (0, external_flag_provider_index_js_namespaceObject.useFlag)() || {};
63
+ const { isInSubForm, isInSubTable } = (0, useFlag_js_namespaceObject.useFlag)() || {};
62
64
  const { getAssociationAppends } = (0, index_js_namespaceObject.useAssociationNames)();
63
65
  const schemaName = fieldSchema.name.toString();
64
66
  const formValue = external_lodash_default().cloneDeep(isInSubForm || isInSubTable ? subFormValue : form.values);
@@ -41,10 +41,14 @@ const client_namespaceObject = require("@tego/client");
41
41
  const external_lodash_namespaceObject = require("lodash");
42
42
  var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
43
43
  const index_js_namespaceObject = require("../../../../record-provider/index.js");
44
- const external_collection_manager_index_js_namespaceObject = require("../../../../collection-manager/index.js");
44
+ const useCollection_deprecated_js_namespaceObject = require("../../../../collection-manager/hooks/useCollection_deprecated.js");
45
45
  const CollectionRecordProvider_js_namespaceObject = require("../../../../data-source/collection-record/CollectionRecordProvider.js");
46
- const external_flag_provider_index_js_namespaceObject = require("../../../../flag-provider/index.js");
47
- const external_variables_index_js_namespaceObject = require("../../../../variables/index.js");
46
+ const useFlag_js_namespaceObject = require("../../../../flag-provider/hooks/useFlag.js");
47
+ const constants_js_namespaceObject = require("../../../../variables/constants.js");
48
+ const useLocalVariables_js_namespaceObject = require("../../../../variables/hooks/useLocalVariables.js");
49
+ var useLocalVariables_js_default = /*#__PURE__*/ __webpack_require__.n(useLocalVariables_js_namespaceObject);
50
+ const useVariables_js_namespaceObject = require("../../../../variables/hooks/useVariables.js");
51
+ var useVariables_js_default = /*#__PURE__*/ __webpack_require__.n(useVariables_js_namespaceObject);
48
52
  const getPath_js_namespaceObject = require("../../../../variables/utils/getPath.js");
49
53
  const getVariableName_js_namespaceObject = require("../../../../variables/utils/getVariableName.js");
50
54
  const isVariable_js_namespaceObject = require("../../../../variables/utils/isVariable.js");
@@ -54,11 +58,11 @@ const external_useSpecialCase_js_namespaceObject = require("./useSpecialCase.js"
54
58
  const useParseDefaultValue = ()=>{
55
59
  const field = (0, schema_namespaceObject.useField)();
56
60
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
57
- const variables = (0, external_variables_index_js_namespaceObject.useVariables)();
58
- const localVariables = (0, external_variables_index_js_namespaceObject.useLocalVariables)();
61
+ const variables = useVariables_js_default()();
62
+ const localVariables = useLocalVariables_js_default()();
59
63
  const recordV2 = (0, CollectionRecordProvider_js_namespaceObject.useCollectionRecord)();
60
- const { isInAssignFieldValues, isInSetDefaultValueDialog, isInFormDataTemplate, isInSubTable, isInSubForm } = (0, external_flag_provider_index_js_namespaceObject.useFlag)() || {};
61
- const { getField } = (0, external_collection_manager_index_js_namespaceObject.useCollection_deprecated)();
64
+ const { isInAssignFieldValues, isInSetDefaultValueDialog, isInFormDataTemplate, isInSubTable, isInSubForm } = (0, useFlag_js_namespaceObject.useFlag)() || {};
65
+ const { getField } = (0, useCollection_deprecated_js_namespaceObject.useCollection_deprecated)();
62
66
  const { isSpecialCase, setDefaultValue } = (0, external_useSpecialCase_js_namespaceObject.useSpecialCase)();
63
67
  const index = (0, index_js_namespaceObject.useRecordIndex)();
64
68
  const findVariable = (0, external_react_namespaceObject.useCallback)((name)=>{
@@ -93,7 +97,7 @@ const useParseDefaultValue = ()=>{
93
97
  field.loading = false;
94
98
  } else if (!/\{\{.+\}\}/g.test(fieldSchema.default) && field.setInitialValue) field.setInitialValue(fieldSchema.default);
95
99
  };
96
- const run = external_lodash_default().debounce(_run, external_variables_index_js_namespaceObject.DEBOUNCE_WAIT);
100
+ const run = external_lodash_default().debounce(_run, constants_js_namespaceObject.DEBOUNCE_WAIT);
97
101
  if ((0, isVariable_js_namespaceObject.isVariable)(fieldSchema.default)) {
98
102
  const variableName = (0, getVariableName_js_namespaceObject.getVariableName)(fieldSchema.default);
99
103
  const variable = findVariable(variableName);