@chelone/vue 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/admin.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/admin/auth-gate.js +1 -3
- package/dist/admin/resource-view.d.ts +8 -0
- package/dist/admin/resource-view.js +19 -0
- package/dist/auth/permissions-hooks.js +1 -3
- package/dist/choices/choices-context.d.ts +1 -2
- package/dist/choices/use-choices.d.ts +3 -3
- package/dist/choices/use-choices.js +13 -10
- package/dist/choices/use-reference-input.js +4 -4
- package/dist/components/admin/auth/auth-error.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/auth/auth-layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/auth/can-access.vue.d.ts +2 -2
- package/dist/components/admin/auth/login-form.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/auth/login-with-email.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/admin/buttons/bulk-update-button.vue.d.ts +19 -6
- package/dist/components/admin/buttons/bulk-update-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/buttons/clone-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/clone-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/delete-button.vue.d.ts +19 -10
- package/dist/components/admin/buttons/delete-button.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/components/admin/buttons/dual-approval-button.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/admin/buttons/edit-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/edit-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/export-button.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/buttons/fields-selector.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/buttons/filter-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/buttons/record-button-props.d.ts +12 -0
- package/dist/components/admin/buttons/show-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/show-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/status-transition-button.vue_vue_type_script_setup_true_lang.js +3 -7
- package/dist/components/admin/buttons/update-button.vue.d.ts +28 -24
- package/dist/components/admin/buttons/update-button.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/admin/common/application-updated-notification.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/common/i18n-key-editor.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/csv-import/csv-import.vue_vue_type_script_setup_true_lang.js +2 -5
- package/dist/components/admin/feedback/error.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/feedback/linear-progress.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/admin/feedback/loading.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/components/admin/feedback/placeholder.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/fields/api-key-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/api-key-field.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/components/admin/fields/array-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/badge-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/boolean-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/chip-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/color-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/cron-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/currency-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/date-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/diff-viewer.vue.d.ts +3 -3
- package/dist/components/admin/fields/duration-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/email-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/field-props.d.ts +2 -2
- package/dist/components/admin/fields/file-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/image-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/json-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/number-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/phone-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/phone-field.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/admin/fields/rating-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/rating-field.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/reference-array-field.vue.d.ts +20 -10
- package/dist/components/admin/fields/reference-field.vue.d.ts +22 -35
- package/dist/components/admin/fields/reference-many-count.vue.d.ts +20 -5
- package/dist/components/admin/fields/reference-many-field.vue.d.ts +20 -12
- package/dist/components/admin/fields/reference-one-field.vue.d.ts +22 -12
- package/dist/components/admin/fields/select-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/text-array-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/text-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/url-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/usage-meter-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/usage-meter-field.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/webhook-endpoint-field.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/fields/wrapper-field.vue.d.ts +21 -11
- package/dist/components/admin/inputs/api-key-input.vue.d.ts +20 -5
- package/dist/components/admin/inputs/api-key-input.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/admin/inputs/array-input-row.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/checkbox-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/date-input-format.d.ts +4 -1
- package/dist/components/admin/inputs/date-input-format.js +10 -1
- package/dist/components/admin/inputs/date-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/date-time-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/duration-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/image-input-thumbnail.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/components/admin/inputs/image-input.vue.d.ts +1 -0
- package/dist/components/admin/inputs/image-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/inputs/in-place-editor-form.vue.d.ts +3 -3
- package/dist/components/admin/inputs/in-place-editor-form.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/in-place-editor.vue.d.ts +3 -3
- package/dist/components/admin/inputs/number-input.vue.d.ts +6 -0
- package/dist/components/admin/inputs/number-input.vue_vue_type_script_setup_true_lang.js +9 -0
- package/dist/components/admin/inputs/password-input.vue_vue_type_script_setup_true_lang.js +34 -30
- package/dist/components/admin/inputs/phone-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/radio-button-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/rating-input.vue_vue_type_script_setup_true_lang.js +24 -12
- package/dist/components/admin/inputs/reference-input.vue.d.ts +1 -1
- package/dist/components/admin/inputs/reference-input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +6 -4
- package/dist/components/admin/inputs/resettable-text-input.vue_vue_type_script_setup_true_lang.js +44 -39
- package/dist/components/admin/inputs/subscription-plan-picker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/inputs/text-input.vue.d.ts +13 -2
- package/dist/components/admin/inputs/text-input.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/components/admin/inputs/time-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/use-choice-input.d.ts +2 -2
- package/dist/components/admin/layout/app-sidebar.vue.d.ts +12 -1
- package/dist/components/admin/layout/app-sidebar.vue_vue_type_script_setup_true_lang.js +15 -11
- package/dist/components/admin/layout/command-menu-content.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/command-menu.vue.d.ts +1 -1
- package/dist/components/admin/layout/command-menu.vue_vue_type_script_setup_true_lang.js +9 -63
- package/dist/components/admin/layout/data-provider-devtools-entry.vue.d.ts +1 -1
- package/dist/components/admin/layout/data-provider-devtools-entry.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/admin/layout/data-provider-devtools.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/menu-item-link.vue.d.ts +5 -0
- package/dist/components/admin/layout/menu-item-link.vue_vue_type_script_setup_true_lang.js +27 -8
- package/dist/components/admin/layout/onboarding-tour-overlay.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/layout/resource-menu-item-group.vue.d.ts +8 -1
- package/dist/components/admin/layout/resource-menu-item-group.vue_vue_type_script_setup_true_lang.js +8 -7
- package/dist/components/admin/layout/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/admin/layout/title-portal-id.d.ts +1 -1
- package/dist/components/admin/layout/title-portal-id.js +1 -9
- package/dist/components/admin/layout/top-toolbar.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/list/approval-queue-row.vue.d.ts +2 -2
- package/dist/components/admin/list/approval-queue-row.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/list/approval-queue.vue.d.ts +3 -3
- package/dist/components/admin/list/calendar-agenda-view.vue.d.ts +23 -15
- package/dist/components/admin/list/calendar-event.vue.d.ts +21 -8
- package/dist/components/admin/list/calendar-list.vue.d.ts +29 -56
- package/dist/components/admin/list/calendar-list.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/admin/list/calendar-month-view.vue.d.ts +26 -20
- package/dist/components/admin/list/calendar-month-view.vue_vue_type_script_setup_true_lang.js +2 -6
- package/dist/components/admin/list/calendar-week-view.vue.d.ts +24 -17
- package/dist/components/admin/list/data-table-col.vue_vue_type_script_setup_true_lang.js +8 -5
- package/dist/components/admin/list/data-table-context.d.ts +9 -6
- package/dist/components/admin/list/data-table-context.js +9 -1
- package/dist/components/admin/list/data-table-row.vue.d.ts +19 -15
- package/dist/components/admin/list/data-table-row.vue_vue_type_script_setup_true_lang.js +5 -9
- package/dist/components/admin/list/data-table.vue.d.ts +35 -23
- package/dist/components/admin/list/data-table.vue_vue_type_script_setup_true_lang.js +4 -7
- package/dist/components/admin/list/list-pagination.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/list/pivot-grid.vue.d.ts +3 -3
- package/dist/components/admin/list/record-timeline.vue.d.ts +3 -3
- package/dist/components/admin/list/record-timeline.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/list/simple-list-item.vue.d.ts +21 -19
- package/dist/components/admin/list/simple-list-item.vue_vue_type_script_setup_true_lang.js +3 -7
- package/dist/components/admin/list/simple-list.vue.d.ts +28 -20
- package/dist/components/admin/list/single-field-list-record.vue.d.ts +19 -9
- package/dist/components/admin/list/single-field-list.vue.d.ts +21 -11
- package/dist/components/admin/list/tree-list-context.d.ts +11 -6
- package/dist/components/admin/list/tree-list-node.vue.d.ts +19 -4
- package/dist/components/admin/list/tree-list.vue.d.ts +28 -37
- package/dist/components/admin/realtime/comments-thread.vue_vue_type_script_setup_true_lang.js +56 -44
- package/dist/components/admin/supabase/forgot-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/supabase/set-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/supabase/use-password-recovery.js +11 -1
- package/dist/components/admin/view/create.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/view/edit.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/view/show.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/widgets/job-monitor-row.vue.d.ts +24 -11
- package/dist/components/admin/widgets/job-monitor.vue.d.ts +3 -3
- package/dist/components/admin/widgets/job-monitor.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/block-editor/block-doc-field.vue.d.ts +3 -3
- package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/components/charts/bar-chart.vue.d.ts +6 -2
- package/dist/components/charts/bar-chart.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/charts/series-chart.d.ts +1 -1
- package/dist/components/charts/series-chart.js +9 -3
- package/dist/components/index.js +2 -2
- package/dist/components/inspector/configurable.vue.d.ts +0 -21
- package/dist/components/inspector/configurable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/inspector/inspector.vue_vue_type_script_setup_true_lang.js +6 -8
- package/dist/components/kanban/kanban-board.vue.d.ts +3 -3
- package/dist/components/kanban/kanban-board.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/maps/bbox-field.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/maps/geo-json-field.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/maps/geo-json-layers.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/maps/geo-json-view.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/maps/lat-lng-field.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/maps/lat-lng-input.vue_vue_type_script_setup_true_lang.js +5 -7
- package/dist/components/maps/map-canvas.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/maps/use-map.js +1 -3
- package/dist/components/maps-draw/shape-input.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/maps-draw/simplify-input.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/maps-osm/geocoding-input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/maps-osm/map-with-search.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/mdx-editor/mdx-editor-theme.css +47 -0
- package/dist/components/mdx-editor/mdx-field.vue.d.ts +21 -11
- package/dist/components/mdx-editor/mdx-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/monaco/internal/use-json-schema.js +1 -2
- package/dist/components/monaco/internal/use-monaco-markers.d.ts +0 -6
- package/dist/components/monaco/internal/use-monaco-markers.js +4 -2
- package/dist/components/monaco/monaco-json-field-lazy.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-field-lazy.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/monaco/monaco-json-field.vue.d.ts +3 -3
- package/dist/components/monaco/monaco-json-input-lazy.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/rich-text-input/rich-text-field.vue.d.ts +3 -3
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.js +4 -4
- package/dist/components/ui/button-variants.js +1 -1
- package/dist/components/ui/chart/chart-container.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/command/command-dialog.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/sidebar/sidebar-menu-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/sidebar/sidebar-parts.js +2 -2
- package/dist/components/ui/sidebar/sidebar.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/controllers/use-controller-for-id.d.ts +2 -2
- package/dist/controllers/use-prev-next-controller.d.ts +2 -2
- package/dist/controllers/use-reference-many-field-controller.d.ts +4 -4
- package/dist/controllers/use-reference-one-field-controller.d.ts +4 -4
- package/dist/create-resource-components.d.ts +225 -117
- package/dist/data/undoable.js +2 -2
- package/dist/form/use-form.d.ts +5 -3
- package/dist/form/use-form.js +1 -1
- package/dist/form/use-input.d.ts +0 -2
- package/dist/form/use-input.js +1 -2
- package/dist/index.js +2 -2
- package/dist/resource-context.d.ts +5 -1
- package/dist/resource-context.js +4 -0
- package/dist/router/use-get-path-for-record.d.ts +3 -3
- package/package.json +5 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString, unref } from "vue";
|
|
3
|
+
import { DEVTOOLS_MAX_VALUE_LENGTH } from "@chelone/core";
|
|
3
4
|
// src/components/admin/layout/data-provider-devtools-entry.vue?vue&type=script&setup=true&lang.ts
|
|
4
5
|
var _hoisted_1 = ["data-status"];
|
|
5
6
|
var _hoisted_2 = { class: "flex items-baseline gap-2" };
|
|
@@ -17,8 +18,6 @@ var _hoisted_10 = { class: "max-h-48 overflow-auto rounded bg-muted p-2 whitespa
|
|
|
17
18
|
var _hoisted_11 = { key: 1 };
|
|
18
19
|
var _hoisted_12 = { class: "text-muted-foreground" };
|
|
19
20
|
var _hoisted_13 = { class: "max-h-48 overflow-auto rounded bg-muted p-2 whitespace-pre-wrap break-all" };
|
|
20
|
-
var maxValueLength = 2e3;
|
|
21
|
-
/** The value as indented JSON cut to `maxValueLength`, or `undefined` when there is none to show. */
|
|
22
21
|
var data_provider_devtools_entry_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
22
|
__name: "data-provider-devtools-entry",
|
|
24
23
|
props: { entry: {} },
|
|
@@ -30,9 +29,10 @@ var data_provider_devtools_entry_vue_vue_type_script_setup_true_lang_default = /
|
|
|
30
29
|
*/
|
|
31
30
|
const props = __props;
|
|
32
31
|
const translate = useTranslate();
|
|
32
|
+
/** The value as indented JSON cut to `DEVTOOLS_MAX_VALUE_LENGTH`, or `undefined` when there is none to show. */
|
|
33
33
|
function show(value) {
|
|
34
34
|
try {
|
|
35
|
-
return JSON.stringify(value, null, 2)?.slice(0,
|
|
35
|
+
return JSON.stringify(value, null, 2)?.slice(0, DEVTOOLS_MAX_VALUE_LENGTH);
|
|
36
36
|
} catch {
|
|
37
37
|
return "[unserializable]";
|
|
38
38
|
}
|
package/dist/components/admin/layout/data-provider-devtools.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -15,7 +15,7 @@ var _hoisted_5 = {
|
|
|
15
15
|
};
|
|
16
16
|
var _hoisted_6 = {
|
|
17
17
|
key: 1,
|
|
18
|
-
class: "overflow-y-auto"
|
|
18
|
+
class: "min-h-0 flex-1 overflow-y-auto"
|
|
19
19
|
};
|
|
20
20
|
var data_provider_devtools_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
21
21
|
__name: "data-provider-devtools",
|
|
@@ -7,7 +7,7 @@ import { createBlock, createElementVNode, createVNode, defineComponent, openBloc
|
|
|
7
7
|
// src/components/admin/layout/layout.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var _hoisted_1 = {
|
|
9
9
|
"data-slot": "layout-main",
|
|
10
|
-
class: "ml-auto flex h-svh w-full max-w-full flex-1 flex-col"
|
|
10
|
+
class: "ml-auto flex h-svh w-full max-w-full min-w-0 flex-1 flex-col"
|
|
11
11
|
};
|
|
12
12
|
var _hoisted_2 = {
|
|
13
13
|
id: "main-content",
|
|
@@ -21,6 +21,11 @@ export interface MenuItemLinkProps {
|
|
|
21
21
|
class?: string;
|
|
22
22
|
/** Click handler invoked alongside the default navigation (e.g. close the mobile drawer). */
|
|
23
23
|
onClick?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Keys that navigate to `to` from anywhere on the page, such as `"mod+1"` or
|
|
26
|
+
* `"alt+/"`, shown after the label. `mod` is Cmd or Ctrl.
|
|
27
|
+
*/
|
|
28
|
+
keyboardShortcut?: string;
|
|
24
29
|
}
|
|
25
30
|
declare const _default: typeof __VLS_export;
|
|
26
31
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
2
2
|
import { useBasename } from "../../../router/adapter.js";
|
|
3
|
-
import { useMatch } from "../../../router/nav-composables.js";
|
|
3
|
+
import { useMatch, useNavigate } from "../../../router/nav-composables.js";
|
|
4
4
|
import { SidebarContextKey } from "../../ui/sidebar/sidebar-context.js";
|
|
5
5
|
import sidebar_menu_button_default from "../../ui/sidebar/sidebar-menu-button.js";
|
|
6
6
|
import { SidebarMenuItem } from "../../ui/sidebar/sidebar-parts.js";
|
|
7
|
-
import
|
|
7
|
+
import keyboard_shortcut_default from "../common/keyboard-shortcut.js";
|
|
8
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, inject, normalizeClass, onBeforeUnmount, onMounted, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
|
|
9
|
+
import { shouldHandleHotkey } from "@chelone/core";
|
|
8
10
|
import { RouterLink } from "vue-router";
|
|
9
11
|
// src/components/admin/layout/menu-item-link.vue?vue&type=script&setup=true&lang.ts
|
|
10
12
|
var menu_item_link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -14,7 +16,8 @@ var menu_item_link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
14
16
|
label: {},
|
|
15
17
|
icon: {},
|
|
16
18
|
class: {},
|
|
17
|
-
onClick: { type: Function }
|
|
19
|
+
onClick: { type: Function },
|
|
20
|
+
keyboardShortcut: {}
|
|
18
21
|
},
|
|
19
22
|
setup(__props) {
|
|
20
23
|
/**
|
|
@@ -27,10 +30,11 @@ var menu_item_link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
27
30
|
* building block for `<DashboardMenuItem>` / `<ResourceMenuItem>` and for custom
|
|
28
31
|
* `<Menu>` children.
|
|
29
32
|
*
|
|
30
|
-
* Vue divergences from the React twin: the
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* Vue divergences from the React twin: the collapsed-rail `<Tooltip>` wrapper
|
|
34
|
+
* is NOT ported yet (that React sub-component has no Vue twin in this wave) — a
|
|
35
|
+
* later surface-parity wave. `keyboardShortcut` reads core's hotkey grammar
|
|
36
|
+
* (`mod`, `shift`, `alt`), so `ctrl` and `cmd` are not aliases here, and
|
|
37
|
+
* `keyboardShortcutRepresentation` has no slot yet. Navigation uses vue-router's `<RouterLink>` (the framework link), and `onClick`
|
|
34
38
|
* is a prop invoked on click rather than a synthetic-event handler.
|
|
35
39
|
*/
|
|
36
40
|
const props = __props;
|
|
@@ -43,6 +47,16 @@ var menu_item_link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
43
47
|
});
|
|
44
48
|
const isActive = computed(() => match.value != null);
|
|
45
49
|
const text = computed(() => translate(props.label, { _: props.label }));
|
|
50
|
+
const navigate = useNavigate();
|
|
51
|
+
function onShortcut(event) {
|
|
52
|
+
if (!props.keyboardShortcut) return;
|
|
53
|
+
const target = event.target instanceof HTMLElement ? event.target : null;
|
|
54
|
+
if (!shouldHandleHotkey(event, props.keyboardShortcut, target)) return;
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
navigate(props.to);
|
|
57
|
+
}
|
|
58
|
+
onMounted(() => window.addEventListener("keydown", onShortcut));
|
|
59
|
+
onBeforeUnmount(() => window.removeEventListener("keydown", onShortcut));
|
|
46
60
|
function onClick() {
|
|
47
61
|
props.onClick?.();
|
|
48
62
|
if (sidebar?.openMobile.value) sidebar.setOpenMobile(false);
|
|
@@ -59,7 +73,12 @@ var menu_item_link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
59
73
|
default: withCtx(() => [
|
|
60
74
|
__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), { key: 0 })) : createCommentVNode("", true),
|
|
61
75
|
renderSlot(_ctx.$slots, "icon"),
|
|
62
|
-
createElementVNode("span", null, toDisplayString(text.value), 1)
|
|
76
|
+
createElementVNode("span", null, toDisplayString(text.value), 1),
|
|
77
|
+
__props.keyboardShortcut ? (openBlock(), createBlock(keyboard_shortcut_default, {
|
|
78
|
+
key: 1,
|
|
79
|
+
"keyboard-shortcut": __props.keyboardShortcut,
|
|
80
|
+
class: "ml-auto"
|
|
81
|
+
}, null, 8, ["keyboard-shortcut"])) : createCommentVNode("", true)
|
|
63
82
|
]),
|
|
64
83
|
_: 3
|
|
65
84
|
}, 8, [
|
package/dist/components/admin/layout/onboarding-tour-overlay.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
2
2
|
import button_default from "../../ui/button.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeStyle, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, shallowRef, toDisplayString, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
4
|
-
import { placeTourCard, tourSpotlightPath } from "@chelone/core";
|
|
4
|
+
import { REMEASURE_MS, placeTourCard, tourSpotlightPath } from "@chelone/core";
|
|
5
5
|
// src/components/admin/layout/onboarding-tour-overlay.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = { "data-slot": "onboarding-tour" };
|
|
7
7
|
var _hoisted_2 = ["data-side", "aria-labelledby"];
|
|
@@ -9,7 +9,6 @@ var _hoisted_3 = { class: "text-sm text-muted-foreground" };
|
|
|
9
9
|
var _hoisted_4 = { class: "mt-4 flex items-center gap-2" };
|
|
10
10
|
var _hoisted_5 = { class: "mr-auto text-xs text-muted-foreground" };
|
|
11
11
|
var nextTitleId = 0;
|
|
12
|
-
var REMEASURE_MS = 250;
|
|
13
12
|
function findTarget(selector) {
|
|
14
13
|
try {
|
|
15
14
|
return document.querySelector(selector);
|
|
@@ -14,4 +14,11 @@ export interface ResourceMenuItemGroupProps {
|
|
|
14
14
|
}
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
16
16
|
export default _default;
|
|
17
|
-
declare const __VLS_export: import("vue").DefineComponent<ResourceMenuItemGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ResourceMenuItemGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ResourceMenuItemGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ResourceMenuItemGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
18
|
+
default?: (props: {}) => any;
|
|
19
|
+
}>;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
package/dist/components/admin/layout/resource-menu-item-group.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useResourceRegistry } from "../../../admin/resource-registry.js";
|
|
2
2
|
import { SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu } from "../../ui/sidebar/sidebar-parts.js";
|
|
3
3
|
import resource_menu_item_default from "./resource-menu-item.js";
|
|
4
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
5
5
|
// src/components/admin/layout/resource-menu-item-group.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var resource_menu_item_group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "resource-menu-item-group",
|
|
@@ -23,13 +23,14 @@ var resource_menu_item_group_vue_vue_type_script_setup_true_lang_default = /*@__
|
|
|
23
23
|
* `options.group` bag yet, so there is no auto-grouping and a labeled group
|
|
24
24
|
* renders a plain `<SidebarGroupLabel>` rather than a collapsible section (the
|
|
25
25
|
* React twin's `<Collapsible>` has no Vue twin in this wave). The `label`/
|
|
26
|
-
* `resources` props still let an author build explicit sections by hand.
|
|
26
|
+
* `resources` props still let an author build explicit sections by hand. The
|
|
27
|
+
* default slot adds entries after the resources, inside the group.
|
|
27
28
|
*/
|
|
28
29
|
const props = __props;
|
|
29
30
|
const registry = useResourceRegistry();
|
|
30
31
|
const names = computed(() => props.resources ?? Object.keys(registry.definitions).filter((name) => registry.definitions[name]?.list != null));
|
|
31
32
|
return (_ctx, _cache) => {
|
|
32
|
-
return names.value.length > 0 ? (openBlock(), createBlock(unref(SidebarGroup), {
|
|
33
|
+
return names.value.length > 0 || _ctx.$slots.default ? (openBlock(), createBlock(unref(SidebarGroup), {
|
|
33
34
|
key: 0,
|
|
34
35
|
class: normalizeClass(props.class)
|
|
35
36
|
}, {
|
|
@@ -43,12 +44,12 @@ var resource_menu_item_group_vue_vue_type_script_setup_true_lang_default = /*@__
|
|
|
43
44
|
key: name,
|
|
44
45
|
name
|
|
45
46
|
}, null, 8, ["name"]);
|
|
46
|
-
}), 128))]),
|
|
47
|
-
_:
|
|
47
|
+
}), 128)), renderSlot(_ctx.$slots, "default")]),
|
|
48
|
+
_: 3
|
|
48
49
|
}, 8, ["class"])]),
|
|
49
|
-
_:
|
|
50
|
+
_: 3
|
|
50
51
|
})]),
|
|
51
|
-
_:
|
|
52
|
+
_: 3
|
|
52
53
|
}, 8, ["class"])) : createCommentVNode("", true);
|
|
53
54
|
};
|
|
54
55
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ThemeContextKey, resolveTheme } from "./theme-context.js";
|
|
2
2
|
import { defineComponent, provide, ref, renderSlot, watchEffect } from "vue";
|
|
3
|
+
import { DEFAULT_THEME_STORAGE_KEY } from "@chelone/core";
|
|
3
4
|
// src/components/admin/layout/theme-provider.vue?vue&type=script&setup=true&lang.ts
|
|
4
5
|
var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
6
|
__name: "theme-provider",
|
|
6
7
|
props: {
|
|
7
8
|
defaultTheme: { default: "system" },
|
|
8
|
-
storageKey: { default:
|
|
9
|
+
storageKey: { default: DEFAULT_THEME_STORAGE_KEY }
|
|
9
10
|
},
|
|
10
11
|
setup(__props) {
|
|
11
12
|
/**
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* sibling so `title-portal.vue` stays component-only. Matches the React twin's
|
|
5
5
|
* `TITLE_PORTAL_ID` so the two adapters share the same portal contract.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export { TITLE_PORTAL_ID } from "@chelone/core";
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* The DOM id of the app-bar title portal target. `<TitlePortal>` reserves the
|
|
4
|
-
* element with this id; a page `<Title>` teleports into it. Kept in a `.ts`
|
|
5
|
-
* sibling so `title-portal.vue` stays component-only. Matches the React twin's
|
|
6
|
-
* `TITLE_PORTAL_ID` so the two adapters share the same portal contract.
|
|
7
|
-
*/
|
|
8
|
-
var TITLE_PORTAL_ID = "chelone-title-portal";
|
|
9
|
-
export { TITLE_PORTAL_ID };
|
|
1
|
+
export { TITLE_PORTAL_ID } from "@chelone/core";
|
|
@@ -11,7 +11,10 @@ var top_toolbar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
11
11
|
*/
|
|
12
12
|
const props = __props;
|
|
13
13
|
return (_ctx, _cache) => {
|
|
14
|
-
return openBlock(), createElementBlock("div", {
|
|
14
|
+
return openBlock(), createElementBlock("div", {
|
|
15
|
+
"data-slot": "top-toolbar",
|
|
16
|
+
class: normalizeClass(unref(cn)("flex items-center justify-end gap-2 mb-2", props.class))
|
|
17
|
+
}, [renderSlot(_ctx.$slots, "default")], 2);
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
20
|
});
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* `<DualApprovalButton>` and a Reject that opens a reason form. It owns the
|
|
4
4
|
* form and the rejection write, and publishes its record as the ambient one.
|
|
5
5
|
*/
|
|
6
|
-
import { type LooseRecord } from "@chelone/core";
|
|
6
|
+
import { type LooseRecord, type ResourceRecord } from "@chelone/core";
|
|
7
7
|
import { type VNode } from "vue";
|
|
8
8
|
import type { ApprovalQueueProps } from "./approval-queue.vue.js";
|
|
9
|
-
declare const __VLS_export: <TRecord extends
|
|
9
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
10
10
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<Omit<ApprovalQueueProps<TRecord>, "class"> & {
|
|
11
11
|
record: TRecord;
|
|
12
12
|
}> & (typeof globalThis extends {
|
package/dist/components/admin/list/approval-queue-row.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -12,7 +12,7 @@ import textarea_default from "../../ui/textarea.js";
|
|
|
12
12
|
import dual_approval_button_default from "../buttons/dual-approval-button.js";
|
|
13
13
|
import { useMenuAccess } from "../layout/use-menu-access.js";
|
|
14
14
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderSlot, toDisplayString, toRef, unref, useId, withCtx, withModifiers } from "vue";
|
|
15
|
-
import { buildRejectionUpdate, getAtPath } from "@chelone/core";
|
|
15
|
+
import { buildRejectionUpdate, getAtPath, isLooseRecord } from "@chelone/core";
|
|
16
16
|
import { useIsMutating } from "@tanstack/vue-query";
|
|
17
17
|
// src/components/admin/list/approval-queue-row.vue?vue&type=script&setup=true&lang.ts
|
|
18
18
|
var _hoisted_1 = { class: "flex flex-wrap items-center gap-3" };
|
|
@@ -100,7 +100,7 @@ var approval_queue_row_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
100
100
|
}
|
|
101
101
|
async function confirm() {
|
|
102
102
|
const data = rejection.value;
|
|
103
|
-
if (!data) return;
|
|
103
|
+
if (!data || !isLooseRecord(props.record)) return;
|
|
104
104
|
const request = update.mutateAsync({
|
|
105
105
|
id: props.record.id,
|
|
106
106
|
data,
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* </List>
|
|
17
17
|
*/
|
|
18
18
|
import { type VNode } from "vue";
|
|
19
|
-
import type { LooseRecord, MutationMode, SourceProp } from "@chelone/core";
|
|
19
|
+
import type { LooseRecord, ResourceRecord, MutationMode, SourceProp } from "@chelone/core";
|
|
20
20
|
/** Props for {@link ApprovalQueue}. */
|
|
21
|
-
export interface ApprovalQueueProps<TRecord extends
|
|
21
|
+
export interface ApprovalQueueProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
22
22
|
/** The field shown as the row title; the record representation when it is null or undefined. */
|
|
23
23
|
titleSource?: SourceProp<TRecord>;
|
|
24
24
|
/** The field shown as a second line when its value is not empty. */
|
|
@@ -47,7 +47,7 @@ export interface ApprovalQueueProps<TRecord extends LooseRecord = LooseRecord> {
|
|
|
47
47
|
}
|
|
48
48
|
declare const _default: typeof __VLS_export;
|
|
49
49
|
export default _default;
|
|
50
|
-
declare const __VLS_export: <TRecord extends
|
|
50
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
51
51
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<ApprovalQueueProps<TRecord>> & (typeof globalThis extends {
|
|
52
52
|
__VLS_PROPS_FALLBACK: infer P;
|
|
53
53
|
} ? P : {});
|
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
import { type VNode } from "vue";
|
|
2
2
|
import type { CalendarEventSlotProps } from "./calendar-month-view.vue.js";
|
|
3
|
-
import type { CalendarEvent, CalendarLabels, CalendarRange, LooseRecord } from "@chelone/core";
|
|
3
|
+
import type { CalendarEvent, CalendarLabels, CalendarRange, LooseRecord, ResourceRecord } from "@chelone/core";
|
|
4
4
|
/** Props for {@link CalendarAgendaView}. */
|
|
5
|
-
export interface CalendarAgendaViewProps {
|
|
5
|
+
export interface CalendarAgendaViewProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
6
6
|
range: CalendarRange;
|
|
7
7
|
labels: CalendarLabels;
|
|
8
8
|
/** The label of the list. */
|
|
9
9
|
label: string;
|
|
10
|
-
events: CalendarEvent<
|
|
10
|
+
events: CalendarEvent<TRecord>[];
|
|
11
11
|
/** The link an event is, when it navigates. */
|
|
12
|
-
hrefFor: (record:
|
|
12
|
+
hrefFor: (record: TRecord) => string | undefined;
|
|
13
13
|
/** Whether activating the event does anything: it is inert otherwise. */
|
|
14
|
-
isSelectable: (record:
|
|
14
|
+
isSelectable: (record: TRecord) => boolean;
|
|
15
15
|
}
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
17
17
|
export default _default;
|
|
18
|
-
declare const __VLS_export:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
19
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarAgendaViewProps<TRecord> & {
|
|
20
|
+
onSelectEvent?: ((record: TRecord) => any) | undefined;
|
|
21
|
+
}> & (typeof globalThis extends {
|
|
22
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
23
|
+
} ? P : {});
|
|
24
|
+
expose: (exposed: {}) => void;
|
|
25
|
+
attrs: any;
|
|
26
|
+
slots: {
|
|
27
|
+
event?(props: CalendarEventSlotProps<TRecord>): VNode[];
|
|
28
28
|
};
|
|
29
|
+
emit: (evt: "selectEvent", record: TRecord) => void;
|
|
30
|
+
}>) => import("vue").VNode & {
|
|
31
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
29
32
|
};
|
|
33
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
34
|
+
[K in keyof T]: T[K];
|
|
35
|
+
} : {
|
|
36
|
+
[K in keyof T as K]: T[K];
|
|
37
|
+
}) & {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CalendarEvent, LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { CalendarEvent, LooseRecord, ResourceRecord } from "@chelone/core";
|
|
2
2
|
/** Props for {@link CalendarEventButton}. */
|
|
3
|
-
export interface CalendarEventProps {
|
|
4
|
-
event: CalendarEvent<
|
|
3
|
+
export interface CalendarEventProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
4
|
+
event: CalendarEvent<TRecord>;
|
|
5
5
|
/** The link the event is, when it navigates. */
|
|
6
6
|
href?: string;
|
|
7
7
|
/** Whether activating the event does anything: it is inert otherwise. */
|
|
@@ -9,8 +9,21 @@ export interface CalendarEventProps {
|
|
|
9
9
|
}
|
|
10
10
|
declare const _default: typeof __VLS_export;
|
|
11
11
|
export default _default;
|
|
12
|
-
declare const __VLS_export:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
13
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarEventProps<TRecord> & {
|
|
14
|
+
onSelect?: ((record: TRecord) => any) | undefined;
|
|
15
|
+
}> & (typeof globalThis extends {
|
|
16
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
17
|
+
} ? P : {});
|
|
18
|
+
expose: (exposed: {}) => void;
|
|
19
|
+
attrs: any;
|
|
20
|
+
slots: {};
|
|
21
|
+
emit: (evt: "select", record: TRecord) => void;
|
|
22
|
+
}>) => import("vue").VNode & {
|
|
23
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
26
|
+
[K in keyof T]: T[K];
|
|
27
|
+
} : {
|
|
28
|
+
[K in keyof T as K]: T[K];
|
|
29
|
+
}) & {};
|
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<CalendarList>` — the records of the ambient `<List>` as events in a month
|
|
3
|
-
* grid, or in a week of hour rows, or in an agenda. The Vue analog of `@chelone/react`'s `list/calendar-list.tsx`. It asks
|
|
4
|
-
* the list for the visible range (and `perPage` records), so moving to another
|
|
5
|
-
* month refetches; it removes that filter and restores `perPage` when it
|
|
6
|
-
* unmounts. The filters the user set stay.
|
|
7
|
-
*
|
|
8
|
-
* Emits `select-event` with the record when an event is activated; with no
|
|
9
|
-
* listener attached, the event navigates to the record's edit or show page.
|
|
10
|
-
* Emits `select-slot` with `{ startISO, endISO, allDay }` when an empty part of
|
|
11
|
-
* a day is clicked. With a `drop` listener attached, month-view events can be
|
|
12
|
-
* dragged to another day; `drop` carries the record and its new `{ start, end? }`
|
|
13
|
-
* as ISO strings and the list is not updated. A promise the listener returns is
|
|
14
|
-
* the caller's to handle. The `#event` slot replaces an event and the `#header` slot
|
|
15
|
-
* the title and navigation.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* <List>
|
|
19
|
-
* <CalendarList start-source="starts_at" end-source="ends_at" title-source="name" />
|
|
20
|
-
* </List>
|
|
21
|
-
*/
|
|
22
|
-
import { type LooseRecord } from "@chelone/core";
|
|
23
1
|
import { type VNode } from "vue";
|
|
24
2
|
import { type CalendarEventSlotProps, type CalendarDrop, type CalendarSlot } from "./calendar-month-view.vue.js";
|
|
25
|
-
import type { CalendarRange, CalendarView, CalendarWeekStart, SourceProp } from "@chelone/core";
|
|
3
|
+
import type { CalendarRange, CalendarView, CalendarWeekStart, LooseRecord, ResourceRecord, SourceProp } from "@chelone/core";
|
|
26
4
|
import type { CalendarNavigateDirection } from "./calendar-header.vue.js";
|
|
27
5
|
/** Props for {@link CalendarList}. */
|
|
28
|
-
export interface CalendarListProps {
|
|
6
|
+
export interface CalendarListProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
29
7
|
/** The field holding the start of an event; a dotted path reads a nested value. */
|
|
30
|
-
startSource: SourceProp
|
|
8
|
+
startSource: SourceProp<TRecord>;
|
|
31
9
|
/** The field holding the end. An event with none, or one before its start, covers its start day only. */
|
|
32
|
-
endSource?: SourceProp
|
|
10
|
+
endSource?: SourceProp<TRecord>;
|
|
33
11
|
/** The string field shown as the event title; the record representation otherwise. */
|
|
34
|
-
titleSource?: SourceProp
|
|
12
|
+
titleSource?: SourceProp<TRecord>;
|
|
35
13
|
/** The field whose value picks a color from `colorMap`. */
|
|
36
|
-
colorSource?: SourceProp
|
|
14
|
+
colorSource?: SourceProp<TRecord>;
|
|
37
15
|
colorMap?: Record<string, string>;
|
|
38
16
|
/** The view shown first. Default `month`. */
|
|
39
17
|
defaultView?: CalendarView;
|
|
@@ -74,33 +52,28 @@ export interface CalendarHeaderSlotProps {
|
|
|
74
52
|
}
|
|
75
53
|
declare const _default: typeof __VLS_export;
|
|
76
54
|
export default _default;
|
|
77
|
-
declare const __VLS_export:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
colorMap: Record<string, string>;
|
|
93
|
-
defaultView: CalendarView;
|
|
94
|
-
weekStartsOn: CalendarWeekStart;
|
|
95
|
-
rangeFilter: (range: CalendarRange) => Record<string, unknown>;
|
|
96
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
97
|
-
/** Replaces an event in its day cell. */
|
|
98
|
-
event?(props: CalendarEventSlotProps): VNode[];
|
|
99
|
-
/** Replaces the title and the navigation. */
|
|
100
|
-
header?(props: CalendarHeaderSlotProps): VNode[];
|
|
101
|
-
}>;
|
|
102
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
103
|
-
new (): {
|
|
104
|
-
$slots: S;
|
|
55
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
56
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarListProps<TRecord> & {
|
|
57
|
+
onDrop?: ((record: TRecord, range: CalendarDrop) => any) | undefined;
|
|
58
|
+
onSelectEvent?: ((record: TRecord) => any) | undefined;
|
|
59
|
+
onSelectSlot?: ((slot: CalendarSlot) => any) | undefined;
|
|
60
|
+
}> & (typeof globalThis extends {
|
|
61
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
62
|
+
} ? P : {});
|
|
63
|
+
expose: (exposed: {}) => void;
|
|
64
|
+
attrs: any;
|
|
65
|
+
slots: {
|
|
66
|
+
/** Replaces an event in its day cell. */
|
|
67
|
+
event?(props: CalendarEventSlotProps<TRecord>): VNode[];
|
|
68
|
+
/** Replaces the title and the navigation. */
|
|
69
|
+
header?(props: CalendarHeaderSlotProps): VNode[];
|
|
105
70
|
};
|
|
71
|
+
emit: ((evt: "drop", record: TRecord, range: CalendarDrop) => void) & ((evt: "selectEvent", record: TRecord) => void) & ((evt: "selectSlot", slot: CalendarSlot) => void);
|
|
72
|
+
}>) => import("vue").VNode & {
|
|
73
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
106
74
|
};
|
|
75
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
76
|
+
[K in keyof T]: T[K];
|
|
77
|
+
} : {
|
|
78
|
+
[K in keyof T as K]: T[K];
|
|
79
|
+
}) & {};
|
|
@@ -10,7 +10,7 @@ import calendar_header_default from "./calendar-header.js";
|
|
|
10
10
|
import calendar_month_view_default from "./calendar-month-view.js";
|
|
11
11
|
import calendar_week_view_default from "./calendar-week-view.js";
|
|
12
12
|
import { computed, createBlock, createElementBlock, createSlots, defineComponent, getCurrentInstance, guardReactiveProps, normalizeClass, normalizeProps, onBeforeUnmount, openBlock, ref, renderSlot, unref, watch, withCtx } from "vue";
|
|
13
|
-
import { calendarDays, calendarLabels, calendarRange, calendarRangeFilter, shiftCalendarAnchor, staleCalendarRangeKeys, toCalendarEvents } from "@chelone/core";
|
|
13
|
+
import { DEFAULT_PER_PAGE, calendarDays, calendarLabels, calendarRange, calendarRangeFilter, shiftCalendarAnchor, staleCalendarRangeKeys, toCalendarEvents } from "@chelone/core";
|
|
14
14
|
// src/components/admin/list/calendar-list.vue?vue&type=script&setup=true&lang.ts
|
|
15
15
|
var _hoisted_1 = ["aria-busy"];
|
|
16
16
|
var calendar_list_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -109,18 +109,22 @@ var calendar_list_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
109
109
|
const labels = computed(() => calendarLabels(locale.value));
|
|
110
110
|
const title = computed(() => labels.value.title(view.value, anchor.value, range.value));
|
|
111
111
|
const weekdays = computed(() => days.value.slice(0, 7).map((day) => labels.value.weekday(day)));
|
|
112
|
+
const pathOf = (source) => {
|
|
113
|
+
return source;
|
|
114
|
+
};
|
|
115
|
+
const pathOfOptional = (source) => source === void 0 ? void 0 : pathOf(source);
|
|
112
116
|
const events = computed(() => toCalendarEvents(list.data ?? [], {
|
|
113
|
-
startSource: props.startSource,
|
|
114
|
-
endSource: props.endSource,
|
|
115
|
-
titleSource: props.titleSource,
|
|
116
|
-
colorSource: props.colorSource,
|
|
117
|
+
startSource: pathOf(props.startSource),
|
|
118
|
+
endSource: pathOfOptional(props.endSource),
|
|
119
|
+
titleSource: pathOfOptional(props.titleSource),
|
|
120
|
+
colorSource: pathOfOptional(props.colorSource),
|
|
117
121
|
colorMap: props.colorMap,
|
|
118
122
|
getTitle: getRepresentation
|
|
119
123
|
}));
|
|
120
124
|
const rangeValue = computed(() => props.rangeFilter ? props.rangeFilter(range.value) : calendarRangeFilter(props.startSource, range.value, props.endSource));
|
|
121
125
|
const rangeStartISO = computed(() => range.value.start.toISOString());
|
|
122
126
|
const rangeEndISO = computed(() => range.value.end.toISOString());
|
|
123
|
-
const originalPerPage = list.perPage === props.perPage ? list.defaultPerPage ??
|
|
127
|
+
const originalPerPage = list.perPage === props.perPage ? list.defaultPerPage ?? DEFAULT_PER_PAGE : list.perPage;
|
|
124
128
|
let appliedKeys = [];
|
|
125
129
|
const without = (filter, keys) => Object.fromEntries(Object.entries(filter).filter(([key]) => !keys.includes(key)));
|
|
126
130
|
const staleKeys = computed(() => props.rangeFilter ? [] : staleCalendarRangeKeys(props.startSource, props.endSource));
|
|
@@ -151,11 +155,11 @@ var calendar_list_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
151
155
|
});
|
|
152
156
|
});
|
|
153
157
|
const type = computed(() => props.linkType ?? (definition.value.hasEdit ? "edit" : definition.value.hasShow ? "show" : false));
|
|
154
|
-
const linkTo = (record) => resource
|
|
158
|
+
const linkTo = (record) => !resource || type.value === false ? void 0 : createPath({
|
|
155
159
|
resource,
|
|
156
160
|
id: record.id,
|
|
157
161
|
type: type.value
|
|
158
|
-
})
|
|
162
|
+
});
|
|
159
163
|
const hrefFor = (record) => hasListener() ? void 0 : linkTo(record);
|
|
160
164
|
const isSelectable = (record) => hasListener() || linkTo(record) !== void 0;
|
|
161
165
|
function onSelectEvent(record) {
|