@antelopejs/dms 0.20.3 → 0.20.4
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/CHANGELOG.md +21 -0
- package/dist/implementations/dms-builder/engine/compose-page.js +3 -2
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +1 -0
- package/dist/mcp/page-verify/index.js +1 -0
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/redact-report.d.ts +2 -0
- package/dist/mcp/page-verify/redact-report.js +120 -0
- package/dist/mcp/page-verify/redact-report.js.map +1 -0
- package/dist/mcp/page-verify/render.js +4 -1
- package/dist/mcp/page-verify/render.js.map +1 -1
- package/dist/mcp/redact.d.ts +87 -0
- package/dist/mcp/redact.js +139 -0
- package/dist/mcp/redact.js.map +1 -0
- package/dist/mcp/tools/builder-compose.js +11 -2
- package/dist/mcp/tools/builder-compose.js.map +1 -1
- package/dist/mcp/tools/builder-project.js +56 -23
- package/dist/mcp/tools/builder-project.js.map +1 -1
- package/dist/mcp/tools/builder-queries.js +41 -4
- package/dist/mcp/tools/builder-queries.js.map +1 -1
- package/dist/mcp/tools/builder-shared.d.ts +3 -1
- package/dist/mcp/tools/builder-shared.js +5 -0
- package/dist/mcp/tools/builder-shared.js.map +1 -1
- package/dist/mcp/tools/database.js +3 -2
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/page-verify.js +3 -2
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/frontend-vue/eslint-globals.generated.mjs +259 -942
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +46 -23
- package/frontend-vue/layers/dms-core/app/build/composables/auth/usePermissionPreview.ts +34 -23
- package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +8 -2
- package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +11 -5
- package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +4 -2
- package/frontend-vue/layers/dms-core/app/build/utils/json.ts +31 -0
- package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +6 -11
- package/frontend-vue/layers/dms-core/app/build/utils/record.ts +4 -0
- package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +56 -36
- package/frontend-vue/layers/dms-core/app/composables/auth/useApiData.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +6 -1
- package/frontend-vue/layers/dms-core/app/composables/auth/useCurrentUser.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useLogout.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useMultiAccount.ts +15 -14
- package/frontend-vue/layers/dms-core/app/composables/auth/useSessionRecovery.ts +21 -8
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -3
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +11 -9
- package/frontend-vue/layers/dms-core/app/composables/period/periodLink.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/realtime/usePageRealtime.ts +10 -3
- package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +22 -16
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +68 -46
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +22 -11
- package/frontend-vue/layers/dms-core/app/composables/useEventedAction.ts +4 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +14 -6
- package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +8 -3
- package/frontend-vue/layers/dms-core/app/composables/watch/useWatch.ts +17 -8
- package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -1
- package/frontend-vue/layers/dms-core/app/types/page.ts +3 -1
- package/frontend-vue/layers/dms-core/app/utils/dedupedRefresh.ts +2 -2
- package/frontend-vue/layers/dms-core/app/utils/formatter.ts +5 -5
- package/frontend-vue/layers/dms-core/app/utils/menu.ts +12 -4
- package/frontend-vue/layers/dms-core/app/utils/pageQuery.ts +7 -4
- package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +7 -3
- package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -10
- package/frontend-vue/layers/dms-core/app/utils/type-check.ts +25 -12
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIndex.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue +5 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/drawer/DynamicDrawer.vue +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/containers/modal/DynamicModal.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/row/RowHeader.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +10 -7
- package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/table/FiltersRow.vue +20 -18
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuColumns.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuDensity.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuFilter.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuPage.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuSort.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuViewMode.vue +21 -19
- package/frontend-vue/layers/dms-ui/app/build/components/table/RowSelection.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableMenu.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +3 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableTabs.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableViews.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentFilters.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPreferences.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentRows.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +11 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +35 -9
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/mockups/resync.ts +9 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +34 -25
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +52 -26
- package/frontend-vue/layers/dms-ui/app/build/utils/calendarDay.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/characterCount.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/dispatchQuickActionTarget.ts +16 -11
- package/frontend-vue/layers/dms-ui/app/build/utils/fieldOptionsI18n.ts +23 -21
- package/frontend-vue/layers/dms-ui/app/build/utils/json.ts +74 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/link.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +59 -50
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupDrop.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +34 -28
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStamp.ts +11 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/streamHighlight.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/components/RecursiveComponent.vue +3 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +5 -4
- package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/card/NavCard.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +62 -13
- package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +18 -6
- package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +9 -4
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +9 -6
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +16 -18
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -9
- package/frontend-vue/layers/dms-ui/app/components/form/LocalizedField.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputAddress.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputImage.vue +5 -8
- package/frontend-vue/layers/dms-ui/app/components/form/components/RichText.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/components/master-detail/MasterDetail.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +11 -6
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanDisplay.vue +40 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/apexDatetimeBuckets.ts +9 -5
- package/frontend-vue/layers/dms-ui/app/composables/chart/events.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/heatmapColors.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/localizeSeries.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +27 -4
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useChartFetch.ts +3 -4
- package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/openDynamicContainer.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/composables/containers/useModal.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +80 -39
- package/frontend-vue/layers/dms-ui/app/composables/live/usePageLiveRefresh.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/resolveDmsComponent.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/composables/tab/useTab.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/shortcuts/tableViewShiftA.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/column.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/display.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableViewExport.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useUnsavedChanges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +21 -9
- package/frontend-vue/layers/dms-ui/app/utils/blockRefresh.ts +8 -2
- package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +18 -8
- package/frontend-vue/layers/dms-ui/app/utils/metadataRetry.ts +1 -1
- package/frontend-vue/package.json +2 -1
- package/frontend-vue/scripts/check-api-error-presentation.mjs +257 -117
- package/frontend-vue/scripts/check-autoimport-boundaries.mjs +143 -27
- package/frontend-vue/scripts/check-disable-blocks.mjs +26 -4
- package/frontend-vue/scripts/check-dms-components.mjs +152 -246
- package/frontend-vue/scripts/check-invariants.mjs +100 -42
- package/frontend-vue/scripts/check-page-invariants.mjs +103 -40
- package/frontend-vue/scripts/dms-components-dependencies.mjs +106 -13
- package/frontend-vue/scripts/dms-components-script.mjs +375 -0
- package/frontend-vue/scripts/eslint-test-quality.mjs +126 -0
- package/frontend-vue/scripts/jsconfig.json +10 -0
- package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +4 -2
- package/frontend-vue/scripts/probes/frontend-behavior.cjs +217 -47
- package/frontend-vue/scripts/probes/frontend-legacy.cjs +159 -8
- package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +89 -10
- package/frontend-vue/scripts/prove-comment-emit.mjs +33 -4
- package/frontend-vue/scripts/prove-component-registration.mjs +110 -24
- package/frontend-vue/scripts/test-autoimport-boundaries.mjs +37 -6
- package/frontend-vue/scripts/test-dms-components.mjs +51 -2
- package/package.json +1 -1
- package/frontend-vue/eslint-test-quality.mjs +0 -62
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRecord } from "../../build/utils/record";
|
|
2
|
+
import { isNull, isString, isUndefined } from "../../utils/type-check";
|
|
2
3
|
import { ComponentId } from "../../types/watch";
|
|
3
4
|
|
|
4
5
|
function getValueByPath(
|
|
@@ -8,8 +9,9 @@ function getValueByPath(
|
|
|
8
9
|
const keys = path.split(".");
|
|
9
10
|
let current: unknown = obj;
|
|
10
11
|
for (const key of keys) {
|
|
11
|
-
if (current
|
|
12
|
-
|
|
12
|
+
if (isNull(current) || isUndefined(current)) return undefined;
|
|
13
|
+
const target: unknown = Object(current);
|
|
14
|
+
current = isRecord(target) ? target[key] : undefined;
|
|
13
15
|
}
|
|
14
16
|
return current;
|
|
15
17
|
}
|
|
@@ -41,6 +43,13 @@ interface WatchEventDetail {
|
|
|
41
43
|
|
|
42
44
|
type WatchEvent = Event & Partial<Pick<CustomEvent, "detail">>;
|
|
43
45
|
|
|
46
|
+
function isWatchEventDetail(value: unknown): value is WatchEventDetail {
|
|
47
|
+
return (
|
|
48
|
+
isRecord(value) &&
|
|
49
|
+
(isUndefined(value.component) || isString(value.component))
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
function checkParamConditions(
|
|
45
54
|
onParam: WatchAction["onParam"],
|
|
46
55
|
data: WatchEventDetail["data"],
|
|
@@ -87,7 +96,7 @@ export function useWatch(
|
|
|
87
96
|
*/
|
|
88
97
|
function runMatchingActions(
|
|
89
98
|
matchingActions: WatchAction[],
|
|
90
|
-
|
|
99
|
+
detail: WatchEventDetail,
|
|
91
100
|
) {
|
|
92
101
|
isLoading.value = true;
|
|
93
102
|
try {
|
|
@@ -98,7 +107,7 @@ export function useWatch(
|
|
|
98
107
|
}
|
|
99
108
|
// prettier-ignore
|
|
100
109
|
try {
|
|
101
|
-
actionFn(action,
|
|
110
|
+
actionFn(action, detail, componentState);
|
|
102
111
|
} catch {
|
|
103
112
|
// eslint-disable-line no-empty -- A synchronous action failure does not stop subsequent actions.
|
|
104
113
|
}
|
|
@@ -109,8 +118,8 @@ export function useWatch(
|
|
|
109
118
|
}
|
|
110
119
|
|
|
111
120
|
function handleWatchEvent(event: WatchEvent) {
|
|
112
|
-
const
|
|
113
|
-
if (!detail) {
|
|
121
|
+
const detail: unknown = event.detail;
|
|
122
|
+
if (!isWatchEventDetail(detail)) {
|
|
114
123
|
return;
|
|
115
124
|
}
|
|
116
125
|
|
|
@@ -122,7 +131,7 @@ export function useWatch(
|
|
|
122
131
|
return;
|
|
123
132
|
}
|
|
124
133
|
|
|
125
|
-
runMatchingActions(matchingActions,
|
|
134
|
+
runMatchingActions(matchingActions, detail);
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
onMounted(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { JsonValue } from "./json";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Mirror of the backend's module store listing (`GET /dms/store/listing`,
|
|
3
5
|
* `src/store/types.ts` in `@antelopejs/dms`).
|
|
@@ -133,7 +135,7 @@ export interface StoreDependencyChoice {
|
|
|
133
135
|
/** npm package, never a git or local source. */
|
|
134
136
|
package: string;
|
|
135
137
|
/** Config written to its antelope.config.ts entry. */
|
|
136
|
-
config?:
|
|
138
|
+
config?: { [key: string]: JsonValue };
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
/** Body of `POST /dms/store/<kind>`; only an install carries dependencies. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlockText } from "#dms-core/app/types/composed-text";
|
|
2
|
+
import type { JsonValue } from "#dms-core/app/types/json";
|
|
2
3
|
import type { BlockAction } from "#dms-core/app/entries/types/block-action";
|
|
3
4
|
import type { PageLiveOptions } from "#dms-core/app/types/live";
|
|
4
5
|
import type { ModuleSourceKind } from "./module-store";
|
|
@@ -141,7 +142,8 @@ export interface LayoutBanner {
|
|
|
141
142
|
/** Link buttons after the text; the last one leads. */
|
|
142
143
|
actions?: BlockAction[];
|
|
143
144
|
component?: string;
|
|
144
|
-
props
|
|
145
|
+
/** The props `component` is drawn with, as the backend sends them. */
|
|
146
|
+
props?: { [key: string]: JsonValue };
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
export type SiteLayout = {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* token out from under each other and log the user out.
|
|
10
10
|
*/
|
|
11
11
|
export function runDeduped<T>(
|
|
12
|
-
holder: Record<PropertyKey,
|
|
12
|
+
holder: Record<PropertyKey, Promise<T> | null | undefined>,
|
|
13
13
|
key: PropertyKey,
|
|
14
14
|
task: () => Promise<T>,
|
|
15
15
|
): Promise<T> {
|
|
16
|
-
const existing = holder[key]
|
|
16
|
+
const existing = Object.hasOwn(holder, key) ? holder[key] : undefined;
|
|
17
17
|
if (existing) {
|
|
18
18
|
return existing;
|
|
19
19
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
regionalDateTimeFormat,
|
|
4
4
|
regionalDayNumber,
|
|
5
5
|
} from "./regional";
|
|
6
|
-
import { isNumber } from "./type-check";
|
|
6
|
+
import { isDate, isNull, isNumber, isString, isUndefined } from "./type-check";
|
|
7
7
|
import type { I18nTranslate } from "../composables/translation/useTranslation";
|
|
8
8
|
|
|
9
9
|
const DEFAULT_LOCALE = "en-US";
|
|
@@ -183,7 +183,7 @@ export function formatDate(
|
|
|
183
183
|
locale: string = DEFAULT_LOCALE,
|
|
184
184
|
options?: Intl.DateTimeFormatOptions,
|
|
185
185
|
): string | null {
|
|
186
|
-
if (date
|
|
186
|
+
if (isUndefined(date) || isNull(date)) {
|
|
187
187
|
return null;
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -191,10 +191,10 @@ export function formatDate(
|
|
|
191
191
|
const formatOptions = options || defaultDateFormatterOptions;
|
|
192
192
|
|
|
193
193
|
try {
|
|
194
|
-
if (date
|
|
194
|
+
if (isDate(date)) {
|
|
195
195
|
validDate = date;
|
|
196
196
|
} else {
|
|
197
|
-
validDate = new Date(date
|
|
197
|
+
validDate = new Date(isNumber(date) ? date : String(date));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
if (Number.isNaN(validDate.getTime())) {
|
|
@@ -278,7 +278,7 @@ const CURRENCY_CODE = /^[A-Za-z]{3}$/;
|
|
|
278
278
|
*/
|
|
279
279
|
function priceCurrency(options: Intl.NumberFormatOptions | undefined): string {
|
|
280
280
|
const code = options?.currency;
|
|
281
|
-
return
|
|
281
|
+
return isString(code) && CURRENCY_CODE.test(code)
|
|
282
282
|
? code.toUpperCase()
|
|
283
283
|
: DEFAULT_CURRENCY;
|
|
284
284
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NavigationMenuItem } from "@nuxt/ui";
|
|
2
2
|
import { parseLinkQuery, stripQueryAndHash } from "./routePath";
|
|
3
|
-
import {
|
|
3
|
+
import { isRecord } from "../build/utils/record";
|
|
4
|
+
import { isString, isUndefined } from "./type-check";
|
|
4
5
|
|
|
5
6
|
export const MENU_STATUS_TEXT_CLASSES: Record<MenuItemStatus, string> = {
|
|
6
7
|
success: "text-success",
|
|
@@ -58,15 +59,22 @@ const matchesRoutePrefix = (currentPath: string, to: string): boolean => {
|
|
|
58
59
|
return current === target || current.startsWith(`${target}/`);
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
const isMenuItemTarget = (
|
|
63
|
+
value: NavigationMenuItem["to"],
|
|
64
|
+
): value is MenuItemTarget =>
|
|
65
|
+
isRecord(value) &&
|
|
66
|
+
isString(value.path) &&
|
|
67
|
+
(isUndefined(value.query) ||
|
|
68
|
+
(isRecord(value.query) && Object.values(value.query).every(isString)));
|
|
69
|
+
|
|
61
70
|
const resolveItemTarget = (
|
|
62
71
|
to: NavigationMenuItem["to"],
|
|
63
72
|
): MenuItemTarget | null => {
|
|
64
73
|
if (isString(to)) {
|
|
65
74
|
return { path: stripQueryAndHash(to), query: parseLinkQuery(to) };
|
|
66
75
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return { path: target.path, query: target.query };
|
|
76
|
+
if (isMenuItemTarget(to)) {
|
|
77
|
+
return { path: to.path, query: to.query };
|
|
70
78
|
}
|
|
71
79
|
return null;
|
|
72
80
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { isString } from "#dms-core/app/utils/type-check";
|
|
2
|
+
import type { ValidationRouteContext } from "./query-validation";
|
|
2
3
|
|
|
3
4
|
/** The page query as the server reads it: one value per name, the last one. */
|
|
4
5
|
export function pageQueryValues(
|
|
5
|
-
query:
|
|
6
|
+
query: ValidationRouteContext["query"] | undefined,
|
|
6
7
|
): Record<string, string> {
|
|
7
8
|
return Object.fromEntries(
|
|
8
9
|
Object.entries(query ?? {}).flatMap(([name, value]) => {
|
|
9
|
-
const last = Array.isArray(value) ? value.at(-1) : value;
|
|
10
|
+
const last: unknown = Array.isArray(value) ? value.at(-1) : value;
|
|
10
11
|
return isString(last) ? [[name, last]] : [];
|
|
11
12
|
}),
|
|
12
13
|
);
|
|
@@ -65,7 +66,7 @@ export function fillRouteParams(
|
|
|
65
66
|
params: Record<string, string>,
|
|
66
67
|
): string {
|
|
67
68
|
return layoutUrl.replace(/:([^/]+)/g, (segment, name: string) =>
|
|
68
|
-
name
|
|
69
|
+
Object.hasOwn(params, name) ? params[name]! : segment,
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -77,6 +78,8 @@ export function isSameRouteParams(
|
|
|
77
78
|
const names = Object.keys(left);
|
|
78
79
|
return (
|
|
79
80
|
names.length === Object.keys(right).length &&
|
|
80
|
-
names.every(
|
|
81
|
+
names.every(
|
|
82
|
+
(name) => Object.hasOwn(right, name) && left[name] === right[name],
|
|
83
|
+
)
|
|
81
84
|
);
|
|
82
85
|
}
|
|
@@ -22,11 +22,15 @@ export const evaluateRowActionRule: RuleEvaluator = (rule, row) => {
|
|
|
22
22
|
|
|
23
23
|
if (FIELD_KEY in rule) {
|
|
24
24
|
const ruleObj: RuleDictionary = rule;
|
|
25
|
-
const fieldValue = get(row, rule.field);
|
|
25
|
+
const fieldValue: unknown = get(row, rule.field);
|
|
26
26
|
for (const [operator, def] of Object.entries(FIELD_OPERATORS)) {
|
|
27
27
|
if (operator in ruleObj) {
|
|
28
|
-
const
|
|
29
|
-
return compare(fieldValue,
|
|
28
|
+
const ruleValue = ruleObj[operator];
|
|
29
|
+
if (!def.isArray) return def.compare(fieldValue, ruleValue);
|
|
30
|
+
const ruleValues: unknown[] | undefined = Array.isArray(ruleValue)
|
|
31
|
+
? ruleValue
|
|
32
|
+
: undefined;
|
|
33
|
+
return ruleValues !== undefined && def.compare(fieldValue, ruleValues);
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
| Date
|
|
6
|
-
| null
|
|
7
|
-
| undefined
|
|
8
|
-
| Record<string, unknown>
|
|
9
|
-
| unknown[];
|
|
1
|
+
import { isJsonValue } from "../build/utils/json";
|
|
2
|
+
import type { JsonValue } from "../types/json";
|
|
3
|
+
|
|
4
|
+
export type Primitive = JsonValue | Date | undefined;
|
|
10
5
|
|
|
11
6
|
const KEYWORD_VALUES: Record<
|
|
12
7
|
Parameters<typeof isKeyword>[0],
|
|
@@ -33,7 +28,10 @@ const PARSER_REGISTRY = [
|
|
|
33
28
|
},
|
|
34
29
|
{
|
|
35
30
|
test: isStringJSON,
|
|
36
|
-
parse: (value: string) =>
|
|
31
|
+
parse: (value: string): Primitive => {
|
|
32
|
+
const parsed: unknown = JSON.parse(value);
|
|
33
|
+
return isJsonValue(parsed) ? parsed : value;
|
|
34
|
+
},
|
|
37
35
|
},
|
|
38
36
|
];
|
|
39
37
|
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
/** Any function: what it returns is unknown until a guard reads it. */
|
|
2
|
+
type CallableFunction = (...args: any[]) => Parameters<typeof isNull>[0];
|
|
3
|
+
|
|
4
|
+
/** The type each `typeof` result a guard below tests for narrows to. */
|
|
5
|
+
interface TypeofResults {
|
|
6
|
+
string: string;
|
|
7
|
+
number: number;
|
|
8
|
+
boolean: boolean;
|
|
9
|
+
undefined: undefined;
|
|
10
|
+
function: CallableFunction;
|
|
11
|
+
bigint: bigint;
|
|
12
|
+
symbol: symbol;
|
|
13
|
+
}
|
|
2
14
|
|
|
3
15
|
const createTypeGuard =
|
|
4
|
-
<
|
|
5
|
-
(v: unknown): v is
|
|
16
|
+
<K extends keyof TypeofResults>(type: K) =>
|
|
17
|
+
(v: unknown): v is TypeofResults[K] =>
|
|
6
18
|
typeof v === type;
|
|
7
19
|
|
|
8
|
-
export const isString = createTypeGuard
|
|
9
|
-
export const isNumber = createTypeGuard
|
|
10
|
-
export const isBoolean = createTypeGuard
|
|
11
|
-
export const isUndefined = createTypeGuard
|
|
12
|
-
export const isObject =
|
|
13
|
-
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
20
|
+
export const isString = createTypeGuard("string");
|
|
21
|
+
export const isNumber = createTypeGuard("number");
|
|
22
|
+
export const isBoolean = createTypeGuard("boolean");
|
|
23
|
+
export const isUndefined = createTypeGuard("undefined");
|
|
24
|
+
export const isObject = (v: unknown): v is Record<string, unknown> =>
|
|
25
|
+
typeof v === "object";
|
|
26
|
+
export const isFunction = createTypeGuard("function");
|
|
27
|
+
export const isBigint = createTypeGuard("bigint");
|
|
28
|
+
export const isSymbol = createTypeGuard("symbol");
|
|
16
29
|
|
|
17
30
|
export const isNull = (value: unknown): value is null => value === null;
|
|
18
31
|
|
|
@@ -24,7 +37,7 @@ export const isJSON = (value: Parameters<typeof isString>[0]): boolean => {
|
|
|
24
37
|
return false;
|
|
25
38
|
}
|
|
26
39
|
try {
|
|
27
|
-
const parsed = JSON.parse(value);
|
|
40
|
+
const parsed: unknown = JSON.parse(value);
|
|
28
41
|
return isObject(parsed) && !isNull(parsed);
|
|
29
42
|
} catch {
|
|
30
43
|
return false;
|
|
@@ -61,7 +61,7 @@ watch(
|
|
|
61
61
|
},
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
function box(rect: PreviewRect)
|
|
64
|
+
function box(rect: PreviewRect) {
|
|
65
65
|
return {
|
|
66
66
|
left: `${rect.x}px`,
|
|
67
67
|
top: `${rect.y}px`,
|
|
@@ -98,7 +98,7 @@ const textStyle = computed(() => {
|
|
|
98
98
|
};
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
function pointOf(event: DragEvent)
|
|
101
|
+
function pointOf(event: DragEvent) {
|
|
102
102
|
const target = event.currentTarget;
|
|
103
103
|
const origin =
|
|
104
104
|
target instanceof Element
|
|
@@ -22,7 +22,7 @@ function viewerLink(name: string): string {
|
|
|
22
22
|
|
|
23
23
|
onMounted(async () => {
|
|
24
24
|
try {
|
|
25
|
-
const answer = await $authFetch(MOCKUP_LIST_ENDPOINT);
|
|
25
|
+
const answer: unknown = await $authFetch(MOCKUP_LIST_ENDPOINT);
|
|
26
26
|
const list = parseMockupList(answer);
|
|
27
27
|
hasFailed.value = list === undefined;
|
|
28
28
|
mockups.value = list ?? [];
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
type MockupSpecDocument,
|
|
14
14
|
} from "../../utils/mockupSpec";
|
|
15
15
|
import type { MockupIssue } from "../../utils/mockup";
|
|
16
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
16
17
|
import MockupInspectorField from "./MockupInspectorField.vue";
|
|
17
18
|
import MockupIssues from "./MockupIssues.vue";
|
|
18
19
|
import MockupPageInspector from "./MockupPageInspector.vue";
|
|
@@ -62,12 +63,12 @@ const hasData = computed(() => {
|
|
|
62
63
|
);
|
|
63
64
|
});
|
|
64
65
|
|
|
65
|
-
function optionValue(key: string):
|
|
66
|
+
function optionValue(key: string): JsonValue | undefined {
|
|
66
67
|
const options = node.value?.options ?? {};
|
|
67
68
|
return Object.hasOwn(options, key) ? options[key] : undefined;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
function setOption(key: string, value:
|
|
71
|
+
function setOption(key: string, value: JsonValue | undefined): void {
|
|
71
72
|
const pointer = props.selection;
|
|
72
73
|
if (!pointer) return;
|
|
73
74
|
emit("edit", { kind: "setOption", pointer, key, value }, `${pointer}:${key}`);
|
package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
isNumber,
|
|
6
6
|
isString,
|
|
7
7
|
} from "../../../../../dms-core/app/utils/type-check";
|
|
8
|
+
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
8
9
|
import type { MockupInspectorField } from "../../utils/mockupInspector";
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -15,7 +16,7 @@ const props = defineProps<{
|
|
|
15
16
|
field: MockupInspectorField;
|
|
16
17
|
value: unknown;
|
|
17
18
|
}>();
|
|
18
|
-
const emit = defineEmits<{ update: [value:
|
|
19
|
+
const emit = defineEmits<{ update: [value: JsonValue | undefined] }>();
|
|
19
20
|
|
|
20
21
|
const UNSET = "\u0000unset";
|
|
21
22
|
const COLOR_PATTERN = /^#[0-9a-f]{6}$/i;
|
|
@@ -60,7 +61,9 @@ const selected = computed(() =>
|
|
|
60
61
|
: UNSET,
|
|
61
62
|
);
|
|
62
63
|
|
|
63
|
-
function emitChoice(
|
|
64
|
+
function emitChoice(
|
|
65
|
+
next: MockupInspectorField["choices"][number]["value"],
|
|
66
|
+
): void {
|
|
64
67
|
emit("update", next === UNSET ? undefined : next);
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -15,6 +15,7 @@ import { useWindowSize } from "@vueuse/core";
|
|
|
15
15
|
import type {
|
|
16
16
|
ContainerColor,
|
|
17
17
|
ContainerInstance,
|
|
18
|
+
ContainerOptions,
|
|
18
19
|
DrawerDirection,
|
|
19
20
|
} from "../../../../composables/containers/types";
|
|
20
21
|
import type { ModalSize } from "../../../../types/modal";
|
|
@@ -42,11 +43,11 @@ interface DynamicDrawerProps {
|
|
|
42
43
|
description?: string;
|
|
43
44
|
containerId: string;
|
|
44
45
|
component: Component;
|
|
45
|
-
componentOptions?:
|
|
46
|
+
componentOptions?: ContainerOptions["componentOptions"];
|
|
46
47
|
/** Mounts the body component anew when it changes. */
|
|
47
48
|
componentKey?: string;
|
|
48
49
|
headerComponent?: Component;
|
|
49
|
-
headerComponentOptions?:
|
|
50
|
+
headerComponentOptions?: ContainerOptions["headerComponentOptions"];
|
|
50
51
|
direction?: DrawerDirection;
|
|
51
52
|
/**
|
|
52
53
|
* Width a side drawer opens at, from `lg`: a modal's width at that size;
|
|
@@ -95,7 +96,7 @@ const NUXT_UI_FORM_KEYS: symbol[] = [
|
|
|
95
96
|
];
|
|
96
97
|
const drawerInstance = currentInstanceProvides();
|
|
97
98
|
if (drawerInstance && props.callerProvides) {
|
|
98
|
-
drawerInstance.provides =
|
|
99
|
+
drawerInstance.provides = { __proto__: toRaw(props.callerProvides) };
|
|
99
100
|
|
|
100
101
|
for (const key of NUXT_UI_FORM_KEYS) provide(key, undefined);
|
|
101
102
|
}
|
|
@@ -5,6 +5,7 @@ import type { ModalSize } from "../../../../types/modal";
|
|
|
5
5
|
import type {
|
|
6
6
|
ContainerColor,
|
|
7
7
|
ContainerInstance,
|
|
8
|
+
ContainerOptions,
|
|
8
9
|
} from "../../../../composables/containers/types";
|
|
9
10
|
import DmsIconWell from "../../../../components/icon-well/IconWell.vue";
|
|
10
11
|
import {
|
|
@@ -20,11 +21,11 @@ interface DynamicModalProps {
|
|
|
20
21
|
size?: ModalSize;
|
|
21
22
|
containerId: string;
|
|
22
23
|
component: Component;
|
|
23
|
-
componentOptions?:
|
|
24
|
+
componentOptions?: ContainerOptions["componentOptions"];
|
|
24
25
|
/** Mounts the body component anew when it changes. */
|
|
25
26
|
componentKey?: string;
|
|
26
27
|
headerComponent?: Component;
|
|
27
|
-
headerComponentOptions?:
|
|
28
|
+
headerComponentOptions?: ContainerOptions["headerComponentOptions"];
|
|
28
29
|
icon?: string;
|
|
29
30
|
color?: ContainerColor;
|
|
30
31
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { computed } from "vue";
|
|
10
10
|
import type { Component } from "vue";
|
|
11
|
+
import type { ContainerOptions } from "../../../../composables/containers/types";
|
|
11
12
|
import type { RowNavigation } from "../../../../types/row-navigation";
|
|
12
13
|
|
|
13
14
|
interface RowHeaderProps {
|
|
@@ -25,7 +26,7 @@ interface RowHeaderProps {
|
|
|
25
26
|
subtitleClass?: string;
|
|
26
27
|
/** Drawn under the position line (pills, hints). */
|
|
27
28
|
component?: Component;
|
|
28
|
-
componentOptions?:
|
|
29
|
+
componentOptions?: ContainerOptions["componentOptions"];
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const props = withDefaults(defineProps<RowHeaderProps>(), {
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
type CalendarRange,
|
|
25
25
|
isBeyondMaxDays,
|
|
26
26
|
} from "../../composables/period/periodDisplay";
|
|
27
|
+
import { toCalendarDay } from "../../utils/calendarDay";
|
|
27
28
|
|
|
28
29
|
interface Props {
|
|
29
30
|
modelValue: CalendarRange | null;
|
|
@@ -39,7 +40,8 @@ interface Props {
|
|
|
39
40
|
maxDays?: number;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
const WEEK_STARTS = [0, 1, 2, 3, 4, 5, 6] as const;
|
|
44
|
+
const MONDAY = 1;
|
|
43
45
|
|
|
44
46
|
const props = withDefaults(defineProps<Props>(), {
|
|
45
47
|
compareRange: null,
|
|
@@ -93,8 +95,8 @@ const rekaValue = computed<DateRange>(() =>
|
|
|
93
95
|
);
|
|
94
96
|
|
|
95
97
|
function onUpdate(value: DateRange | null) {
|
|
96
|
-
const start = value?.start
|
|
97
|
-
const end = value?.end
|
|
98
|
+
const start = toCalendarDay(value?.start);
|
|
99
|
+
const end = toCalendarDay(value?.end);
|
|
98
100
|
if (start && end) {
|
|
99
101
|
pendingStart.value = null;
|
|
100
102
|
emit("pending", null);
|
|
@@ -107,9 +109,8 @@ function onUpdate(value: DateRange | null) {
|
|
|
107
109
|
|
|
108
110
|
function isDateDisabled(date: DateValue): boolean {
|
|
109
111
|
const picked = pendingStart.value;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
);
|
|
112
|
+
const day = toCalendarDay(date);
|
|
113
|
+
return !!picked && !!day && isBeyondMaxDays(day, picked, props.maxDays);
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
function onPlaceholder(value: DateValue) {
|
|
@@ -198,7 +199,9 @@ function triggerClass(date: DateValue): (string | false)[] {
|
|
|
198
199
|
];
|
|
199
200
|
}
|
|
200
201
|
|
|
201
|
-
const weekStart = computed(
|
|
202
|
+
const weekStart = computed(
|
|
203
|
+
() => WEEK_STARTS.find((day) => day === props.weekStartsOn) ?? MONDAY,
|
|
204
|
+
);
|
|
202
205
|
</script>
|
|
203
206
|
|
|
204
207
|
<template>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* `added` from another one, `removed` to another one.
|
|
11
11
|
*/
|
|
12
12
|
import { useSortable } from "@vueuse/integrations/useSortable";
|
|
13
|
-
import { ref, watch } from "vue";
|
|
13
|
+
import { type VNode, ref, watch } from "vue";
|
|
14
14
|
|
|
15
15
|
export interface SortableListChange<Item> {
|
|
16
16
|
added?: { element: Item; newIndex: number };
|
|
@@ -44,7 +44,7 @@ const props = defineProps<{
|
|
|
44
44
|
const emit = defineEmits<{ change: [change: SortableListChange<Item>] }>();
|
|
45
45
|
|
|
46
46
|
defineSlots<{
|
|
47
|
-
item(props: { element: Item; index: number }):
|
|
47
|
+
item(props: { element: Item; index: number }): VNode | VNode[];
|
|
48
48
|
}>();
|
|
49
49
|
|
|
50
50
|
/** What this list reads of SortableJS's events. */
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends Data">
|
|
2
|
+
import { themeOverride } from "./tableComponentTheme";
|
|
2
3
|
import { EYEBROW_CLASS } from "../../utils/eyebrow";
|
|
3
4
|
import { injectLocal } from "@vueuse/core";
|
|
4
5
|
import { tv } from "tailwind-variants";
|
|
5
6
|
import type { ShallowRef } from "vue";
|
|
6
|
-
import
|
|
7
|
+
import { isJsonObject } from "../../utils/json";
|
|
7
8
|
import type {
|
|
8
9
|
Data,
|
|
9
10
|
TableFilter,
|
|
@@ -54,13 +55,11 @@ const tableSharedData =
|
|
|
54
55
|
const { t } = useI18n();
|
|
55
56
|
const { processI18n } = useTranslation();
|
|
56
57
|
|
|
57
|
-
const appConfig = useDmsAppConfig()
|
|
58
|
-
ui: { tableFiltersRow: Partial<typeof theme> };
|
|
59
|
-
};
|
|
58
|
+
const appConfig = useDmsAppConfig();
|
|
60
59
|
|
|
61
60
|
const uiVariant = tv({
|
|
62
61
|
extend: tv(theme),
|
|
63
|
-
...
|
|
62
|
+
...themeOverride("tableFiltersRow"),
|
|
64
63
|
});
|
|
65
64
|
const ui = computed(() => uiVariant());
|
|
66
65
|
|
|
@@ -99,13 +98,16 @@ const resolveFilterComponent = (filter: TableFilter) => {
|
|
|
99
98
|
? processI18n(opts.placeholder)
|
|
100
99
|
: opts.placeholder;
|
|
101
100
|
const items = Array.isArray(opts.items)
|
|
102
|
-
? opts.items.map((item) =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
? opts.items.map((item) =>
|
|
102
|
+
isJsonObject(item)
|
|
103
|
+
? {
|
|
104
|
+
...item,
|
|
105
|
+
label: isString(item.label)
|
|
106
|
+
? processI18n(item.label)
|
|
107
|
+
: item.label,
|
|
108
|
+
}
|
|
109
|
+
: item,
|
|
110
|
+
)
|
|
109
111
|
: opts.items;
|
|
110
112
|
|
|
111
113
|
return { ...candidate, options: { ...opts, placeholder, items } };
|
|
@@ -145,8 +147,8 @@ const clearable = computed(
|
|
|
145
147
|
const canClear = computed(
|
|
146
148
|
() => !!clearable.value?.filters || !!clearable.value?.search,
|
|
147
149
|
);
|
|
148
|
-
const reset = () => {
|
|
149
|
-
tableSharedData?.value?.resetFilters();
|
|
150
|
+
const reset = async () => {
|
|
151
|
+
await tableSharedData?.value?.resetFilters();
|
|
150
152
|
};
|
|
151
153
|
|
|
152
154
|
const addFilterOpen = ref(false);
|
|
@@ -171,10 +173,10 @@ const itemLabels = (filter: TableFilter): string | undefined => {
|
|
|
171
173
|
const values = Array.isArray(filter.value) ? filter.value : [filter.value];
|
|
172
174
|
const labels = values.map((value) => {
|
|
173
175
|
const item = items.find(
|
|
174
|
-
(candidate) =>
|
|
175
|
-
|
|
176
|
-
)
|
|
177
|
-
return
|
|
176
|
+
(candidate) => isJsonObject(candidate) && candidate.value === value,
|
|
177
|
+
);
|
|
178
|
+
const label = isJsonObject(item) ? item.label : undefined;
|
|
179
|
+
return label !== undefined ? String(label) : String(value);
|
|
178
180
|
});
|
|
179
181
|
return labels.length ? labels.join(", ") : undefined;
|
|
180
182
|
};
|
|
@@ -6,6 +6,7 @@ import type { ShallowRef } from "vue";
|
|
|
6
6
|
|
|
7
7
|
import type { TableSharedData, Data } from "./TableRoot.vue";
|
|
8
8
|
import SortableList from "../sortable/SortableList.vue";
|
|
9
|
+
import { themeOverride } from "./tableComponentTheme";
|
|
9
10
|
|
|
10
11
|
const theme = tv({
|
|
11
12
|
slots: {
|
|
@@ -27,10 +28,6 @@ const tableSharedData =
|
|
|
27
28
|
|
|
28
29
|
const { t } = useI18n();
|
|
29
30
|
|
|
30
|
-
const appConfig = useDmsAppConfig() as ReturnType<typeof useDmsAppConfig> & {
|
|
31
|
-
ui: { tableMenuColumn: Partial<typeof theme> };
|
|
32
|
-
};
|
|
33
|
-
|
|
34
31
|
const order = computed(
|
|
35
32
|
() => tableSharedData?.value?.columnOrderState.value || [],
|
|
36
33
|
);
|
|
@@ -88,7 +85,7 @@ function resetColumns() {
|
|
|
88
85
|
|
|
89
86
|
const uiTableMenuColumnVariant = tv({
|
|
90
87
|
extend: tv(theme),
|
|
91
|
-
...
|
|
88
|
+
...themeOverride("tableMenuColumn"),
|
|
92
89
|
});
|
|
93
90
|
const uiTableMenuColumn = computed(() => uiTableMenuColumnVariant());
|
|
94
91
|
</script>
|