cabloy 5.1.247 → 5.1.249
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/.cabloy-version +1 -1
- package/.vscode/settings.json +1 -2
- package/CHANGELOG.md +27 -0
- package/package.json +1 -7
- package/repo-docs/frontend/column-configuration-guide.md +3 -1
- package/repo-docs/frontend/table-guide.md +27 -2
- package/repo-e2e/specs/a-commerce.spec.ts +32 -0
- package/repo-e2e/specs/cabloy-basic.spec.ts +1236 -0
- package/vona/package.original.json +1 -7
- package/vona/pnpm-lock.yaml +139 -1011
- package/zova/package.original.json +0 -6
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/package.json +2 -2
- package/zova/packages-utils/zova-vite/package.json +1 -1
- package/zova/packages-utils/zova-vite/src/teleports.ts +7 -0
- package/zova/packages-utils/zova-vite/test/teleports.test.ts +114 -0
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +6 -958
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/controller.tsx +267 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.header.tsx +42 -10
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.locale.tsx +10 -5
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.tabs.tsx +97 -11
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.theme.tsx +19 -10
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.user.tsx +11 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/style.ts +128 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/config/locale/en-us.ts +6 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/config/locale/zh-cn.ts +6 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/component/layoutWeb.ts +10 -8
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/index.ts +25 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/controller.tsx +83 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.header.tsx +37 -8
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.locale.tsx +25 -8
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tabs.tsx +3 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.theme.tsx +10 -5
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.user.tsx +64 -21
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/style.ts +42 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/locale/en-us.ts +4 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/locale/zh-cn.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/rowOperations/controller.tsx +2 -1
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/table/controller.tsx +6 -10
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/table/render.tsx +9 -6
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssr.ts +17 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssrProfile.ts +15 -0
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/types/ssr.ts +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/test/lib/ssrProfile.test.ts +23 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/src/service/ssrHandler.ts +11 -11
- package/zova/src/suite-vendor/a-zova/package.json +3 -3
- package/vona/.textlintrc.json +0 -19
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BeanStyleBase } from 'zova';
|
|
2
|
+
import { Style } from 'zova-module-a-bean';
|
|
3
|
+
|
|
4
|
+
@Style()
|
|
5
|
+
export class StyleLayoutWeb extends BeanStyleBase {
|
|
6
|
+
cHeaderActions: string;
|
|
7
|
+
|
|
8
|
+
protected async __init__() {
|
|
9
|
+
this.cHeaderActions = this.$style({
|
|
10
|
+
$nest: {
|
|
11
|
+
'& .header-actions-panel > ul > li > details > ul': {
|
|
12
|
+
maxHeight: 'calc(100dvh - 5rem)',
|
|
13
|
+
overflowY: 'auto',
|
|
14
|
+
},
|
|
15
|
+
'@media (width < 64rem)': {
|
|
16
|
+
$nest: {
|
|
17
|
+
'& .header-actions-panel': {
|
|
18
|
+
width: '16rem',
|
|
19
|
+
maxWidth: 'calc(100vw - 1rem)',
|
|
20
|
+
maxHeight: 'calc(100dvh - 5rem)',
|
|
21
|
+
overflowY: 'auto',
|
|
22
|
+
},
|
|
23
|
+
'& .header-actions-panel > ul > li > details > ul': {
|
|
24
|
+
width: 'auto',
|
|
25
|
+
maxWidth: '100%',
|
|
26
|
+
whiteSpace: 'normal',
|
|
27
|
+
overflowWrap: 'anywhere',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
'@media (min-width: 64rem)': {
|
|
32
|
+
$nest: {
|
|
33
|
+
'& .header-actions-panel > ul > li > details > ul': {
|
|
34
|
+
right: 0,
|
|
35
|
+
maxWidth: 'calc(100vw - 1rem)',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/rowOperations/controller.tsx
CHANGED
|
@@ -37,6 +37,7 @@ export class ControllerRowOperations extends BeanControllerBase {
|
|
|
37
37
|
};
|
|
38
38
|
this._id = this.$composable(useId);
|
|
39
39
|
this._cPopover = this.$style({
|
|
40
|
+
display: 'none',
|
|
40
41
|
position: 'fixed',
|
|
41
42
|
inset: 'auto',
|
|
42
43
|
margin: 0,
|
|
@@ -207,7 +208,7 @@ export class ControllerRowOperations extends BeanControllerBase {
|
|
|
207
208
|
aria-label={label}
|
|
208
209
|
aria-controls={this._id}
|
|
209
210
|
aria-expanded={this._open}
|
|
210
|
-
{...{ popovertarget: this._id }}
|
|
211
|
+
{...{ 'popovertarget': this._id, 'data-hydrate-ignore-popovertarget': '' }}
|
|
211
212
|
>
|
|
212
213
|
<ZIcon name="::more-horiz" width={24} aria-hidden="true" />
|
|
213
214
|
</ZButton>
|
|
@@ -19,8 +19,8 @@ export class ControllerTable extends BeanControllerBase {
|
|
|
19
19
|
static $propsDefault = { compactBreakpoint: 768 };
|
|
20
20
|
|
|
21
21
|
innerTable?: ControllerTableInner<any>;
|
|
22
|
-
containerWidth: number
|
|
23
|
-
popoverSupported: boolean
|
|
22
|
+
containerWidth: number | undefined;
|
|
23
|
+
popoverSupported: boolean | undefined;
|
|
24
24
|
private _container?: HTMLElement;
|
|
25
25
|
private _observer?: ResizeObserver;
|
|
26
26
|
private _mounted: boolean = false;
|
|
@@ -39,12 +39,9 @@ export class ControllerTable extends BeanControllerBase {
|
|
|
39
39
|
|
|
40
40
|
public get compact() {
|
|
41
41
|
const breakpoint = this.$props.compactBreakpoint;
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.containerWidth > 0 &&
|
|
46
|
-
this.containerWidth < (breakpoint ?? 768)
|
|
47
|
-
);
|
|
42
|
+
if (breakpoint === false || this.popoverSupported === false) return false;
|
|
43
|
+
if (this.containerWidth === undefined) return this.$ssr.state.compactHint === true;
|
|
44
|
+
return this.containerWidth > 0 && this.containerWidth < (breakpoint ?? 768);
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
public get columnSizing() {
|
|
@@ -57,8 +54,7 @@ export class ControllerTable extends BeanControllerBase {
|
|
|
57
54
|
return sizing;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
|
-
public isOperationsColumn(key: string) {
|
|
61
|
-
const table = this.innerTable;
|
|
57
|
+
public isOperationsColumn(key: string, table = this.innerTable) {
|
|
62
58
|
if (!table) return false;
|
|
63
59
|
const scope = table.getColumnScope(key);
|
|
64
60
|
const { render } = table.getColumnComponentPropsTop(key, scope, {});
|
|
@@ -45,12 +45,15 @@ export class RenderTable<TData extends {} = {}> extends BeanRenderBase {
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
private _getColumnStyle(column: any): CSSProperties {
|
|
48
|
+
private _getColumnStyle(column: any, $$table: ControllerTable<TData>): CSSProperties {
|
|
49
49
|
const rest = (column.columnDef.meta as any)?.rest;
|
|
50
50
|
const fixed = column.getIsPinned();
|
|
51
|
-
const
|
|
51
|
+
const compactOperations = this.compact && this.isOperationsColumn(column.id, $$table);
|
|
52
|
+
const width = compactOperations ? 80 : column.getSize();
|
|
52
53
|
return {
|
|
53
|
-
...(
|
|
54
|
+
...(compactOperations ||
|
|
55
|
+
typeof rest?.width === 'number' ||
|
|
56
|
+
typeof this.columnSizing[column.id] === 'number'
|
|
54
57
|
? { width: `${width}px`, minWidth: `${width}px` }
|
|
55
58
|
: {}),
|
|
56
59
|
textAlign: rest?.align,
|
|
@@ -89,7 +92,7 @@ export class RenderTable<TData extends {} = {}> extends BeanRenderBase {
|
|
|
89
92
|
onChange={table.getToggleAllPageRowsSelectedHandler()}
|
|
90
93
|
/>
|
|
91
94
|
)
|
|
92
|
-
) : this.compact && this.isOperationsColumn(column.id) ? (
|
|
95
|
+
) : this.compact && this.isOperationsColumn(column.id, $$table) ? (
|
|
93
96
|
<span class="sr-only">
|
|
94
97
|
<FlexRender render={headerDefinition} props={header.getContext()}></FlexRender>
|
|
95
98
|
</span>
|
|
@@ -109,7 +112,7 @@ export class RenderTable<TData extends {} = {}> extends BeanRenderBase {
|
|
|
109
112
|
<th
|
|
110
113
|
key={header.id}
|
|
111
114
|
class={fixed ? 'bg-base-100' : undefined}
|
|
112
|
-
style={this._getColumnStyle(column)}
|
|
115
|
+
style={this._getColumnStyle(column, $$table)}
|
|
113
116
|
aria-sort={sortAria}
|
|
114
117
|
>
|
|
115
118
|
{canSort ? (
|
|
@@ -141,7 +144,7 @@ export class RenderTable<TData extends {} = {}> extends BeanRenderBase {
|
|
|
141
144
|
<td
|
|
142
145
|
key={cell.id}
|
|
143
146
|
class={column.getIsPinned() ? 'bg-base-100' : undefined}
|
|
144
|
-
style={this._getColumnStyle(column)}
|
|
147
|
+
style={this._getColumnStyle(column, $$table)}
|
|
145
148
|
>
|
|
146
149
|
{selection ? (
|
|
147
150
|
<input
|
|
@@ -7,6 +7,7 @@ import type { Functionable, IControllerLoadEvent, ILocaleRecord, ZovaContext } f
|
|
|
7
7
|
|
|
8
8
|
import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';
|
|
9
9
|
import { defu } from 'defu';
|
|
10
|
+
import { Platform } from 'quasar';
|
|
10
11
|
import { normalizeClass, normalizeStyle, ref, useSSRContext } from 'vue';
|
|
11
12
|
import { BeanSimple } from 'zova';
|
|
12
13
|
|
|
@@ -24,7 +25,11 @@ import type {
|
|
|
24
25
|
|
|
25
26
|
import { CtxSSRMetaStore } from './ssrMetaStore.ts';
|
|
26
27
|
import { getCanonicalLocaleRoutePath } from './ssrNavigation.ts';
|
|
27
|
-
import {
|
|
28
|
+
import {
|
|
29
|
+
resolveSsrProfile,
|
|
30
|
+
resolveSsrProfileOptions,
|
|
31
|
+
resolveSsrResponseCacheExpires,
|
|
32
|
+
} from './ssrProfile.ts';
|
|
28
33
|
|
|
29
34
|
const SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');
|
|
30
35
|
const SymbolSSRContext = Symbol('SymbolSSRContext');
|
|
@@ -210,6 +215,17 @@ export class CtxSSR extends BeanSimple {
|
|
|
210
215
|
);
|
|
211
216
|
this.state.ssrProfile = ssrProfile;
|
|
212
217
|
this.state.ssrProfileOptions = ssrProfileOptions;
|
|
218
|
+
if (process.env.SERVER) {
|
|
219
|
+
const expires = resolveSsrResponseCacheExpires(
|
|
220
|
+
ssrProfileOptions.responseCache,
|
|
221
|
+
this.sys.env.META_MODE,
|
|
222
|
+
);
|
|
223
|
+
if (ssrProfile === 'public' && expires !== false && expires !== 0) {
|
|
224
|
+
delete this.state.compactHint;
|
|
225
|
+
} else {
|
|
226
|
+
this.state.compactHint = !!Platform.parseSSR(this.context).is.mobile;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
213
229
|
}
|
|
214
230
|
|
|
215
231
|
/** @internal */
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ZovaConfigSsrProfile } from 'zova';
|
|
2
2
|
|
|
3
|
+
import ms from 'ms';
|
|
4
|
+
|
|
3
5
|
import type {
|
|
4
6
|
ISsrProfileOptions,
|
|
5
7
|
ISsrResponseCachePolicy,
|
|
@@ -18,6 +20,19 @@ export function resolveSsrProfile(
|
|
|
18
20
|
return ssrProfile;
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
export function resolveSsrResponseCacheExpires(
|
|
24
|
+
responseCache: ISsrProfileOptions['responseCache'],
|
|
25
|
+
metaMode: string | undefined,
|
|
26
|
+
): number | false {
|
|
27
|
+
if (responseCache === false) return false;
|
|
28
|
+
const responseCacheExpires = responseCache.expires ?? 0;
|
|
29
|
+
const expires =
|
|
30
|
+
typeof responseCacheExpires === 'string'
|
|
31
|
+
? ms(responseCacheExpires) / 1000
|
|
32
|
+
: responseCacheExpires;
|
|
33
|
+
return metaMode === 'development' ? 0 : expires;
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
export function resolveSsrProfileOptions(
|
|
22
37
|
ssrProfile: TypeSsrProfile,
|
|
23
38
|
profiles: Readonly<Record<TypeSsrProfile, ZovaConfigSsrProfile>>,
|
|
@@ -5,7 +5,11 @@ import test from 'node:test';
|
|
|
5
5
|
|
|
6
6
|
import type { ISsrRouteProfileOptions } from '../../src/types/ssr.ts';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
resolveSsrProfile,
|
|
10
|
+
resolveSsrProfileOptions,
|
|
11
|
+
resolveSsrResponseCacheExpires,
|
|
12
|
+
} from '../../src/lib/ssrProfile.ts';
|
|
9
13
|
|
|
10
14
|
const profiles = {
|
|
11
15
|
public: {
|
|
@@ -77,6 +81,24 @@ test('SSR route options override locale-aware cache defaults', () => {
|
|
|
77
81
|
assert.equal(disabled.responseCache, false);
|
|
78
82
|
});
|
|
79
83
|
|
|
84
|
+
test('SSR response cache expiry preserves disabled, no-store, and public max-age branches', () => {
|
|
85
|
+
assert.equal(resolveSsrResponseCacheExpires(false, 'production'), false);
|
|
86
|
+
assert.equal(resolveSsrResponseCacheExpires(false, 'development'), false);
|
|
87
|
+
assert.equal(resolveSsrResponseCacheExpires({}, 'production'), 0);
|
|
88
|
+
assert.equal(resolveSsrResponseCacheExpires({ expires: 0 }, 'production'), 0);
|
|
89
|
+
assert.equal(resolveSsrResponseCacheExpires({ expires: '0s' }, 'production'), 0);
|
|
90
|
+
assert.equal(resolveSsrResponseCacheExpires({ expires: 600 }, 'production'), 600);
|
|
91
|
+
assert.equal(resolveSsrResponseCacheExpires({ expires: '10m' }, 'test'), 600);
|
|
92
|
+
assert.equal(resolveSsrResponseCacheExpires({ expires: '10m' }, 'development'), 0);
|
|
93
|
+
|
|
94
|
+
const override = resolveSsrProfileOptions('public', profiles, {
|
|
95
|
+
responseCache: { expires: '5m' },
|
|
96
|
+
});
|
|
97
|
+
assert.equal(resolveSsrResponseCacheExpires(override.responseCache, 'production'), 300);
|
|
98
|
+
const noLocale = resolveSsrProfileOptions('public', profiles);
|
|
99
|
+
assert.equal(resolveSsrResponseCacheExpires(noLocale.responseCache, 'production'), 0);
|
|
100
|
+
});
|
|
101
|
+
|
|
80
102
|
test('SSR profile options are fresh immutable snapshots', () => {
|
|
81
103
|
const routeOptions: ISsrRouteProfileOptions = {
|
|
82
104
|
responseCache: { expires: '5m' },
|
|
@@ -2,13 +2,16 @@ import type { ISsrProfileOptions } from 'zova-module-a-ssr';
|
|
|
2
2
|
|
|
3
3
|
import { catchError } from '@cabloy/utils';
|
|
4
4
|
import fse from 'fs-extra';
|
|
5
|
-
import ms from 'ms';
|
|
6
5
|
import path, { basename } from 'node:path';
|
|
7
6
|
import { pathToFileURL } from 'node:url';
|
|
8
7
|
import { BeanBase, cast, Use } from 'zova';
|
|
9
8
|
import { Service } from 'zova-module-a-bean';
|
|
10
9
|
import { SysRouter } from 'zova-module-a-router';
|
|
11
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
resolveSsrProfile,
|
|
12
|
+
resolveSsrProfileOptions,
|
|
13
|
+
resolveSsrResponseCacheExpires,
|
|
14
|
+
} from 'zova-module-a-ssr';
|
|
12
15
|
|
|
13
16
|
import { ISsrHandlerRenderOptionsInner, TypeEventResolvePathResult } from '../types/ssr.ts';
|
|
14
17
|
|
|
@@ -286,15 +289,12 @@ export class ServiceSsrHandler extends BeanBase {
|
|
|
286
289
|
ssrProfileOptions: Readonly<ISsrProfileOptions>,
|
|
287
290
|
) {
|
|
288
291
|
const { res } = options;
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
? ms(responseCacheExpires) / 1000
|
|
296
|
-
: responseCacheExpires;
|
|
297
|
-
if (expires === 0 || this.sys.env.META_MODE === 'development') {
|
|
292
|
+
const expires = resolveSsrResponseCacheExpires(
|
|
293
|
+
ssrProfileOptions.responseCache,
|
|
294
|
+
this.sys.env.META_MODE,
|
|
295
|
+
);
|
|
296
|
+
if (expires === false) return;
|
|
297
|
+
if (expires === 0) {
|
|
298
298
|
res.setHeader('cache-control', 'no-cache, no-store, must-revalidate');
|
|
299
299
|
} else {
|
|
300
300
|
res.setHeader('cache-control', `public, max-age=${expires}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.178",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"zova-module-a-router": "^5.1.43",
|
|
26
26
|
"zova-module-a-routerstack": "^5.1.30",
|
|
27
27
|
"zova-module-a-routertabs": "^5.1.36",
|
|
28
|
-
"zova-module-a-ssr": "^5.1.
|
|
28
|
+
"zova-module-a-ssr": "^5.1.43",
|
|
29
29
|
"zova-module-a-ssrhmr": "^5.1.24",
|
|
30
|
-
"zova-module-a-ssrserver": "^5.1.
|
|
30
|
+
"zova-module-a-ssrserver": "^5.1.28",
|
|
31
31
|
"zova-module-a-style": "^5.1.36",
|
|
32
32
|
"zova-module-a-table": "^5.1.46",
|
|
33
33
|
"zova-module-a-zod": "^5.1.39",
|
package/vona/.textlintrc.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"plugins": {},
|
|
3
|
-
"filters": {},
|
|
4
|
-
"rules": {
|
|
5
|
-
"ja-no-mixed-period": {
|
|
6
|
-
"periodMark": "。",
|
|
7
|
-
"forceAppendPeriod": true,
|
|
8
|
-
"allowPeriodMarks": ["?", "!", ":", "?", "!", ":"]
|
|
9
|
-
},
|
|
10
|
-
"en-no-mixed-period": {
|
|
11
|
-
"periodMark": ".",
|
|
12
|
-
"forceAppendPeriod": true,
|
|
13
|
-
"allowPeriodMarks": ["?", "!", ":", "?", "!", ":", "。"]
|
|
14
|
-
},
|
|
15
|
-
"ja-space-between-half-and-full-width": {
|
|
16
|
-
"space": "always"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|