@chelone/vue 0.2.0 → 0.4.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.
Files changed (142) hide show
  1. package/dist/array/use-array-input.d.ts +4 -3
  2. package/dist/choices/use-choices.d.ts +19 -12
  3. package/dist/choices/use-choices.js +8 -11
  4. package/dist/components/admin/auth/auth-error.vue.d.ts +1 -1
  5. package/dist/components/admin/buttons/dual-approval-button.vue.d.ts +19 -15
  6. package/dist/components/admin/buttons/dual-approval-button.vue.js +3 -1
  7. package/dist/components/admin/buttons/save-button.vue.d.ts +1 -1
  8. package/dist/components/admin/buttons/sort-button.vue.d.ts +2 -1
  9. package/dist/components/admin/buttons/status-transition-button.vue.d.ts +19 -14
  10. package/dist/components/admin/buttons/status-transition-button.vue.js +3 -1
  11. package/dist/components/admin/buttons/update-button.vue.d.ts +3 -3
  12. package/dist/components/admin/feedback/linear-progress.vue.d.ts +1 -1
  13. package/dist/components/admin/fields/api-key-field.vue.d.ts +27 -9
  14. package/dist/components/admin/fields/api-key-field.vue.js +3 -1
  15. package/dist/components/admin/fields/array-field.vue.d.ts +2 -2
  16. package/dist/components/admin/fields/badge-field.vue.d.ts +2 -2
  17. package/dist/components/admin/fields/boolean-field.vue.d.ts +2 -2
  18. package/dist/components/admin/fields/chip-field.vue.d.ts +2 -2
  19. package/dist/components/admin/fields/color-field.vue.d.ts +2 -2
  20. package/dist/components/admin/fields/cron-field.vue.d.ts +2 -2
  21. package/dist/components/admin/fields/currency-field.vue.d.ts +2 -2
  22. package/dist/components/admin/fields/date-field.vue.d.ts +2 -2
  23. package/dist/components/admin/fields/duration-field.vue.d.ts +2 -2
  24. package/dist/components/admin/fields/email-field.vue.d.ts +2 -2
  25. package/dist/components/admin/fields/file-field.vue.d.ts +2 -2
  26. package/dist/components/admin/fields/file-field.vue.js +3 -3
  27. package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
  28. package/dist/components/admin/fields/image-field.vue.d.ts +2 -2
  29. package/dist/components/admin/fields/image-field.vue.js +3 -3
  30. package/dist/components/admin/fields/json-field.vue.d.ts +2 -2
  31. package/dist/components/admin/fields/number-field.vue.d.ts +2 -2
  32. package/dist/components/admin/fields/phone-field.vue.d.ts +2 -2
  33. package/dist/components/admin/fields/rating-field.vue.d.ts +22 -7
  34. package/dist/components/admin/fields/rating-field.vue.js +3 -1
  35. package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
  36. package/dist/components/admin/fields/reference-array-field.vue.d.ts +2 -2
  37. package/dist/components/admin/fields/reference-field.vue.d.ts +2 -1
  38. package/dist/components/admin/fields/reference-many-count.vue.d.ts +2 -2
  39. package/dist/components/admin/fields/reference-many-field.vue.d.ts +2 -2
  40. package/dist/components/admin/fields/reference-one-field.vue.d.ts +2 -2
  41. package/dist/components/admin/fields/select-field.vue.d.ts +2 -2
  42. package/dist/components/admin/fields/select-field.vue.js +1 -1
  43. package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +2 -2
  44. package/dist/components/admin/fields/text-array-field.vue.d.ts +2 -2
  45. package/dist/components/admin/fields/text-field.vue.d.ts +2 -8
  46. package/dist/components/admin/fields/url-field.vue.d.ts +2 -2
  47. package/dist/components/admin/fields/usage-meter-field.vue.d.ts +22 -7
  48. package/dist/components/admin/fields/usage-meter-field.vue.js +3 -1
  49. package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +2 -2
  50. package/dist/components/admin/fields/wrapper-field.vue.d.ts +3 -3
  51. package/dist/components/admin/fields/wrapper-field.vue.js +6 -0
  52. package/dist/components/admin/inputs/api-key-input.vue.d.ts +2 -2
  53. package/dist/components/admin/inputs/array-input.vue.d.ts +2 -2
  54. package/dist/components/admin/inputs/autocomplete-array-input.vue.d.ts +14 -6
  55. package/dist/components/admin/inputs/autocomplete-array-input.vue.js +2 -3
  56. package/dist/components/admin/inputs/autocomplete-input.vue.d.ts +14 -6
  57. package/dist/components/admin/inputs/autocomplete-input.vue.js +2 -3
  58. package/dist/components/admin/inputs/boolean-input.vue.d.ts +2 -2
  59. package/dist/components/admin/inputs/checkbox-group-input.vue.d.ts +1 -1
  60. package/dist/components/admin/inputs/choice-input-props.d.ts +7 -7
  61. package/dist/components/admin/inputs/color-input.vue.d.ts +2 -2
  62. package/dist/components/admin/inputs/cron-input.vue.d.ts +2 -2
  63. package/dist/components/admin/inputs/currency-input.vue.d.ts +2 -2
  64. package/dist/components/admin/inputs/date-input.vue.d.ts +2 -2
  65. package/dist/components/admin/inputs/date-time-input.vue.d.ts +2 -2
  66. package/dist/components/admin/inputs/duration-input.vue.d.ts +2 -2
  67. package/dist/components/admin/inputs/file-input.vue.d.ts +2 -2
  68. package/dist/components/admin/inputs/nullable-boolean-input.vue.d.ts +2 -2
  69. package/dist/components/admin/inputs/number-input.vue.d.ts +2 -2
  70. package/dist/components/admin/inputs/password-input.vue.d.ts +2 -2
  71. package/dist/components/admin/inputs/phone-input.vue.d.ts +2 -2
  72. package/dist/components/admin/inputs/radio-button-group-input.vue.d.ts +1 -1
  73. package/dist/components/admin/inputs/rating-input.vue.d.ts +2 -2
  74. package/dist/components/admin/inputs/reference-array-input.vue.d.ts +2 -2
  75. package/dist/components/admin/inputs/reference-input.vue.d.ts +2 -2
  76. package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +2 -1
  77. package/dist/components/admin/inputs/search-input.vue.d.ts +3 -3
  78. package/dist/components/admin/inputs/select-array-input.vue.d.ts +14 -5
  79. package/dist/components/admin/inputs/select-array-input.vue.js +1 -1
  80. package/dist/components/admin/inputs/select-input.vue.d.ts +14 -7
  81. package/dist/components/admin/inputs/select-input.vue.js +1 -1
  82. package/dist/components/admin/inputs/subscription-plan-picker.vue.d.ts +2 -2
  83. package/dist/components/admin/inputs/text-array-input.vue.d.ts +2 -2
  84. package/dist/components/admin/inputs/text-input.vue.d.ts +2 -1
  85. package/dist/components/admin/inputs/time-input.vue.d.ts +2 -1
  86. package/dist/components/admin/inputs/use-choice-input.d.ts +13 -19
  87. package/dist/components/admin/inputs/use-choice-input.js +4 -1
  88. package/dist/components/admin/inputs/webhook-endpoint-input.vue.d.ts +2 -2
  89. package/dist/components/admin/list/calendar-list.vue.d.ts +8 -8
  90. package/dist/components/admin/list/data-table-col.vue.d.ts +2 -2
  91. package/dist/components/admin/list/data-table-number-col.vue.d.ts +2 -1
  92. package/dist/components/admin/list/filter-form.vue.js +2 -10
  93. package/dist/components/admin/list/filter-live-search.vue.d.ts +1 -1
  94. package/dist/components/admin/list/kanban-board.vue.d.ts +41 -0
  95. package/dist/components/admin/list/kanban-board.vue.js +275 -0
  96. package/dist/components/admin/list/kanban-board2.vue.js +4 -0
  97. package/dist/components/admin/list/list-icons.d.ts +2 -0
  98. package/dist/components/admin/list/list-icons.js +7 -0
  99. package/dist/components/admin/list/tree-list.vue.d.ts +7 -6
  100. package/dist/components/admin/list/tree-list.vue.js +3 -9
  101. package/dist/components/admin/view/labeled.vue.d.ts +6 -5
  102. package/dist/components/admin/view/labeled.vue.js +4 -1
  103. package/dist/components/admin/view/tabbed-show-layout-tab.vue.d.ts +2 -2
  104. package/dist/components/index.d.ts +2 -0
  105. package/dist/components/maps/geo-json-field.vue.d.ts +2 -1
  106. package/dist/components/maps/lat-lng-field.vue.d.ts +3 -3
  107. package/dist/components/maps/lat-lng-input.vue.d.ts +4 -4
  108. package/dist/components/maps-draw/shape-input.vue.d.ts +4 -4
  109. package/dist/components/maps-draw/simplify-input.vue.d.ts +2 -2
  110. package/dist/components/maps-osm/geocoding-input.vue.d.ts +6 -6
  111. package/dist/components/maps-osm/map-with-search.vue.d.ts +4 -4
  112. package/dist/components/maps-osm/osm-feature-operator.vue.d.ts +3 -3
  113. package/dist/components/maps-osm/reverse-geocode-field.vue.d.ts +3 -3
  114. package/dist/components/mdx-editor/mdx-field.vue.d.ts +2 -2
  115. package/dist/components/mdx-editor/mdx-input.vue.d.ts +2 -2
  116. package/dist/components/monaco/monaco-json-field.vue.d.ts +2 -2
  117. package/dist/components/monaco/monaco-json-input.vue.d.ts +2 -2
  118. package/dist/components/ui/alert.d.ts +1 -1
  119. package/dist/components/ui/badge.d.ts +1 -1
  120. package/dist/components/ui/button.vue.d.ts +1 -1
  121. package/dist/components/ui/command/command-dialog.vue.d.ts +1 -1
  122. package/dist/components/ui/dropdown-menu/dropdown-menu-item.vue.js +9 -3
  123. package/dist/components/ui/input.vue.d.ts +2 -2
  124. package/dist/components/ui/sidebar/sidebar-menu-button.vue.d.ts +1 -1
  125. package/dist/components/ui/textarea.vue.d.ts +2 -2
  126. package/dist/controllers/use-controller-for-id.d.ts +6 -2
  127. package/dist/controllers/use-controller-for-id.js +2 -1
  128. package/dist/create-resource-components.d.ts +743 -0
  129. package/dist/create-resource-components.js +171 -0
  130. package/dist/data/create-chelone-hooks.d.ts +28 -8
  131. package/dist/data/mutations.d.ts +28 -8
  132. package/dist/form/use-input.d.ts +9 -6
  133. package/dist/form/use-input.js +2 -1
  134. package/dist/index.d.ts +2 -0
  135. package/dist/index.js +248 -243
  136. package/dist/label/use-get-record-representation.d.ts +2 -1
  137. package/dist/label/use-get-record-representation.js +1 -13
  138. package/dist/record/use-field-value.d.ts +22 -11
  139. package/dist/record/use-field-value.js +3 -20
  140. package/package.json +4 -4
  141. package/dist/components/admin/fields/get-path.d.ts +0 -7
  142. package/dist/components/admin/fields/get-path.js +0 -14
@@ -1,8 +1,8 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp } from "@chelone/core";
2
2
  import type { editor } from "monaco-editor";
3
3
  /** Props for {@link MonacoJsonField}. */
4
4
  export interface MonacoJsonFieldProps {
5
- source: string;
5
+ source: SourceProp;
6
6
  record?: LooseRecord;
7
7
  /** Shown when the record has no value at `source`. */
8
8
  defaultValue?: unknown;
@@ -1,8 +1,8 @@
1
- import type { Validator } from "@chelone/core";
1
+ import type { SourceProp, Validator } from "@chelone/core";
2
2
  import type { editor } from "monaco-editor";
3
3
  /** Props for {@link MonacoJsonInput}. */
4
4
  export interface MonacoJsonInputProps {
5
- source: string;
5
+ source: SourceProp;
6
6
  label?: string | false;
7
7
  defaultValue?: unknown;
8
8
  validate?: Validator | readonly Validator[];
@@ -27,8 +27,8 @@ export declare const Alert: import("vue").DefineComponent<import("vue").ExtractP
27
27
  default: string;
28
28
  };
29
29
  }>> & Readonly<{}>, {
30
- class: string;
31
30
  variant: AlertVariant;
31
+ class: string;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
33
  export declare const AlertDescription: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
34
34
  class: {
@@ -29,6 +29,6 @@ export declare const Badge: import("vue").DefineComponent<import("vue").ExtractP
29
29
  default: string;
30
30
  };
31
31
  }>> & Readonly<{}>, {
32
- class: string;
33
32
  variant: BadgeVariant;
33
+ class: string;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -11,9 +11,9 @@ type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_1) => any;
12
12
  };
13
13
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
+ variant: ButtonVariant;
14
15
  size: ButtonSize;
15
16
  type: "button" | "submit" | "reset";
16
- variant: ButtonVariant;
17
17
  disabled: boolean;
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -14,8 +14,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CommandDia
14
14
  }, string, import("vue").PublicProps, Readonly<CommandDialogProps> & Readonly<{
15
15
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
16
16
  }>, {
17
- description: string;
18
17
  title: string;
18
+ description: string;
19
19
  open: boolean;
20
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
21
21
  default?: (props: {}) => any;
@@ -11,10 +11,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  const props = __props;
12
12
  const emit = __emit;
13
13
  const { setOpen } = useDropdownMenu();
14
- function onClick() {
14
+ function select() {
15
15
  setOpen(false);
16
16
  emit("select");
17
17
  }
18
+ function onKeydown(event) {
19
+ if (event.key !== "Enter" && event.key !== " ") return;
20
+ event.preventDefault();
21
+ select();
22
+ }
18
23
  return (_ctx, _cache) => {
19
24
  return openBlock(), createElementBlock("div", {
20
25
  role: "menuitem",
@@ -26,10 +31,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
31
  )
27
32
  ),
28
33
  "data-slot": "dropdown-menu-item",
29
- onClick
34
+ onClick: select,
35
+ onKeydown
30
36
  }, [
31
37
  renderSlot(_ctx.$slots, "default")
32
- ], 2);
38
+ ], 34);
33
39
  };
34
40
  }
35
41
  });
@@ -10,12 +10,12 @@ type __VLS_Props = {
10
10
  class?: string;
11
11
  };
12
12
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
- "update:modelValue": (value: string) => any;
14
13
  blur: (event: FocusEvent) => any;
15
14
  focus: (event: FocusEvent) => any;
15
+ "update:modelValue": (value: string) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
18
17
  onBlur?: ((event: FocusEvent) => any) | undefined;
19
18
  onFocus?: ((event: FocusEvent) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
21
  export default _default;
@@ -17,8 +17,8 @@ export interface SidebarMenuButtonProps {
17
17
  }
18
18
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarMenuButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarMenuButtonProps> & Readonly<{}>, {
19
19
  size: "default" | "sm" | "lg";
20
- as: string | Component;
21
20
  isActive: boolean;
21
+ as: string | Component;
22
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
23
23
  default?: (props: {}) => any;
24
24
  }>;
@@ -9,12 +9,12 @@ type __VLS_Props = {
9
9
  class?: string;
10
10
  };
11
11
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
- "update:modelValue": (value: string) => any;
13
12
  blur: (event: FocusEvent) => any;
14
13
  focus: (event: FocusEvent) => any;
14
+ "update:modelValue": (value: string) => any;
15
15
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
17
16
  onBlur?: ((event: FocusEvent) => any) | undefined;
18
17
  onFocus?: ((event: FocusEvent) => any) | undefined;
18
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
19
19
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  export default _default;
@@ -5,7 +5,7 @@
5
5
  * the 4R release: the old controller's observer detaches the moment the id
6
6
  * moves on, and the last scope disposal releases the final one.
7
7
  */
8
- import type { Identifier, MicroStore } from "@chelone/core";
8
+ import { type Identifier, type MicroStore } from "@chelone/core";
9
9
  import { type Ref } from "vue";
10
10
  import type { RecordValue } from "../record/record-context.js";
11
11
  export type SourceId = Identifier | undefined;
@@ -13,7 +13,11 @@ export interface BoundController<TController, TState> {
13
13
  controller: TController;
14
14
  state: Readonly<Ref<TState>>;
15
15
  }
16
- /** The foreign key `source` holds on the record; anything but a string or number reads as no key. */
16
+ /**
17
+ * The foreign key `source` holds on the record, read through core's
18
+ * {@link getAtPath} so `source="author.id"` resolves the way the field
19
+ * composables read it. Anything but a string or number reads as no key.
20
+ */
17
21
  export declare function foreignKeyOf(record: RecordValue, source: string): SourceId;
18
22
  /**
19
23
  * Builds `create(id)` inside a scope of its own and keeps it bound to `id`:
@@ -1,7 +1,8 @@
1
+ import { getAtPath } from "@chelone/core";
1
2
  import { shallowRef, watch, onScopeDispose, effectScope } from "vue";
2
3
  import { useMicroStore } from "../store/use-micro-store.js";
3
4
  function foreignKeyOf(record, source) {
4
- const value = record?.[source];
5
+ const value = getAtPath(record, source);
5
6
  return typeof value === "string" || typeof value === "number" ? value : void 0;
6
7
  }
7
8
  function useControllerForId(id, create) {