@headless-adminapp/app 0.0.17-alpha.52 → 0.0.17-alpha.53

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 (220) hide show
  1. package/app/AppProvider.js +13 -17
  2. package/app/AuthWrapper.js +9 -13
  3. package/app/LayoutProvider.js +16 -20
  4. package/app/context.js +2 -5
  5. package/app/hooks/index.js +1 -17
  6. package/app/hooks/useAppContext.js +4 -7
  7. package/app/index.js +4 -11
  8. package/auth/AuthProvider.js +17 -21
  9. package/auth/context.d.ts +1 -1
  10. package/auth/context.js +2 -5
  11. package/auth/hooks/index.js +2 -18
  12. package/auth/hooks/useAuthSession.js +4 -7
  13. package/auth/hooks/useIsSkipAuthCheck.js +4 -7
  14. package/auth/hooks/useLogout.js +7 -10
  15. package/auth/index.js +4 -23
  16. package/auth/types.js +1 -2
  17. package/board/BoardColumnDataResolver.js +20 -23
  18. package/board/BoardColumnProvider.js +10 -14
  19. package/board/context.js +3 -6
  20. package/board/hooks/index.js +6 -15
  21. package/board/hooks/useBoardColumnConfig.js +4 -7
  22. package/board/hooks/useBoardColumnData.js +4 -7
  23. package/board/hooks/useBoardColumnDataState.js +4 -7
  24. package/board/hooks/useBoardConfig.js +4 -7
  25. package/board/hooks/useBoardSchema.js +3 -6
  26. package/board/hooks/useSearchText.js +7 -10
  27. package/board/types.js +1 -2
  28. package/board/utils.js +1 -4
  29. package/builders/CommandBuilder/CommandBuilder.js +10 -13
  30. package/builders/CommandBuilder/DefaultCommandBuilder.js +22 -25
  31. package/builders/CommandBuilder/FormCommandBuilder.js +9 -12
  32. package/builders/CommandBuilder/SubgridCommandBuilder.js +11 -14
  33. package/builders/CommandBuilder/ViewCommandBuilder.js +14 -17
  34. package/builders/CommandBuilder/index.js +1 -5
  35. package/builders/CommandBuilder/utils.js +2 -6
  36. package/builders/SchemaExperienceBuilder.js +1 -5
  37. package/builders/index.js +2 -7
  38. package/builders/utils.js +12 -41
  39. package/command/hooks/index.js +2 -18
  40. package/command/hooks/useBaseCommandHandlerContext.js +25 -29
  41. package/command/hooks/useCommands.js +6 -9
  42. package/command/index.js +2 -18
  43. package/command/types.js +1 -2
  44. package/command/utils/index.js +4 -7
  45. package/components/ScrollView/index.js +4 -11
  46. package/components/ScrollbarWithMoreDataRequest/index.js +9 -13
  47. package/dataform/DataFormProvider/DataResolver.d.ts +2 -2
  48. package/dataform/DataFormProvider/DataResolver.js +31 -32
  49. package/dataform/DataFormProvider/InitialValueResolver.js +19 -22
  50. package/dataform/DataFormProvider/ReadonlyInfoResolver.js +9 -12
  51. package/dataform/DataFormProvider/index.js +22 -25
  52. package/dataform/context.js +2 -5
  53. package/dataform/hooks/index.js +13 -29
  54. package/dataform/hooks/useFormInstance.js +3 -6
  55. package/dataform/hooks/useFormIsDirty.js +3 -6
  56. package/dataform/hooks/useFormIsReadonly.js +4 -7
  57. package/dataform/hooks/useFormNotifications.js +7 -10
  58. package/dataform/hooks/useFormRecord.js +4 -7
  59. package/dataform/hooks/useFormSave.js +30 -33
  60. package/dataform/hooks/useFormSchema.js +4 -7
  61. package/dataform/hooks/useLoadFormGridPage.js +10 -13
  62. package/dataform/hooks/useMainFormCommands.js +27 -32
  63. package/dataform/hooks/useProcessFlowSteps.js +18 -21
  64. package/dataform/hooks/useRecordId.js +4 -7
  65. package/dataform/hooks/useRecordTitle.d.ts +3 -1
  66. package/dataform/hooks/useRecordTitle.js +11 -14
  67. package/dataform/hooks/useSelectedForm.js +4 -7
  68. package/dataform/index.js +4 -23
  69. package/dataform/utils/defaultParameters.js +2 -6
  70. package/dataform/utils/index.d.ts +1 -1
  71. package/dataform/utils/index.js +17 -45
  72. package/dataform/utils/saveRecord.js +5 -9
  73. package/datagrid/DataGridProvider/DataResolver.js +42 -39
  74. package/datagrid/DataGridProvider/index.js +22 -25
  75. package/datagrid/DataGridProvider/transformViewColumns.js +4 -7
  76. package/datagrid/DataGridProvider/utils.js +5 -13
  77. package/datagrid/column-filter/constants.js +2 -5
  78. package/datagrid/column-filter/index.js +2 -7
  79. package/datagrid/column-filter/types.js +1 -2
  80. package/datagrid/column-filter/utils.js +3 -7
  81. package/datagrid/context.d.ts +1 -1
  82. package/datagrid/context.js +2 -5
  83. package/datagrid/hooks/index.js +20 -36
  84. package/datagrid/hooks/useChangeView.js +6 -9
  85. package/datagrid/hooks/useGridColumnFilter.js +7 -10
  86. package/datagrid/hooks/useGridColumns.js +4 -7
  87. package/datagrid/hooks/useGridCommands.js +4 -7
  88. package/datagrid/hooks/useGridData.js +4 -7
  89. package/datagrid/hooks/useGridDataState.js +4 -7
  90. package/datagrid/hooks/useGridExtraFilter.js +4 -7
  91. package/datagrid/hooks/useGridOptions.js +1 -4
  92. package/datagrid/hooks/useGridPagination.js +1 -4
  93. package/datagrid/hooks/useGridRefresh.js +7 -10
  94. package/datagrid/hooks/useGridSchema.js +4 -7
  95. package/datagrid/hooks/useGridSelection.js +7 -10
  96. package/datagrid/hooks/useGridSorting.js +7 -10
  97. package/datagrid/hooks/useGridViewLookupData.js +4 -7
  98. package/datagrid/hooks/useLoadMainGridPage.js +9 -12
  99. package/datagrid/hooks/useMainGridCommands.js +50 -57
  100. package/datagrid/hooks/useMaxRecords.js +4 -7
  101. package/datagrid/hooks/useOpenRecord.js +15 -18
  102. package/datagrid/hooks/useSearchText.js +7 -10
  103. package/datagrid/hooks/useSelectedView.js +4 -7
  104. package/datagrid/hooks/useSubGridCommands.js +19 -24
  105. package/datagrid/index.js +5 -27
  106. package/defaults.js +2 -5
  107. package/dialog/DialogProvider.js +6 -10
  108. package/dialog/context.d.ts +1 -1
  109. package/dialog/context.js +2 -5
  110. package/dialog/hooks/index.js +8 -24
  111. package/dialog/hooks/useCloseDialog.js +6 -9
  112. package/dialog/hooks/useDialogItem.d.ts +1 -1
  113. package/dialog/hooks/useDialogItem.js +4 -7
  114. package/dialog/hooks/useDialogItems.d.ts +1 -1
  115. package/dialog/hooks/useDialogItems.js +4 -7
  116. package/dialog/hooks/useOpenAlertDialog.js +5 -8
  117. package/dialog/hooks/useOpenConfirmDialog.js +5 -8
  118. package/dialog/hooks/useOpenDialog.js +10 -13
  119. package/dialog/hooks/useOpenErrorDialog.js +5 -8
  120. package/dialog/hooks/useOpenPromptDialog.js +5 -8
  121. package/dialog/index.js +3 -22
  122. package/form/FormValidationStringContext.js +5 -9
  123. package/form/index.js +1 -7
  124. package/hooks/index.js +6 -24
  125. package/hooks/useDebouncedValue.js +8 -11
  126. package/hooks/useElementLayout.js +4 -7
  127. package/hooks/useIsMobile.js +6 -12
  128. package/hooks/useItemsWithKey.js +5 -8
  129. package/hooks/useStorageState.js +4 -7
  130. package/hooks/useSystemColorScheme.js +4 -7
  131. package/insights/InsightsProvider.js +10 -13
  132. package/insights/context.d.ts +1 -1
  133. package/insights/context.js +2 -5
  134. package/insights/hooks/index.js +4 -7
  135. package/insights/index.js +2 -20
  136. package/locale/LocaleProvider.js +8 -12
  137. package/locale/context.js +2 -5
  138. package/locale/index.js +4 -23
  139. package/locale/useCurrencySymbol.js +7 -10
  140. package/locale/useLocale.js +4 -7
  141. package/locale/utils.js +1 -4
  142. package/metadata/MetadataProvider.js +17 -21
  143. package/metadata/context.d.ts +1 -1
  144. package/metadata/context.js +2 -5
  145. package/metadata/hooks/index.js +8 -24
  146. package/metadata/hooks/useAppStore.js +4 -7
  147. package/metadata/hooks/useExperienceStore.js +4 -7
  148. package/metadata/hooks/useExperienceView.js +6 -9
  149. package/metadata/hooks/useExperienceViewCommands.js +7 -10
  150. package/metadata/hooks/useExperienceViewLookup.js +5 -8
  151. package/metadata/hooks/useExperienceViewSubgridCommands.js +7 -10
  152. package/metadata/hooks/useMetadata.js +8 -11
  153. package/metadata/hooks/useSchema.js +3 -6
  154. package/metadata/index.js +3 -22
  155. package/mutable/context.js +17 -25
  156. package/mutable/index.js +3 -27
  157. package/mutable/state.js +6 -10
  158. package/mutable/type.js +1 -2
  159. package/mutable/utils.js +7 -11
  160. package/navigation/hooks/index.js +1 -17
  161. package/navigation/hooks/useOpenForm.js +11 -14
  162. package/navigation/index.js +1 -17
  163. package/package.json +3 -2
  164. package/progress-indicator/ProgressIndicatorProvider.js +12 -16
  165. package/progress-indicator/context.js +2 -5
  166. package/progress-indicator/hooks/index.js +1 -17
  167. package/progress-indicator/hooks/useProgressIndicator.d.ts +1 -1
  168. package/progress-indicator/hooks/useProgressIndicator.js +4 -7
  169. package/progress-indicator/index.js +3 -22
  170. package/providers/PageEntityFormProvider/index.js +4 -7
  171. package/providers/PageEntityViewProvider/index.js +4 -7
  172. package/recordset/RecordSetProvider.js +12 -16
  173. package/recordset/context.d.ts +1 -1
  174. package/recordset/context.js +2 -5
  175. package/recordset/hooks/index.js +3 -19
  176. package/recordset/hooks/useRecordSetResult.js +15 -18
  177. package/recordset/hooks/useRecordSetSetter.js +6 -9
  178. package/recordset/hooks/useRecordSetVisibility.js +7 -10
  179. package/recordset/index.js +3 -22
  180. package/route/RouteProvider.js +14 -18
  181. package/route/context.js +6 -9
  182. package/route/hooks/index.js +6 -22
  183. package/route/hooks/useBasePath.js +4 -7
  184. package/route/hooks/useIsRouteActive.js +4 -7
  185. package/route/hooks/usePathname.js +4 -7
  186. package/route/hooks/useRouteResolver.js +4 -7
  187. package/route/hooks/useRouter.js +4 -7
  188. package/route/hooks/useSearchParams.js +4 -7
  189. package/route/index.js +2 -20
  190. package/route/types.js +1 -2
  191. package/store/ClientAppStore.js +1 -5
  192. package/store/ComponentStore.js +1 -5
  193. package/store/EventManager.js +1 -5
  194. package/store/SchemaExperienceStore.js +2 -7
  195. package/store/index.js +4 -20
  196. package/toast-notification/ToastNotificationProvider.js +6 -10
  197. package/toast-notification/context.d.ts +1 -1
  198. package/toast-notification/context.js +2 -5
  199. package/toast-notification/hooks/index.js +3 -19
  200. package/toast-notification/hooks/useCloseToastNotification.js +6 -9
  201. package/toast-notification/hooks/useOpenToastNotification.js +10 -13
  202. package/toast-notification/hooks/useToastNotificationItems.d.ts +1 -1
  203. package/toast-notification/hooks/useToastNotificationItems.js +4 -7
  204. package/toast-notification/index.js +3 -22
  205. package/transport/InMemoryDataService/index.js +1 -5
  206. package/transport/RestDataService/index.js +5 -10
  207. package/transport/context.js +4 -7
  208. package/transport/hooks/index.js +2 -18
  209. package/transport/hooks/useDataService.js +4 -7
  210. package/transport/hooks/useFileService.js +4 -7
  211. package/transport/hooks/useRetriveRecords.d.ts +1 -1
  212. package/transport/hooks/useRetriveRecords.js +12 -17
  213. package/transport/index.js +2 -20
  214. package/utils/calculateColumnWidths.js +1 -4
  215. package/utils/color.js +1 -4
  216. package/utils/getAttributeFormattedValue.js +12 -18
  217. package/utils/index.js +2 -18
  218. package/widget/context.js +2 -5
  219. package/widget/hooks/index.js +4 -7
  220. package/widget/index.js +1 -5
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useBoardConfig = useBoardConfig;
4
- const context_1 = require("@headless-adminapp/app/mutable/context");
5
- const context_2 = require("../context");
6
- function useBoardConfig() {
7
- return (0, context_1.useContextSelector)(context_2.BoardContext, (context) => context.config);
1
+ import { useContextSelector } from '@headless-adminapp/app/mutable/context';
2
+ import { BoardContext } from '../context';
3
+ export function useBoardConfig() {
4
+ return useContextSelector(BoardContext, (context) => context.config);
8
5
  }
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useBoardSchema = useBoardSchema;
4
- const useBoardConfig_1 = require("./useBoardConfig");
5
- function useBoardSchema() {
6
- return (0, useBoardConfig_1.useBoardConfig)().schema;
1
+ import { useBoardConfig } from './useBoardConfig';
2
+ export function useBoardSchema() {
3
+ return useBoardConfig().schema;
7
4
  }
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSearchText = useSearchText;
4
- const context_1 = require("@headless-adminapp/app/mutable/context");
5
- const react_1 = require("react");
6
- const context_2 = require("../context");
7
- function useSearchText() {
8
- const searchText = (0, context_1.useContextSelector)(context_2.BoardContext, (context) => context.searchText);
9
- const setValue = (0, context_1.useContextSetValue)(context_2.BoardContext);
10
- const setSearchText = (0, react_1.useCallback)((value) => {
1
+ import { useContextSelector, useContextSetValue, } from '@headless-adminapp/app/mutable/context';
2
+ import { useCallback } from 'react';
3
+ import { BoardContext } from '../context';
4
+ export function useSearchText() {
5
+ const searchText = useContextSelector(BoardContext, (context) => context.searchText);
6
+ const setValue = useContextSetValue(BoardContext);
7
+ const setSearchText = useCallback((value) => {
11
8
  setValue({ searchText: value });
12
9
  }, [setValue]);
13
10
  return [searchText, setSearchText];
package/board/types.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/board/utils.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineBoardConfig = defineBoardConfig;
4
- function defineBoardConfig(config) {
1
+ export function defineBoardConfig(config) {
5
2
  return config;
6
3
  }
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandBuilder = void 0;
4
- const DefaultCommandBuilder_1 = require("./DefaultCommandBuilder");
5
- const FormCommandBuilder_1 = require("./FormCommandBuilder");
6
- const SubgridCommandBuilder_1 = require("./SubgridCommandBuilder");
7
- const ViewCommandBuilder_1 = require("./ViewCommandBuilder");
8
- var CommandBuilder;
1
+ import { DefaultCommandBuilder } from './DefaultCommandBuilder';
2
+ import { FormCommandBuilder } from './FormCommandBuilder';
3
+ import { SubgridCommandBuilder } from './SubgridCommandBuilder';
4
+ import { ViewCommandBuilder } from './ViewCommandBuilder';
5
+ export var CommandBuilder;
9
6
  (function (CommandBuilder) {
10
- CommandBuilder.View = ViewCommandBuilder_1.ViewCommandBuilder;
11
- CommandBuilder.Form = FormCommandBuilder_1.FormCommandBuilder;
12
- CommandBuilder.Subgrid = SubgridCommandBuilder_1.SubgridCommandBuilder;
13
- CommandBuilder.Default = DefaultCommandBuilder_1.DefaultCommandBuilder;
14
- })(CommandBuilder || (exports.CommandBuilder = CommandBuilder = {}));
7
+ CommandBuilder.View = ViewCommandBuilder;
8
+ CommandBuilder.Form = FormCommandBuilder;
9
+ CommandBuilder.Subgrid = SubgridCommandBuilder;
10
+ CommandBuilder.Default = DefaultCommandBuilder;
11
+ })(CommandBuilder || (CommandBuilder = {}));
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultCommandBuilder = void 0;
4
- const FormCommandBuilder_1 = require("./FormCommandBuilder");
5
- const SubgridCommandBuilder_1 = require("./SubgridCommandBuilder");
6
- const ViewCommandBuilder_1 = require("./ViewCommandBuilder");
7
- var DefaultCommandBuilder;
1
+ import { FormCommandBuilder } from './FormCommandBuilder';
2
+ import { SubgridCommandBuilder } from './SubgridCommandBuilder';
3
+ import { ViewCommandBuilder } from './ViewCommandBuilder';
4
+ export var DefaultCommandBuilder;
8
5
  (function (DefaultCommandBuilder) {
9
6
  DefaultCommandBuilder.defaultViewCommandStrings = {
10
7
  new: 'New',
11
8
  edit: 'Edit',
12
9
  delete: 'Delete',
13
- deleteRecordCommandStringSet: ViewCommandBuilder_1.ViewCommandBuilder.defaultDeleteRecordStringSet,
10
+ deleteRecordCommandStringSet: ViewCommandBuilder.defaultDeleteRecordStringSet,
14
11
  refresh: 'Refresh',
15
12
  export: 'Export',
16
13
  exportCsv: 'CSV',
@@ -28,31 +25,31 @@ var DefaultCommandBuilder;
28
25
  function createDefaultViewCommands({ icons, strings = DefaultCommandBuilder.defaultViewCommandStrings, localizedSrings, }) {
29
26
  return [
30
27
  [
31
- ViewCommandBuilder_1.ViewCommandBuilder.createNewRecordCommand({
28
+ ViewCommandBuilder.createNewRecordCommand({
32
29
  Icon: icons.New,
33
30
  text: strings.new,
34
31
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.new),
35
32
  }),
36
- ViewCommandBuilder_1.ViewCommandBuilder.createEditRecordCommand({
33
+ ViewCommandBuilder.createEditRecordCommand({
37
34
  Icon: icons.Edit,
38
35
  text: strings.edit,
39
36
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.edit),
40
37
  }),
41
- ViewCommandBuilder_1.ViewCommandBuilder.createDeleteRecordCommand({
38
+ ViewCommandBuilder.createDeleteRecordCommand({
42
39
  Icon: icons.Delete,
43
40
  text: strings.delete,
44
41
  localizedText: extractLocalizedStrings(localizedSrings, (x) => x.delete),
45
42
  stringSet: strings.deleteRecordCommandStringSet,
46
43
  localizedStringSet: extractLocalizedStrings(localizedSrings, (x) => x.deleteRecordCommandStringSet),
47
44
  }),
48
- ViewCommandBuilder_1.ViewCommandBuilder.createRefreshCommand({
45
+ ViewCommandBuilder.createRefreshCommand({
49
46
  Icon: icons.Refresh,
50
47
  text: strings.refresh,
51
48
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.refresh),
52
49
  }),
53
50
  ],
54
51
  [
55
- ViewCommandBuilder_1.ViewCommandBuilder.createExportCommand({
52
+ ViewCommandBuilder.createExportCommand({
56
53
  button: {
57
54
  Icon: icons.Export,
58
55
  text: strings.export,
@@ -78,27 +75,27 @@ var DefaultCommandBuilder;
78
75
  saveAndClose: 'Save & Close',
79
76
  refresh: 'Refresh',
80
77
  delete: 'Delete',
81
- deleteRecordCommandStringSet: FormCommandBuilder_1.FormCommandBuilder.defaultDeleteRecordStringSet,
78
+ deleteRecordCommandStringSet: FormCommandBuilder.defaultDeleteRecordStringSet,
82
79
  };
83
80
  function createDefaultFormCommands({ icons, strings = DefaultCommandBuilder.defaultFormCommandStrings, localizedSrings, }) {
84
81
  return [
85
82
  [
86
- FormCommandBuilder_1.FormCommandBuilder.createSaveCommand({
83
+ FormCommandBuilder.createSaveCommand({
87
84
  Icon: icons.Save,
88
85
  text: strings.save,
89
86
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.save),
90
87
  }),
91
- FormCommandBuilder_1.FormCommandBuilder.createSaveAndCloseCommand({
88
+ FormCommandBuilder.createSaveAndCloseCommand({
92
89
  Icon: icons.SaveAndClose,
93
90
  text: strings.saveAndClose,
94
91
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.saveAndClose),
95
92
  }),
96
- FormCommandBuilder_1.FormCommandBuilder.createRefreshCommand({
93
+ FormCommandBuilder.createRefreshCommand({
97
94
  Icon: icons.Refresh,
98
95
  text: strings.refresh,
99
96
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.refresh),
100
97
  }),
101
- FormCommandBuilder_1.FormCommandBuilder.createDeleteCommand({
98
+ FormCommandBuilder.createDeleteCommand({
102
99
  Icon: icons.Delete,
103
100
  text: 'Delete',
104
101
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.delete),
@@ -117,36 +114,36 @@ var DefaultCommandBuilder;
117
114
  export: 'Export',
118
115
  exportCsv: 'CSV',
119
116
  exportExcel: 'Excel',
120
- deleteRecordCommandStringSet: ViewCommandBuilder_1.ViewCommandBuilder.defaultDeleteRecordStringSet,
117
+ deleteRecordCommandStringSet: ViewCommandBuilder.defaultDeleteRecordStringSet,
121
118
  };
122
119
  function createDefaultSubgridCommands({ icons, strings = defaultSubgridCommandStrings, localizedSrings, }) {
123
120
  return [
124
121
  [
125
- SubgridCommandBuilder_1.SubgridCommandBuilder.createNewRecordCommand({
122
+ SubgridCommandBuilder.createNewRecordCommand({
126
123
  Icon: icons.New,
127
124
  text: strings.new,
128
125
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.new),
129
126
  }),
130
- SubgridCommandBuilder_1.SubgridCommandBuilder.createEditRecordCommand({
127
+ SubgridCommandBuilder.createEditRecordCommand({
131
128
  Icon: icons.Edit,
132
129
  text: strings.edit,
133
130
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.edit),
134
131
  }),
135
- SubgridCommandBuilder_1.SubgridCommandBuilder.createDeleteRecordCommand({
132
+ SubgridCommandBuilder.createDeleteRecordCommand({
136
133
  Icon: icons.Delete,
137
134
  text: strings.delete,
138
135
  localizedText: extractLocalizedStrings(localizedSrings, (x) => x.delete),
139
136
  stringSet: strings.deleteRecordCommandStringSet,
140
137
  localizedStringSet: extractLocalizedStrings(localizedSrings, (x) => x.deleteRecordCommandStringSet),
141
138
  }),
142
- SubgridCommandBuilder_1.SubgridCommandBuilder.createRefreshCommand({
139
+ SubgridCommandBuilder.createRefreshCommand({
143
140
  Icon: icons.Refresh,
144
141
  text: strings.refresh,
145
142
  localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.refresh),
146
143
  }),
147
144
  ],
148
145
  [
149
- SubgridCommandBuilder_1.SubgridCommandBuilder.createExportCommand({
146
+ SubgridCommandBuilder.createExportCommand({
150
147
  button: {
151
148
  Icon: icons.Export,
152
149
  text: strings.export,
@@ -188,4 +185,4 @@ var DefaultCommandBuilder;
188
185
  };
189
186
  }
190
187
  DefaultCommandBuilder.createDefaultCommands = createDefaultCommands;
191
- })(DefaultCommandBuilder || (exports.DefaultCommandBuilder = DefaultCommandBuilder = {}));
188
+ })(DefaultCommandBuilder || (DefaultCommandBuilder = {}));
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,9 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FormCommandBuilder = void 0;
13
- const utils_1 = require("./utils");
10
+ import { createLocalizedSelector, plurialize } from './utils';
14
11
  var EnabledRules;
15
12
  (function (EnabledRules) {
16
13
  function HasCreatePermisssion(context) {
@@ -29,7 +26,7 @@ var EnabledRules;
29
26
  }
30
27
  EnabledRules.HasDeletePermission = HasDeletePermission;
31
28
  })(EnabledRules || (EnabledRules = {}));
32
- var FormCommandBuilder;
29
+ export var FormCommandBuilder;
33
30
  (function (FormCommandBuilder) {
34
31
  function createSaveCommand({ Icon, text, localizedTexts, }) {
35
32
  return {
@@ -121,22 +118,22 @@ var FormCommandBuilder;
121
118
  // if (typeof stringSet === 'function') {
122
119
  // stringSet = stringSet(context);
123
120
  // }
124
- const localizeSelector = (0, utils_1.createLocalizedSelector)(stringSet, localizedStringSet, context.locale.language);
121
+ const localizeSelector = createLocalizedSelector(stringSet, localizedStringSet, context.locale.language);
125
122
  try {
126
123
  const confirmResult = yield context.utility.openConfirmDialog({
127
- title: (0, utils_1.plurialize)(1, localizeSelector((s) => s.confirmation.title)),
128
- text: (0, utils_1.plurialize)(1, localizeSelector((s) => s.confirmation.text)),
124
+ title: plurialize(1, localizeSelector((s) => s.confirmation.title)),
125
+ text: plurialize(1, localizeSelector((s) => s.confirmation.text)),
129
126
  cancelButtonLabel: stringSet.confirmation.buttonCancel,
130
127
  confirmButtonLabel: stringSet.confirmation.buttonConfirm,
131
128
  });
132
129
  if (!(confirmResult === null || confirmResult === void 0 ? void 0 : confirmResult.confirmed)) {
133
130
  return;
134
131
  }
135
- context.utility.showProgressIndicator((0, utils_1.plurialize)(1, localizeSelector((s) => s.status.deleting)) + '...');
132
+ context.utility.showProgressIndicator(plurialize(1, localizeSelector((s) => s.status.deleting)) + '...');
136
133
  yield context.dataService.deleteRecord(context.primaryControl.logicalName, recordId);
137
134
  context.utility.showNotification({
138
- title: (0, utils_1.plurialize)(1, localizeSelector((s) => s.successNotification.title)),
139
- text: (0, utils_1.plurialize)(1, localizeSelector((s) => s.successNotification.text)),
135
+ title: plurialize(1, localizeSelector((s) => s.successNotification.title)),
136
+ text: plurialize(1, localizeSelector((s) => s.successNotification.text)),
140
137
  type: 'success',
141
138
  });
142
139
  context.primaryControl.close();
@@ -168,4 +165,4 @@ var FormCommandBuilder;
168
165
  };
169
166
  }
170
167
  FormCommandBuilder.createRefreshCommand = createRefreshCommand;
171
- })(FormCommandBuilder || (exports.FormCommandBuilder = FormCommandBuilder = {}));
168
+ })(FormCommandBuilder || (FormCommandBuilder = {}));
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,11 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SubgridCommandBuilder = void 0;
13
- const utils_1 = require("../utils");
14
- const utils_2 = require("./utils");
15
- const ViewCommandBuilder_1 = require("./ViewCommandBuilder");
10
+ import { exportRecordsCSV, exportRecordsXLS, retriveRecords } from '../utils';
11
+ import { createLocalizedSelector } from './utils';
12
+ import { ViewCommandBuilder } from './ViewCommandBuilder';
16
13
  var EnabledRules;
17
14
  (function (EnabledRules) {
18
15
  function HasCreatePermisssion(context) {
@@ -39,7 +36,7 @@ var EnabledRules;
39
36
  }
40
37
  EnabledRules.HasAtLeastOneRecordSelected = HasAtLeastOneRecordSelected;
41
38
  })(EnabledRules || (EnabledRules = {}));
42
- var SubgridCommandBuilder;
39
+ export var SubgridCommandBuilder;
43
40
  (function (SubgridCommandBuilder) {
44
41
  function createNewRecordCommand({ Icon, text, localizedTexts, }) {
45
42
  return {
@@ -93,7 +90,7 @@ var SubgridCommandBuilder;
93
90
  msg = msg.replace('{count}', count.toString());
94
91
  return msg;
95
92
  }
96
- function createDeleteRecordCommand({ Icon, localizedText, text, stringSet = ViewCommandBuilder_1.ViewCommandBuilder.defaultDeleteRecordStringSet, localizedStringSet, }) {
93
+ function createDeleteRecordCommand({ Icon, localizedText, text, stringSet = ViewCommandBuilder.defaultDeleteRecordStringSet, localizedStringSet, }) {
97
94
  return {
98
95
  type: 'button',
99
96
  Icon,
@@ -106,7 +103,7 @@ var SubgridCommandBuilder;
106
103
  if (!recordIds.length) {
107
104
  return;
108
105
  }
109
- const localizeSelector = (0, utils_2.createLocalizedSelector)(stringSet, localizedStringSet, context.locale.language);
106
+ const localizeSelector = createLocalizedSelector(stringSet, localizedStringSet, context.locale.language);
110
107
  try {
111
108
  const confirmResult = yield context.utility.openConfirmDialog({
112
109
  title: plurialize(recordIds.length, localizeSelector((s) => s.confirmation.title)),
@@ -173,7 +170,7 @@ var SubgridCommandBuilder;
173
170
  onClick: (context) => __awaiter(this, void 0, void 0, function* () {
174
171
  context.utility.showProgressIndicator('Exporting to Excel...');
175
172
  try {
176
- const result = yield (0, utils_1.retriveRecords)({
173
+ const result = yield retriveRecords({
177
174
  columnFilters: context.secondaryControl.columnFilter,
178
175
  dataService: context.dataService,
179
176
  gridColumns: context.secondaryControl.gridColumns,
@@ -186,7 +183,7 @@ var SubgridCommandBuilder;
186
183
  skip: 0,
187
184
  limit: 5000,
188
185
  });
189
- yield (0, utils_1.exportRecordsXLS)({
186
+ yield exportRecordsXLS({
190
187
  fileName: context.secondaryControl.view.name + '.xlsx',
191
188
  gridColumns: context.secondaryControl.gridColumns,
192
189
  records: result.records,
@@ -206,7 +203,7 @@ var SubgridCommandBuilder;
206
203
  onClick: (context) => __awaiter(this, void 0, void 0, function* () {
207
204
  context.utility.showProgressIndicator('Exporting to CSV...');
208
205
  try {
209
- const result = yield (0, utils_1.retriveRecords)({
206
+ const result = yield retriveRecords({
210
207
  columnFilters: context.secondaryControl.columnFilter,
211
208
  dataService: context.dataService,
212
209
  gridColumns: context.secondaryControl.gridColumns,
@@ -219,7 +216,7 @@ var SubgridCommandBuilder;
219
216
  skip: 0,
220
217
  limit: 5000,
221
218
  });
222
- yield (0, utils_1.exportRecordsCSV)({
219
+ yield exportRecordsCSV({
223
220
  fileName: context.secondaryControl.view.name + '.csv',
224
221
  gridColumns: context.secondaryControl.gridColumns,
225
222
  records: result.records,
@@ -237,4 +234,4 @@ var SubgridCommandBuilder;
237
234
  };
238
235
  }
239
236
  SubgridCommandBuilder.createExportCommand = createExportCommand;
240
- })(SubgridCommandBuilder || (exports.SubgridCommandBuilder = SubgridCommandBuilder = {}));
237
+ })(SubgridCommandBuilder || (SubgridCommandBuilder = {}));
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,10 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ViewCommandBuilder = void 0;
13
- const utils_1 = require("../utils");
14
- const utils_2 = require("./utils");
10
+ import { exportRecordsCSV, exportRecordsXLS, retriveRecords } from '../utils';
11
+ import { createLocalizedSelector, plurialize } from './utils';
15
12
  var EnabledRules;
16
13
  (function (EnabledRules) {
17
14
  function HasCreatePermisssion(context) {
@@ -38,7 +35,7 @@ var EnabledRules;
38
35
  }
39
36
  EnabledRules.HasAtLeastOneRecordSelected = HasAtLeastOneRecordSelected;
40
37
  })(EnabledRules || (EnabledRules = {}));
41
- var ViewCommandBuilder;
38
+ export var ViewCommandBuilder;
42
39
  (function (ViewCommandBuilder) {
43
40
  function createNewRecordCommand({ Icon, text, localizedTexts, }) {
44
41
  return {
@@ -108,24 +105,24 @@ var ViewCommandBuilder;
108
105
  if (!recordIds.length) {
109
106
  return;
110
107
  }
111
- const localizeSelector = (0, utils_2.createLocalizedSelector)(stringSet, localizedStringSet, context.locale.language);
108
+ const localizeSelector = createLocalizedSelector(stringSet, localizedStringSet, context.locale.language);
112
109
  try {
113
110
  const confirmResult = yield context.utility.openConfirmDialog({
114
- title: (0, utils_2.plurialize)(recordIds.length, localizeSelector((s) => s.confirmation.title)),
115
- text: (0, utils_2.plurialize)(recordIds.length, localizeSelector((s) => s.confirmation.text)),
111
+ title: plurialize(recordIds.length, localizeSelector((s) => s.confirmation.title)),
112
+ text: plurialize(recordIds.length, localizeSelector((s) => s.confirmation.text)),
116
113
  cancelButtonLabel: localizeSelector((s) => s.confirmation.buttonCancel),
117
114
  confirmButtonLabel: localizeSelector((s) => s.confirmation.buttonConfirm),
118
115
  });
119
116
  if (!(confirmResult === null || confirmResult === void 0 ? void 0 : confirmResult.confirmed)) {
120
117
  return;
121
118
  }
122
- context.utility.showProgressIndicator((0, utils_2.plurialize)(recordIds.length, localizeSelector((s) => s.status.deleting)) + '...');
119
+ context.utility.showProgressIndicator(plurialize(recordIds.length, localizeSelector((s) => s.status.deleting)) + '...');
123
120
  for (const recordId of recordIds) {
124
121
  yield context.dataService.deleteRecord(context.primaryControl.logicalName, recordId);
125
122
  }
126
123
  context.utility.showNotification({
127
- title: (0, utils_2.plurialize)(recordIds.length, localizeSelector((s) => s.successNotification.title)),
128
- text: (0, utils_2.plurialize)(recordIds.length, localizeSelector((s) => s.successNotification.text)),
124
+ title: plurialize(recordIds.length, localizeSelector((s) => s.successNotification.title)),
125
+ text: plurialize(recordIds.length, localizeSelector((s) => s.successNotification.text)),
129
126
  type: 'success',
130
127
  });
131
128
  context.primaryControl.refresh();
@@ -175,7 +172,7 @@ var ViewCommandBuilder;
175
172
  onClick: (context) => __awaiter(this, void 0, void 0, function* () {
176
173
  context.utility.showProgressIndicator('Exporting to Excel...');
177
174
  try {
178
- const result = yield (0, utils_1.retriveRecords)({
175
+ const result = yield retriveRecords({
179
176
  columnFilters: context.primaryControl.columnFilter,
180
177
  dataService: context.dataService,
181
178
  gridColumns: context.primaryControl.gridColumns,
@@ -188,7 +185,7 @@ var ViewCommandBuilder;
188
185
  skip: 0,
189
186
  limit: 5000,
190
187
  });
191
- yield (0, utils_1.exportRecordsXLS)({
188
+ yield exportRecordsXLS({
192
189
  fileName: context.primaryControl.view.name + '.xlsx',
193
190
  gridColumns: context.primaryControl.gridColumns,
194
191
  records: result.records,
@@ -208,7 +205,7 @@ var ViewCommandBuilder;
208
205
  onClick: (context) => __awaiter(this, void 0, void 0, function* () {
209
206
  context.utility.showProgressIndicator('Exporting to CSV...');
210
207
  try {
211
- const result = yield (0, utils_1.retriveRecords)({
208
+ const result = yield retriveRecords({
212
209
  columnFilters: context.primaryControl.columnFilter,
213
210
  dataService: context.dataService,
214
211
  gridColumns: context.primaryControl.gridColumns,
@@ -221,7 +218,7 @@ var ViewCommandBuilder;
221
218
  skip: 0,
222
219
  limit: 5000,
223
220
  });
224
- yield (0, utils_1.exportRecordsCSV)({
221
+ yield exportRecordsCSV({
225
222
  fileName: context.primaryControl.view.name + '.csv',
226
223
  gridColumns: context.primaryControl.gridColumns,
227
224
  records: result.records,
@@ -239,4 +236,4 @@ var ViewCommandBuilder;
239
236
  };
240
237
  }
241
238
  ViewCommandBuilder.createExportCommand = createExportCommand;
242
- })(ViewCommandBuilder || (exports.ViewCommandBuilder = ViewCommandBuilder = {}));
239
+ })(ViewCommandBuilder || (ViewCommandBuilder = {}));
@@ -1,5 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandBuilder = void 0;
4
- var CommandBuilder_1 = require("./CommandBuilder");
5
- Object.defineProperty(exports, "CommandBuilder", { enumerable: true, get: function () { return CommandBuilder_1.CommandBuilder; } });
1
+ export { CommandBuilder } from './CommandBuilder';
@@ -1,8 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createLocalizedSelector = createLocalizedSelector;
4
- exports.plurialize = plurialize;
5
- function createLocalizedSelector(stringSet, localizedStringSet, language) {
1
+ export function createLocalizedSelector(stringSet, localizedStringSet, language) {
6
2
  return function selectLocalized(selector) {
7
3
  if (localizedStringSet && localizedStringSet[language]) {
8
4
  return selector(localizedStringSet[language]);
@@ -10,7 +6,7 @@ function createLocalizedSelector(stringSet, localizedStringSet, language) {
10
6
  return selector(stringSet);
11
7
  };
12
8
  }
13
- function plurialize(count, singular, plural) {
9
+ export function plurialize(count, singular, plural) {
14
10
  if (Array.isArray(singular)) {
15
11
  plural = singular[1];
16
12
  singular = singular[0];
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaExperienceBuilder = void 0;
4
1
  class BaseSchemaExperienceBuilder {
5
2
  constructor(logicalName) {
6
3
  this.logicalName = logicalName;
@@ -65,7 +62,7 @@ class BaseSchemaExperienceBuilder {
65
62
  return formExperience;
66
63
  }
67
64
  }
68
- class SchemaExperienceBuilder extends BaseSchemaExperienceBuilder {
65
+ export class SchemaExperienceBuilder extends BaseSchemaExperienceBuilder {
69
66
  constructor(schema, defaults, options) {
70
67
  super(schema.logicalName);
71
68
  this.schema = schema;
@@ -254,4 +251,3 @@ class SchemaExperienceBuilder extends BaseSchemaExperienceBuilder {
254
251
  };
255
252
  }
256
253
  }
257
- exports.SchemaExperienceBuilder = SchemaExperienceBuilder;
package/builders/index.js CHANGED
@@ -1,7 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandBuilder = exports.SchemaExperienceBuilder = void 0;
4
- var SchemaExperienceBuilder_1 = require("./SchemaExperienceBuilder");
5
- Object.defineProperty(exports, "SchemaExperienceBuilder", { enumerable: true, get: function () { return SchemaExperienceBuilder_1.SchemaExperienceBuilder; } });
6
- var CommandBuilder_1 = require("./CommandBuilder");
7
- Object.defineProperty(exports, "CommandBuilder", { enumerable: true, get: function () { return CommandBuilder_1.CommandBuilder; } });
1
+ export { SchemaExperienceBuilder, } from './SchemaExperienceBuilder';
2
+ export { CommandBuilder } from './CommandBuilder';