@shwfed/nuxt 0.11.36 → 0.11.38

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 (22) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/fields.d.vue.ts +396 -342
  3. package/dist/runtime/components/fields.vue +2 -1
  4. package/dist/runtime/components/fields.vue.d.ts +396 -342
  5. package/dist/runtime/components/modal.vue +2 -2
  6. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +3 -3
  7. package/dist/runtime/components/ui/command/CommandDialog.vue +3 -3
  8. package/dist/runtime/components/ui/dialog/DialogScrollContent.d.vue.ts +8 -3
  9. package/dist/runtime/components/ui/dialog/DialogScrollContent.vue +167 -14
  10. package/dist/runtime/components/ui/dialog/DialogScrollContent.vue.d.ts +8 -3
  11. package/dist/runtime/components/ui/fields/Fields.d.vue.ts +846 -350
  12. package/dist/runtime/components/ui/fields/Fields.vue +538 -435
  13. package/dist/runtime/components/ui/fields/Fields.vue.d.ts +846 -350
  14. package/dist/runtime/components/ui/fields/schema.d.ts +3337 -30
  15. package/dist/runtime/components/ui/fields/schema.js +86 -9
  16. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +394 -340
  17. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +767 -175
  18. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +394 -340
  19. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue +3 -3
  20. package/dist/runtime/components/ui/table/Table.vue +1 -0
  21. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +3 -3
  22. package/package.json +1 -1
@@ -4,10 +4,10 @@ import { computed, ref, useAttrs, useSlots } from "vue";
4
4
  import {
5
5
  Dialog,
6
6
  DialogClose,
7
- DialogContent,
8
7
  DialogDescription,
9
8
  DialogFooter,
10
9
  DialogHeader,
10
+ DialogScrollContent,
11
11
  DialogTitle,
12
12
  DialogTrigger
13
13
  } from "./ui/dialog";
@@ -39,7 +39,7 @@ const isDesktop = useMediaQuery(props.breakpoint);
39
39
  const desktopComponents = {
40
40
  Root: Dialog,
41
41
  Trigger: DialogTrigger,
42
- Content: DialogContent,
42
+ Content: DialogScrollContent,
43
43
  Header: DialogHeader,
44
44
  Title: DialogTitle,
45
45
  Description: DialogDescription,
@@ -13,7 +13,7 @@ import {
13
13
  ButtonsStyleC
14
14
  } from "../buttons/schema";
15
15
  import { Checkbox } from "../checkbox";
16
- import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../dialog";
16
+ import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogScrollContent, DialogTitle } from "../dialog";
17
17
  import { IconPicker } from "../icon-picker";
18
18
  import { Input } from "../input";
19
19
  import Locale from "../locale/Locale.vue";
@@ -848,7 +848,7 @@ function confirmChanges() {
848
848
  :open="open"
849
849
  @update:open="open = $event"
850
850
  >
851
- <DialogContent class="flex h-[min(40rem,calc(100vh-4rem))] w-[calc(100%-2rem)] max-w-[calc(100%-2rem)] flex-col overflow-hidden p-0 sm:w-[72rem] sm:max-w-[72rem]">
851
+ <DialogScrollContent class="flex h-[min(40rem,calc(100vh-4rem))] w-[calc(100%-2rem)] max-w-[calc(100%-2rem)] flex-col overflow-hidden p-0 sm:w-[72rem] sm:max-w-[72rem]">
852
852
  <DialogHeader class="gap-1 border-b border-zinc-200 px-6 py-5">
853
853
  <div class="flex items-center gap-3">
854
854
  <DialogTitle class="text-xl font-semibold text-zinc-800">
@@ -1382,7 +1382,7 @@ function confirmChanges() {
1382
1382
  </Button>
1383
1383
  </div>
1384
1384
  </DialogFooter>
1385
- </DialogContent>
1385
+ </DialogScrollContent>
1386
1386
  </Dialog>
1387
1387
  </template>
1388
1388
 
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useForwardPropsEmits } from "reka-ui";
3
- import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../dialog";
3
+ import { Dialog, DialogDescription, DialogHeader, DialogScrollContent, DialogTitle } from "../dialog";
4
4
  import Command from "./Command.vue";
5
5
  const props = defineProps({
6
6
  open: { type: Boolean, required: false },
@@ -18,7 +18,7 @@ const forwarded = useForwardPropsEmits(props, emits);
18
18
  v-slot="slotProps"
19
19
  v-bind="forwarded"
20
20
  >
21
- <DialogContent
21
+ <DialogScrollContent
22
22
  :show-close-button="false"
23
23
  class="overflow-hidden p-0"
24
24
  >
@@ -29,6 +29,6 @@ const forwarded = useForwardPropsEmits(props, emits);
29
29
  <Command>
30
30
  <slot v-bind="slotProps" />
31
31
  </Command>
32
- </DialogContent>
32
+ </DialogScrollContent>
33
33
  </Dialog>
34
34
  </template>
@@ -2,10 +2,11 @@ import type { DialogContentProps } from 'reka-ui';
2
2
  import type { HTMLAttributes } from 'vue';
3
3
  type __VLS_Props = DialogContentProps & {
4
4
  class?: HTMLAttributes['class'];
5
+ showCloseButton?: boolean;
5
6
  };
6
- declare var __VLS_22: {};
7
+ declare var __VLS_23: {};
7
8
  type __VLS_Slots = {} & {
8
- default?: (props: typeof __VLS_22) => any;
9
+ default?: (props: typeof __VLS_23) => any;
9
10
  };
10
11
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
12
  escapeKeyDown: (event: KeyboardEvent) => any;
@@ -14,6 +15,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
14
15
  interactOutside: (event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any;
15
16
  openAutoFocus: (event: Event) => any;
16
17
  closeAutoFocus: (event: Event) => any;
18
+ "after-close": () => any;
17
19
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
20
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
19
21
  onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
@@ -21,7 +23,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
21
23
  onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
22
24
  onOpenAutoFocus?: ((event: Event) => any) | undefined;
23
25
  onCloseAutoFocus?: ((event: Event) => any) | undefined;
24
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ "onAfter-close"?: (() => any) | undefined;
27
+ }>, {
28
+ showCloseButton: boolean;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
30
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
31
  declare const _default: typeof __VLS_export;
27
32
  export default _default;
@@ -1,6 +1,13 @@
1
1
  <script setup>
2
- import { Icon } from "@iconify/vue";
3
2
  import { reactiveOmit } from "@vueuse/core";
3
+ import { Icon } from "@iconify/vue";
4
+ import {
5
+ computed,
6
+ onBeforeUnmount,
7
+ shallowRef,
8
+ useAttrs,
9
+ watchEffect
10
+ } from "vue";
4
11
  import {
5
12
  DialogClose,
6
13
  DialogContent,
@@ -17,11 +24,158 @@ const props = defineProps({
17
24
  disableOutsidePointerEvents: { type: Boolean, required: false },
18
25
  asChild: { type: Boolean, required: false },
19
26
  as: { type: null, required: false },
20
- class: { type: null, required: false }
27
+ class: { type: null, required: false },
28
+ showCloseButton: { type: Boolean, required: false, default: true }
29
+ });
30
+ const emit = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus", "after-close"]);
31
+ const attrs = useAttrs();
32
+ const delegatedProps = reactiveOmit(props, "class", "showCloseButton");
33
+ const forwarded = useForwardPropsEmits(delegatedProps, emit);
34
+ const contentElement = shallowRef(null);
35
+ let closeFallbackTimer;
36
+ let hasEmittedAfterClose = false;
37
+ function isClosedContentTarget(target) {
38
+ return target instanceof HTMLElement && target.dataset.state === "closed";
39
+ }
40
+ function isPointerDownOutsideEvent(event) {
41
+ if (!("detail" in event) || typeof event.detail !== "object" || event.detail === null) {
42
+ return false;
43
+ }
44
+ if (!("originalEvent" in event.detail)) {
45
+ return false;
46
+ }
47
+ return event.detail.originalEvent instanceof MouseEvent;
48
+ }
49
+ function clearCloseFallbackTimer() {
50
+ if (closeFallbackTimer === void 0) {
51
+ return;
52
+ }
53
+ window.clearTimeout(closeFallbackTimer);
54
+ closeFallbackTimer = void 0;
55
+ }
56
+ function emitAfterClose() {
57
+ if (hasEmittedAfterClose) {
58
+ return;
59
+ }
60
+ hasEmittedAfterClose = true;
61
+ clearCloseFallbackTimer();
62
+ emit("after-close");
63
+ }
64
+ function parseDurationMs(value) {
65
+ const normalizedValue = value.trim();
66
+ if (normalizedValue.endsWith("ms")) {
67
+ const duration = Number.parseFloat(normalizedValue.slice(0, -2));
68
+ return Number.isFinite(duration) ? duration : 0;
69
+ }
70
+ if (normalizedValue.endsWith("s")) {
71
+ const duration = Number.parseFloat(normalizedValue.slice(0, -1));
72
+ return Number.isFinite(duration) ? duration * 1e3 : 0;
73
+ }
74
+ return 0;
75
+ }
76
+ function getLongestMotionMs(element) {
77
+ const style = window.getComputedStyle(element);
78
+ const animationDurations = style.animationDuration.split(",");
79
+ const animationDelays = style.animationDelay.split(",");
80
+ const transitionDurations = style.transitionDuration.split(",");
81
+ const transitionDelays = style.transitionDelay.split(",");
82
+ let longestMotionMs = 0;
83
+ for (const [index, durationValue] of animationDurations.entries()) {
84
+ const durationMs = parseDurationMs(durationValue);
85
+ const delayMs = parseDurationMs(animationDelays[index] ?? animationDelays[0] ?? "0s");
86
+ longestMotionMs = Math.max(longestMotionMs, durationMs + delayMs);
87
+ }
88
+ for (const [index, durationValue] of transitionDurations.entries()) {
89
+ const durationMs = parseDurationMs(durationValue);
90
+ const delayMs = parseDurationMs(transitionDelays[index] ?? transitionDelays[0] ?? "0s");
91
+ longestMotionMs = Math.max(longestMotionMs, durationMs + delayMs);
92
+ }
93
+ return longestMotionMs;
94
+ }
95
+ function syncCloseFallback() {
96
+ const element = contentElement.value;
97
+ clearCloseFallbackTimer();
98
+ if (!element) {
99
+ return;
100
+ }
101
+ if (element.dataset.state !== "closed") {
102
+ hasEmittedAfterClose = false;
103
+ return;
104
+ }
105
+ const motionMs = getLongestMotionMs(element);
106
+ closeFallbackTimer = window.setTimeout(() => {
107
+ emitAfterClose();
108
+ }, motionMs > 0 ? motionMs : 0);
109
+ }
110
+ function handleCloseMotionEnd(event) {
111
+ if (hasEmittedAfterClose || event.target !== event.currentTarget || !isClosedContentTarget(event.currentTarget)) {
112
+ return;
113
+ }
114
+ emitAfterClose();
115
+ }
116
+ function setContentElement(target) {
117
+ if (target instanceof HTMLElement) {
118
+ contentElement.value = target;
119
+ syncCloseFallback();
120
+ return;
121
+ }
122
+ if (target && "$el" in target && target.$el instanceof HTMLElement) {
123
+ contentElement.value = target.$el;
124
+ syncCloseFallback();
125
+ return;
126
+ }
127
+ contentElement.value = null;
128
+ clearCloseFallbackTimer();
129
+ }
130
+ function callEventHandlers(eventHandler, event) {
131
+ if (typeof eventHandler === "function") {
132
+ eventHandler(event);
133
+ return;
134
+ }
135
+ if (!Array.isArray(eventHandler)) {
136
+ return;
137
+ }
138
+ for (const handler of eventHandler) {
139
+ if (typeof handler === "function") {
140
+ handler(event);
141
+ }
142
+ }
143
+ }
144
+ function handlePointerDownOutside(event) {
145
+ if (isPointerDownOutsideEvent(event) && event.detail.originalEvent.target instanceof HTMLElement) {
146
+ const target = event.detail.originalEvent.target;
147
+ if (event.detail.originalEvent.offsetX > target.clientWidth || event.detail.originalEvent.offsetY > target.clientHeight) {
148
+ event.preventDefault();
149
+ }
150
+ }
151
+ callEventHandlers(Reflect.get(forwarded, "onPointerDownOutside"), event);
152
+ callEventHandlers(Reflect.get(attrs, "onPointerDownOutside"), event);
153
+ }
154
+ const contentBindings = computed(() => ({
155
+ ...attrs,
156
+ ...forwarded,
157
+ onPointerDownOutside: handlePointerDownOutside
158
+ }));
159
+ watchEffect((onCleanup) => {
160
+ const element = contentElement.value;
161
+ if (!element) {
162
+ return;
163
+ }
164
+ const observer = new MutationObserver(() => {
165
+ syncCloseFallback();
166
+ });
167
+ observer.observe(element, {
168
+ attributes: true,
169
+ attributeFilter: ["data-state"]
170
+ });
171
+ syncCloseFallback();
172
+ onCleanup(() => {
173
+ observer.disconnect();
174
+ });
175
+ });
176
+ onBeforeUnmount(() => {
177
+ clearCloseFallbackTimer();
21
178
  });
22
- const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"]);
23
- const delegatedProps = reactiveOmit(props, "class");
24
- const forwarded = useForwardPropsEmits(delegatedProps, emits);
25
179
  </script>
26
180
 
27
181
  <template>
@@ -30,25 +184,24 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
30
184
  class="fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
31
185
  >
32
186
  <DialogContent
187
+ :ref="setContentElement"
188
+ data-slot="dialog-content"
33
189
  :class="
34
190
  cn(
35
191
  'relative z-50 grid w-full max-w-lg my-8 gap-4 border border-zinc-200 bg-white p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
36
192
  props.class
37
193
  )
38
194
  "
39
- v-bind="{ ...$attrs, ...forwarded }"
40
- @pointer-down-outside="(event) => {
41
- const originalEvent = event.detail.originalEvent;
42
- const target = originalEvent.target;
43
- if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) {
44
- event.preventDefault();
45
- }
46
- }"
195
+ v-bind="contentBindings"
196
+ @animationend="handleCloseMotionEnd"
197
+ @transitionend="handleCloseMotionEnd"
47
198
  >
48
199
  <slot />
49
200
 
50
201
  <DialogClose
51
- class="absolute top-4 right-4 p-0.5 transition-colors rounded-md hover:bg-zinc-100"
202
+ v-if="showCloseButton"
203
+ data-slot="dialog-close"
204
+ class="data-[state=open]:bg-zinc-100 data-[state=open]:text-zinc-700 absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
52
205
  >
53
206
  <Icon icon="fluent:dismiss-20-filled" />
54
207
  <span class="sr-only">Close</span>
@@ -2,10 +2,11 @@ import type { DialogContentProps } from 'reka-ui';
2
2
  import type { HTMLAttributes } from 'vue';
3
3
  type __VLS_Props = DialogContentProps & {
4
4
  class?: HTMLAttributes['class'];
5
+ showCloseButton?: boolean;
5
6
  };
6
- declare var __VLS_22: {};
7
+ declare var __VLS_23: {};
7
8
  type __VLS_Slots = {} & {
8
- default?: (props: typeof __VLS_22) => any;
9
+ default?: (props: typeof __VLS_23) => any;
9
10
  };
10
11
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
12
  escapeKeyDown: (event: KeyboardEvent) => any;
@@ -14,6 +15,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
14
15
  interactOutside: (event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any;
15
16
  openAutoFocus: (event: Event) => any;
16
17
  closeAutoFocus: (event: Event) => any;
18
+ "after-close": () => any;
17
19
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
20
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
19
21
  onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
@@ -21,7 +23,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
21
23
  onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
22
24
  onOpenAutoFocus?: ((event: Event) => any) | undefined;
23
25
  onCloseAutoFocus?: ((event: Event) => any) | undefined;
24
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ "onAfter-close"?: (() => any) | undefined;
27
+ }>, {
28
+ showCloseButton: boolean;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
30
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
31
  declare const _default: typeof __VLS_export;
27
32
  export default _default;