zova-module-a-routertabs 5.1.13 → 5.1.15
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/.metadata/component/routerViewTabs.d.ts +5 -0
- package/dist/.metadata/component/routerViewTabs.d.ts.map +1 -1
- package/dist/component/routerViewTabs/controller.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/tabs.d.ts.map +1 -1
- package/package.json +2 -2
- package/rest/components.ts +1 -1
- package/src/.metadata/component/routerViewTabs.ts +16 -5
- package/src/component/routerViewTabs/controller.tsx +6 -1
- package/src/model/tabs.ts +35 -10
- package/rest/component/routerViewTabs.ts +0 -7
|
@@ -17,5 +17,10 @@ export declare const ZRouterViewTabs: import("vue").DefineSetupFnComponent<TypeC
|
|
|
17
17
|
} | {
|
|
18
18
|
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
19
19
|
}), import("vue").PublicProps>;
|
|
20
|
+
declare module 'zova-module-a-bean' {
|
|
21
|
+
interface IVonaComponentRecord {
|
|
22
|
+
'a-routertabs:routerViewTabs': ControllerRouterViewTabsProps;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
20
25
|
export {};
|
|
21
26
|
//# sourceMappingURL=routerViewTabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerViewTabs.d.ts","sourceRoot":"","sources":["../../../src/.metadata/component/routerViewTabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAKrD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAEnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,MAAM,MAAM,uCAAuC,GAAG;IACpD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACzD,GAAG,6BAA6B,CAAC;AAElC,KAAK,oBAAoB,GAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"routerViewTabs.d.ts","sourceRoot":"","sources":["../../../src/.metadata/component/routerViewTabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAKrD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAEnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,MAAM,MAAM,uCAAuC,GAAG;IACpD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACzD,GAAG,6BAA6B,CAAC;AAElC,KAAK,oBAAoB,GAAG,wBAAwB,CAClD,6BAA6B,EAC7B,MAAM,OAAO,wBAAwB,CAAC,aAAa,CACpD,CAAC;AACF,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAiB,wBAAwB;QACvC,MAAM,EAAE,oBAAoB,CAAC;KAC9B;CACF;AAED,eAAO,MAAM,eAAe;oBAbV,CAAC,GAAG,EAAE,wBAAwB,KAAK,IAAI;;;;;8BAmBxD,CAAC;AACF,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAiB,oBAAoB;QACnC,6BAA6B,EAAE,6BAA6B,CAAC;KAC9D;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/component/routerViewTabs/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/component/routerViewTabs/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,WAAW,6BAA8B,SAAQ,oBAAoB;CAAG;AAE9E,qBACa,wBAAyB,SAAQ,kBAAkB;IAC9D,MAAM,CAAC,aAAa,KAAM;IAG1B,WAAW,EAAE,SAAS,CAAC;IAEhB,SAAS,CAAC,KAAK,EAAE,oCAAoC;IAKrD,YAAY,CAAC,KAAK,EAAE,oCAAoC;IAKxD,WAAW,CAAC,KAAK,EAAE,oCAAoC,EAAE,QAAQ,EAAE,SAAS;IAInF,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,oCAAoC,GAAG,mBAAmB;IAI5F,SAAS,CAAC,mBAAmB,IAAI,MAAM,EAAE,GAAG,SAAS;CAGtD"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Use","Controller","BeanRouterViewBase","ControllerRouterViewTabs","_dec","_dec2","__z_BeanInfo","module","_dec3","injectionScope","_dec4","Reflect","metadata","ModelTabs","Object","_class","_class2","_ControllerRouterViewTabs","constructor","args","_initializerDefineProperty","_descriptor","backRoute","route","$$modelTabs","forwardRoute","setPageMeta","pageMeta","prepareRouteMeta","getKeepAliveInclude","keepAliveInclude","$propsDefault","_applyDecoratedDescriptor","prototype","configurable","enumerable","writable","initializer"],"sources":["../src/model/tabs.ts","../src/component/routerViewTabs/controller.tsx","../src/.metadata/component/routerViewTabs.ts","../src/.metadata/index.ts"],"sourcesContent":["import type { IDecoratorModelOptions, UseQueryOptions } from 'zova-module-a-model';\n\nimport { RouteLocationNormalizedLoaded, RouteLocationNormalizedLoadedGeneric } from '@cabloy/vue-router';\nimport { mutate } from 'mutate-on-copy';\nimport { deepEqual, deepExtend, TypeEventOff, useComputed } from 'zova';\nimport { BeanModelBase, Model } from 'zova-module-a-model';\nimport { IPageMeta, IRouteViewRouteItem, IRouteViewRouteMeta } from 'zova-module-a-router';\n\nimport { ModelTabsOptions, ModelTabsOptionsBase, RouteTab, RouteTabInitial, RouteTabTransient } from '../types/tabs.js';\n\nexport interface IModelOptionsTabs extends IDecoratorModelOptions, ModelTabsOptionsBase {}\n\n@Model<IModelOptionsTabs>({\n enableSelector: true,\n max: -1,\n maxItems: -1,\n cache: false,\n})\nexport class ModelTabs extends BeanModelBase {\n tabsOptions: ModelTabsOptions;\n tabs: RouteTab[];\n componentKeyCurrent?: string;\n tabKeyCurrent?: string;\n tabCurrentIndex: number;\n tabCurrent?: RouteTab;\n keepAliveInclude: string[];\n private _eventSsrHmrReload: TypeEventOff;\n\n protected async __init__(scene: string, options?: ModelTabsOptions) {\n await super.__init__(scene);\n this.bean._setBean('$$modelTabs', this);\n // options\n this.tabsOptions = deepExtend({}, this.$onionOptions, options);\n // computed\n this.tabCurrentIndex = useComputed(() => {\n const [index] = this.findTab(this.tabKeyCurrent);\n return index;\n });\n this.tabCurrent = useComputed(() => {\n const [, tab] = this.findTab(this.tabKeyCurrent);\n return tab;\n });\n this.keepAliveInclude = useComputed(() => {\n return this._getKeepAliveInclude();\n });\n // componentKeyCurrent\n const queryOptionsComponentKeyCurrent: UseQueryOptions<string> = {\n queryKey: ['componentKeyCurrent'],\n };\n this.componentKeyCurrent = this.$useStateMem(queryOptionsComponentKeyCurrent);\n // tabKeyCurrent\n const queryOptionsTabKeyCurrent: UseQueryOptions<string> = {\n queryKey: ['tabKeyCurrent'],\n };\n this.tabKeyCurrent = this.$useStateMem(queryOptionsTabKeyCurrent);\n // if (this.tabsOptions.cache) {\n // this.tabKeyCurrent = this.$useStateDb(queryOptionsTabKeyCurrent);\n // } else {\n // this.tabKeyCurrent = this.$useStateMem(queryOptionsTabKeyCurrent);\n // }\n // tabs\n const queryOptionsTabs: UseQueryOptions<RouteTab[]> = {\n queryKey: ['tabs'],\n meta: {\n defaultData: this._getInitialTabs(),\n },\n };\n if (this.tabsOptions.cache) {\n this.tabs = this.$useStateDb(queryOptionsTabs);\n } else {\n this.tabs = this.$useStateMem(queryOptionsTabs);\n }\n // load cache\n if (this.tabsOptions.cache) {\n // await this.$loadStateDb(this.tabKeyCurrent);\n await this.$loadStateDb(this.tabs);\n }\n // reset pageDirty\n this._resetAllPageDirty();\n // first route\n if (this.$currentRoute) {\n this.forwardRoute(this.$currentRoute);\n }\n // event\n if (process.env.CLIENT && this.sys.config.ssr.hmr) {\n this._eventSsrHmrReload = this.sys.meta.event.on('a-ssrhmr:reload', async (_data, next) => {\n this.updateAllTabInfos();\n return next();\n });\n }\n // locale\n this.$watch(\n () => {\n return this.app.meta.locale.current;\n },\n () => {\n this.updateAllTabInfos();\n },\n );\n }\n\n protected __dispose__() {\n if (this._eventSsrHmrReload) {\n this._eventSsrHmrReload();\n }\n }\n\n get cache() {\n return this.tabsOptions.cache;\n }\n\n // need not async\n addTab(tab: RouteTabTransient, affix?: boolean): boolean {\n const res = this._addTab(tab, affix);\n // current\n this.tabKeyCurrent = res ? tab.tabKey : undefined;\n this.componentKeyCurrent = res ? tab.componentKey : undefined;\n return res;\n }\n\n // need not async\n _addTab(tab: Partial<RouteTabTransient>, affix?: boolean): boolean {\n const tabKey = tab.tabKey;\n if (!tabKey) return false;\n // tab\n const [index, tabOld] = this.findTab(tabKey);\n // tabInfo\n const tabInfo = this.tabsOptions.getTabInfo?.(tabKey) ?? tabOld?.info;\n if (!tabInfo) return false;\n // tabs\n if (index === -1) {\n // new\n const items: IRouteViewRouteItem[] = tab.componentKey\n ? [\n {\n componentKey: tab.componentKey!,\n fullPath: tab.fullPath!,\n keepAlive: tab.keepAlive,\n updatedAt: Date.now(),\n },\n ]\n : [];\n const tabNew: RouteTab = {\n tabKey,\n affix,\n items,\n updatedAt: Date.now(),\n info: tabInfo,\n };\n if (this.tabCurrentIndex === -1) {\n this.tabs = mutate(this.tabs, copyState => {\n copyState.push(tabNew);\n });\n } else {\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(this.tabCurrentIndex + 1, 0, tabNew);\n });\n }\n // need not await\n this.pruneTabs();\n } else {\n // update tabInfo\n if (!deepEqual(tabInfo, tabOld?.info)) {\n this.updateTabInfo(tabKey);\n }\n // update\n if (!this._checkIfTabNeedUpdate(tabOld!, tab)) {\n return true;\n }\n this.updateTab(tab);\n // need not await\n this.pruneTabItems(tabKey);\n }\n return true;\n }\n\n updateAllTabInfos(tabInitials?: RouteTabInitial[]) {\n for (const tab of this.tabs) {\n const tabInitial = tabInitials?.find(item => item.tabKey === tab.tabKey);\n this.updateTabInfo(tab.tabKey, tabInitial);\n }\n }\n\n updateTabInfo(tabKey?: string, tabInitial?: RouteTabInitial) {\n if (!tabKey) return;\n // tabs\n const [index, tabOld] = this.findTab(tabKey);\n if (index === -1) return;\n // tabInfo\n const tabInfo = this.tabsOptions.getTabInfo ? this.tabsOptions.getTabInfo(tabKey) : (tabInitial?.info ?? tabOld?.info);\n if (!tabInfo) return;\n // update\n const tabNew = { ...tabOld, info: tabInfo };\n this.updateTab(tabNew);\n }\n\n updateTabItemPageMeta(tabKey?: string, componentKey?: string, pageMeta?: IPageMeta) {\n if (!tabKey || !componentKey) return false;\n // tab\n const [index, tab] = this.findTab(tabKey);\n if (index === -1 || !tab) return false;\n // tabItem\n if (!tab.items) return false;\n const indexItem = tab.items.findIndex(item => item.componentKey === componentKey);\n if (indexItem === -1) return false;\n const tabItem = tab.items[indexItem];\n // change tab item\n const pageMetaNew: IPageMeta = { ...tabItem.pageMeta, ...pageMeta };\n const tabItemNew: IRouteViewRouteItem = { ...tabItem, pageMeta: pageMetaNew };\n const items = mutate(tab.items, copyState => {\n copyState.splice(indexItem, 1, tabItemNew);\n });\n const tabNew: RouteTab = { ...tab, items };\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1, tabNew);\n });\n return true;\n }\n\n async deleteTab(tabKey?: string, noActiveNext?: boolean) {\n if (!tabKey) return;\n // tabs\n const [index] = this.findTab(tabKey);\n if (index === -1) return;\n // active next\n let tabKeyActiveNext;\n if (!noActiveNext && index === this.tabCurrentIndex) {\n // prev/next\n const tabCurrentIndex = index + 1 < this.tabs.length ? index + 1 : index - 1 > -1 ? index - 1 : -1;\n if (tabCurrentIndex > -1) {\n tabKeyActiveNext = this.tabs[tabCurrentIndex]?.tabKey;\n }\n }\n // tabs\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1);\n });\n // active next\n if (tabKeyActiveNext) {\n await this.activeTab(tabKeyActiveNext);\n }\n }\n\n async deleteTabItem(tabKey?: string, componentKey?: string, noActiveNext?: boolean) {\n if (!tabKey || !componentKey) return false;\n if (tabKey === componentKey) return false; // not delete first tabItem\n // tab\n const [index, tab] = this.findTab(tabKey);\n if (index === -1 || !tab) return false;\n // indexItem\n if (!tab.items) return false;\n const indexItem = tab.items.findIndex(item => item.componentKey === componentKey);\n if (indexItem === -1) return false;\n // deleteTab if length===1\n if (tab.items.length === 1 && !tab.affix) {\n // delete tab\n await this.deleteTab(tabKey, noActiveNext);\n return true;\n }\n // active next\n let componentKeyActiveNext;\n if (!noActiveNext && componentKey === this.componentKeyCurrent) {\n // prev/next\n const tabItemCurrentIndex = indexItem + 1 < tab.items.length ? indexItem + 1 : indexItem - 1 > -1 ? indexItem - 1 : -1;\n if (tabItemCurrentIndex > -1) {\n componentKeyActiveNext = tab.items[tabItemCurrentIndex]?.componentKey;\n }\n }\n // delete tab item\n const items = mutate(tab.items, copyState => {\n copyState.splice(indexItem, 1);\n });\n const tabNew: RouteTab = { ...tab, items };\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1, tabNew);\n });\n // active next\n if (componentKeyActiveNext) {\n await this.activeTabItem(tabKey, componentKeyActiveNext);\n }\n return true;\n }\n\n findTabItemByFullPath(fullPath: string) {\n for (const tab of this.tabs) {\n if (!tab.items) continue;\n for (const item of tab.items) {\n if (item.fullPath === fullPath) {\n return [tab.tabKey, item.componentKey];\n }\n }\n }\n return [];\n }\n\n updateTab(tab: Partial<RouteTabTransient>) {\n const tabKey = tab.tabKey!;\n const [index, tabOld] = this.findTab(tabKey);\n if (index === -1 || !tabOld) return;\n const items: IRouteViewRouteItem[] = tabOld.items ? ([] as IRouteViewRouteItem[]).concat(tabOld.items) : [];\n if (tab.componentKey) {\n const tabItem: IRouteViewRouteItem = {\n componentKey: tab.componentKey,\n fullPath: tab.fullPath!,\n keepAlive: tab.keepAlive,\n updatedAt: Date.now(),\n };\n const index = items.findIndex(item => item.componentKey === tab.componentKey);\n if (index === -1) {\n items.push(tabItem);\n } else {\n const tabItemNew: IRouteViewRouteItem = { ...items[index], ...tabItem };\n items.splice(index, 1, tabItemNew);\n }\n // not use fullPath, because fullPath has query string\n items.sort((a, b) => (a.componentKey === tabKey ? 0 : 1) - (b.componentKey === tabKey ? 0 : 1));\n }\n const tabNew: RouteTab = {\n ...tabOld,\n ...tab,\n tabKey,\n items,\n updatedAt: Date.now(),\n };\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1, tabNew);\n });\n }\n\n async activeTab(tabKey?: string) {\n if (!tabKey) return;\n const [_, tab] = this.findTab(tabKey);\n if (!tab) return;\n // should not updateTab here\n // this.updateTab({ tabKey });\n // this.tabKeyCurrent = tabKey;\n // first check tab.items?.[0]?.fullPath, because fullPath maybe has query string\n const tabItemFirst = tab.items?.[0];\n const path = tabItemFirst?.componentKey === tabKey ? tabItemFirst.fullPath : tabKey;\n await this.$router.push(path);\n }\n\n async activeTabItem(tabKey?: string, componentKey?: string) {\n if (!tabKey || !componentKey) return;\n const [_, tab] = this.findTab(tabKey);\n if (!tab) return;\n const tabItem = tab.items?.find(item => item.componentKey === componentKey);\n if (!tabItem) return;\n //\n const path = tabItem.fullPath;\n await this.$router.push(path);\n }\n\n findTab(tabKey?: string): [number, RouteTab | undefined] {\n if (!tabKey) return [-1, undefined];\n const index = this.tabs.findIndex(item => item.tabKey === tabKey);\n if (index === -1) return [index, undefined];\n return [index, this.tabs[index]];\n }\n\n async pruneTabs() {\n let max = this.tabsOptions.max;\n if (max === undefined || max === -1) return;\n if (max < 1) max = 1;\n while (true) {\n const affixCount = this.tabs.filter(item => item.affix).length;\n if (this.tabs.length - affixCount <= max) break;\n let tabKey: string | undefined;\n let updatedAt = Date.now();\n for (const tab of this.tabs) {\n if (!tab.affix && tab.updatedAt < updatedAt) {\n tabKey = tab.tabKey;\n updatedAt = tab.updatedAt;\n }\n }\n if (!tabKey) break;\n await this.deleteTab(tabKey, true);\n }\n }\n\n async pruneTabItems(tabKey?: string) {\n if (!tabKey) return;\n let maxItems = this.tabsOptions.maxItems;\n if (maxItems === undefined || maxItems === -1) return;\n if (maxItems < 1) maxItems = 1;\n while (true) {\n const [_, tab] = this.findTab(tabKey);\n if (!tab || !tab.items) break;\n const ignoreCount = tab.items.filter(item => item.componentKey === tabKey).length;\n if (tab.items.length - ignoreCount <= maxItems) break;\n let componentKey: string | undefined;\n let updatedAt = Date.now();\n for (const tabItem of tab.items) {\n if (tabItem.componentKey !== tabKey && tabItem.updatedAt < updatedAt) {\n componentKey = tabItem.componentKey;\n updatedAt = tabItem.updatedAt;\n }\n }\n if (!componentKey) break;\n await this.deleteTabItem(tabKey, componentKey, true);\n }\n }\n\n // special for _addTab\n private _checkIfTabNeedUpdate(tabOld: RouteTab, tabNew: Partial<RouteTabTransient>) {\n for (const key in tabNew) {\n if (['fullPath', 'keepAlive', 'updatedAt'].includes(key)) continue;\n if (['componentKey'].includes(key)) {\n if (!tabOld.items) return true;\n const tabItemOld = tabOld.items.find(item => item[key] === tabNew[key]);\n if (!tabItemOld) return true;\n for (const key2 of ['fullPath', 'keepAlive']) {\n if (tabItemOld[key2] !== tabNew[key2]) return true;\n }\n const recentItemIndex = tabOld.items.findIndex(item => item[key] !== tabItemOld[key] && (item.updatedAt ?? 0) >= (tabItemOld.updatedAt ?? 0));\n if (recentItemIndex > -1) return true;\n } else if (tabNew[key] !== tabOld[key]) {\n return true;\n }\n }\n const recentTabIndex = this.tabs.findIndex(item => item.tabKey !== tabOld.tabKey && (item.updatedAt ?? 0) >= (tabOld.updatedAt ?? 0));\n if (recentTabIndex > -1) return true;\n return false;\n }\n\n private _getKeepAliveInclude() {\n const include: string[] = [];\n for (const tab of this.tabs) {\n if (!tab.items) continue;\n for (const item of tab.items) {\n if (item.keepAlive !== false && item.componentKey) {\n if (!include.includes(item.componentKey)) {\n include.push(item.componentKey);\n }\n }\n }\n }\n return include;\n }\n\n private _getInitialTabs() {\n const tabs = this.tabsOptions.getInitialTabs?.() ?? [];\n if (!this.tabsOptions.getTabInfo) return tabs;\n return tabs.map(tab => {\n return {\n ...tab,\n info: this.tabsOptions.getTabInfo?.(tab.tabKey) ?? tab.info,\n };\n });\n }\n\n backRoute(route: RouteLocationNormalizedLoadedGeneric) {\n const [tabKey, componentKey] = this.findTabItemByFullPath(route.fullPath);\n this.deleteTabItem(tabKey, componentKey, true);\n }\n\n forwardRoute(route: RouteLocationNormalizedLoadedGeneric) {\n const routeMeta = this.prepareRouteMeta(route);\n this.addTab(routeMeta);\n }\n\n public setPageMeta(route: RouteLocationNormalizedLoadedGeneric, pageMeta: IPageMeta) {\n const [tabKey, componentKey] = this.findTabItemByFullPath(route.fullPath);\n this.updateTabItemPageMeta(tabKey, componentKey, pageMeta);\n }\n\n prepareRouteMeta(route: RouteLocationNormalizedLoadedGeneric): IRouteViewRouteMeta {\n // fullPath\n const fullPath = route.fullPath;\n // componentKey\n const componentKey = this.__handleRoutePropComponentKey(route);\n // tabKey\n const tabKey = this._handleRouteProp(route, 'tabKey') || componentKey;\n // keepAlive\n const keepAlive = this._handleRouteProp(route, 'keepAlive');\n // tab\n return { tabKey, componentKey, fullPath, keepAlive };\n }\n\n private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop: 'componentKey' | 'tabKey'): string;\n private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop: 'keepAlive'): boolean;\n private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop) {\n let value = route.meta[prop];\n if (typeof value === 'function') {\n value = value.call(this.app, route);\n }\n return value;\n }\n\n private __handleRoutePropComponentKey(route: RouteLocationNormalizedLoaded) {\n const componentKey = this._handleRouteProp(route, 'componentKey');\n if (componentKey) return componentKey;\n // name\n const name = this.$router.getRealRouteName(route.name);\n // path\n if (!name) return route.path;\n // name: nameOnly\n if (route.meta.componentKeyMode === 'nameOnly') return name;\n // name: withParams\n return route.path;\n }\n\n private _resetAllPageDirty() {\n const tabItems: [string, string][] = [];\n for (const tab of this.tabs) {\n if (!tab.items) continue;\n for (const tabItem of tab.items) {\n if (tabItem.pageMeta?.pageDirty) {\n tabItems.push([tab.tabKey, tabItem.componentKey]);\n }\n }\n }\n for (const [tabKey, componentKey] of tabItems) {\n this.updateTabItemPageMeta(tabKey, componentKey, { pageDirty: false });\n }\n }\n}\n","import { RouteLocationNormalizedLoadedGeneric } from '@cabloy/vue-router';\nimport { Use } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\nimport { BeanRouterViewBase, IPageMeta, IRouterViewPropsBase, IRouteViewRouteMeta } from 'zova-module-a-router';\n\nimport type { ModelTabs } from '../../model/tabs.js';\n\nexport interface ControllerRouterViewTabsProps extends IRouterViewPropsBase {}\n\n@Controller()\nexport class ControllerRouterViewTabs extends BeanRouterViewBase {\n static $propsDefault = {};\n\n @Use({ injectionScope: 'skipSelf' })\n $$modelTabs: ModelTabs;\n\n public backRoute(route: RouteLocationNormalizedLoadedGeneric) {\n this.$$modelTabs.backRoute(route);\n return true;\n }\n\n public forwardRoute(route: RouteLocationNormalizedLoadedGeneric) {\n this.$$modelTabs.forwardRoute(route);\n return true;\n }\n\n public setPageMeta(route: RouteLocationNormalizedLoadedGeneric, pageMeta: IPageMeta) {\n this.$$modelTabs.setPageMeta(route, pageMeta);\n }\n\n protected prepareRouteMeta(route: RouteLocationNormalizedLoadedGeneric): IRouteViewRouteMeta {\n return this.$$modelTabs.prepareRouteMeta(route);\n }\n\n protected getKeepAliveInclude(): string[] | undefined {\n return this.$$modelTabs.keepAliveInclude;\n }\n}\n","import type { TypeControllerInnerProps } from 'zova';\n\nimport { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\n\nimport type { ControllerRouterViewTabsProps } from '../../component/routerViewTabs/controller.jsx';\n\nimport { ControllerRouterViewTabs } from '../../component/routerViewTabs/controller.jsx';\nexport type TypeControllerRouterViewTabsPublicProps = {\n controllerRef?: (ref: ControllerRouterViewTabs) => void;\n} & ControllerRouterViewTabsProps;\n\ntype ControllerInnerProps = TypeControllerInnerProps<ControllerRouterViewTabsProps, keyof typeof ControllerRouterViewTabs.$propsDefault>;\ndeclare module 'zova-module-a-routertabs' {\n export interface ControllerRouterViewTabs {\n $props: ControllerInnerProps;\n }\n}\n\nexport const ZRouterViewTabs = defineComponent((_props: TypeControllerRouterViewTabsPublicProps) => {\n useController(ControllerRouterViewTabs, undefined, undefined);\n return () => {};\n}, prepareComponentOptions());\n","// eslint-disable\n/** model: begin */\nexport * from '../model/tabs.js';\nimport { IModelOptionsTabs } from '../model/tabs.js';\nimport 'zova-module-a-model';\ndeclare module 'zova-module-a-model' {\n \n export interface IModelRecord {\n 'a-routertabs:tabs': IModelOptionsTabs;\n }\n\n \n}\ndeclare module 'zova-module-a-routertabs' {\n \n export interface ModelTabs {\n /** @internal */\n get scope(): ScopeModuleARoutertabs;\n }\n\n export interface ModelTabs {\n get $beanFullName(): 'a-routertabs.model.tabs';\n get $onionName(): 'a-routertabs:tabs';\n get $onionOptions(): IModelOptionsTabs;\n } \n}\n/** model: end */\n/** model: begin */\nimport { ModelTabs } from '../model/tabs.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-routertabs.model.tabs': ModelTabs;\n }\n}\n/** model: end */\n/** controller: begin */\nexport * from '../component/routerViewTabs/controller.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-routertabs' {\n \n export interface ControllerRouterViewTabs {\n /** @internal */\n get scope(): ScopeModuleARoutertabs;\n } \n}\n/** controller: end */\n/** controller: begin */\nimport { ControllerRouterViewTabs } from '../component/routerViewTabs/controller.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-routertabs.controller.routerViewTabs': ControllerRouterViewTabs;\n }\n}\n/** controller: end */\n\n/** components: begin */\nexport * from './component/routerViewTabs.js';\nimport { ZRouterViewTabs } from './component/routerViewTabs.js';\nexport const components = {\n 'routerViewTabs': ZRouterViewTabs,\n};\nimport 'zova';\ndeclare module 'zova' {\nexport interface IComponentRecord {\n 'a-routertabs:routerViewTabs': ControllerRouterViewTabs;\n}\nexport interface IZovaComponentRecord {\n 'a-routertabs:routerViewTabs': typeof ZRouterViewTabs;\n}\n}\n/** components: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleARoutertabs extends BeanScopeBase {}\n\nexport interface ScopeModuleARoutertabs {\n util: BeanScopeUtil;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-routertabs': ScopeModuleARoutertabs;\n }\n \n \n\n \n\n \n}\n \n/** scope: end */\n"],"mappings":";;;;;;;AAAA,IAAA,QAAO,SAAO;AAKd,IAAS,eAAe,SAAO,MAAM;CACrC,gBAAkB;;CAElB,UAAS;;CAET,CAAA,EAAA,UAAO,SAAU,EAAA,QAAA,gBAEhB,CAAA,EAAA,OAAM,WAAA,QAAiB,WAAE,MAAA,kBAAA,cAAA;CACxB,YAAA,GAAe,MAAK;AACpB,QAAO,GAAA,KAAA;AACP,OAAA,cAAY,KAAA;AACZ,OAAO,OAAK,KAAA;AACb,OAAA,sBAAA,KAAA;AACD,OAAO,gBAAgB,KAAO;AAC5B,OAAA,kBAAa,KAAgB;AAC7B,OAAM,aAAU,KAAA;AAChB,OAAA,mBAAsB,KAAM;AAC5B,OAAA,qBAAsB,KAAA;;CAEtB,MAAA,SAAa,OAAQ,SAAA;AACrB,QAAA,MAAA,SAAkB,MAAQ;AAC1B,OAAO,KAAC,SAAA,eAAoB,KAAY;AAExC,OAAA,cAA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YAAA;CAAAC,UAAA;CAAAC,aAAA;CAAA,CAAA,EAAArB,SAAA,IAAAD,SAAA,IAAAA;;;ACR3B,IAAS,kBAAA,iBAAsC,WAAS;;AAExD,cAAc;;;;;;ACLd,IAAG,MAAO,OAAA;AAuBV,IAAa,aAAE,EACb,kBAAO,iBACT;AAMA,IAAS,0BAA4B,OAAC,OAAA,EAAA,QAAA,SAAA,EACpC,QAAK,gBACN,CAAC,EAAA,KAAA,SAAA,MAAA,SAAA,MAAA,+BAAA,cAAA,GAAA,IAAA,OAAA,IAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Use","Controller","BeanRouterViewBase","ControllerRouterViewTabs","_dec","_dec2","__z_BeanInfo","module","_dec3","injectionScope","_dec4","Reflect","metadata","ModelTabs","Object","_class","_class2","_ControllerRouterViewTabs","constructor","args","_initializerDefineProperty","_descriptor","backRoute","route","$$modelTabs","forwardRoute","setPageMeta","pageMeta","prepareRouteMeta","getKeepAliveInclude","keepAliveInclude","$propsDefault","_applyDecoratedDescriptor","prototype","configurable","enumerable","writable","initializer"],"sources":["../src/model/tabs.ts","../src/component/routerViewTabs/controller.tsx","../src/.metadata/component/routerViewTabs.ts","../src/.metadata/index.ts"],"sourcesContent":["import type { IDecoratorModelOptions, UseQueryOptions } from 'zova-module-a-model';\n\nimport {\n RouteLocationNormalizedLoaded,\n RouteLocationNormalizedLoadedGeneric,\n} from '@cabloy/vue-router';\nimport { mutate } from 'mutate-on-copy';\nimport { deepEqual, deepExtend, TypeEventOff, useComputed } from 'zova';\nimport { BeanModelBase, Model } from 'zova-module-a-model';\nimport { IPageMeta, IRouteViewRouteItem, IRouteViewRouteMeta } from 'zova-module-a-router';\n\nimport {\n ModelTabsOptions,\n ModelTabsOptionsBase,\n RouteTab,\n RouteTabInitial,\n RouteTabTransient,\n} from '../types/tabs.js';\n\nexport interface IModelOptionsTabs extends IDecoratorModelOptions, ModelTabsOptionsBase {}\n\n@Model<IModelOptionsTabs>({\n enableSelector: true,\n max: -1,\n maxItems: -1,\n cache: false,\n})\nexport class ModelTabs extends BeanModelBase {\n tabsOptions: ModelTabsOptions;\n tabs: RouteTab[];\n componentKeyCurrent?: string;\n tabKeyCurrent?: string;\n tabCurrentIndex: number;\n tabCurrent?: RouteTab;\n keepAliveInclude: string[];\n private _eventSsrHmrReload: TypeEventOff;\n\n protected async __init__(scene: string, options?: ModelTabsOptions) {\n await super.__init__(scene);\n this.bean._setBean('$$modelTabs', this);\n // options\n this.tabsOptions = deepExtend({}, this.$onionOptions, options);\n // computed\n this.tabCurrentIndex = useComputed(() => {\n const [index] = this.findTab(this.tabKeyCurrent);\n return index;\n });\n this.tabCurrent = useComputed(() => {\n const [, tab] = this.findTab(this.tabKeyCurrent);\n return tab;\n });\n this.keepAliveInclude = useComputed(() => {\n return this._getKeepAliveInclude();\n });\n // componentKeyCurrent\n const queryOptionsComponentKeyCurrent: UseQueryOptions<string> = {\n queryKey: ['componentKeyCurrent'],\n };\n this.componentKeyCurrent = this.$useStateMem(queryOptionsComponentKeyCurrent);\n // tabKeyCurrent\n const queryOptionsTabKeyCurrent: UseQueryOptions<string> = {\n queryKey: ['tabKeyCurrent'],\n };\n this.tabKeyCurrent = this.$useStateMem(queryOptionsTabKeyCurrent);\n // if (this.tabsOptions.cache) {\n // this.tabKeyCurrent = this.$useStateDb(queryOptionsTabKeyCurrent);\n // } else {\n // this.tabKeyCurrent = this.$useStateMem(queryOptionsTabKeyCurrent);\n // }\n // tabs\n const queryOptionsTabs: UseQueryOptions<RouteTab[]> = {\n queryKey: ['tabs'],\n meta: {\n defaultData: this._getInitialTabs(),\n },\n };\n if (this.tabsOptions.cache) {\n this.tabs = this.$useStateDb(queryOptionsTabs);\n } else {\n this.tabs = this.$useStateMem(queryOptionsTabs);\n }\n // load cache\n if (this.tabsOptions.cache) {\n // await this.$loadStateDb(this.tabKeyCurrent);\n await this.$loadStateDb(this.tabs);\n }\n // reset pageDirty\n this._resetAllPageDirty();\n // first route\n if (this.$currentRoute) {\n this.forwardRoute(this.$currentRoute);\n }\n // event\n if (process.env.CLIENT && this.sys.config.ssr.hmr) {\n this._eventSsrHmrReload = this.sys.meta.event.on('a-ssrhmr:reload', async (_data, next) => {\n this.updateAllTabInfos();\n return next();\n });\n }\n // locale\n this.$watch(\n () => {\n return this.app.meta.locale.current;\n },\n () => {\n this.updateAllTabInfos();\n },\n );\n }\n\n protected __dispose__() {\n if (this._eventSsrHmrReload) {\n this._eventSsrHmrReload();\n }\n }\n\n get cache() {\n return this.tabsOptions.cache;\n }\n\n // need not async\n addTab(tab: RouteTabTransient, affix?: boolean): boolean {\n const res = this._addTab(tab, affix);\n // current\n this.tabKeyCurrent = res ? tab.tabKey : undefined;\n this.componentKeyCurrent = res ? tab.componentKey : undefined;\n return res;\n }\n\n // need not async\n _addTab(tab: Partial<RouteTabTransient>, affix?: boolean): boolean {\n const tabKey = tab.tabKey;\n if (!tabKey) return false;\n // tab\n const [index, tabOld] = this.findTab(tabKey);\n // tabInfo\n const tabInfo = this.tabsOptions.getTabInfo?.(tabKey) ?? tabOld?.info;\n if (!tabInfo) return false;\n // tabs\n if (index === -1) {\n // new\n const items: IRouteViewRouteItem[] = tab.componentKey\n ? [\n {\n componentKey: tab.componentKey!,\n fullPath: tab.fullPath!,\n keepAlive: tab.keepAlive,\n updatedAt: Date.now(),\n },\n ]\n : [];\n const tabNew: RouteTab = {\n tabKey,\n affix,\n items,\n updatedAt: Date.now(),\n info: tabInfo,\n };\n if (this.tabCurrentIndex === -1) {\n this.tabs = mutate(this.tabs, copyState => {\n copyState.push(tabNew);\n });\n } else {\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(this.tabCurrentIndex + 1, 0, tabNew);\n });\n }\n // need not await\n this.pruneTabs();\n } else {\n // update tabInfo\n if (!deepEqual(tabInfo, tabOld?.info)) {\n this.updateTabInfo(tabKey);\n }\n // update\n if (!this._checkIfTabNeedUpdate(tabOld!, tab)) {\n return true;\n }\n this.updateTab(tab);\n // need not await\n this.pruneTabItems(tabKey);\n }\n return true;\n }\n\n updateAllTabInfos(tabInitials?: RouteTabInitial[]) {\n for (const tab of this.tabs) {\n const tabInitial = tabInitials?.find(item => item.tabKey === tab.tabKey);\n this.updateTabInfo(tab.tabKey, tabInitial);\n }\n }\n\n updateTabInfo(tabKey?: string, tabInitial?: RouteTabInitial) {\n if (!tabKey) return;\n // tabs\n const [index, tabOld] = this.findTab(tabKey);\n if (index === -1) return;\n // tabInfo\n const tabInfo = this.tabsOptions.getTabInfo\n ? this.tabsOptions.getTabInfo(tabKey)\n : (tabInitial?.info ?? tabOld?.info);\n if (!tabInfo) return;\n // update\n const tabNew = { ...tabOld, info: tabInfo };\n this.updateTab(tabNew);\n }\n\n updateTabItemPageMeta(tabKey?: string, componentKey?: string, pageMeta?: IPageMeta) {\n if (!tabKey || !componentKey) return false;\n // tab\n const [index, tab] = this.findTab(tabKey);\n if (index === -1 || !tab) return false;\n // tabItem\n if (!tab.items) return false;\n const indexItem = tab.items.findIndex(item => item.componentKey === componentKey);\n if (indexItem === -1) return false;\n const tabItem = tab.items[indexItem];\n // change tab item\n const pageMetaNew: IPageMeta = { ...tabItem.pageMeta, ...pageMeta };\n const tabItemNew: IRouteViewRouteItem = { ...tabItem, pageMeta: pageMetaNew };\n const items = mutate(tab.items, copyState => {\n copyState.splice(indexItem, 1, tabItemNew);\n });\n const tabNew: RouteTab = { ...tab, items };\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1, tabNew);\n });\n return true;\n }\n\n async deleteTab(tabKey?: string, noActiveNext?: boolean) {\n if (!tabKey) return;\n // tabs\n const [index] = this.findTab(tabKey);\n if (index === -1) return;\n // active next\n let tabKeyActiveNext;\n if (!noActiveNext && index === this.tabCurrentIndex) {\n // prev/next\n const tabCurrentIndex =\n index + 1 < this.tabs.length ? index + 1 : index - 1 > -1 ? index - 1 : -1;\n if (tabCurrentIndex > -1) {\n tabKeyActiveNext = this.tabs[tabCurrentIndex]?.tabKey;\n }\n }\n // tabs\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1);\n });\n // active next\n if (tabKeyActiveNext) {\n await this.activeTab(tabKeyActiveNext);\n }\n }\n\n async deleteTabItem(tabKey?: string, componentKey?: string, noActiveNext?: boolean) {\n if (!tabKey || !componentKey) return false;\n if (tabKey === componentKey) return false; // not delete first tabItem\n // tab\n const [index, tab] = this.findTab(tabKey);\n if (index === -1 || !tab) return false;\n // indexItem\n if (!tab.items) return false;\n const indexItem = tab.items.findIndex(item => item.componentKey === componentKey);\n if (indexItem === -1) return false;\n // deleteTab if length===1\n if (tab.items.length === 1 && !tab.affix) {\n // delete tab\n await this.deleteTab(tabKey, noActiveNext);\n return true;\n }\n // active next\n let componentKeyActiveNext;\n if (!noActiveNext && componentKey === this.componentKeyCurrent) {\n // prev/next\n const tabItemCurrentIndex =\n indexItem + 1 < tab.items.length ? indexItem + 1 : indexItem - 1 > -1 ? indexItem - 1 : -1;\n if (tabItemCurrentIndex > -1) {\n componentKeyActiveNext = tab.items[tabItemCurrentIndex]?.componentKey;\n }\n }\n // delete tab item\n const items = mutate(tab.items, copyState => {\n copyState.splice(indexItem, 1);\n });\n const tabNew: RouteTab = { ...tab, items };\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1, tabNew);\n });\n // active next\n if (componentKeyActiveNext) {\n await this.activeTabItem(tabKey, componentKeyActiveNext);\n }\n return true;\n }\n\n findTabItemByFullPath(fullPath: string) {\n for (const tab of this.tabs) {\n if (!tab.items) continue;\n for (const item of tab.items) {\n if (item.fullPath === fullPath) {\n return [tab.tabKey, item.componentKey];\n }\n }\n }\n return [];\n }\n\n updateTab(tab: Partial<RouteTabTransient>) {\n const tabKey = tab.tabKey!;\n const [index, tabOld] = this.findTab(tabKey);\n if (index === -1 || !tabOld) return;\n const items: IRouteViewRouteItem[] = tabOld.items\n ? ([] as IRouteViewRouteItem[]).concat(tabOld.items)\n : [];\n if (tab.componentKey) {\n const tabItem: IRouteViewRouteItem = {\n componentKey: tab.componentKey,\n fullPath: tab.fullPath!,\n keepAlive: tab.keepAlive,\n updatedAt: Date.now(),\n };\n const index = items.findIndex(item => item.componentKey === tab.componentKey);\n if (index === -1) {\n items.push(tabItem);\n } else {\n const tabItemNew: IRouteViewRouteItem = { ...items[index], ...tabItem };\n items.splice(index, 1, tabItemNew);\n }\n // not use fullPath, because fullPath has query string\n items.sort(\n (a, b) => (a.componentKey === tabKey ? 0 : 1) - (b.componentKey === tabKey ? 0 : 1),\n );\n }\n const tabNew: RouteTab = {\n ...tabOld,\n ...tab,\n tabKey,\n items,\n updatedAt: Date.now(),\n };\n this.tabs = mutate(this.tabs, copyState => {\n copyState.splice(index, 1, tabNew);\n });\n }\n\n async activeTab(tabKey?: string) {\n if (!tabKey) return;\n const [_, tab] = this.findTab(tabKey);\n if (!tab) return;\n // should not updateTab here\n // this.updateTab({ tabKey });\n // this.tabKeyCurrent = tabKey;\n // first check tab.items?.[0]?.fullPath, because fullPath maybe has query string\n const tabItemFirst = tab.items?.[0];\n const path = tabItemFirst?.componentKey === tabKey ? tabItemFirst.fullPath : tabKey;\n await this.$router.push(path);\n }\n\n async activeTabItem(tabKey?: string, componentKey?: string) {\n if (!tabKey || !componentKey) return;\n const [_, tab] = this.findTab(tabKey);\n if (!tab) return;\n const tabItem = tab.items?.find(item => item.componentKey === componentKey);\n if (!tabItem) return;\n //\n const path = tabItem.fullPath;\n await this.$router.push(path);\n }\n\n findTab(tabKey?: string): [number, RouteTab | undefined] {\n if (!tabKey) return [-1, undefined];\n const index = this.tabs.findIndex(item => item.tabKey === tabKey);\n if (index === -1) return [index, undefined];\n return [index, this.tabs[index]];\n }\n\n async pruneTabs() {\n let max = this.tabsOptions.max;\n if (max === undefined || max === -1) return;\n if (max < 1) max = 1;\n while (true) {\n const affixCount = this.tabs.filter(item => item.affix).length;\n if (this.tabs.length - affixCount <= max) break;\n let tabKey: string | undefined;\n let updatedAt = Date.now();\n for (const tab of this.tabs) {\n if (!tab.affix && tab.updatedAt < updatedAt) {\n tabKey = tab.tabKey;\n updatedAt = tab.updatedAt;\n }\n }\n if (!tabKey) break;\n await this.deleteTab(tabKey, true);\n }\n }\n\n async pruneTabItems(tabKey?: string) {\n if (!tabKey) return;\n let maxItems = this.tabsOptions.maxItems;\n if (maxItems === undefined || maxItems === -1) return;\n if (maxItems < 1) maxItems = 1;\n while (true) {\n const [_, tab] = this.findTab(tabKey);\n if (!tab || !tab.items) break;\n const ignoreCount = tab.items.filter(item => item.componentKey === tabKey).length;\n if (tab.items.length - ignoreCount <= maxItems) break;\n let componentKey: string | undefined;\n let updatedAt = Date.now();\n for (const tabItem of tab.items) {\n if (tabItem.componentKey !== tabKey && tabItem.updatedAt < updatedAt) {\n componentKey = tabItem.componentKey;\n updatedAt = tabItem.updatedAt;\n }\n }\n if (!componentKey) break;\n await this.deleteTabItem(tabKey, componentKey, true);\n }\n }\n\n // special for _addTab\n private _checkIfTabNeedUpdate(tabOld: RouteTab, tabNew: Partial<RouteTabTransient>) {\n for (const key in tabNew) {\n if (['fullPath', 'keepAlive', 'updatedAt'].includes(key)) continue;\n if (['componentKey'].includes(key)) {\n if (!tabOld.items) return true;\n const tabItemOld = tabOld.items.find(item => item[key] === tabNew[key]);\n if (!tabItemOld) return true;\n for (const key2 of ['fullPath', 'keepAlive']) {\n if (tabItemOld[key2] !== tabNew[key2]) return true;\n }\n const recentItemIndex = tabOld.items.findIndex(\n item =>\n item[key] !== tabItemOld[key] && (item.updatedAt ?? 0) >= (tabItemOld.updatedAt ?? 0),\n );\n if (recentItemIndex > -1) return true;\n } else if (tabNew[key] !== tabOld[key]) {\n return true;\n }\n }\n const recentTabIndex = this.tabs.findIndex(\n item => item.tabKey !== tabOld.tabKey && (item.updatedAt ?? 0) >= (tabOld.updatedAt ?? 0),\n );\n if (recentTabIndex > -1) return true;\n return false;\n }\n\n private _getKeepAliveInclude() {\n const include: string[] = [];\n for (const tab of this.tabs) {\n if (!tab.items) continue;\n for (const item of tab.items) {\n if (item.keepAlive !== false && item.componentKey) {\n if (!include.includes(item.componentKey)) {\n include.push(item.componentKey);\n }\n }\n }\n }\n return include;\n }\n\n private _getInitialTabs() {\n const tabs = this.tabsOptions.getInitialTabs?.() ?? [];\n if (!this.tabsOptions.getTabInfo) return tabs;\n return tabs.map(tab => {\n return {\n ...tab,\n info: this.tabsOptions.getTabInfo?.(tab.tabKey) ?? tab.info,\n };\n });\n }\n\n backRoute(route: RouteLocationNormalizedLoadedGeneric) {\n const [tabKey, componentKey] = this.findTabItemByFullPath(route.fullPath);\n this.deleteTabItem(tabKey, componentKey, true);\n }\n\n forwardRoute(route: RouteLocationNormalizedLoadedGeneric) {\n const routeMeta = this.prepareRouteMeta(route);\n this.addTab(routeMeta);\n }\n\n public setPageMeta(route: RouteLocationNormalizedLoadedGeneric, pageMeta: IPageMeta) {\n const [tabKey, componentKey] = this.findTabItemByFullPath(route.fullPath);\n this.updateTabItemPageMeta(tabKey, componentKey, pageMeta);\n }\n\n prepareRouteMeta(route: RouteLocationNormalizedLoadedGeneric): IRouteViewRouteMeta {\n // fullPath\n const fullPath = route.fullPath;\n // componentKey\n const componentKey = this.__handleRoutePropComponentKey(route);\n // tabKey\n const tabKey = this._handleRouteProp(route, 'tabKey') || componentKey;\n // keepAlive\n const keepAlive = this._handleRouteProp(route, 'keepAlive');\n // tab\n return { tabKey, componentKey, fullPath, keepAlive };\n }\n\n private _handleRouteProp(\n route: RouteLocationNormalizedLoaded,\n prop: 'componentKey' | 'tabKey',\n ): string;\n private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop: 'keepAlive'): boolean;\n private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop) {\n let value = route.meta[prop];\n if (typeof value === 'function') {\n value = value.call(this.app, route);\n }\n return value;\n }\n\n private __handleRoutePropComponentKey(route: RouteLocationNormalizedLoaded) {\n const componentKey = this._handleRouteProp(route, 'componentKey');\n if (componentKey) return componentKey;\n // name\n const name = this.$router.getRealRouteName(route.name);\n // path\n if (!name) return route.path;\n // name: nameOnly\n if (route.meta.componentKeyMode === 'nameOnly') return name;\n // name: withParams\n return route.path;\n }\n\n private _resetAllPageDirty() {\n const tabItems: [string, string][] = [];\n for (const tab of this.tabs) {\n if (!tab.items) continue;\n for (const tabItem of tab.items) {\n if (tabItem.pageMeta?.pageDirty) {\n tabItems.push([tab.tabKey, tabItem.componentKey]);\n }\n }\n }\n for (const [tabKey, componentKey] of tabItems) {\n this.updateTabItemPageMeta(tabKey, componentKey, { pageDirty: false });\n }\n }\n}\n","import { RouteLocationNormalizedLoadedGeneric } from '@cabloy/vue-router';\nimport { Use } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\nimport {\n BeanRouterViewBase,\n IPageMeta,\n IRouterViewPropsBase,\n IRouteViewRouteMeta,\n} from 'zova-module-a-router';\n\nimport type { ModelTabs } from '../../model/tabs.js';\n\nexport interface ControllerRouterViewTabsProps extends IRouterViewPropsBase {}\n\n@Controller()\nexport class ControllerRouterViewTabs extends BeanRouterViewBase {\n static $propsDefault = {};\n\n @Use({ injectionScope: 'skipSelf' })\n $$modelTabs: ModelTabs;\n\n public backRoute(route: RouteLocationNormalizedLoadedGeneric) {\n this.$$modelTabs.backRoute(route);\n return true;\n }\n\n public forwardRoute(route: RouteLocationNormalizedLoadedGeneric) {\n this.$$modelTabs.forwardRoute(route);\n return true;\n }\n\n public setPageMeta(route: RouteLocationNormalizedLoadedGeneric, pageMeta: IPageMeta) {\n this.$$modelTabs.setPageMeta(route, pageMeta);\n }\n\n protected prepareRouteMeta(route: RouteLocationNormalizedLoadedGeneric): IRouteViewRouteMeta {\n return this.$$modelTabs.prepareRouteMeta(route);\n }\n\n protected getKeepAliveInclude(): string[] | undefined {\n return this.$$modelTabs.keepAliveInclude;\n }\n}\n","import type { TypeControllerInnerProps } from 'zova';\n\nimport { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\n\nimport type { ControllerRouterViewTabsProps } from '../../component/routerViewTabs/controller.jsx';\n\nimport { ControllerRouterViewTabs } from '../../component/routerViewTabs/controller.jsx';\nexport type TypeControllerRouterViewTabsPublicProps = {\n controllerRef?: (ref: ControllerRouterViewTabs) => void;\n} & ControllerRouterViewTabsProps;\n\ntype ControllerInnerProps = TypeControllerInnerProps<\n ControllerRouterViewTabsProps,\n keyof typeof ControllerRouterViewTabs.$propsDefault\n>;\ndeclare module 'zova-module-a-routertabs' {\n export interface ControllerRouterViewTabs {\n $props: ControllerInnerProps;\n }\n}\n\nexport const ZRouterViewTabs = defineComponent(\n (_props: TypeControllerRouterViewTabsPublicProps) => {\n useController(ControllerRouterViewTabs, undefined, undefined);\n return () => {};\n },\n prepareComponentOptions(),\n);\ndeclare module 'zova-module-a-bean' {\n export interface IVonaComponentRecord {\n 'a-routertabs:routerViewTabs': ControllerRouterViewTabsProps;\n }\n}\n","// eslint-disable\n/** model: begin */\nexport * from '../model/tabs.js';\nimport { IModelOptionsTabs } from '../model/tabs.js';\nimport 'zova-module-a-model';\ndeclare module 'zova-module-a-model' {\n \n export interface IModelRecord {\n 'a-routertabs:tabs': IModelOptionsTabs;\n }\n\n \n}\ndeclare module 'zova-module-a-routertabs' {\n \n export interface ModelTabs {\n /** @internal */\n get scope(): ScopeModuleARoutertabs;\n }\n\n export interface ModelTabs {\n get $beanFullName(): 'a-routertabs.model.tabs';\n get $onionName(): 'a-routertabs:tabs';\n get $onionOptions(): IModelOptionsTabs;\n } \n}\n/** model: end */\n/** model: begin */\nimport { ModelTabs } from '../model/tabs.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-routertabs.model.tabs': ModelTabs;\n }\n}\n/** model: end */\n/** controller: begin */\nexport * from '../component/routerViewTabs/controller.jsx';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-routertabs' {\n \n export interface ControllerRouterViewTabs {\n /** @internal */\n get scope(): ScopeModuleARoutertabs;\n } \n}\n/** controller: end */\n/** controller: begin */\nimport { ControllerRouterViewTabs } from '../component/routerViewTabs/controller.jsx';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordLocal {\n 'a-routertabs.controller.routerViewTabs': ControllerRouterViewTabs;\n }\n}\n/** controller: end */\n\n/** components: begin */\nexport * from './component/routerViewTabs.js';\nimport { ZRouterViewTabs } from './component/routerViewTabs.js';\nexport const components = {\n 'routerViewTabs': ZRouterViewTabs,\n};\nimport 'zova';\ndeclare module 'zova' {\nexport interface IComponentRecord {\n 'a-routertabs:routerViewTabs': ControllerRouterViewTabs;\n}\nexport interface IZovaComponentRecord {\n 'a-routertabs:routerViewTabs': typeof ZRouterViewTabs;\n}\n}\n/** components: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleARoutertabs extends BeanScopeBase {}\n\nexport interface ScopeModuleARoutertabs {\n util: BeanScopeUtil;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-routertabs': ScopeModuleARoutertabs;\n }\n \n \n\n \n\n \n}\n \n/** scope: end */\n"],"mappings":";;;;;;;AAAA,IAAA,QAAO,SAAO;AAKd,IAAS,eAAW,SAAO,MAAA;CAC3B,gBAAkB;CAClB,KAAO;CACP,UAAS;CACT,OAAS;yBAET,QAAO,gBACN,CAAC,EAAA,OAAA,WAAgB,QAAA,WAAA,MAAA,kBAAA,cAAA;CAChB,YAAA,GAAA,MAAoB;AACpB,QAAQ,GAAA,KAAA;AACR,OAAA,cAAe,KAAA;AACf,OAAA,OAAA,KAAiB;AACjB,OAAO,sBAAgB,KAAA;;AAEzB,OAAO,kBAAU,KAAA;;AAEhB,OAAM,mBAAmB,KAAA;AACxB,OAAA,qBAAoB,KAAA;;CAEpB,MAAA,SAAY,OAAA,SAAA;AACZ,QAAO,MAAK,SAAA,MAAA;AACb,OAAA,KAAA,SAAA,eAAA,KAAA;AAEC,OAAA,cAAa,WAAgB,EAAA,EAAA,KAAA,eAAA,QAAA;AAE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;;CAGvCM,sBAA4C;AACpD,SAAO,KAAKL,YAAYM;;GAE3Bb,0BA1BQc,gBAAgB,EAAE,EAAAd,4BAAAI,cAAAW,0BAAAhB,QAAAiB,WAAA,eAAA,CAAAzB,OAAAE,MAAA,EAAA;CAAAwB,cAAA;CAAAC,YAAA;CAAAC,UAAA;CAAAC,aAAA;CAAA,CAAA,EAAArB,SAAA,IAAAD,SAAA,IAAAA;;;ACb3B,IAAS,kBAAA,iBAAsC,WAAS;;AAExD,cAAc;;;;;;ACLd,IAAG,MAAO,OAAA;AAuBV,IAAa,aAAE,EACb,kBAAO,iBACT;AAMA,IAAS,0BAA4B,OAAC,OAAA,EAAA,QAAA,SAAA,EACpC,QAAK,gBACN,CAAC,EAAA,KAAA,SAAA,MAAA,SAAA,MAAA,+BAAA,cAAA,GAAA,IAAA,OAAA,IAAA"}
|
package/dist/model/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/model/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAmB,MAAM,qBAAqB,CAAC;AAEnF,OAAO,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/model/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAmB,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAEL,oCAAoC,EACrC,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAS,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAuB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,eAAe,EACf,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB,EAAE,oBAAoB;CAAG;AAE1F,qBAMa,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AM;IAW1D,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAOlD,SAAS;IAoBT,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM;IAwBnC,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,eAAe;IAWvB,SAAS,CAAC,KAAK,EAAE,oCAAoC;IAKrD,YAAY,CAAC,KAAK,EAAE,oCAAoC;IAKjD,WAAW,CAAC,KAAK,EAAE,oCAAoC,EAAE,QAAQ,EAAE,SAAS;IAKnF,gBAAgB,CAAC,KAAK,EAAE,oCAAoC,GAAG,mBAAmB;IAalF,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,6BAA6B;IAarC,OAAO,CAAC,kBAAkB;CAc3B"}
|
package/package.json
CHANGED
package/rest/components.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from 'zova-module-a-routertabs';
|
|
@@ -10,14 +10,25 @@ export type TypeControllerRouterViewTabsPublicProps = {
|
|
|
10
10
|
controllerRef?: (ref: ControllerRouterViewTabs) => void;
|
|
11
11
|
} & ControllerRouterViewTabsProps;
|
|
12
12
|
|
|
13
|
-
type ControllerInnerProps = TypeControllerInnerProps<
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerRouterViewTabsProps,
|
|
15
|
+
keyof typeof ControllerRouterViewTabs.$propsDefault
|
|
16
|
+
>;
|
|
14
17
|
declare module 'zova-module-a-routertabs' {
|
|
15
18
|
export interface ControllerRouterViewTabs {
|
|
16
19
|
$props: ControllerInnerProps;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
export const ZRouterViewTabs = defineComponent(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
export const ZRouterViewTabs = defineComponent(
|
|
24
|
+
(_props: TypeControllerRouterViewTabsPublicProps) => {
|
|
25
|
+
useController(ControllerRouterViewTabs, undefined, undefined);
|
|
26
|
+
return () => {};
|
|
27
|
+
},
|
|
28
|
+
prepareComponentOptions(),
|
|
29
|
+
);
|
|
30
|
+
declare module 'zova-module-a-bean' {
|
|
31
|
+
export interface IVonaComponentRecord {
|
|
32
|
+
'a-routertabs:routerViewTabs': ControllerRouterViewTabsProps;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { RouteLocationNormalizedLoadedGeneric } from '@cabloy/vue-router';
|
|
2
2
|
import { Use } from 'zova';
|
|
3
3
|
import { Controller } from 'zova-module-a-bean';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
BeanRouterViewBase,
|
|
6
|
+
IPageMeta,
|
|
7
|
+
IRouterViewPropsBase,
|
|
8
|
+
IRouteViewRouteMeta,
|
|
9
|
+
} from 'zova-module-a-router';
|
|
5
10
|
|
|
6
11
|
import type { ModelTabs } from '../../model/tabs.js';
|
|
7
12
|
|
package/src/model/tabs.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { IDecoratorModelOptions, UseQueryOptions } from 'zova-module-a-model';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
RouteLocationNormalizedLoaded,
|
|
5
|
+
RouteLocationNormalizedLoadedGeneric,
|
|
6
|
+
} from '@cabloy/vue-router';
|
|
4
7
|
import { mutate } from 'mutate-on-copy';
|
|
5
8
|
import { deepEqual, deepExtend, TypeEventOff, useComputed } from 'zova';
|
|
6
9
|
import { BeanModelBase, Model } from 'zova-module-a-model';
|
|
7
10
|
import { IPageMeta, IRouteViewRouteItem, IRouteViewRouteMeta } from 'zova-module-a-router';
|
|
8
11
|
|
|
9
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
ModelTabsOptions,
|
|
14
|
+
ModelTabsOptionsBase,
|
|
15
|
+
RouteTab,
|
|
16
|
+
RouteTabInitial,
|
|
17
|
+
RouteTabTransient,
|
|
18
|
+
} from '../types/tabs.js';
|
|
10
19
|
|
|
11
20
|
export interface IModelOptionsTabs extends IDecoratorModelOptions, ModelTabsOptionsBase {}
|
|
12
21
|
|
|
@@ -187,7 +196,9 @@ export class ModelTabs extends BeanModelBase {
|
|
|
187
196
|
const [index, tabOld] = this.findTab(tabKey);
|
|
188
197
|
if (index === -1) return;
|
|
189
198
|
// tabInfo
|
|
190
|
-
const tabInfo = this.tabsOptions.getTabInfo
|
|
199
|
+
const tabInfo = this.tabsOptions.getTabInfo
|
|
200
|
+
? this.tabsOptions.getTabInfo(tabKey)
|
|
201
|
+
: (tabInitial?.info ?? tabOld?.info);
|
|
191
202
|
if (!tabInfo) return;
|
|
192
203
|
// update
|
|
193
204
|
const tabNew = { ...tabOld, info: tabInfo };
|
|
@@ -226,7 +237,8 @@ export class ModelTabs extends BeanModelBase {
|
|
|
226
237
|
let tabKeyActiveNext;
|
|
227
238
|
if (!noActiveNext && index === this.tabCurrentIndex) {
|
|
228
239
|
// prev/next
|
|
229
|
-
const tabCurrentIndex =
|
|
240
|
+
const tabCurrentIndex =
|
|
241
|
+
index + 1 < this.tabs.length ? index + 1 : index - 1 > -1 ? index - 1 : -1;
|
|
230
242
|
if (tabCurrentIndex > -1) {
|
|
231
243
|
tabKeyActiveNext = this.tabs[tabCurrentIndex]?.tabKey;
|
|
232
244
|
}
|
|
@@ -261,7 +273,8 @@ export class ModelTabs extends BeanModelBase {
|
|
|
261
273
|
let componentKeyActiveNext;
|
|
262
274
|
if (!noActiveNext && componentKey === this.componentKeyCurrent) {
|
|
263
275
|
// prev/next
|
|
264
|
-
const tabItemCurrentIndex =
|
|
276
|
+
const tabItemCurrentIndex =
|
|
277
|
+
indexItem + 1 < tab.items.length ? indexItem + 1 : indexItem - 1 > -1 ? indexItem - 1 : -1;
|
|
265
278
|
if (tabItemCurrentIndex > -1) {
|
|
266
279
|
componentKeyActiveNext = tab.items[tabItemCurrentIndex]?.componentKey;
|
|
267
280
|
}
|
|
@@ -297,7 +310,9 @@ export class ModelTabs extends BeanModelBase {
|
|
|
297
310
|
const tabKey = tab.tabKey!;
|
|
298
311
|
const [index, tabOld] = this.findTab(tabKey);
|
|
299
312
|
if (index === -1 || !tabOld) return;
|
|
300
|
-
const items: IRouteViewRouteItem[] = tabOld.items
|
|
313
|
+
const items: IRouteViewRouteItem[] = tabOld.items
|
|
314
|
+
? ([] as IRouteViewRouteItem[]).concat(tabOld.items)
|
|
315
|
+
: [];
|
|
301
316
|
if (tab.componentKey) {
|
|
302
317
|
const tabItem: IRouteViewRouteItem = {
|
|
303
318
|
componentKey: tab.componentKey,
|
|
@@ -313,7 +328,9 @@ export class ModelTabs extends BeanModelBase {
|
|
|
313
328
|
items.splice(index, 1, tabItemNew);
|
|
314
329
|
}
|
|
315
330
|
// not use fullPath, because fullPath has query string
|
|
316
|
-
items.sort(
|
|
331
|
+
items.sort(
|
|
332
|
+
(a, b) => (a.componentKey === tabKey ? 0 : 1) - (b.componentKey === tabKey ? 0 : 1),
|
|
333
|
+
);
|
|
317
334
|
}
|
|
318
335
|
const tabNew: RouteTab = {
|
|
319
336
|
...tabOld,
|
|
@@ -412,13 +429,18 @@ export class ModelTabs extends BeanModelBase {
|
|
|
412
429
|
for (const key2 of ['fullPath', 'keepAlive']) {
|
|
413
430
|
if (tabItemOld[key2] !== tabNew[key2]) return true;
|
|
414
431
|
}
|
|
415
|
-
const recentItemIndex = tabOld.items.findIndex(
|
|
432
|
+
const recentItemIndex = tabOld.items.findIndex(
|
|
433
|
+
item =>
|
|
434
|
+
item[key] !== tabItemOld[key] && (item.updatedAt ?? 0) >= (tabItemOld.updatedAt ?? 0),
|
|
435
|
+
);
|
|
416
436
|
if (recentItemIndex > -1) return true;
|
|
417
437
|
} else if (tabNew[key] !== tabOld[key]) {
|
|
418
438
|
return true;
|
|
419
439
|
}
|
|
420
440
|
}
|
|
421
|
-
const recentTabIndex = this.tabs.findIndex(
|
|
441
|
+
const recentTabIndex = this.tabs.findIndex(
|
|
442
|
+
item => item.tabKey !== tabOld.tabKey && (item.updatedAt ?? 0) >= (tabOld.updatedAt ?? 0),
|
|
443
|
+
);
|
|
422
444
|
if (recentTabIndex > -1) return true;
|
|
423
445
|
return false;
|
|
424
446
|
}
|
|
@@ -477,7 +499,10 @@ export class ModelTabs extends BeanModelBase {
|
|
|
477
499
|
return { tabKey, componentKey, fullPath, keepAlive };
|
|
478
500
|
}
|
|
479
501
|
|
|
480
|
-
private _handleRouteProp(
|
|
502
|
+
private _handleRouteProp(
|
|
503
|
+
route: RouteLocationNormalizedLoaded,
|
|
504
|
+
prop: 'componentKey' | 'tabKey',
|
|
505
|
+
): string;
|
|
481
506
|
private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop: 'keepAlive'): boolean;
|
|
482
507
|
private _handleRouteProp(route: RouteLocationNormalizedLoaded, prop) {
|
|
483
508
|
let value = route.meta[prop];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TypeRenderComponentJsxPropsPublic } from 'zova-jsx';
|
|
2
|
-
import type { ControllerRouterViewTabsProps } from 'zova-module-a-routertabs';
|
|
3
|
-
|
|
4
|
-
type TypeControllerRouterViewTabsPublicProps = TypeRenderComponentJsxPropsPublic & ControllerRouterViewTabsProps;
|
|
5
|
-
export function BBZRoutertabsRouterViewTabs(_props: TypeControllerRouterViewTabsPublicProps) {
|
|
6
|
-
return 'a-routertabs:routerViewTabs';
|
|
7
|
-
}
|