@conduction/nextcloud-vue 2.102.0 → 2.104.0
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/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js +23 -0
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +94 -72
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +18 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js +3 -3
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js +73 -0
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js +99 -64
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +46 -0
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js +37 -2
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +29 -6
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +39 -2
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +14 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +40 -2
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +113 -20
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +387 -359
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +173 -3
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +107 -87
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/useSelfFetchList.js +7 -2
- package/dist/esm/components/CnIndexPage/useSelfFetchList.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +10 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectRow/CnObjectRow.vue.js +1 -1
- package/dist/esm/components/CnObjectRow/CnObjectRow.vue2.js +57 -5
- package/dist/esm/components/CnObjectRow/CnObjectRow.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectRow/CnObjectRow.vue3.js +37 -4
- package/dist/esm/components/CnObjectRow/CnObjectRow.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +97 -3
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +46 -2
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +9 -0
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js.map +1 -0
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js +165 -0
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -0
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js +85 -0
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -0
- package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue.js +1 -1
- package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js +54 -6
- package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js.map +1 -1
- package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js +3 -1
- package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +8 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue.js +1 -1
- package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +18 -2
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
- package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue.js +1 -1
- package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue2.js +19 -0
- package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue3.js +1 -1
- package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +7 -7
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +4 -0
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +4 -0
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/mixins/pageViews.js +8 -1
- package/dist/esm/mixins/pageViews.js.map +1 -1
- package/dist/esm/nextcloud-vue.css +586 -416
- package/dist/esm/utils/nextcloudDirectory.js +18 -1
- package/dist/esm/utils/nextcloudDirectory.js.map +1 -1
- package/dist/esm/utils/sortOrder.js +61 -0
- package/dist/esm/utils/sortOrder.js.map +1 -0
- package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/esm/utils/visibleWhen.js +13 -2
- package/dist/esm/utils/visibleWhen.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +12270 -10936
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +586 -416
- package/l10n/en.json +4 -0
- package/l10n/nl.json +4 -0
- package/package.json +1 -1
- package/src/components/CnActionsBar/CnActionsBar.md +1 -0
- package/src/components/CnActionsBar/CnActionsBar.vue +39 -2
- package/src/components/CnAppRoot/CnAppRoot.md +1 -1
- package/src/components/CnAppRoot/CnAppRoot.vue +21 -4
- package/src/components/CnConversationThread/CnConversationThread.md +17 -0
- package/src/components/CnConversationThread/CnConversationThread.vue +113 -8
- package/src/components/CnConversationThread/CnConversationWidget.vue +60 -1
- package/src/components/CnDashboardPage/CnDashboardPage.md +4 -1
- package/src/components/CnDashboardPage/CnDashboardPage.vue +29 -6
- package/src/components/CnDataTable/CnDataTable.md +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +49 -0
- package/src/components/CnDetailPage/CnDetailPage.md +2 -1
- package/src/components/CnDetailPage/CnDetailPage.vue +40 -2
- package/src/components/CnFormDialog/CnFormDialog.md +1 -1
- package/src/components/CnFormDialog/CnFormDialog.vue +127 -0
- package/src/components/CnIndexPage/CnIndexPage.md +14 -2
- package/src/components/CnIndexPage/CnIndexPage.vue +192 -11
- package/src/components/CnIndexPage/useSelfFetchList.js +6 -1
- package/src/components/CnObjectListWidget/CnObjectListWidget.vue +10 -1
- package/src/components/CnObjectRow/CnObjectRow.vue +95 -1
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +134 -2
- package/src/components/CnSearchSelect/CnSearchSelect.vue +283 -0
- package/src/components/CnSearchSelect/index.js +12 -0
- package/src/components/CnSetupWizard/CnSetupWizard.vue +56 -6
- package/src/components/CnTabsWidget/CnTabsWidget.vue +8 -1
- package/src/components/CnUserSettingsDialog/CnUserSettingsDialog.vue +7 -2
- package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +18 -2
- package/src/components/CnWizardDialog/CnWizardDialog.vue +20 -1
- package/src/components/index.js +1 -0
- package/src/composables/indexSources.js +7 -7
- package/src/css/dialog.css +5 -3
- package/src/css/index-page.css +19 -0
- package/src/css/look-board-index.css +48 -0
- package/src/index.js +1 -0
- package/src/mixins/pageViews.js +8 -1
- package/src/schemas/app-manifest-v2.schema.json +75 -6
- package/src/utils/nextcloudDirectory.js +17 -0
- package/src/utils/sortOrder.js +58 -0
- package/src/utils/validateManifestV2.compiled.js +3 -3
- package/src/utils/visibleWhen.js +13 -2
|
@@ -55,6 +55,7 @@ import { DEFAULT_ROW_INDICATOR_CAP } from '../../utils/rowIndicators.js';
|
|
|
55
55
|
import { viewMatchesScope, extractViewState, buildRouteQueryFromViewState, extractViewStateFromRouteQuery, buildViewCreatePayload, savedViewScope, normalizeSharedWith } from '../../utils/savedViewHelpers.js';
|
|
56
56
|
import { fieldsFromSchema, columnsFromSchema } from '../../utils/schema.js';
|
|
57
57
|
import { resolveScopeLayout, resolveScopePresentation } from '../../utils/scopeListLayout.js';
|
|
58
|
+
import { sameSortKeys, orderToSortKeys } from '../../utils/sortOrder.js';
|
|
58
59
|
import { dispatchObjectCreated } from '../../utils/walkthroughSignals.js';
|
|
59
60
|
import __sfc_main$7 from '../CnActionButtons/CnActionButtons.vue.js';
|
|
60
61
|
import __sfc_main$8 from '../CnActionsBar/CnActionsBar.vue.js';
|
|
@@ -728,7 +729,10 @@ var script = {
|
|
|
728
729
|
* case" (manifest `config.headerButtons`). Each is `{ label?, action,
|
|
729
730
|
* variant?, icon?, format?, id? }`: `action` is `add` (the Add flow;
|
|
730
731
|
* its label defaults to the Add label), `export` (the export leaf in
|
|
731
|
-
* `format`, `csv` by default, else the export dialog
|
|
732
|
+
* `format`, `csv` by default, else the export dialog; with `run` the
|
|
733
|
+
* `headerActions` entry of that id; on an `entitySource` page without
|
|
734
|
+
* `run` and without a `@mass-export` listener it is not drawn),
|
|
735
|
+
* `import`,
|
|
732
736
|
* `refresh`, `save-view` (the save-current-view dialog: the board's
|
|
733
737
|
* "Zoekopdracht opslaan", label "Save view" by default), or the id of a
|
|
734
738
|
* `headerActions` entry; `variant` is
|
|
@@ -908,6 +912,20 @@ var script = {
|
|
|
908
912
|
validator: (v) => ['', 'toolbar'].includes(v),
|
|
909
913
|
},
|
|
910
914
|
|
|
915
|
+
/**
|
|
916
|
+
* Where the board look's search field sits (manifest
|
|
917
|
+
* `config.searchPlacement`): `''` (the default) opens row 2 with it,
|
|
918
|
+
* `'toolbar'` puts it on row 1 before the Filter button and the view
|
|
919
|
+
* switch (DqTeamwachtrij).
|
|
920
|
+
*
|
|
921
|
+
* @type {''|'toolbar'}
|
|
922
|
+
*/
|
|
923
|
+
searchPlacement: {
|
|
924
|
+
type: String,
|
|
925
|
+
default: '',
|
|
926
|
+
validator: (v) => ['', 'toolbar'].includes(v),
|
|
927
|
+
},
|
|
928
|
+
|
|
911
929
|
/**
|
|
912
930
|
* How the quick filters render: `'chips'` (pill strip, default) or
|
|
913
931
|
* `'dropdown'` (a single `NcSelect`). Sourced from the manifest as
|
|
@@ -1854,6 +1872,16 @@ var script = {
|
|
|
1854
1872
|
default: false,
|
|
1855
1873
|
},
|
|
1856
1874
|
|
|
1875
|
+
/**
|
|
1876
|
+
* `false` draws no inline search in the actions bar, also in the board
|
|
1877
|
+
* look, which otherwise draws one on every index page. Fed from the
|
|
1878
|
+
* manifest as `pages[].config.search`.
|
|
1879
|
+
*/
|
|
1880
|
+
search: {
|
|
1881
|
+
type: Boolean,
|
|
1882
|
+
default: true,
|
|
1883
|
+
},
|
|
1884
|
+
|
|
1857
1885
|
/**
|
|
1858
1886
|
* Keep the "Showing X of Y" counter visible beside the inline search field,
|
|
1859
1887
|
* after any `#after-search` controls (only relevant with `inlineSearch`,
|
|
@@ -1921,12 +1949,28 @@ var script = {
|
|
|
1921
1949
|
default: () => [],
|
|
1922
1950
|
},
|
|
1923
1951
|
|
|
1924
|
-
/**
|
|
1952
|
+
/**
|
|
1953
|
+
* Selected value of the standalone sort dropdown. Empty lets a
|
|
1954
|
+
* self-fetch page show the option matching its current order.
|
|
1955
|
+
*/
|
|
1925
1956
|
sortSelectValue: {
|
|
1926
1957
|
type: String,
|
|
1927
1958
|
default: '',
|
|
1928
1959
|
},
|
|
1929
1960
|
|
|
1961
|
+
/**
|
|
1962
|
+
* The order a self-fetch page opens on when neither the address nor
|
|
1963
|
+
* `sortKeys`/`sortKey` gives one (manifest `config.defaultOrder`):
|
|
1964
|
+
* `"-createdAt"`, `"priority:desc,title"`, an `_order` map or a
|
|
1965
|
+
* `[{ key, order }]` list.
|
|
1966
|
+
*
|
|
1967
|
+
* @type {string|object|Array}
|
|
1968
|
+
*/
|
|
1969
|
+
defaultOrder: {
|
|
1970
|
+
type: [String, Object, Array],
|
|
1971
|
+
default: '',
|
|
1972
|
+
},
|
|
1973
|
+
|
|
1930
1974
|
/** MDI icon name for the list view-toggle option (manifest `config.listIcon`) */
|
|
1931
1975
|
listIcon: {
|
|
1932
1976
|
type: String,
|
|
@@ -1960,6 +2004,9 @@ var script = {
|
|
|
1960
2004
|
* defaults to `field`).
|
|
1961
2005
|
* - `folders` — explicit folder list for `source:'custom'`.
|
|
1962
2006
|
* - `allLabel` / `title` / `allowCreate` — passed to CnFolderSidebar.
|
|
2007
|
+
* - `pane` — `false` draws no pane: the scope still comes from the
|
|
2008
|
+
* deep-link filter (`?caseType=<id>`) and still applies its look, as
|
|
2009
|
+
* a list narrowed to one case type does without a folder column.
|
|
1963
2010
|
*
|
|
1964
2011
|
* A folder entry is also a SCOPE: it may carry `columns`, `defaultSort`
|
|
1965
2012
|
* and `searchFields`, and while it is selected the list is shown that
|
|
@@ -3593,6 +3640,17 @@ var script = {
|
|
|
3593
3640
|
return { shown, total: Math.max(shown, Number(this.effectivePagination?.total || 0)) }
|
|
3594
3641
|
},
|
|
3595
3642
|
|
|
3643
|
+
/**
|
|
3644
|
+
* Whether the folder pane is drawn: a `folderSidebar` without
|
|
3645
|
+
* `pane: false`.
|
|
3646
|
+
*
|
|
3647
|
+
* @spec openspec/changes/folder-sidebar-pane-off/specs/index-page/spec.md#requirement-a-folder-scope-without-a-pane
|
|
3648
|
+
* @return {boolean}
|
|
3649
|
+
*/
|
|
3650
|
+
showsFolderPane() {
|
|
3651
|
+
return Boolean(this.folderSidebar) && this.folderSidebar.pane !== false
|
|
3652
|
+
},
|
|
3653
|
+
|
|
3596
3654
|
/**
|
|
3597
3655
|
* The CnFolderSidebar source. A `register` source is fetched by this
|
|
3598
3656
|
* component and handed to CnFolderSidebar as a `custom` folder list.
|
|
@@ -3641,6 +3699,60 @@ var script = {
|
|
|
3641
3699
|
return match || null
|
|
3642
3700
|
},
|
|
3643
3701
|
|
|
3702
|
+
/**
|
|
3703
|
+
* The heading above the list for the selected folder: on a `groups`
|
|
3704
|
+
* pane (or with `folderSidebar.heading: true`), its name and, under
|
|
3705
|
+
* it, its parent folder and its count. The count reads
|
|
3706
|
+
* `folderSidebar.countText` (`{count}`, through the app's translate),
|
|
3707
|
+
* else "{count} members" on a groups pane.
|
|
3708
|
+
*
|
|
3709
|
+
* @return {{name: string, subtitle: string}|null} The heading, or null on All.
|
|
3710
|
+
*/
|
|
3711
|
+
scopeHeading() {
|
|
3712
|
+
const cfg = this.folderSidebar;
|
|
3713
|
+
const scope = this.activeScope;
|
|
3714
|
+
if (!cfg || !scope || !(cfg.source === 'groups' || cfg.heading === true)) {
|
|
3715
|
+
return null
|
|
3716
|
+
}
|
|
3717
|
+
const idField = this.folderPassthroughIdField;
|
|
3718
|
+
const name = String(this.getByPath(scope, this.folderPassthroughNameField) ?? this.selectedFolderId);
|
|
3719
|
+
const parentId = scope.parentId ?? scope.parent ?? null;
|
|
3720
|
+
const parent = parentId === null || parentId === undefined
|
|
3721
|
+
? null
|
|
3722
|
+
: this.folderSidebarFolders.find((f) => f && String(this.getByPath(f, idField)) === String(parentId));
|
|
3723
|
+
const parts = [];
|
|
3724
|
+
if (parent) {
|
|
3725
|
+
parts.push(String(this.getByPath(parent, this.folderPassthroughNameField) ?? parentId));
|
|
3726
|
+
}
|
|
3727
|
+
if (typeof scope.count === 'number') {
|
|
3728
|
+
if (cfg.countText) {
|
|
3729
|
+
parts.push(this.cnTranslate(cfg.countText).replace('{count}', String(scope.count)));
|
|
3730
|
+
} else if (cfg.source === 'groups') {
|
|
3731
|
+
parts.push(translatePlural('nextcloud-vue', '{count} member', '{count} members', scope.count, { count: scope.count }));
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
return { name, subtitle: parts.join(' · ') }
|
|
3735
|
+
},
|
|
3736
|
+
|
|
3737
|
+
/**
|
|
3738
|
+
* The sort select's shown value: `sortSelectValue` when the host
|
|
3739
|
+
* controls it, else on a self-fetch page the option whose order is the
|
|
3740
|
+
* list's current order (a header click that matches one shows it).
|
|
3741
|
+
*
|
|
3742
|
+
* @return {string} The option value, or '' when none matches.
|
|
3743
|
+
*/
|
|
3744
|
+
effectiveSortSelectValue() {
|
|
3745
|
+
if (this.sortSelectValue) {
|
|
3746
|
+
return this.sortSelectValue
|
|
3747
|
+
}
|
|
3748
|
+
if (!this.isSelfFetchMode || !this.list || !this.list.sortKeys) {
|
|
3749
|
+
return ''
|
|
3750
|
+
}
|
|
3751
|
+
const current = this.list.sortKeys.value || [];
|
|
3752
|
+
const match = (this.sortSelectOptions || []).find((o) => o && sameSortKeys(this.sortSelectKeys(o), current));
|
|
3753
|
+
return match ? match.value : ''
|
|
3754
|
+
},
|
|
3755
|
+
|
|
3644
3756
|
/**
|
|
3645
3757
|
* The `x-index` block the active scope's own schema row carries, for a
|
|
3646
3758
|
* folder list derived from a register. Empty for every other source:
|
|
@@ -5414,6 +5526,7 @@ var script = {
|
|
|
5414
5526
|
variant: button.variant === 'primary' ? 'primary' : 'secondary',
|
|
5415
5527
|
icon,
|
|
5416
5528
|
format: button.format === 'excel' ? 'excel' : 'csv',
|
|
5529
|
+
run: typeof button.run === 'string' ? button.run : '',
|
|
5417
5530
|
items: Array.isArray(button.items)
|
|
5418
5531
|
? button.items.filter((item) => (typeof item === 'string' && item !== '')
|
|
5419
5532
|
|| (item && typeof item === 'object' && typeof item.heading === 'string' && item.heading !== ''))
|
|
@@ -5421,6 +5534,10 @@ var script = {
|
|
|
5421
5534
|
}
|
|
5422
5535
|
})
|
|
5423
5536
|
.filter((button) => button.label !== '')
|
|
5537
|
+
// An Export with nothing to export through is not drawn: a
|
|
5538
|
+
// named or endpoint source with no `run` and no `@mass-export`
|
|
5539
|
+
// listener.
|
|
5540
|
+
.filter((button) => button.action !== 'export' || this.headerExportAvailable(button))
|
|
5424
5541
|
// The Actions menu lists the page's header actions (or the
|
|
5425
5542
|
// entries its `items` name), so a menu with nothing to list
|
|
5426
5543
|
// is not drawn.
|
|
@@ -7209,7 +7326,9 @@ var script = {
|
|
|
7209
7326
|
if (button.action === 'add') {
|
|
7210
7327
|
this.onAddClick();
|
|
7211
7328
|
} else if (button.action === 'export') {
|
|
7212
|
-
if (
|
|
7329
|
+
if (button.run) {
|
|
7330
|
+
this.onHeaderAction({ action: button.run, id: button.run });
|
|
7331
|
+
} else if (this.register && this.exportSchemaSlug) {
|
|
7213
7332
|
this.onExportClick(button.format);
|
|
7214
7333
|
} else {
|
|
7215
7334
|
this.showExportDialog = true;
|
|
@@ -7225,6 +7344,25 @@ var script = {
|
|
|
7225
7344
|
}
|
|
7226
7345
|
},
|
|
7227
7346
|
|
|
7347
|
+
/**
|
|
7348
|
+
* Whether a header Export has something to export through. Any page
|
|
7349
|
+
* listing OpenRegister objects (self-fetch or the consumer's
|
|
7350
|
+
* `objects`) keeps it; a named or endpoint source (`entitySource`)
|
|
7351
|
+
* needs a `run` naming one of the page's header actions, or a
|
|
7352
|
+
* `@mass-export` listener.
|
|
7353
|
+
*
|
|
7354
|
+
* @spec openspec/changes/index-header-export-source/specs/index-page/spec.md#requirement-a-header-export-is-drawn-only-when-it-can-export
|
|
7355
|
+
* @param {{run?: string}} button The resolved header button.
|
|
7356
|
+
* @return {boolean}
|
|
7357
|
+
*/
|
|
7358
|
+
headerExportAvailable(button) {
|
|
7359
|
+
if (!this.isNamedSource || (button && button.run)) {
|
|
7360
|
+
return true
|
|
7361
|
+
}
|
|
7362
|
+
const props = this.$ && this.$.vnode && this.$.vnode.props;
|
|
7363
|
+
return Boolean(props && typeof props.onMassExport === 'function')
|
|
7364
|
+
},
|
|
7365
|
+
|
|
7228
7366
|
/**
|
|
7229
7367
|
* Click dispatch from CnActionsBar's `@header-action`. Looks
|
|
7230
7368
|
* up the resolved entry by id, invokes its handler if any,
|
|
@@ -7345,6 +7483,38 @@ var script = {
|
|
|
7345
7483
|
this.$emit('quick-filter-change', this.selectedQuickFilterIndices);
|
|
7346
7484
|
},
|
|
7347
7485
|
|
|
7486
|
+
/**
|
|
7487
|
+
* The sort keys a sort-select option stands for: its `order` (any
|
|
7488
|
+
* `orderToSortKeys` form), else its `value` read as an order.
|
|
7489
|
+
*
|
|
7490
|
+
* @param {object} option A `sortSelectOptions` entry.
|
|
7491
|
+
* @return {Array<{key: string, order: string}>} The sort keys.
|
|
7492
|
+
*/
|
|
7493
|
+
sortSelectKeys(option) {
|
|
7494
|
+
if (!option) {
|
|
7495
|
+
return []
|
|
7496
|
+
}
|
|
7497
|
+
return orderToSortKeys(option.order !== undefined ? option.order : option.value)
|
|
7498
|
+
},
|
|
7499
|
+
|
|
7500
|
+
/**
|
|
7501
|
+
* A choice in the sort select. On a self-fetch page it orders the list
|
|
7502
|
+
* as a header click does (`_order`, kept in the address); every page
|
|
7503
|
+
* also emits `sort-change` with the value.
|
|
7504
|
+
*
|
|
7505
|
+
* @param {string} value The chosen option's value.
|
|
7506
|
+
* @return {void}
|
|
7507
|
+
*/
|
|
7508
|
+
onSortSelectChange(value) {
|
|
7509
|
+
const option = (this.sortSelectOptions || []).find((o) => o && o.value === value);
|
|
7510
|
+
const keys = this.sortSelectKeys(option);
|
|
7511
|
+
if (option && keys.length > 0 && this.isSelfFetchMode && typeof this.list.onSort === 'function') {
|
|
7512
|
+
this.list.onSort({ key: keys[0].key, order: keys[0].order, keys });
|
|
7513
|
+
this.persistViewStateToRoute(this.currentViewState());
|
|
7514
|
+
}
|
|
7515
|
+
this.$emit('sort-change', value);
|
|
7516
|
+
},
|
|
7517
|
+
|
|
7348
7518
|
/**
|
|
7349
7519
|
* @param {{key: string, order: string, keys?: Array<{key: string, order: string}>}} payload Sort change from CnDataTable.
|
|
7350
7520
|
* @return {void}
|