@omnitend/dashboard-for-laravel 0.4.14 → 0.6.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 (35) hide show
  1. package/dist/components/base/DButton.vue.d.ts +2 -3
  2. package/dist/components/base/DTable.vue.d.ts +11 -3
  3. package/dist/components/extended/DXBasicForm.vue.d.ts +4 -33
  4. package/dist/components/extended/DXField.vue.d.ts +88 -0
  5. package/dist/components/extended/DXForm.vue.d.ts +34 -8
  6. package/dist/components/extended/DXRepeater.vue.d.ts +30 -0
  7. package/dist/components/extended/DXTable.vue.d.ts +10 -17
  8. package/dist/dashboard-for-laravel.js +31131 -16052
  9. package/dist/dashboard-for-laravel.js.map +1 -1
  10. package/dist/dashboard-for-laravel.umd.cjs +10 -7
  11. package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
  12. package/dist/index.d.ts +12 -4
  13. package/dist/style.css +1 -1
  14. package/dist/types/index.d.ts +114 -9
  15. package/dist/utils/objectPath.d.ts +18 -0
  16. package/docs/public/api-reference.json +354 -130
  17. package/docs/public/docs-map.md +5 -4
  18. package/docs/public/llms.txt +8 -7
  19. package/package.json +3 -3
  20. package/resources/js/components/base/DButton.vue +2 -3
  21. package/resources/js/components/base/{DCarousel.vue → DFormRadioGroup.vue} +5 -5
  22. package/resources/js/components/base/DTable.vue +39 -3
  23. package/resources/js/components/base/DToaster.vue +5 -3
  24. package/resources/js/components/extended/DXBasicForm.vue +35 -184
  25. package/resources/js/components/extended/DXField.vue +402 -0
  26. package/resources/js/components/extended/DXForm.vue +282 -17
  27. package/resources/js/components/extended/DXRepeater.vue +216 -0
  28. package/resources/js/components/extended/DXTable.vue +96 -210
  29. package/resources/js/composables/defineForm.ts +7 -0
  30. package/resources/js/index.ts +18 -3
  31. package/resources/js/types/index.ts +146 -9
  32. package/resources/js/utils/objectPath.ts +59 -0
  33. package/dist/components/base/DCarouselSlide.vue.d.ts +0 -12
  34. package/resources/js/components/base/DCarouselSlide.vue +0 -14
  35. /package/dist/components/base/{DCarousel.vue.d.ts → DFormRadioGroup.vue.d.ts} +0 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Minimal dot-path get/set helpers used for nested form binding
3
+ * (e.g. repeater rows where a field value lives at `lines.0.price`).
4
+ *
5
+ * Paths are dot-separated; numeric segments index into arrays. Setting
6
+ * creates intermediate objects/arrays as needed so a fresh repeater row
7
+ * can be populated without pre-seeding the whole shape.
8
+ */
9
+
10
+ type AnyRecord = Record<string, any>;
11
+
12
+ /** Segments that could pollute Object.prototype if written through. */
13
+ const BLOCKED_SEGMENTS = new Set(["__proto__", "prototype", "constructor"]);
14
+
15
+ /** Split a dot path into segments, ignoring empty segments. */
16
+ function splitPath(path: string): string[] {
17
+ return path.split(".").filter((segment) => segment.length > 0);
18
+ }
19
+
20
+ /** Read the value at `path` within `target`, or `undefined` if absent. */
21
+ export function getByPath(target: AnyRecord, path: string): any {
22
+ const segments = splitPath(path);
23
+ let current: any = target;
24
+ for (const segment of segments) {
25
+ if (current === null || current === undefined) return undefined;
26
+ current = current[segment];
27
+ }
28
+ return current;
29
+ }
30
+
31
+ /**
32
+ * Write `value` at `path` within `target`, creating intermediate
33
+ * containers. A numeric next-segment creates an array; otherwise an
34
+ * object. Mutates `target` in place (form.data is reactive).
35
+ */
36
+ export function setByPath(target: AnyRecord, path: string, value: any): void {
37
+ const segments = splitPath(path);
38
+ if (segments.length === 0) return;
39
+ // Never write through prototype-polluting segments.
40
+ if (segments.some((segment) => BLOCKED_SEGMENTS.has(segment))) return;
41
+
42
+ let current: any = target;
43
+ for (let index = 0; index < segments.length - 1; index += 1) {
44
+ const segment = segments[index];
45
+ const nextSegment = segments[index + 1];
46
+ const nextIsIndex = /^\d+$/.test(nextSegment);
47
+
48
+ if (
49
+ current[segment] === null ||
50
+ current[segment] === undefined ||
51
+ typeof current[segment] !== "object"
52
+ ) {
53
+ current[segment] = nextIsIndex ? [] : {};
54
+ }
55
+ current = current[segment];
56
+ }
57
+
58
+ current[segments[segments.length - 1]] = value;
59
+ }
@@ -1,12 +0,0 @@
1
- declare var __VLS_7: string | number, __VLS_8: any;
2
- type __VLS_Slots = {} & {
3
- [K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
4
- };
5
- declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
- export default _default;
8
- type __VLS_WithSlots<T, S> = T & {
9
- new (): {
10
- $slots: S;
11
- };
12
- };
@@ -1,14 +0,0 @@
1
- <script setup lang="ts">
2
- import { BCarouselSlide } from "bootstrap-vue-next";
3
- import { useSlots } from "vue";
4
-
5
- const slots = useSlots();
6
- </script>
7
-
8
- <template>
9
- <BCarouselSlide v-bind="$attrs">
10
- <template v-for="(_, name) in slots" :key="name" #[name]="slotProps">
11
- <slot :name="name" v-bind="slotProps" />
12
- </template>
13
- </BCarouselSlide>
14
- </template>