@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,6 +1,6 @@
|
|
|
1
|
-
import type { LooseRecord, SortPayload, SourceKey, SourceProp } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, ResourceRecord, SortPayload, SourceKey, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link JobMonitor}. */
|
|
3
|
-
export interface JobMonitorProps<TRecord extends
|
|
3
|
+
export interface JobMonitorProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
4
4
|
/** The jobs resource. Defaults to the resource context; with neither, nothing renders. */
|
|
5
5
|
resource?: string;
|
|
6
6
|
/** Milliseconds between reads. Default 5000, `0` turns polling off. */
|
|
@@ -39,7 +39,7 @@ export interface JobMonitorProps<TRecord extends LooseRecord = LooseRecord> {
|
|
|
39
39
|
}
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
41
41
|
export default _default;
|
|
42
|
-
declare const __VLS_export: <TRecord extends
|
|
42
|
+
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<{
|
|
43
43
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<JobMonitorProps<TRecord>> & (typeof globalThis extends {
|
|
44
44
|
__VLS_PROPS_FALLBACK: infer P;
|
|
45
45
|
} ? P : {});
|
|
@@ -12,7 +12,7 @@ import tabs_list_default from "../../ui/tabs/tabs-list.js";
|
|
|
12
12
|
import tabs_trigger_default from "../../ui/tabs/tabs-trigger.js";
|
|
13
13
|
import job_monitor_row_default from "./job-monitor-row.js";
|
|
14
14
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
15
|
-
import { DEFAULT_JOB_TABS, buildKanbanBuckets } from "@chelone/core";
|
|
15
|
+
import { DEFAULT_JOB_TABS, buildKanbanBuckets, jobStatusSource } from "@chelone/core";
|
|
16
16
|
// src/components/admin/widgets/job-monitor.vue?vue&type=script&setup=true&lang.ts
|
|
17
17
|
var _hoisted_1 = {
|
|
18
18
|
key: 0,
|
|
@@ -70,7 +70,7 @@ var job_monitor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
70
70
|
const notifications = useCheloneNotifications();
|
|
71
71
|
const { mutate, isPending: isWriting } = useUpdate(resource ?? "", { mutationMode: "pessimistic" });
|
|
72
72
|
const fields = computed(() => ({
|
|
73
|
-
statusSource: props.statusSource
|
|
73
|
+
statusSource: jobStatusSource(props.statusSource),
|
|
74
74
|
typeSource: props.typeSource ?? "type",
|
|
75
75
|
payloadSource: props.payloadSource ?? "payload",
|
|
76
76
|
errorSource: props.errorSource ?? "lastError",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type VNode } from "vue";
|
|
2
|
-
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
2
|
+
import type { LooseRecord, ResourceRecord, SourceProp } from "@chelone/core";
|
|
3
3
|
import type { BlockDefinition } from "./block-nodes.js";
|
|
4
4
|
/** Props for {@link BlockDocField}. */
|
|
5
|
-
export interface BlockDocFieldProps<RecordType extends
|
|
5
|
+
export interface BlockDocFieldProps<RecordType extends ResourceRecord = LooseRecord> {
|
|
6
6
|
source: SourceProp<RecordType>;
|
|
7
7
|
record?: RecordType;
|
|
8
8
|
/** Read once, when the editor mounts. Each block's `read` component draws it. */
|
|
@@ -13,7 +13,7 @@ export interface BlockDocFieldProps<RecordType extends LooseRecord = LooseRecord
|
|
|
13
13
|
}
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
export default _default;
|
|
16
|
-
declare const __VLS_export: <RecordType extends
|
|
16
|
+
declare const __VLS_export: <RecordType 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<{
|
|
17
17
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<BlockDocFieldProps<RecordType>> & (typeof globalThis extends {
|
|
18
18
|
__VLS_PROPS_FALLBACK: infer P;
|
|
19
19
|
} ? P : {});
|
package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -3,6 +3,7 @@ import { GripVerticalIcon } from "./block-icons.js";
|
|
|
3
3
|
import block_drop_gap_default from "./block-drop-gap.js";
|
|
4
4
|
import { moveTopLevelBlock } from "./block-toolbar.vue_vue_type_script_setup_true_lang.js";
|
|
5
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, shallowRef, unref, watch } from "vue";
|
|
6
|
+
import { GAP_PREFIX, HANDLE_ID } from "@chelone/core";
|
|
6
7
|
import { Accessibility, PointerSensor } from "@dnd-kit/dom";
|
|
7
8
|
import { useDragDropMonitor, useDraggable } from "@dnd-kit/vue";
|
|
8
9
|
// src/components/block-editor/block-drag-handle.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -21,8 +22,6 @@ var block_drag_handle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
21
22
|
* `@chelone/react`'s `block-editor/block-drag-handle.tsx`, on `@dnd-kit/vue`.
|
|
22
23
|
*/
|
|
23
24
|
const props = __props;
|
|
24
|
-
const HANDLE_ID = "block-drag-handle";
|
|
25
|
-
const GAP_PREFIX = "block-gap-";
|
|
26
25
|
const sameBoxes = (a, b) => a.length === b.length && a.every((box, i) => box.top === b[i]?.top && box.bottom === b[i]?.bottom);
|
|
27
26
|
const translate = useTranslate();
|
|
28
27
|
const layer = ref();
|
|
@@ -101,7 +100,7 @@ var block_drag_handle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
101
100
|
hovered.value = null;
|
|
102
101
|
if (canceled || typeof target !== "string") return;
|
|
103
102
|
if (!target.startsWith(GAP_PREFIX)) return;
|
|
104
|
-
const gap = Number(target.slice(
|
|
103
|
+
const gap = Number(target.slice(GAP_PREFIX.length));
|
|
105
104
|
const from = index.value;
|
|
106
105
|
moveTopLevelBlock(props.editor, from, gap > from ? gap - 1 : gap);
|
|
107
106
|
} });
|
|
@@ -142,7 +141,7 @@ var block_drag_handle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
142
141
|
}, [createVNode(unref(GripVerticalIcon))], 14, _hoisted_1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(gaps.value, (gap) => {
|
|
143
142
|
return openBlock(), createBlock(block_drop_gap_default, {
|
|
144
143
|
key: gap.gap,
|
|
145
|
-
id: `${GAP_PREFIX}${gap.gap}`,
|
|
144
|
+
id: `${unref(GAP_PREFIX)}${gap.gap}`,
|
|
146
145
|
start: gap.start,
|
|
147
146
|
end: gap.end,
|
|
148
147
|
line: gap.line
|
package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useTranslate } from "../../i18n/use-translate.js";
|
|
|
2
2
|
import { FieldLabel } from "../ui/field.js";
|
|
3
3
|
import input_default from "../ui/input.js";
|
|
4
4
|
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, toDisplayString, unref, useId, withCtx } from "vue";
|
|
5
|
-
import { isSafeImageSrc } from "@chelone/core";
|
|
5
|
+
import { MAX_IMAGE_BYTES, isSafeImageSrc } from "@chelone/core";
|
|
6
6
|
// src/components/block-editor/image-block-config.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = { class: "grid gap-3 sm:grid-cols-2" };
|
|
8
8
|
var _hoisted_2 = { class: "flex flex-col gap-1.5" };
|
|
@@ -14,7 +14,6 @@ var _hoisted_6 = {
|
|
|
14
14
|
role: "alert",
|
|
15
15
|
class: "text-destructive text-sm"
|
|
16
16
|
};
|
|
17
|
-
var maxImageBytes = 5242880;
|
|
18
17
|
var image_block_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
19
18
|
__name: "image-block-config",
|
|
20
19
|
props: {
|
|
@@ -48,7 +47,7 @@ var image_block_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
48
47
|
input.value = "";
|
|
49
48
|
const { onChange } = props;
|
|
50
49
|
if (!file) return;
|
|
51
|
-
if (!file.type.startsWith("image/") || file.size >
|
|
50
|
+
if (!file.type.startsWith("image/") || file.size > MAX_IMAGE_BYTES) {
|
|
52
51
|
failed.value = true;
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { LooseRecord } from "@chelone/core";
|
|
2
2
|
import type { SeriesChartProps } from "./series-chart.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface BarChartProps<TRow extends object = LooseRecord, TX extends keyof TRow & string = keyof TRow & string> extends SeriesChartProps<TRow, TX> {
|
|
4
|
+
/** Any CSS color. Left out, each bar draws in the next theme chart color. */
|
|
5
|
+
color?: string;
|
|
6
|
+
/** Any CSS colors, cycled over the bars when `color` is left out. Defaults to the theme's chart colors. */
|
|
7
|
+
colors?: readonly string[];
|
|
8
|
+
}
|
|
5
9
|
declare const _default: typeof __VLS_export;
|
|
6
10
|
export default _default;
|
|
7
11
|
declare const __VLS_export: <TRow extends object = LooseRecord, TX extends keyof TRow & string = keyof TRow & string>(__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<{
|
|
@@ -2,17 +2,18 @@ import chart_container_default from "../ui/chart/chart-container.js";
|
|
|
2
2
|
import chart_frame_default from "./chart-frame.js";
|
|
3
3
|
import { rowX, rowY, useSeriesRows } from "./series-chart.js";
|
|
4
4
|
import { createBlock, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, unref, withCtx } from "vue";
|
|
5
|
-
import { hasChartValues } from "@chelone/core";
|
|
5
|
+
import { DEFAULT_CHART_COLORS, chartColor, hasChartValues } from "@chelone/core";
|
|
6
6
|
import { VisAxis, VisCrosshair, VisGroupedBar, VisTooltip, VisXYContainer } from "@unovis/vue";
|
|
7
7
|
// src/components/charts/bar-chart.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var bar_chart_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
__name: "bar-chart",
|
|
10
10
|
props: {
|
|
11
|
+
color: {},
|
|
12
|
+
colors: { default: () => DEFAULT_CHART_COLORS },
|
|
11
13
|
data: {},
|
|
12
14
|
xField: {},
|
|
13
15
|
yField: {},
|
|
14
16
|
title: {},
|
|
15
|
-
color: { default: "var(--primary)" },
|
|
16
17
|
height: { default: 200 },
|
|
17
18
|
loading: {
|
|
18
19
|
type: Boolean,
|
|
@@ -38,8 +39,9 @@ var bar_chart_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
38
39
|
*/
|
|
39
40
|
const props = __props;
|
|
40
41
|
const { rows, config, xAxis, tooltipFor } = useSeriesRows(props);
|
|
41
|
-
const
|
|
42
|
-
const
|
|
42
|
+
const colorOf = (index) => props.color ?? chartColor(index, props.colors);
|
|
43
|
+
const color = (row) => colorOf(row.index);
|
|
44
|
+
const tooltipTemplate = (row) => tooltipFor(row, row.y, colorOf(row.index));
|
|
43
45
|
return (_ctx, _cache) => {
|
|
44
46
|
return openBlock(), createBlock(chart_frame_default, {
|
|
45
47
|
"data-slot": "bar-chart",
|
|
@@ -41,6 +41,6 @@ export declare function useSeriesRows<TRow extends object, TX extends keyof TRow
|
|
|
41
41
|
tickValues: number[];
|
|
42
42
|
tickFormat: (position: number | Date) => string;
|
|
43
43
|
}>;
|
|
44
|
-
tooltipFor: (row: import("@chelone/core").CartesianRow<TRow[TX]>, value: number | string | null) => string;
|
|
44
|
+
tooltipFor: (row: import("@chelone/core").CartesianRow<TRow[TX]>, value: number | string | null, color?: string) => string;
|
|
45
45
|
};
|
|
46
46
|
export {};
|
|
@@ -28,9 +28,15 @@ function useSeriesRows(props) {
|
|
|
28
28
|
const step = Math.max(1, Math.ceil(rows.value.length / 7));
|
|
29
29
|
return rows.value.filter((row) => row.index % step === 0).map(rowX);
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The crosshair's HTML for a row, with `value` shown in place of the row's y.
|
|
33
|
+
* `color` draws the row's own indicator, for a chart whose color is not the
|
|
34
|
+
* same for every row.
|
|
35
|
+
*/
|
|
36
|
+
const tooltipFor = (row, value, color) => componentToString(config.value, chart_tooltip_content_default, {
|
|
37
|
+
labelFormatter: xLabel,
|
|
38
|
+
...color === void 0 ? {} : { color }
|
|
39
|
+
})?.({ [props.yField]: value }, row.index) ?? "";
|
|
34
40
|
return {
|
|
35
41
|
rows,
|
|
36
42
|
config,
|
package/dist/components/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import skeleton_default from "./ui/skeleton.js";
|
|
|
23
23
|
import logout_default from "./admin/auth/logout.js";
|
|
24
24
|
import user_menu_default from "./admin/layout/user-menu.js";
|
|
25
25
|
import app_bar_default from "./admin/layout/app-bar.js";
|
|
26
|
+
import keyboard_shortcut_default from "./admin/common/keyboard-shortcut.js";
|
|
26
27
|
import menu_item_link_default from "./admin/layout/menu-item-link.js";
|
|
27
28
|
import dashboard_menu_item_default from "./admin/layout/dashboard-menu-item.js";
|
|
28
29
|
import resource_menu_item_default from "./admin/layout/resource-menu-item.js";
|
|
@@ -90,7 +91,6 @@ import field_label_text_default from "./admin/common/field-label-text.js";
|
|
|
90
91
|
import i18n_key_editor_default from "./admin/common/i18n-key-editor.js";
|
|
91
92
|
import icon_button_with_tooltip_default from "./admin/common/icon-button-with-tooltip.js";
|
|
92
93
|
import input_helper_text_default from "./admin/common/input-helper-text.js";
|
|
93
|
-
import keyboard_shortcut_default from "./admin/common/keyboard-shortcut.js";
|
|
94
94
|
import link_default from "./admin/common/link.js";
|
|
95
95
|
import title_default from "./admin/layout/title.js";
|
|
96
96
|
import error_default from "./admin/feedback/error.js";
|
|
@@ -201,7 +201,6 @@ import command_group_default from "./ui/command/command-group.js";
|
|
|
201
201
|
import command_input_default from "./ui/command/command-input.js";
|
|
202
202
|
import command_item_default from "./ui/command/command-item.js";
|
|
203
203
|
import { CommandEmpty, CommandList, CommandSeparator, CommandShortcut } from "./ui/command/parts.js";
|
|
204
|
-
import sheet_default from "./ui/sheet.js";
|
|
205
204
|
import command_menu_default from "./admin/layout/command-menu.js";
|
|
206
205
|
import data_provider_devtools_default from "./admin/layout/data-provider-devtools.js";
|
|
207
206
|
import hide_on_scroll_default from "./admin/layout/hide-on-scroll.js";
|
|
@@ -209,6 +208,7 @@ import onboarding_tour_default from "./admin/layout/onboarding-tour.js";
|
|
|
209
208
|
import top_toolbar_default from "./admin/layout/top-toolbar.js";
|
|
210
209
|
import textarea_default from "./ui/textarea.js";
|
|
211
210
|
import approval_queue_default from "./admin/list/approval-queue.js";
|
|
211
|
+
import sheet_default from "./ui/sheet.js";
|
|
212
212
|
import bulk_edit_drawer_default from "./admin/list/bulk-edit-drawer.js";
|
|
213
213
|
import calendar_list_default from "./admin/list/calendar-list.js";
|
|
214
214
|
import count_default from "./admin/list/count.js";
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<Configurable>` — marks a piece of the page as configurable. While the
|
|
3
|
-
* inspector's configure mode is on it is outlined and shows a Customize button
|
|
4
|
-
* that opens its `#editor` slot in the panel. The Vue twin of
|
|
5
|
-
* `@chelone/react`'s `Configurable`. Without an `<Inspector>` it renders its
|
|
6
|
-
* default slot and nothing else.
|
|
7
|
-
*
|
|
8
|
-
* The wrapper is there whether or not the mode is on, so turning it on never
|
|
9
|
-
* remounts the content.
|
|
10
|
-
*
|
|
11
|
-
* The editor is teleported into the panel, so it reads the contexts around this
|
|
12
|
-
* (resource, list, record), not the ones around the `<Inspector>`.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* <Configurable preference-key="posts.columns" title="Columns">
|
|
16
|
-
* <PostTable />
|
|
17
|
-
* <template #editor>
|
|
18
|
-
* <SortableFieldsSelector store-key="posts.datatable" />
|
|
19
|
-
* </template>
|
|
20
|
-
* </Configurable>
|
|
21
|
-
*/
|
|
22
1
|
import { type VNode } from "vue";
|
|
23
2
|
/** Props for {@link Configurable}. */
|
|
24
3
|
export interface ConfigurableProps {
|
|
@@ -4,6 +4,7 @@ import { SlidersHorizontalIcon } from "../admin/buttons/icons.js";
|
|
|
4
4
|
import button_default from "../ui/button.js";
|
|
5
5
|
import { useInspector, useInspectorBody } from "./inspector-context.js";
|
|
6
6
|
import { Teleport, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, onScopeDispose, openBlock, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
7
|
+
import { INSPECTOR_OPEN_LABEL } from "@chelone/core";
|
|
7
8
|
// src/components/inspector/configurable.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var _hoisted_1 = ["data-inspector-enabled", "data-selected"];
|
|
9
10
|
var configurable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -40,7 +41,6 @@ var configurable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
40
41
|
const translate = useTranslate();
|
|
41
42
|
const inspector = useInspector();
|
|
42
43
|
const body = useInspectorBody();
|
|
43
|
-
const defaultOpenLabel = "chelone.inspector.customize";
|
|
44
44
|
const enabled = computed(() => inspector?.value.enabled ?? false);
|
|
45
45
|
const isSelected = computed(() => inspector?.value.selected?.key === props.preferenceKey);
|
|
46
46
|
const editor = () => [];
|
|
@@ -71,7 +71,7 @@ var configurable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
71
71
|
class: "absolute top-1 right-1 z-10 h-6 gap-1 px-2 text-xs opacity-0 focus-visible:opacity-100 group-focus-within/configurable:opacity-100 group-hover/configurable:opacity-100 group-data-[selected]/configurable:opacity-100",
|
|
72
72
|
onClick: open
|
|
73
73
|
}, {
|
|
74
|
-
default: withCtx(() => [createVNode(unref(SlidersHorizontalIcon)), createTextVNode(" " + toDisplayString(unref(translate)(props.openButtonLabel ??
|
|
74
|
+
default: withCtx(() => [createVNode(unref(SlidersHorizontalIcon)), createTextVNode(" " + toDisplayString(unref(translate)(props.openButtonLabel ?? unref(INSPECTOR_OPEN_LABEL), { _: props.openButtonLabel ?? "Customize" })), 1)]),
|
|
75
75
|
_: 1
|
|
76
76
|
})) : createCommentVNode("", true),
|
|
77
77
|
isSelected.value && unref(body) ? (openBlock(), createBlock(Teleport, {
|
|
@@ -7,7 +7,7 @@ import { XIcon } from "../admin/buttons/icons.js";
|
|
|
7
7
|
import button_default from "../ui/button.js";
|
|
8
8
|
import { provideInspector, provideInspectorBody } from "./inspector-context.js";
|
|
9
9
|
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, shallowRef, toDisplayString, unref, withCtx } from "vue";
|
|
10
|
-
import { clampInspectorPosition, createInspector, inspectorPositionKey } from "@chelone/core";
|
|
10
|
+
import { INSPECTOR_KEY_STEP, PANEL_WIDTH, clampInspectorPosition, createInspector, inspectorPositionKey } from "@chelone/core";
|
|
11
11
|
// src/components/inspector/inspector.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var _hoisted_1 = ["aria-label"];
|
|
13
13
|
var _hoisted_2 = ["aria-label"];
|
|
@@ -37,24 +37,22 @@ var inspector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
37
37
|
* </template>
|
|
38
38
|
* </Admin>
|
|
39
39
|
*/
|
|
40
|
-
const PANEL_WIDTH = 320;
|
|
41
|
-
const KEY_STEP = 16;
|
|
42
40
|
const ARROWS = {
|
|
43
41
|
ArrowLeft: {
|
|
44
|
-
x: -
|
|
42
|
+
x: -INSPECTOR_KEY_STEP,
|
|
45
43
|
y: 0
|
|
46
44
|
},
|
|
47
45
|
ArrowRight: {
|
|
48
|
-
x:
|
|
46
|
+
x: INSPECTOR_KEY_STEP,
|
|
49
47
|
y: 0
|
|
50
48
|
},
|
|
51
49
|
ArrowUp: {
|
|
52
50
|
x: 0,
|
|
53
|
-
y: -
|
|
51
|
+
y: -INSPECTOR_KEY_STEP
|
|
54
52
|
},
|
|
55
53
|
ArrowDown: {
|
|
56
54
|
x: 0,
|
|
57
|
-
y:
|
|
55
|
+
y: INSPECTOR_KEY_STEP
|
|
58
56
|
}
|
|
59
57
|
};
|
|
60
58
|
const props = __props;
|
|
@@ -142,7 +140,7 @@ var inspector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
142
140
|
style: normalizeStyle({
|
|
143
141
|
left: `${position.value.x}px`,
|
|
144
142
|
top: `${position.value.y}px`,
|
|
145
|
-
width: `${PANEL_WIDTH}px`
|
|
143
|
+
width: `${unref(PANEL_WIDTH)}px`
|
|
146
144
|
}),
|
|
147
145
|
class: normalizeClass(unref(cn)("fixed z-50 flex max-h-[80vh] max-w-[calc(100vw-1rem)] flex-col rounded-lg border bg-popover text-popover-foreground shadow-lg", props.class))
|
|
148
146
|
}, [createElementVNode("div", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VNode } from "vue";
|
|
2
|
-
import type { KanbanColumnDef, LooseRecord, SourceKey, SourceProp } from "@chelone/core";
|
|
2
|
+
import type { KanbanColumnDef, LooseRecord, ResourceRecord, SourceKey, SourceProp } from "@chelone/core";
|
|
3
3
|
/** Props for {@link KanbanBoard}. */
|
|
4
|
-
export interface KanbanBoardProps<TRecord extends
|
|
4
|
+
export interface KanbanBoardProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
5
5
|
/**
|
|
6
6
|
* The top-level field whose value names a column; a drop writes the target
|
|
7
7
|
* column's `id` to it.
|
|
@@ -22,7 +22,7 @@ export interface KanbanBoardProps<TRecord extends LooseRecord = LooseRecord> {
|
|
|
22
22
|
}
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
|
24
24
|
export default _default;
|
|
25
|
-
declare const __VLS_export: <TRecord extends
|
|
25
|
+
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<{
|
|
26
26
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<KanbanBoardProps<TRecord> & {
|
|
27
27
|
"onSelect-card"?: ((record: TRecord) => any) | undefined;
|
|
28
28
|
}> & (typeof globalThis extends {
|
|
@@ -17,7 +17,7 @@ import { ArrowRightLeftIcon } from "../admin/list/list-icons.js";
|
|
|
17
17
|
import kanban_draggable_card_default from "./kanban-draggable-card.js";
|
|
18
18
|
import kanban_drop_area_default from "./kanban-drop-area.js";
|
|
19
19
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
20
|
-
import { buildKanbanBuckets, getAtPath, planKanbanMove } from "@chelone/core";
|
|
20
|
+
import { buildKanbanBuckets, getAtPath, isLooseRecord, planKanbanMove } from "@chelone/core";
|
|
21
21
|
import { PointerSensor } from "@dnd-kit/dom";
|
|
22
22
|
import { DragDropProvider } from "@dnd-kit/vue";
|
|
23
23
|
// src/components/kanban/kanban-board.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -115,9 +115,14 @@ var kanban_board_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
115
115
|
};
|
|
116
116
|
const buckets = computed(() => buildKanbanBuckets(list.data ?? [], props.groupSource, props.columns));
|
|
117
117
|
function move(record, targetColumnId) {
|
|
118
|
+
if (!isLooseRecord(record)) return;
|
|
118
119
|
const plan = planKanbanMove(record, props.groupSource, props.columns, targetColumnId);
|
|
119
120
|
if (!plan) return;
|
|
120
|
-
update.mutateAsync(
|
|
121
|
+
update.mutateAsync({
|
|
122
|
+
id: plan.id,
|
|
123
|
+
data: plan.data,
|
|
124
|
+
previousData: record
|
|
125
|
+
}).catch(() => {
|
|
121
126
|
notifications?.notify("chelone.notification.http_error", { type: "error" });
|
|
122
127
|
});
|
|
123
128
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFieldValue } from "../../record/use-field-value.js";
|
|
2
2
|
import geo_json_field_default from "./geo-json-field.js";
|
|
3
3
|
import { computed, createBlock, defineComponent, normalizeClass, openBlock } from "vue";
|
|
4
|
-
import { bboxToPolygon } from "@chelone/core";
|
|
4
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAP_HEIGHT, DEFAULT_MAX_FIT_ZOOM, bboxToPolygon } from "@chelone/core";
|
|
5
5
|
// src/components/maps/bbox-field.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var bbox_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "bbox-field",
|
|
@@ -10,7 +10,7 @@ var bbox_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
10
10
|
record: {},
|
|
11
11
|
defaultValue: {},
|
|
12
12
|
emptyText: {},
|
|
13
|
-
height: { default:
|
|
13
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
14
14
|
mapStyle: {},
|
|
15
15
|
scrollZoom: {
|
|
16
16
|
type: Boolean,
|
|
@@ -22,8 +22,8 @@ var bbox_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: true
|
|
24
24
|
},
|
|
25
|
-
fitPadding: { default:
|
|
26
|
-
maxFitZoom: { default:
|
|
25
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
26
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
27
27
|
},
|
|
28
28
|
setup(__props) {
|
|
29
29
|
/**
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../lib/utils.js";
|
|
|
3
3
|
import { useFieldValue } from "../../record/use-field-value.js";
|
|
4
4
|
import geo_json_view_default from "./geo-json-view.js";
|
|
5
5
|
import { computed, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref } from "vue";
|
|
6
|
-
import { geoBounds, isGeoJsonValue, isLngLatBox } from "@chelone/core";
|
|
6
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAP_HEIGHT, DEFAULT_MAX_FIT_ZOOM, geoBounds, isGeoJsonValue, isLngLatBox } from "@chelone/core";
|
|
7
7
|
// src/components/maps/geo-json-field.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var geo_json_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
__name: "geo-json-field",
|
|
@@ -12,7 +12,7 @@ var geo_json_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
12
12
|
record: {},
|
|
13
13
|
defaultValue: {},
|
|
14
14
|
emptyText: {},
|
|
15
|
-
height: { default:
|
|
15
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
16
16
|
mapStyle: {},
|
|
17
17
|
scrollZoom: {
|
|
18
18
|
type: Boolean,
|
|
@@ -24,8 +24,8 @@ var geo_json_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: true
|
|
26
26
|
},
|
|
27
|
-
fitPadding: { default:
|
|
28
|
-
maxFitZoom: { default:
|
|
27
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
28
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
29
29
|
},
|
|
30
30
|
setup(__props) {
|
|
31
31
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uniqueGeoJsonSourceId, useGeoJsonSource } from "./use-geo-json-source.js";
|
|
2
2
|
import { useMap } from "./use-map.js";
|
|
3
3
|
import { computed, defineComponent, toRaw, watch } from "vue";
|
|
4
|
-
import { asFeatureCollection, geoBounds, isLngLatBox } from "@chelone/core";
|
|
4
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAX_FIT_ZOOM, asFeatureCollection, geoBounds, isLngLatBox } from "@chelone/core";
|
|
5
5
|
// src/components/maps/geo-json-layers.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var geo_json_layers_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "geo-json-layers",
|
|
@@ -12,8 +12,8 @@ var geo_json_layers_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
12
12
|
type: Boolean,
|
|
13
13
|
default: true
|
|
14
14
|
},
|
|
15
|
-
fitPadding: { default:
|
|
16
|
-
maxFitZoom: { default:
|
|
15
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
16
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
17
17
|
},
|
|
18
18
|
setup(__props) {
|
|
19
19
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import geo_json_layers_default from "./geo-json-layers.js";
|
|
2
2
|
import map_canvas_default from "./map-canvas.js";
|
|
3
3
|
import { createBlock, createVNode, defineComponent, normalizeClass, openBlock, withCtx } from "vue";
|
|
4
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAX_FIT_ZOOM } from "@chelone/core";
|
|
4
5
|
// src/components/maps/geo-json-view.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var geo_json_view_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
7
|
__name: "geo-json-view",
|
|
@@ -18,8 +19,8 @@ var geo_json_view_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
18
19
|
type: Boolean,
|
|
19
20
|
default: true
|
|
20
21
|
},
|
|
21
|
-
fitPadding: { default:
|
|
22
|
-
maxFitZoom: { default:
|
|
22
|
+
fitPadding: { default: DEFAULT_FIT_PADDING },
|
|
23
|
+
maxFitZoom: { default: DEFAULT_MAX_FIT_ZOOM }
|
|
23
24
|
},
|
|
24
25
|
setup(__props) {
|
|
25
26
|
/**
|
|
@@ -4,6 +4,7 @@ import map_canvas_default from "./map-canvas.js";
|
|
|
4
4
|
import { useCoordinates } from "./use-coordinates.js";
|
|
5
5
|
import { MapMarker } from "./use-map.js";
|
|
6
6
|
import { computed, createBlock, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
7
|
+
import { DEFAULT_MAP_HEIGHT, LATITUDE_LIMIT, LONGITUDE_LIMIT } from "@chelone/core";
|
|
7
8
|
// src/components/maps/lat-lng-field.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var lat_lng_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
10
|
__name: "lat-lng-field",
|
|
@@ -32,10 +33,10 @@ var lat_lng_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
32
33
|
function inRange(value, limit) {
|
|
33
34
|
return value !== null && Math.abs(value) <= limit ? value : null;
|
|
34
35
|
}
|
|
35
|
-
const lat = computed(() => inRange(coordinates.lat.value,
|
|
36
|
-
const lng = computed(() => inRange(coordinates.lng.value,
|
|
36
|
+
const lat = computed(() => inRange(coordinates.lat.value, LATITUDE_LIMIT));
|
|
37
|
+
const lng = computed(() => inRange(coordinates.lng.value, LONGITUDE_LIMIT));
|
|
37
38
|
const cssHeight = computed(() => {
|
|
38
|
-
const height = props.height ??
|
|
39
|
+
const height = props.height ?? DEFAULT_MAP_HEIGHT;
|
|
39
40
|
return typeof height === "number" ? `${height}px` : height;
|
|
40
41
|
});
|
|
41
42
|
return (_ctx, _cache) => {
|
|
@@ -9,7 +9,7 @@ import input_default from "../ui/input.js";
|
|
|
9
9
|
import map_canvas_default from "./map-canvas.js";
|
|
10
10
|
import { MapMarker, useMap } from "./use-map.js";
|
|
11
11
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, toDisplayString, unref, watch, withCtx } from "vue";
|
|
12
|
-
import { latitude, longitude, toCoordinate } from "@chelone/core";
|
|
12
|
+
import { DEFAULT_MAP_HEIGHT, DEFAULT_MAP_ZOOM, LATITUDE_LIMIT, LONGITUDE_LIMIT, latitude, longitude, toCoordinate, wrapLongitude } from "@chelone/core";
|
|
13
13
|
// src/components/maps/lat-lng-input.vue?vue&type=script&setup=true&lang.ts
|
|
14
14
|
var _hoisted_1 = ["data-invalid"];
|
|
15
15
|
var _hoisted_2 = {
|
|
@@ -80,8 +80,8 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
80
80
|
latValidate: {},
|
|
81
81
|
lngValidate: {},
|
|
82
82
|
defaultPosition: { default: () => [0, 0] },
|
|
83
|
-
zoom: { default:
|
|
84
|
-
height: { default:
|
|
83
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
84
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
85
85
|
mapStyle: {},
|
|
86
86
|
disabled: {
|
|
87
87
|
type: Boolean,
|
|
@@ -111,8 +111,6 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
111
111
|
}
|
|
112
112
|
/** About 10 cm, so the text fields stay readable. */
|
|
113
113
|
const round6 = (value) => Math.round(value * 1e6) / 1e6;
|
|
114
|
-
/** A click on a repeated copy of the world reports a longitude past 180. */
|
|
115
|
-
const wrapLng = (lng) => Math.abs(lng) <= 180 ? lng : ((lng + 180) % 360 + 360) % 360 - 180;
|
|
116
114
|
/** Digits with an optional sign and point: what a coordinate looks like while it is typed. */
|
|
117
115
|
const TYPING = /^[+-]?\d*\.?\d*$/;
|
|
118
116
|
/** MapLibre throws on a coordinate outside its range. */
|
|
@@ -162,7 +160,7 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
162
160
|
const position = computed(() => {
|
|
163
161
|
const a = lat.stored.value;
|
|
164
162
|
const b = lng.stored.value;
|
|
165
|
-
return inRange(a,
|
|
163
|
+
return inRange(a, LATITUDE_LIMIT) && inRange(b, LONGITUDE_LIMIT) ? [a, b] : null;
|
|
166
164
|
});
|
|
167
165
|
const center = computed(() => position.value ?? props.defaultPosition);
|
|
168
166
|
const invalid = computed(() => lat.invalid.value || lng.invalid.value);
|
|
@@ -170,7 +168,7 @@ var lat_lng_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
170
168
|
const gesture = { current: null };
|
|
171
169
|
function place(rawLat, rawLng) {
|
|
172
170
|
const nextLat = round6(rawLat);
|
|
173
|
-
const nextLng = round6(
|
|
171
|
+
const nextLng = round6(wrapLongitude(rawLng));
|
|
174
172
|
gesture.current = [nextLat, nextLng];
|
|
175
173
|
lat.setValue(nextLat);
|
|
176
174
|
lat.blur();
|
|
@@ -2,7 +2,7 @@ import { useTranslate } from "../../i18n/use-translate.js";
|
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
3
|
import { provideMap, useMapsConfig } from "./use-map.js";
|
|
4
4
|
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, shallowRef, toDisplayString, unref } from "vue";
|
|
5
|
-
import { latLngToLngLat } from "@chelone/core";
|
|
5
|
+
import { DEFAULT_MAP_HEIGHT, DEFAULT_MAP_ZOOM, latLngToLngLat } from "@chelone/core";
|
|
6
6
|
import { Map } from "maplibre-gl";
|
|
7
7
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
8
8
|
// src/components/maps/map-canvas.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,8 +16,8 @@ var map_canvas_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
16
16
|
__name: "map-canvas",
|
|
17
17
|
props: {
|
|
18
18
|
center: { default: () => [0, 0] },
|
|
19
|
-
zoom: { default:
|
|
20
|
-
height: { default:
|
|
19
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
20
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
21
21
|
mapStyle: {},
|
|
22
22
|
scrollZoom: {
|
|
23
23
|
type: Boolean,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, onBeforeUnmount, provide, toValue, watch } from "vue";
|
|
2
|
-
import { latLngToLngLat } from "@chelone/core";
|
|
2
|
+
import { DEFAULT_PIN_COLOR, PIN_NS, latLngToLngLat } from "@chelone/core";
|
|
3
3
|
import { Marker } from "maplibre-gl";
|
|
4
4
|
// src/components/maps/use-map.ts
|
|
5
5
|
var MapsConfigKey = Symbol("chelone-maps-config");
|
|
@@ -53,8 +53,6 @@ function useMap() {
|
|
|
53
53
|
if (!map) throw new Error("useMap must be used inside a <MapCanvas>.");
|
|
54
54
|
return map;
|
|
55
55
|
}
|
|
56
|
-
var PIN_NS = "http://www.w3.org/2000/svg";
|
|
57
|
-
var DEFAULT_PIN_COLOR = "#dc2626";
|
|
58
56
|
/** A pin whose tip is the bottom edge of the element. */
|
|
59
57
|
function createPin(color) {
|
|
60
58
|
const svg = document.createElementNS(PIN_NS, "svg");
|
|
@@ -13,7 +13,7 @@ import { uniqueGeoJsonSourceId, useGeoJsonSource } from "../maps/use-geo-json-so
|
|
|
13
13
|
import { useMap } from "../maps/use-map.js";
|
|
14
14
|
import { useTerraDraw } from "./use-terra-draw.js";
|
|
15
15
|
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, onBeforeUnmount, openBlock, ref, shallowRef, toDisplayString, toRaw, unref, watch, withCtx } from "vue";
|
|
16
|
-
import { deepEqual, featuresToShape, geoBounds, heldFeatures, isLngLatBox, maxVertices, minAreaM2, minVertices, noSelfIntersection, shapeToFeatures } from "@chelone/core";
|
|
16
|
+
import { DEFAULT_FIT_PADDING, DEFAULT_MAP_HEIGHT, DEFAULT_MAP_ZOOM, DEFAULT_MAX_FIT_ZOOM, deepEqual, featuresToShape, geoBounds, heldFeatures, isLngLatBox, maxVertices, minAreaM2, minVertices, noSelfIntersection, shapeToFeatures } from "@chelone/core";
|
|
17
17
|
// src/components/maps-draw/shape-input.vue?vue&type=script&setup=true&lang.ts
|
|
18
18
|
var _hoisted_1 = ["data-invalid"];
|
|
19
19
|
var _hoisted_2 = {
|
|
@@ -110,8 +110,8 @@ var Editor = defineComponent((props, { emit }) => {
|
|
|
110
110
|
if (props.getValue() === props.written.current) return;
|
|
111
111
|
if (!isLngLatBox(corners)) return;
|
|
112
112
|
map.fitBounds(corners, {
|
|
113
|
-
padding:
|
|
114
|
-
maxZoom:
|
|
113
|
+
padding: DEFAULT_FIT_PADDING,
|
|
114
|
+
maxZoom: DEFAULT_MAX_FIT_ZOOM,
|
|
115
115
|
duration: 0
|
|
116
116
|
});
|
|
117
117
|
}, { immediate: true });
|
|
@@ -200,8 +200,8 @@ var shape_input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
200
200
|
default: false
|
|
201
201
|
},
|
|
202
202
|
defaultCenter: { default: () => [0, 0] },
|
|
203
|
-
zoom: { default:
|
|
204
|
-
height: { default:
|
|
203
|
+
zoom: { default: DEFAULT_MAP_ZOOM },
|
|
204
|
+
height: { default: DEFAULT_MAP_HEIGHT },
|
|
205
205
|
mapStyle: { default: void 0 },
|
|
206
206
|
shapeStyle: { default: void 0 },
|
|
207
207
|
aspectRatio: { default: void 0 },
|