pxd 0.0.44 → 0.0.46

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 (172) hide show
  1. package/dist/components/_internal/fragment-container.d.ts +2 -0
  2. package/dist/components/_internal/fragment-container.js +25 -0
  3. package/dist/components/active-graph/index.d.vue.ts +2 -2
  4. package/dist/components/active-graph/index.vue.d.ts +2 -2
  5. package/dist/components/avatar/index.vue +1 -1
  6. package/dist/components/backtop/index.d.vue.ts +2 -2
  7. package/dist/components/backtop/index.vue.d.ts +2 -2
  8. package/dist/components/badge/index.d.vue.ts +2 -2
  9. package/dist/components/badge/index.vue +2 -2
  10. package/dist/components/badge/index.vue.d.ts +2 -2
  11. package/dist/components/browser/index.d.vue.ts +2 -2
  12. package/dist/components/browser/index.vue +3 -1
  13. package/dist/components/browser/index.vue.d.ts +2 -2
  14. package/dist/components/button/index.d.vue.ts +4 -4
  15. package/dist/components/button/index.vue +1 -1
  16. package/dist/components/button/index.vue.d.ts +4 -4
  17. package/dist/components/carousel-group/index.d.vue.ts +2 -3
  18. package/dist/components/carousel-group/index.vue +17 -5
  19. package/dist/components/carousel-group/index.vue.d.ts +2 -3
  20. package/dist/components/checkbox-group/index.d.vue.ts +4 -4
  21. package/dist/components/checkbox-group/index.vue.d.ts +4 -4
  22. package/dist/components/choicebox/index.d.vue.ts +3 -3
  23. package/dist/components/choicebox/index.vue +1 -1
  24. package/dist/components/choicebox/index.vue.d.ts +3 -3
  25. package/dist/components/choicebox-group/index.d.vue.ts +2 -2
  26. package/dist/components/choicebox-group/index.vue +1 -1
  27. package/dist/components/choicebox-group/index.vue.d.ts +2 -2
  28. package/dist/components/command-menu/index.d.vue.ts +3 -3
  29. package/dist/components/command-menu/index.vue +6 -2
  30. package/dist/components/command-menu/index.vue.d.ts +3 -3
  31. package/dist/components/command-menu-item/index.d.vue.ts +2 -2
  32. package/dist/components/command-menu-item/index.vue.d.ts +2 -2
  33. package/dist/components/config-provider/index.d.vue.ts +2 -2
  34. package/dist/components/config-provider/index.vue +1 -1
  35. package/dist/components/config-provider/index.vue.d.ts +2 -2
  36. package/dist/components/countdown/index.d.vue.ts +2 -2
  37. package/dist/components/countdown/index.vue.d.ts +2 -2
  38. package/dist/components/dash-line/index.d.vue.ts +13 -0
  39. package/dist/components/dash-line/index.vue +78 -0
  40. package/dist/components/dash-line/index.vue.d.ts +13 -0
  41. package/dist/components/description/index.d.vue.ts +2 -2
  42. package/dist/components/description/index.vue.d.ts +2 -2
  43. package/dist/components/drawer/index.d.vue.ts +7 -6
  44. package/dist/components/drawer/index.vue +7 -2
  45. package/dist/components/drawer/index.vue.d.ts +7 -6
  46. package/dist/components/error/index.d.vue.ts +2 -2
  47. package/dist/components/error/index.vue +1 -1
  48. package/dist/components/error/index.vue.d.ts +2 -2
  49. package/dist/components/fader/index.vue +8 -24
  50. package/dist/components/hold-button/index.d.vue.ts +4 -4
  51. package/dist/components/hold-button/index.vue.d.ts +4 -4
  52. package/dist/components/index.d.ts +2 -1
  53. package/dist/components/index.js +2 -1
  54. package/dist/components/input/index.d.vue.ts +8 -9
  55. package/dist/components/input/index.vue +68 -71
  56. package/dist/components/input/index.vue.d.ts +8 -9
  57. package/dist/components/intersection-observer/index.d.vue.ts +3 -3
  58. package/dist/components/intersection-observer/index.vue +5 -5
  59. package/dist/components/intersection-observer/index.vue.d.ts +3 -3
  60. package/dist/components/kbd/index.vue +1 -1
  61. package/dist/components/link-button/index.d.vue.ts +5 -5
  62. package/dist/components/link-button/index.vue +1 -1
  63. package/dist/components/link-button/index.vue.d.ts +5 -5
  64. package/dist/components/list/index.d.vue.ts +2 -2
  65. package/dist/components/list/index.vue +5 -4
  66. package/dist/components/list/index.vue.d.ts +2 -2
  67. package/dist/components/list-item/index.vue +1 -1
  68. package/dist/components/material/index.d.vue.ts +2 -2
  69. package/dist/components/material/index.vue.d.ts +2 -2
  70. package/dist/components/menu/index.d.vue.ts +2 -2
  71. package/dist/components/menu/index.vue +1 -7
  72. package/dist/components/menu/index.vue.d.ts +2 -2
  73. package/dist/components/message/index.vue +6 -2
  74. package/dist/components/modal/index.d.vue.ts +7 -6
  75. package/dist/components/modal/index.vue +7 -2
  76. package/dist/components/modal/index.vue.d.ts +7 -6
  77. package/dist/components/noise-background/index.d.vue.ts +19 -0
  78. package/dist/components/noise-background/index.vue +18 -0
  79. package/dist/components/noise-background/index.vue.d.ts +19 -0
  80. package/dist/components/note/index.d.vue.ts +3 -3
  81. package/dist/components/note/index.vue +3 -3
  82. package/dist/components/note/index.vue.d.ts +3 -3
  83. package/dist/components/number-input/index.d.vue.ts +4 -4
  84. package/dist/components/number-input/index.vue +5 -9
  85. package/dist/components/number-input/index.vue.d.ts +4 -4
  86. package/dist/components/overlay/index.d.vue.ts +2 -2
  87. package/dist/components/overlay/index.vue +33 -26
  88. package/dist/components/overlay/index.vue.d.ts +2 -2
  89. package/dist/components/overlay/overlay-stack.d.ts +3 -0
  90. package/dist/components/overlay/overlay-stack.js +17 -0
  91. package/dist/components/pagination/index.d.vue.ts +2 -2
  92. package/dist/components/pagination/index.vue +2 -2
  93. package/dist/components/pagination/index.vue.d.ts +2 -2
  94. package/dist/components/pin-input/index.d.vue.ts +3 -14
  95. package/dist/components/pin-input/index.vue +28 -40
  96. package/dist/components/pin-input/index.vue.d.ts +3 -14
  97. package/dist/components/placeholder/index.d.vue.ts +12 -4
  98. package/dist/components/placeholder/index.vue +14 -20
  99. package/dist/components/placeholder/index.vue.d.ts +12 -4
  100. package/dist/components/popover/index.d.vue.ts +8 -18
  101. package/dist/components/popover/index.vue +71 -284
  102. package/dist/components/popover/index.vue.d.ts +8 -18
  103. package/dist/components/progress/index.d.vue.ts +1 -1
  104. package/dist/components/progress/index.vue.d.ts +1 -1
  105. package/dist/components/radio-group/index.d.vue.ts +4 -4
  106. package/dist/components/radio-group/index.vue.d.ts +4 -4
  107. package/dist/components/scrollable/index.vue +2 -2
  108. package/dist/components/slider/index.d.vue.ts +1 -1
  109. package/dist/components/slider/index.vue.d.ts +1 -1
  110. package/dist/components/snippet/index.vue +3 -2
  111. package/dist/components/stack/index.d.vue.ts +2 -2
  112. package/dist/components/stack/index.vue +1 -1
  113. package/dist/components/stack/index.vue.d.ts +2 -2
  114. package/dist/components/status-dot/index.d.vue.ts +3 -2
  115. package/dist/components/status-dot/index.vue +1 -1
  116. package/dist/components/status-dot/index.vue.d.ts +3 -2
  117. package/dist/components/teleport/index.d.vue.ts +3 -3
  118. package/dist/components/teleport/index.vue.d.ts +3 -3
  119. package/dist/components/text/index.d.vue.ts +2 -2
  120. package/dist/components/text/index.vue +1 -1
  121. package/dist/components/text/index.vue.d.ts +2 -2
  122. package/dist/components/textarea/index.d.vue.ts +6 -17
  123. package/dist/components/textarea/index.vue +25 -33
  124. package/dist/components/textarea/index.vue.d.ts +6 -17
  125. package/dist/components/time-picker/index.d.vue.ts +9 -2
  126. package/dist/components/time-picker/index.vue +76 -93
  127. package/dist/components/time-picker/index.vue.d.ts +9 -2
  128. package/dist/components/toggle/index.d.vue.ts +6 -9
  129. package/dist/components/toggle/index.vue +32 -41
  130. package/dist/components/toggle/index.vue.d.ts +6 -9
  131. package/dist/components/tooltip/index.d.vue.ts +3 -3
  132. package/dist/components/tooltip/index.vue +1 -1
  133. package/dist/components/tooltip/index.vue.d.ts +3 -3
  134. package/dist/composables/index.d.ts +1 -0
  135. package/dist/composables/index.js +1 -0
  136. package/dist/composables/use-focus-trap.d.ts +9 -1
  137. package/dist/composables/use-focus-trap.js +33 -51
  138. package/dist/composables/use-lock-scroll.d.ts +5 -0
  139. package/dist/composables/use-lock-scroll.js +40 -0
  140. package/dist/composables/use-outside-click.js +8 -2
  141. package/dist/composables/use-repeat-action.js +3 -2
  142. package/dist/index.d.ts +1 -1
  143. package/dist/index.js +1 -1
  144. package/dist/styles/source.css +8 -5
  145. package/dist/styles/styles.css +2 -2
  146. package/dist/styles/tw.css +8 -5
  147. package/dist/types/components/error.d.ts +1 -1
  148. package/dist/types/components/input.d.ts +1 -1
  149. package/dist/utils/debounce.d.ts +1 -1
  150. package/dist/utils/debounce.js +1 -1
  151. package/dist/utils/dom.d.ts +1 -0
  152. package/dist/utils/dom.js +12 -0
  153. package/dist/utils/event.js +12 -20
  154. package/dist/utils/get.d.ts +0 -8
  155. package/dist/utils/get.js +1 -126
  156. package/dist/utils/index.d.ts +11 -0
  157. package/dist/utils/index.js +11 -0
  158. package/dist/utils/throttle.d.ts +7 -1
  159. package/dist/utils/throttle.js +16 -1
  160. package/package.json +25 -18
  161. package/volar.d.ts +2 -1
  162. package/dist/components/keep-alive-container/index.d.vue.ts +0 -13
  163. package/dist/components/keep-alive-container/index.vue +0 -11
  164. package/dist/components/keep-alive-container/index.vue.d.ts +0 -13
  165. package/dist/utils/debounce/compat.d.ts +0 -143
  166. package/dist/utils/debounce/compat.js +0 -47
  167. package/dist/utils/debounce/index.d.ts +0 -73
  168. package/dist/utils/debounce/index.js +0 -60
  169. package/dist/utils/throttle/compat.d.ts +0 -79
  170. package/dist/utils/throttle/compat.js +0 -9
  171. package/dist/utils/throttle/index.d.ts +0 -53
  172. package/dist/utils/throttle/index.js +0 -34
@@ -135,10 +135,10 @@ function onInputKeydown(ev) {
135
135
  <PInput
136
136
  v-bind="$attrs"
137
137
  v-model="modelValue"
138
- inputmode="decimal"
139
138
  :min="min"
140
139
  :max="max"
141
140
  align="center"
141
+ inputmode="decimal"
142
142
  input-type="number"
143
143
  :disabled="disabled"
144
144
  :readonly="readonly"
@@ -150,7 +150,7 @@ function onInputKeydown(ev) {
150
150
  >
151
151
  <template #prefix>
152
152
  <button
153
- class="flex aspect-square h-full cursor-pointer touch-manipulation appearance-none items-center justify-center text-foreground-secondary outline-none enabled:hover:bg-background-hover enabled:hover:text-gray-1000 enabled:active:bg-background-active disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 motion-safe:transition-colors"
153
+ class="mr-2 -ml-3 flex aspect-square h-full cursor-pointer touch-manipulation appearance-none items-center justify-center border-r text-foreground outline-none enabled:hover:bg-background-hover enabled:hover:text-gray-1000 enabled:active:bg-background-active disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 motion-safe:transition-colors"
154
154
  :disabled="decreaseDisabled"
155
155
  @pointerdown="startDecrease"
156
156
  @pointercancel="stopDecrease"
@@ -160,18 +160,14 @@ function onInputKeydown(ev) {
160
160
  <MinusIcon class="pointer-events-none" />
161
161
  </button>
162
162
 
163
- <span v-if="$slots.prefix" class="ml-1 text-foreground">
164
- <slot name="prefix" />
165
- </span>
163
+ <slot name="prefix" />
166
164
  </template>
167
165
 
168
166
  <template #suffix>
169
- <span v-if="$slots.suffix" class="mr-1 text-foreground">
170
- <slot name="suffix" />
171
- </span>
167
+ <slot name="suffix" />
172
168
 
173
169
  <button
174
- class="flex aspect-square h-full cursor-pointer touch-manipulation appearance-none items-center justify-center text-foreground-secondary outline-none enabled:hover:bg-background-hover enabled:hover:text-gray-1000 enabled:active:bg-background-active disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 motion-safe:transition-colors"
170
+ class="ml-2 -mr-3 flex aspect-square h-full cursor-pointer touch-manipulation appearance-none items-center justify-center border-l text-foreground outline-none enabled:hover:bg-background-hover enabled:hover:text-gray-1000 enabled:active:bg-background-active disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 motion-safe:transition-colors"
175
171
  :disabled="increaseDisabled"
176
172
  @pointerdown="startIncrease"
177
173
  @pointercancel="stopIncrease"
@@ -8,19 +8,19 @@ interface Props {
8
8
  scientific?: boolean;
9
9
  modelValue?: number | null;
10
10
  }
11
- declare var __VLS_15: {}, __VLS_18: {};
11
+ declare var __VLS_16: {}, __VLS_19: {};
12
12
  type __VLS_Slots = {} & {
13
- prefix?: (props: typeof __VLS_15) => any;
13
+ prefix?: (props: typeof __VLS_16) => any;
14
14
  } & {
15
- suffix?: (props: typeof __VLS_18) => any;
15
+ suffix?: (props: typeof __VLS_19) => any;
16
16
  };
17
17
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
18
  "update:modelValue": (args_0: number) => any;
19
19
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
20
20
  "onUpdate:modelValue"?: ((args_0: number) => any) | undefined;
21
21
  }>, {
22
- disabled: boolean;
23
22
  max: number;
23
+ disabled: boolean;
24
24
  precision: number;
25
25
  min: number;
26
26
  readonly: boolean;
@@ -8,9 +8,9 @@ interface Props {
8
8
  closeOnClickOverlay?: boolean;
9
9
  shownElement?: string | HTMLElement;
10
10
  }
11
- declare var __VLS_11: {};
11
+ declare var __VLS_14: {};
12
12
  type __VLS_Slots = {} & {
13
- default?: (props: typeof __VLS_11) => any;
13
+ default?: (props: typeof __VLS_14) => any;
14
14
  };
15
15
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
16
  click: (args_0: MouseEvent) => any;
@@ -6,17 +6,19 @@ import {
6
6
  shallowRef,
7
7
  watch
8
8
  } from "vue";
9
+ import { useLockScroll } from "../../composables";
9
10
  import {
10
11
  getScrollContainer,
11
12
  getScrollElByContainer,
12
13
  hasScrollbar,
13
14
  isScrollable
14
15
  } from "../../utils/dom";
15
- import { optimizedOff, optimizedOn, preventDefaultScroll } from "../../utils/event";
16
+ import { optimizedOff, optimizedOn } from "../../utils/event";
16
17
  import { isTruthyProp } from "../../utils/format";
17
18
  import { isServer } from "../../utils/is";
18
19
  import { unrefElement } from "../../utils/ref";
19
20
  import PTeleport from "../teleport/index.vue";
21
+ import { isTopOverlay, pushOverlay, removeOverlay } from "./overlay-stack";
20
22
  defineOptions({
21
23
  name: "POverlay",
22
24
  inheritAttrs: false,
@@ -36,6 +38,12 @@ const props = defineProps({
36
38
  shownElement: { type: null, required: false }
37
39
  });
38
40
  const emits = defineEmits(["click", "escape", "update:modelValue"]);
41
+ const {
42
+ isLocked,
43
+ lockScroll,
44
+ unlockScroll
45
+ } = useLockScroll();
46
+ const overlayId = Symbol("pxd-overlay");
39
47
  let scrollContainer;
40
48
  const clipPath = shallowRef("");
41
49
  const overlayRef = shallowRef();
@@ -51,6 +59,9 @@ function onOverlayKeydown(ev) {
51
59
  if (!props.modelValue || !isTruthyProp(props.closeOnPressEscape)) {
52
60
  return;
53
61
  }
62
+ if (!isTopOverlay(overlayId)) {
63
+ return;
64
+ }
54
65
  if (ev.ctrlKey || ev.metaKey || ev.altKey || ev.shiftKey) {
55
66
  return;
56
67
  }
@@ -64,34 +75,30 @@ function lockScrollContainer() {
64
75
  if (!scrollContainer) {
65
76
  return;
66
77
  }
67
- scrollContainer.lockedCounts++;
68
- if (scrollContainer.lockedCounts > 1) {
69
- return;
70
- }
71
- const { x: xScrollbar, y: yScrollbar } = hasScrollbar(scrollContainer);
72
- const { x: xScrollable, y: yScrollable } = isScrollable(scrollContainer);
73
- if (xScrollbar && xScrollable) {
74
- scrollContainer.classList.add("scrollbar-stable", "scroll-disabled-x");
75
- }
76
- if (yScrollbar && yScrollable) {
77
- scrollContainer.classList.add("scrollbar-stable", "scroll-disabled-y");
78
+ if (!isLocked(scrollContainer)) {
79
+ const { x: xScrollbar, y: yScrollbar } = hasScrollbar(scrollContainer);
80
+ const { x: xScrollable, y: yScrollable } = isScrollable(scrollContainer);
81
+ if (xScrollbar && xScrollable) {
82
+ scrollContainer.classList.add("scrollbar-stable", "scroll-disabled-x");
83
+ }
84
+ if (yScrollbar && yScrollable) {
85
+ scrollContainer.classList.add("scrollbar-stable", "scroll-disabled-y");
86
+ }
78
87
  }
79
- optimizedOn(document, "touchmove", preventDefaultScroll, { passive: false });
88
+ lockScroll(scrollContainer);
80
89
  }
81
- async function unlockScrollContainer() {
90
+ function unlockScrollContainer() {
82
91
  if (!scrollContainer) {
83
92
  return;
84
93
  }
85
- scrollContainer.lockedCounts = Math.max(scrollContainer.lockedCounts - 1, 0);
86
- if (scrollContainer.lockedCounts) {
87
- return;
94
+ unlockScroll(scrollContainer);
95
+ if (!isLocked(scrollContainer)) {
96
+ scrollContainer.classList.remove(
97
+ "scrollbar-stable",
98
+ "scroll-disabled-x",
99
+ "scroll-disabled-y"
100
+ );
88
101
  }
89
- scrollContainer.classList.remove(
90
- "scrollbar-stable",
91
- "scroll-disabled-x",
92
- "scroll-disabled-y"
93
- );
94
- optimizedOff(document, "touchmove", preventDefaultScroll);
95
102
  }
96
103
  function tryGetShownElementIfNeed() {
97
104
  const { shownElement } = props;
@@ -121,18 +128,17 @@ function onOverlayVisibleChange(visible) {
121
128
  return;
122
129
  }
123
130
  if (!visible) {
131
+ removeOverlay(overlayId);
124
132
  unlockScrollContainer();
125
133
  optimizedOff(document, "keydown", onOverlayKeydown);
126
134
  return;
127
135
  }
136
+ pushOverlay(overlayId);
128
137
  nextTick(() => {
129
138
  if (!scrollContainer) {
130
139
  scrollContainer = getScrollElByContainer(
131
140
  getScrollContainer(overlayRef.value)
132
141
  );
133
- if (!scrollContainer.lockedCounts) {
134
- scrollContainer.lockedCounts = 0;
135
- }
136
142
  }
137
143
  lockScrollContainer();
138
144
  tryGetShownElementIfNeed();
@@ -150,6 +156,7 @@ watch(
150
156
  );
151
157
  onBeforeUnmount(() => {
152
158
  optimizedOff(document, "keydown", onOverlayKeydown);
159
+ removeOverlay(overlayId);
153
160
  unlockScrollContainer();
154
161
  scrollContainer = null;
155
162
  });
@@ -8,9 +8,9 @@ interface Props {
8
8
  closeOnClickOverlay?: boolean;
9
9
  shownElement?: string | HTMLElement;
10
10
  }
11
- declare var __VLS_11: {};
11
+ declare var __VLS_14: {};
12
12
  type __VLS_Slots = {} & {
13
- default?: (props: typeof __VLS_11) => any;
13
+ default?: (props: typeof __VLS_14) => any;
14
14
  };
15
15
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
16
  click: (args_0: MouseEvent) => any;
@@ -0,0 +1,3 @@
1
+ export declare function pushOverlay(id: symbol): void;
2
+ export declare function removeOverlay(id: symbol): void;
3
+ export declare function isTopOverlay(id: symbol): boolean;
@@ -0,0 +1,17 @@
1
+ const overlayStack = [];
2
+ export function pushOverlay(id) {
3
+ const idx = overlayStack.indexOf(id);
4
+ if (idx !== -1) {
5
+ overlayStack.splice(idx, 1);
6
+ }
7
+ overlayStack.push(id);
8
+ }
9
+ export function removeOverlay(id) {
10
+ const idx = overlayStack.indexOf(id);
11
+ if (idx !== -1) {
12
+ overlayStack.splice(idx, 1);
13
+ }
14
+ }
15
+ export function isTopOverlay(id) {
16
+ return overlayStack[overlayStack.length - 1] === id;
17
+ }
@@ -6,9 +6,9 @@ interface Props {
6
6
  prev?: Page;
7
7
  next?: Page;
8
8
  }
9
- declare var __VLS_11: {};
9
+ declare var __VLS_12: {};
10
10
  type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_11) => any;
11
+ default?: (props: typeof __VLS_12) => any;
12
12
  };
13
13
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -13,7 +13,7 @@ const config = useConfigProvider();
13
13
 
14
14
  <template>
15
15
  <nav aria-label="pagination" class="pxd-pagination relative flex w-full flex-wrap items-start justify-between">
16
- <RouterLink v-if="prev" :to="prev.href" class="pxd-pagination--prev min-h-13 group py-1 pr-2 pl-6 rounded-md !no-underline self-focus-ring outline-none">
16
+ <RouterLink v-if="prev" :to="prev.href" class="pxd-pagination--prev min-h-13 group py-1 pr-2 pl-6 rounded-md no-underline! self-focus-ring outline-none">
17
17
  <span secondary class="text-13px text-foreground-secondary group-hover:text-foreground motion-safe:transition-colors">
18
18
  {{ config.locale.compare.prev }}
19
19
  </span>
@@ -28,7 +28,7 @@ const config = useConfigProvider();
28
28
  <slot />
29
29
  </div>
30
30
 
31
- <RouterLink v-if="next" :to="next.href" class="pxd-pagination--next min-h-13 group py-1 pl-2 pr-6 rounded-md !no-underline self-focus-ring outline-none">
31
+ <RouterLink v-if="next" :to="next.href" class="pxd-pagination--next min-h-13 group py-1 pl-2 pr-6 rounded-md no-underline! self-focus-ring outline-none">
32
32
  <span secondary class="text-13px text-foreground-secondary group-hover:text-foreground motion-safe:transition-colors">
33
33
  {{ config.locale.compare.next }}
34
34
  </span>
@@ -6,9 +6,9 @@ interface Props {
6
6
  prev?: Page;
7
7
  next?: Page;
8
8
  }
9
- declare var __VLS_11: {};
9
+ declare var __VLS_12: {};
10
10
  type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_11) => any;
11
+ default?: (props: typeof __VLS_12) => any;
12
12
  };
13
13
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,10 +1,9 @@
1
1
  import type { HTMLAttributes } from 'vue';
2
- import type { ComponentLabel, ComponentSizeWithXs } from '../../types/shared';
2
+ import type { ComponentSizeWithXs } from '../../types/shared';
3
3
  interface Props {
4
4
  size?: ComponentSizeWithXs;
5
- error?: string;
5
+ error?: boolean | string;
6
6
  length?: number;
7
- label?: ComponentLabel;
8
7
  readonly?: boolean;
9
8
  disabled?: boolean;
10
9
  required?: boolean;
@@ -13,11 +12,7 @@ interface Props {
13
12
  inputMode?: HTMLAttributes['inputmode'];
14
13
  type?: 'numeric' | 'alphabetic' | 'alphanumeric' | 'numeric-password' | 'alphabetic-password' | 'alphanumeric-password';
15
14
  }
16
- declare var __VLS_1: {};
17
- type __VLS_Slots = {} & {
18
- label?: (props: typeof __VLS_1) => any;
19
- };
20
- declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
16
  "update:modelValue": (args_0: string) => any;
22
17
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
23
18
  "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
@@ -27,11 +22,5 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
27
22
  placeholder: string;
28
23
  modelValue: string;
29
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
25
  declare const _default: typeof __VLS_export;
32
26
  export default _default;
33
- type __VLS_WithSlots<T, S> = T & {
34
- new (): {
35
- $slots: S;
36
- };
37
- };
@@ -3,7 +3,6 @@ import { computed, ref, shallowRef } from "vue";
3
3
  import { useConfigProvider } from "../../composables/use-config-provider-context";
4
4
  import { useModelValue } from "../../composables/use-model-value";
5
5
  import { getFallbackValue } from "../../utils/get";
6
- import PError from "../error/index.vue";
7
6
  defineOptions({
8
7
  name: "PPinInput",
9
8
  model: {
@@ -13,9 +12,8 @@ defineOptions({
13
12
  });
14
13
  const props = defineProps({
15
14
  size: { type: String, required: false },
16
- error: { type: String, required: false },
15
+ error: { type: [Boolean, String], required: false },
17
16
  length: { type: Number, required: false, default: 4 },
18
- label: { type: [String, Number, Array, null], required: false },
19
17
  readonly: { type: Boolean, required: false },
20
18
  disabled: { type: Boolean, required: false },
21
19
  required: { type: Boolean, required: false },
@@ -189,43 +187,33 @@ function onInputPastedValue(ev) {
189
187
  </script>
190
188
 
191
189
  <template>
192
- <label class="pxd-pin-input flex w-max flex-col">
193
- <div v-if="label || $slots.label" class="pxd-form--label">
194
- <slot name="label">{{ label }}</slot>
190
+ <label
191
+ class="pxd-pin-input gap-1.5 flex size-max items-center"
192
+ @keydown="onContainerKeydown"
193
+ @compositionend="onCompositionEnd"
194
+ @click="onContainerClick"
195
+ >
196
+ <div v-for="(n, i) of length" :key="n" :class="computedClass">
197
+ <input
198
+ ref="inputsRef"
199
+ :value="modelValueLocal[i]"
200
+ :aria-label="`pin code ${n} of ${length}`"
201
+ :type="computedInputType"
202
+ :data-index="i"
203
+ class="aspect-square size-full appearance-none rounded-inherit border-none bg-transparent text-center font-inherit outline-none placeholder:text-gray-600 placeholder:select-none focus:placeholder:opacity-0 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 disabled:placeholder:text-gray-400 motion-safe:transition-all"
204
+ minlength="1"
205
+ maxlength="1"
206
+ autocorrect="off"
207
+ autocomplete="off"
208
+ autocapitalize="off"
209
+ :readonly="readonly"
210
+ :disabled="disabled"
211
+ :required="required"
212
+ :placeholder="placeholder"
213
+ :inputmode="computedInputMode"
214
+ @paste="onInputPastedValue"
215
+ @beforeinput="onBeforeInputValue"
216
+ >
195
217
  </div>
196
-
197
- <div
198
- class="gap-1.5 flex w-max items-center"
199
- @keydown="onContainerKeydown"
200
- @compositionend="onCompositionEnd"
201
- @click="onContainerClick"
202
- >
203
- <div v-for="(n, i) of length" :key="n" :class="computedClass">
204
- <input
205
- ref="inputsRef"
206
- :value="modelValueLocal[i]"
207
- :aria-label="`pin code ${n} of ${length}`"
208
- :type="computedInputType"
209
- :data-index="i"
210
- class="aspect-square size-full appearance-none rounded-inherit border-none bg-transparent text-center font-inherit outline-none placeholder:text-gray-600 placeholder:select-none focus:placeholder:opacity-0 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-700 disabled:placeholder:text-gray-400 motion-safe:transition-all"
211
- minlength="1"
212
- maxlength="1"
213
- autocorrect="off"
214
- autocomplete="off"
215
- autocapitalize="off"
216
- :readonly="readonly"
217
- :disabled="disabled"
218
- :required="required"
219
- :placeholder="placeholder"
220
- :inputmode="computedInputMode"
221
- @paste="onInputPastedValue"
222
- @beforeinput="onBeforeInputValue"
223
- >
224
- </div>
225
- </div>
226
-
227
- <PError v-if="error" class="mt-2" :size="size">
228
- {{ error }}
229
- </PError>
230
218
  </label>
231
219
  </template>
@@ -1,10 +1,9 @@
1
1
  import type { HTMLAttributes } from 'vue';
2
- import type { ComponentLabel, ComponentSizeWithXs } from '../../types/shared';
2
+ import type { ComponentSizeWithXs } from '../../types/shared';
3
3
  interface Props {
4
4
  size?: ComponentSizeWithXs;
5
- error?: string;
5
+ error?: boolean | string;
6
6
  length?: number;
7
- label?: ComponentLabel;
8
7
  readonly?: boolean;
9
8
  disabled?: boolean;
10
9
  required?: boolean;
@@ -13,11 +12,7 @@ interface Props {
13
12
  inputMode?: HTMLAttributes['inputmode'];
14
13
  type?: 'numeric' | 'alphabetic' | 'alphanumeric' | 'numeric-password' | 'alphabetic-password' | 'alphanumeric-password';
15
14
  }
16
- declare var __VLS_1: {};
17
- type __VLS_Slots = {} & {
18
- label?: (props: typeof __VLS_1) => any;
19
- };
20
- declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
16
  "update:modelValue": (args_0: string) => any;
22
17
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
23
18
  "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
@@ -27,11 +22,5 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
27
22
  placeholder: string;
28
23
  modelValue: string;
29
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
25
  declare const _default: typeof __VLS_export;
32
26
  export default _default;
33
- type __VLS_WithSlots<T, S> = T & {
34
- new (): {
35
- $slots: S;
36
- };
37
- };
@@ -1,10 +1,18 @@
1
1
  interface Props {
2
+ gap?: number | string;
2
3
  color?: string;
3
- width?: string;
4
- height?: string;
5
- border?: boolean;
6
4
  invert?: boolean;
7
5
  }
8
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -6,45 +6,39 @@ defineOptions({
6
6
  inheritAttrs: false
7
7
  });
8
8
  const props = defineProps({
9
+ gap: { type: [Number, String], required: false },
9
10
  color: { type: String, required: false },
10
- width: { type: String, required: false },
11
- height: { type: String, required: false },
12
- border: { type: Boolean, required: false },
13
11
  invert: { type: Boolean, required: false }
14
12
  });
15
13
  const computedStyle = computed(() => {
16
14
  return {
17
- color: props.color,
18
- width: getCssUnitValue(props.width),
19
- height: getCssUnitValue(props.height)
15
+ "--placeholder-color": props.color,
16
+ "--placeholder-gap": getCssUnitValue(props.gap)
20
17
  };
21
18
  });
22
19
  </script>
23
20
 
24
21
  <template>
25
22
  <div
26
- class="pxd-placeholder relative max-w-full overflow-hidden rounded-lg"
27
- :class="{ 'border': border, 'is-invert': invert }"
23
+ class="pxd-placeholder max-w-full min-w-full"
24
+ :class="{ 'is-invert': invert }"
28
25
  :style="computedStyle"
29
26
  v-bind="$attrs"
30
- />
27
+ >
28
+ <slot />
29
+ </div>
31
30
  </template>
32
31
 
33
32
  <style lang="postcss">
34
33
  .pxd-placeholder {
35
- --deg: -45deg;
36
-
37
34
  &.is-invert {
38
- --deg: 45deg;
35
+ --placeholder-deg: 45deg;
39
36
  }
40
37
 
41
- width: 100%;
42
- height: 36px;
43
- color: var(--color-gray-400);
44
- background-image: repeating-linear-gradient(var(--deg),currentColor 0 1px,#0000 0 50%);
45
- background-size: 10px 10px;
46
- background-repeat: repeat;
47
- background-position: 0 0;
48
- background-origin: padding-box;
38
+ --placeholder-deg: -45deg;
39
+ background:
40
+ linear-gradient(var(--placeholder-deg),var(--placeholder-color) 12.5%,#0000 12.5%,#0000 50%,var(--placeholder-color) 50%,var(--placeholder-color) 62.5%,#0000 62.5%,#0000 100%)
41
+ 0 0 / var(--placeholder-gap, 12px) var(--placeholder-gap, 12px)
42
+ padding-box fixed;
49
43
  }
50
44
  </style>
@@ -1,10 +1,18 @@
1
1
  interface Props {
2
+ gap?: number | string;
2
3
  color?: string;
3
- width?: string;
4
- height?: string;
5
- border?: boolean;
6
4
  invert?: boolean;
7
5
  }
8
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -2,12 +2,12 @@ import type { CSSProperties } from 'vue';
2
2
  import type { PopoverTrigger } from '../../types/components/popover';
3
3
  import type { ComponentClass, ComponentPosition } from '../../types/shared';
4
4
  interface Props {
5
- zIndex?: number;
5
+ zIndex?: number | string;
6
6
  offset?: number;
7
7
  visible?: boolean;
8
8
  trigger?: PopoverTrigger | PopoverTrigger[];
9
9
  disabled?: boolean;
10
- maxWidth?: number;
10
+ maxWidth?: number | string;
11
11
  position?: ComponentPosition;
12
12
  showDelay?: number;
13
13
  hideDelay?: number;
@@ -15,26 +15,20 @@ interface Props {
15
15
  showArrow?: boolean;
16
16
  arrowColor?: string;
17
17
  autoPosition?: boolean;
18
- closeOnScroll?: boolean;
19
18
  wrapperClass?: ComponentClass;
20
19
  contentClass?: ComponentClass;
21
20
  contentStyle?: CSSProperties | string;
22
- showTransition?: boolean;
23
- hideTransition?: boolean;
24
21
  transitionType?: 'fade' | 'fade-scale';
22
+ closeOnInvisible?: boolean;
25
23
  closeOnPressEscape?: boolean;
26
- /** 自动调整位置的阈值, 当滚动距离超过该值时, 自动调整位置, 单位: px */
27
- autoPositionThreshold?: number;
28
- /** 滚动隐藏的阈值, 当滚动距离超过该值时, 自动隐藏弹窗, 单位: px */
29
- closeOnScrollThreshold?: number;
30
24
  }
31
- declare function handlePopoverShow(immediate?: boolean): Promise<void>;
25
+ declare function handlePopoverShow(): Promise<void>;
32
26
  declare function handlePopoverHide(immediate?: boolean): Promise<void>;
33
- declare var __VLS_1: {}, __VLS_7: {};
27
+ declare var __VLS_1: {}, __VLS_9: {};
34
28
  type __VLS_Slots = {} & {
35
29
  default?: (props: typeof __VLS_1) => any;
36
30
  } & {
37
- content?: (props: typeof __VLS_7) => any;
31
+ content?: (props: typeof __VLS_9) => any;
38
32
  };
39
33
  declare const __VLS_base: import("vue").DefineComponent<Props, {
40
34
  show: typeof handlePopoverShow;
@@ -54,19 +48,15 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {
54
48
  "onOutside-click"?: ((args_0: MouseEvent) => any) | undefined;
55
49
  "onTrigger-click"?: ((args_0: PointerEvent) => any) | undefined;
56
50
  }>, {
57
- zIndex: number;
51
+ position: ComponentPosition;
58
52
  offset: number;
59
53
  trigger: PopoverTrigger | PopoverTrigger[];
60
- position: ComponentPosition;
61
54
  showDelay: number;
62
55
  hideDelay: number;
63
56
  arrowColor: string;
64
57
  autoPosition: boolean;
65
- showTransition: boolean;
66
- hideTransition: boolean;
67
58
  transitionType: "fade" | "fade-scale";
68
- autoPositionThreshold: number;
69
- closeOnScrollThreshold: number;
59
+ closeOnInvisible: boolean;
70
60
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
71
61
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
72
62
  declare const _default: typeof __VLS_export;