@jsb188/mday-web 1.1.11 → 1.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsb188/mday-web",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Web components and utilities for Marketday app.",
5
5
  "license": "ISC",
6
6
  "author": "jsb188",
@@ -8,27 +8,29 @@
8
8
  "exports": {
9
9
  "./libs/public-form-beacon": "./src/libs/public-form-beacon.ts",
10
10
  "./libs/route-metadata.server": "./src/libs/route-metadata.server.ts",
11
- "./utils/account-web": "./src/utils/account-web.ts",
11
+ "./utils/email": "./src/utils/email.ts",
12
12
  "./utils/route": "./src/utils/route-helpers.ts",
13
13
  "./utils/log-web": "./src/utils/log-web.ts",
14
14
  "./utils/list-web": "./src/utils/list-web.ts",
15
15
  "./utils/org-web": "./src/utils/org-web.ts",
16
+ "./utils/operation-pages": "./src/utils/operation-pages.ts",
16
17
  "./utils/public-form": "./src/utils/public-form.ts",
17
18
  "./utils/workflow-web": "./src/utils/workflow-web.ts",
18
- "./modules/AgentDocs": "./src/modules/AgentDocs.tsx",
19
- "./modules/DocAccessSettings": "./src/modules/DocAccessSettings.tsx",
20
- "./modules/FieldDocEmail": "./src/modules/FieldDocEmail.tsx",
21
19
  "./modules/Grids": "./src/modules/Grids.tsx",
22
- "./ui/FieldDocEmailUI": "./src/ui/FieldDocEmailUI.tsx",
23
- "./modules/RouteShell": "./src/modules/RouteShell.tsx"
20
+ "./modules/RouteShell": "./src/modules/RouteShell.tsx",
21
+ "./schemas/organization": "./src/schemas/organization.ts"
22
+ },
23
+ "dependencies": {
24
+ "zod": "^3.25.76"
24
25
  },
25
- "dependencies": {},
26
26
  "peerDependencies": {
27
- "@jsb188/app": "1.1.11",
28
- "@jsb188/graphql": "1.1.11",
29
- "@jsb188/mday": "1.1.11",
30
- "@jsb188/react": "1.1.11",
31
- "@jsb188/react-web": "1.1.11"
27
+ "@jsb188/app": "1.1.12",
28
+ "@jsb188/graphql": "1.1.12",
29
+ "@jsb188/mday": "1.1.12",
30
+ "@jsb188/react": "1.1.12",
31
+ "@jsb188/react-web": "1.1.12",
32
+ "@jsb188/auth-web": "1.1.12",
33
+ "@jsb188/form": "1.1.12"
32
34
  },
33
35
  "scripts": {
34
36
  "test": "vitest run --config ./vitest.config.ts --passWithNoTests"
@@ -0,0 +1,36 @@
1
+ import i18n from '@jsb188/app/i18n/index.ts';
2
+ import { definePageFilterSchema } from '@jsb188/react/libs/page-filters';
3
+ import { usePageFilters } from '@jsb188/react/libs/use-page-filters';
4
+ import {
5
+ makePageToolbarFilters,
6
+ type PageToolbarFilter,
7
+ } from '@jsb188/react-web/modules/ToolbarFilters';
8
+ import type { GridItemSortEnum } from '@jsb188/mday/types/sheet.d.ts';
9
+
10
+ export const GRIDS_FILTER_SCHEMA = definePageFilterSchema({
11
+ filter: {},
12
+ sort: {
13
+ values: ['UPDATED_AT_DESC', 'TITLE_ASC'],
14
+ default: 'UPDATED_AT_DESC',
15
+ },
16
+ });
17
+ export const GRIDS_SORT_TOOLBAR: PageToolbarFilter = {
18
+ control: 'sort',
19
+ label: i18n.t('c.sort_by'),
20
+ labels: {
21
+ UPDATED_AT_DESC: i18n.t('app.grids_sort_updated_date'),
22
+ TITLE_ASC: i18n.t('app.grids_sort_title'),
23
+ },
24
+ };
25
+
26
+ /*
27
+ * Share committed URL sort state between the grids toolbar and both grid queries.
28
+ */
29
+ export function useGridsToolbarState() {
30
+ const state = usePageFilters(GRIDS_FILTER_SCHEMA);
31
+ return {
32
+ ...state,
33
+ sortQueryValue: state.sort as GridItemSortEnum,
34
+ toolbarOptions: makePageToolbarFilters(state, [GRIDS_SORT_TOOLBAR]),
35
+ };
36
+ }