@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.
- package/app/AppProvider.js +13 -17
- package/app/AuthWrapper.js +9 -13
- package/app/LayoutProvider.js +16 -20
- package/app/context.js +2 -5
- package/app/hooks/index.js +1 -17
- package/app/hooks/useAppContext.js +4 -7
- package/app/index.js +4 -11
- package/auth/AuthProvider.js +17 -21
- package/auth/context.d.ts +1 -1
- package/auth/context.js +2 -5
- package/auth/hooks/index.js +2 -18
- package/auth/hooks/useAuthSession.js +4 -7
- package/auth/hooks/useIsSkipAuthCheck.js +4 -7
- package/auth/hooks/useLogout.js +7 -10
- package/auth/index.js +4 -23
- package/auth/types.js +1 -2
- package/board/BoardColumnDataResolver.js +20 -23
- package/board/BoardColumnProvider.js +10 -14
- package/board/context.js +3 -6
- package/board/hooks/index.js +6 -15
- package/board/hooks/useBoardColumnConfig.js +4 -7
- package/board/hooks/useBoardColumnData.js +4 -7
- package/board/hooks/useBoardColumnDataState.js +4 -7
- package/board/hooks/useBoardConfig.js +4 -7
- package/board/hooks/useBoardSchema.js +3 -6
- package/board/hooks/useSearchText.js +7 -10
- package/board/types.js +1 -2
- package/board/utils.js +1 -4
- package/builders/CommandBuilder/CommandBuilder.js +10 -13
- package/builders/CommandBuilder/DefaultCommandBuilder.js +22 -25
- package/builders/CommandBuilder/FormCommandBuilder.js +9 -12
- package/builders/CommandBuilder/SubgridCommandBuilder.js +11 -14
- package/builders/CommandBuilder/ViewCommandBuilder.js +14 -17
- package/builders/CommandBuilder/index.js +1 -5
- package/builders/CommandBuilder/utils.js +2 -6
- package/builders/SchemaExperienceBuilder.js +1 -5
- package/builders/index.js +2 -7
- package/builders/utils.js +12 -41
- package/command/hooks/index.js +2 -18
- package/command/hooks/useBaseCommandHandlerContext.js +25 -29
- package/command/hooks/useCommands.js +6 -9
- package/command/index.js +2 -18
- package/command/types.js +1 -2
- package/command/utils/index.js +4 -7
- package/components/ScrollView/index.js +4 -11
- package/components/ScrollbarWithMoreDataRequest/index.js +9 -13
- package/dataform/DataFormProvider/DataResolver.d.ts +2 -2
- package/dataform/DataFormProvider/DataResolver.js +31 -32
- package/dataform/DataFormProvider/InitialValueResolver.js +19 -22
- package/dataform/DataFormProvider/ReadonlyInfoResolver.js +9 -12
- package/dataform/DataFormProvider/index.js +22 -25
- package/dataform/context.js +2 -5
- package/dataform/hooks/index.js +13 -29
- package/dataform/hooks/useFormInstance.js +3 -6
- package/dataform/hooks/useFormIsDirty.js +3 -6
- package/dataform/hooks/useFormIsReadonly.js +4 -7
- package/dataform/hooks/useFormNotifications.js +7 -10
- package/dataform/hooks/useFormRecord.js +4 -7
- package/dataform/hooks/useFormSave.js +30 -33
- package/dataform/hooks/useFormSchema.js +4 -7
- package/dataform/hooks/useLoadFormGridPage.js +10 -13
- package/dataform/hooks/useMainFormCommands.js +27 -32
- package/dataform/hooks/useProcessFlowSteps.js +18 -21
- package/dataform/hooks/useRecordId.js +4 -7
- package/dataform/hooks/useRecordTitle.d.ts +3 -1
- package/dataform/hooks/useRecordTitle.js +11 -14
- package/dataform/hooks/useSelectedForm.js +4 -7
- package/dataform/index.js +4 -23
- package/dataform/utils/defaultParameters.js +2 -6
- package/dataform/utils/index.d.ts +1 -1
- package/dataform/utils/index.js +17 -45
- package/dataform/utils/saveRecord.js +5 -9
- package/datagrid/DataGridProvider/DataResolver.js +42 -39
- package/datagrid/DataGridProvider/index.js +22 -25
- package/datagrid/DataGridProvider/transformViewColumns.js +4 -7
- package/datagrid/DataGridProvider/utils.js +5 -13
- package/datagrid/column-filter/constants.js +2 -5
- package/datagrid/column-filter/index.js +2 -7
- package/datagrid/column-filter/types.js +1 -2
- package/datagrid/column-filter/utils.js +3 -7
- package/datagrid/context.d.ts +1 -1
- package/datagrid/context.js +2 -5
- package/datagrid/hooks/index.js +20 -36
- package/datagrid/hooks/useChangeView.js +6 -9
- package/datagrid/hooks/useGridColumnFilter.js +7 -10
- package/datagrid/hooks/useGridColumns.js +4 -7
- package/datagrid/hooks/useGridCommands.js +4 -7
- package/datagrid/hooks/useGridData.js +4 -7
- package/datagrid/hooks/useGridDataState.js +4 -7
- package/datagrid/hooks/useGridExtraFilter.js +4 -7
- package/datagrid/hooks/useGridOptions.js +1 -4
- package/datagrid/hooks/useGridPagination.js +1 -4
- package/datagrid/hooks/useGridRefresh.js +7 -10
- package/datagrid/hooks/useGridSchema.js +4 -7
- package/datagrid/hooks/useGridSelection.js +7 -10
- package/datagrid/hooks/useGridSorting.js +7 -10
- package/datagrid/hooks/useGridViewLookupData.js +4 -7
- package/datagrid/hooks/useLoadMainGridPage.js +9 -12
- package/datagrid/hooks/useMainGridCommands.js +50 -57
- package/datagrid/hooks/useMaxRecords.js +4 -7
- package/datagrid/hooks/useOpenRecord.js +15 -18
- package/datagrid/hooks/useSearchText.js +7 -10
- package/datagrid/hooks/useSelectedView.js +4 -7
- package/datagrid/hooks/useSubGridCommands.js +19 -24
- package/datagrid/index.js +5 -27
- package/defaults.js +2 -5
- package/dialog/DialogProvider.js +6 -10
- package/dialog/context.d.ts +1 -1
- package/dialog/context.js +2 -5
- package/dialog/hooks/index.js +8 -24
- package/dialog/hooks/useCloseDialog.js +6 -9
- package/dialog/hooks/useDialogItem.d.ts +1 -1
- package/dialog/hooks/useDialogItem.js +4 -7
- package/dialog/hooks/useDialogItems.d.ts +1 -1
- package/dialog/hooks/useDialogItems.js +4 -7
- package/dialog/hooks/useOpenAlertDialog.js +5 -8
- package/dialog/hooks/useOpenConfirmDialog.js +5 -8
- package/dialog/hooks/useOpenDialog.js +10 -13
- package/dialog/hooks/useOpenErrorDialog.js +5 -8
- package/dialog/hooks/useOpenPromptDialog.js +5 -8
- package/dialog/index.js +3 -22
- package/form/FormValidationStringContext.js +5 -9
- package/form/index.js +1 -7
- package/hooks/index.js +6 -24
- package/hooks/useDebouncedValue.js +8 -11
- package/hooks/useElementLayout.js +4 -7
- package/hooks/useIsMobile.js +6 -12
- package/hooks/useItemsWithKey.js +5 -8
- package/hooks/useStorageState.js +4 -7
- package/hooks/useSystemColorScheme.js +4 -7
- package/insights/InsightsProvider.js +10 -13
- package/insights/context.d.ts +1 -1
- package/insights/context.js +2 -5
- package/insights/hooks/index.js +4 -7
- package/insights/index.js +2 -20
- package/locale/LocaleProvider.js +8 -12
- package/locale/context.js +2 -5
- package/locale/index.js +4 -23
- package/locale/useCurrencySymbol.js +7 -10
- package/locale/useLocale.js +4 -7
- package/locale/utils.js +1 -4
- package/metadata/MetadataProvider.js +17 -21
- package/metadata/context.d.ts +1 -1
- package/metadata/context.js +2 -5
- package/metadata/hooks/index.js +8 -24
- package/metadata/hooks/useAppStore.js +4 -7
- package/metadata/hooks/useExperienceStore.js +4 -7
- package/metadata/hooks/useExperienceView.js +6 -9
- package/metadata/hooks/useExperienceViewCommands.js +7 -10
- package/metadata/hooks/useExperienceViewLookup.js +5 -8
- package/metadata/hooks/useExperienceViewSubgridCommands.js +7 -10
- package/metadata/hooks/useMetadata.js +8 -11
- package/metadata/hooks/useSchema.js +3 -6
- package/metadata/index.js +3 -22
- package/mutable/context.js +17 -25
- package/mutable/index.js +3 -27
- package/mutable/state.js +6 -10
- package/mutable/type.js +1 -2
- package/mutable/utils.js +7 -11
- package/navigation/hooks/index.js +1 -17
- package/navigation/hooks/useOpenForm.js +11 -14
- package/navigation/index.js +1 -17
- package/package.json +3 -2
- package/progress-indicator/ProgressIndicatorProvider.js +12 -16
- package/progress-indicator/context.js +2 -5
- package/progress-indicator/hooks/index.js +1 -17
- package/progress-indicator/hooks/useProgressIndicator.d.ts +1 -1
- package/progress-indicator/hooks/useProgressIndicator.js +4 -7
- package/progress-indicator/index.js +3 -22
- package/providers/PageEntityFormProvider/index.js +4 -7
- package/providers/PageEntityViewProvider/index.js +4 -7
- package/recordset/RecordSetProvider.js +12 -16
- package/recordset/context.d.ts +1 -1
- package/recordset/context.js +2 -5
- package/recordset/hooks/index.js +3 -19
- package/recordset/hooks/useRecordSetResult.js +15 -18
- package/recordset/hooks/useRecordSetSetter.js +6 -9
- package/recordset/hooks/useRecordSetVisibility.js +7 -10
- package/recordset/index.js +3 -22
- package/route/RouteProvider.js +14 -18
- package/route/context.js +6 -9
- package/route/hooks/index.js +6 -22
- package/route/hooks/useBasePath.js +4 -7
- package/route/hooks/useIsRouteActive.js +4 -7
- package/route/hooks/usePathname.js +4 -7
- package/route/hooks/useRouteResolver.js +4 -7
- package/route/hooks/useRouter.js +4 -7
- package/route/hooks/useSearchParams.js +4 -7
- package/route/index.js +2 -20
- package/route/types.js +1 -2
- package/store/ClientAppStore.js +1 -5
- package/store/ComponentStore.js +1 -5
- package/store/EventManager.js +1 -5
- package/store/SchemaExperienceStore.js +2 -7
- package/store/index.js +4 -20
- package/toast-notification/ToastNotificationProvider.js +6 -10
- package/toast-notification/context.d.ts +1 -1
- package/toast-notification/context.js +2 -5
- package/toast-notification/hooks/index.js +3 -19
- package/toast-notification/hooks/useCloseToastNotification.js +6 -9
- package/toast-notification/hooks/useOpenToastNotification.js +10 -13
- package/toast-notification/hooks/useToastNotificationItems.d.ts +1 -1
- package/toast-notification/hooks/useToastNotificationItems.js +4 -7
- package/toast-notification/index.js +3 -22
- package/transport/InMemoryDataService/index.js +1 -5
- package/transport/RestDataService/index.js +5 -10
- package/transport/context.js +4 -7
- package/transport/hooks/index.js +2 -18
- package/transport/hooks/useDataService.js +4 -7
- package/transport/hooks/useFileService.js +4 -7
- package/transport/hooks/useRetriveRecords.d.ts +1 -1
- package/transport/hooks/useRetriveRecords.js +12 -17
- package/transport/index.js +2 -20
- package/utils/calculateColumnWidths.js +1 -4
- package/utils/color.js +1 -4
- package/utils/getAttributeFormattedValue.js +12 -18
- package/utils/index.js +2 -18
- package/widget/context.js +2 -5
- package/widget/hooks/index.js +4 -7
- package/widget/index.js +1 -5
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/board/utils.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 =
|
|
11
|
-
CommandBuilder.Form =
|
|
12
|
-
CommandBuilder.Subgrid =
|
|
13
|
-
CommandBuilder.Default =
|
|
14
|
-
})(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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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:
|
|
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
|
-
|
|
28
|
+
ViewCommandBuilder.createNewRecordCommand({
|
|
32
29
|
Icon: icons.New,
|
|
33
30
|
text: strings.new,
|
|
34
31
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.new),
|
|
35
32
|
}),
|
|
36
|
-
|
|
33
|
+
ViewCommandBuilder.createEditRecordCommand({
|
|
37
34
|
Icon: icons.Edit,
|
|
38
35
|
text: strings.edit,
|
|
39
36
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.edit),
|
|
40
37
|
}),
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
78
|
+
deleteRecordCommandStringSet: FormCommandBuilder.defaultDeleteRecordStringSet,
|
|
82
79
|
};
|
|
83
80
|
function createDefaultFormCommands({ icons, strings = DefaultCommandBuilder.defaultFormCommandStrings, localizedSrings, }) {
|
|
84
81
|
return [
|
|
85
82
|
[
|
|
86
|
-
|
|
83
|
+
FormCommandBuilder.createSaveCommand({
|
|
87
84
|
Icon: icons.Save,
|
|
88
85
|
text: strings.save,
|
|
89
86
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.save),
|
|
90
87
|
}),
|
|
91
|
-
|
|
88
|
+
FormCommandBuilder.createSaveAndCloseCommand({
|
|
92
89
|
Icon: icons.SaveAndClose,
|
|
93
90
|
text: strings.saveAndClose,
|
|
94
91
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.saveAndClose),
|
|
95
92
|
}),
|
|
96
|
-
|
|
93
|
+
FormCommandBuilder.createRefreshCommand({
|
|
97
94
|
Icon: icons.Refresh,
|
|
98
95
|
text: strings.refresh,
|
|
99
96
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.refresh),
|
|
100
97
|
}),
|
|
101
|
-
|
|
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:
|
|
117
|
+
deleteRecordCommandStringSet: ViewCommandBuilder.defaultDeleteRecordStringSet,
|
|
121
118
|
};
|
|
122
119
|
function createDefaultSubgridCommands({ icons, strings = defaultSubgridCommandStrings, localizedSrings, }) {
|
|
123
120
|
return [
|
|
124
121
|
[
|
|
125
|
-
|
|
122
|
+
SubgridCommandBuilder.createNewRecordCommand({
|
|
126
123
|
Icon: icons.New,
|
|
127
124
|
text: strings.new,
|
|
128
125
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.new),
|
|
129
126
|
}),
|
|
130
|
-
|
|
127
|
+
SubgridCommandBuilder.createEditRecordCommand({
|
|
131
128
|
Icon: icons.Edit,
|
|
132
129
|
text: strings.edit,
|
|
133
130
|
localizedTexts: extractLocalizedStrings(localizedSrings, (x) => x.edit),
|
|
134
131
|
}),
|
|
135
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 || (
|
|
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
|
-
|
|
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 =
|
|
121
|
+
const localizeSelector = createLocalizedSelector(stringSet, localizedStringSet, context.locale.language);
|
|
125
122
|
try {
|
|
126
123
|
const confirmResult = yield context.utility.openConfirmDialog({
|
|
127
|
-
title:
|
|
128
|
-
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(
|
|
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:
|
|
139
|
-
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 || (
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 || (
|
|
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
|
-
|
|
12
|
-
|
|
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 =
|
|
108
|
+
const localizeSelector = createLocalizedSelector(stringSet, localizedStringSet, context.locale.language);
|
|
112
109
|
try {
|
|
113
110
|
const confirmResult = yield context.utility.openConfirmDialog({
|
|
114
|
-
title:
|
|
115
|
-
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(
|
|
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:
|
|
128
|
-
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
|
|
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
|
|
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
|
|
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
|
|
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 || (
|
|
239
|
+
})(ViewCommandBuilder || (ViewCommandBuilder = {}));
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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';
|