pxd 0.0.49 → 0.0.50
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/README.md +2 -2
- package/dist/components/_internal/fragment-container.d.vue.ts +13 -0
- package/dist/components/_internal/fragment-container.vue +11 -0
- package/dist/components/_internal/fragment-container.vue.d.ts +13 -0
- package/dist/components/avatar/index.vue +2 -2
- package/dist/components/book/index.vue +3 -3
- package/dist/components/button/index.vue +1 -1
- package/dist/components/carousel-group/index.d.vue.ts +2 -2
- package/dist/components/carousel-group/index.vue +7 -7
- package/dist/components/carousel-group/index.vue.d.ts +2 -2
- package/dist/components/checkbox/index.d.vue.ts +2 -0
- package/dist/components/checkbox/index.vue +1 -1
- package/dist/components/checkbox/index.vue.d.ts +2 -0
- package/dist/components/checkbox-group/index.d.vue.ts +2 -2
- package/dist/components/checkbox-group/index.vue.d.ts +2 -2
- package/dist/components/chip/index.vue +2 -2
- package/dist/components/choicebox/index.vue +1 -1
- package/dist/components/choicebox-group/index.d.vue.ts +4 -4
- package/dist/components/choicebox-group/index.vue +18 -26
- package/dist/components/choicebox-group/index.vue.d.ts +4 -4
- package/dist/components/collapse/index.vue +1 -1
- package/dist/components/collapse-group/index.vue +3 -3
- package/dist/components/command-menu/index.d.vue.ts +2 -0
- package/dist/components/command-menu/index.vue +1 -1
- package/dist/components/command-menu/index.vue.d.ts +2 -0
- package/dist/components/config-provider/index.vue +1 -1
- package/dist/components/countdown/index.d.vue.ts +2 -2
- package/dist/components/countdown/index.vue.d.ts +2 -2
- package/dist/components/drawer/index.d.vue.ts +2 -0
- package/dist/components/drawer/index.vue +4 -4
- package/dist/components/drawer/index.vue.d.ts +2 -0
- package/dist/components/hold-button/index.vue +4 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/input/index.d.vue.ts +4 -4
- package/dist/components/input/index.vue +37 -18
- package/dist/components/input/index.vue.d.ts +4 -4
- package/dist/components/intersection-observer/index.vue +6 -6
- package/dist/components/label/index.d.vue.ts +13 -0
- package/dist/components/label/index.vue +12 -0
- package/dist/components/label/index.vue.d.ts +13 -0
- package/dist/components/menu/index.vue +8 -2
- package/dist/components/message/index.d.vue.ts +56 -37
- package/dist/components/message/index.vue +34 -27
- package/dist/components/message/index.vue.d.ts +56 -37
- package/dist/components/message-item/index.d.vue.ts +5 -10
- package/dist/components/message-item/index.vue +21 -20
- package/dist/components/message-item/index.vue.d.ts +5 -10
- package/dist/components/modal/index.d.vue.ts +2 -0
- package/dist/components/modal/index.vue +4 -4
- package/dist/components/modal/index.vue.d.ts +2 -0
- package/dist/components/more-button/index.d.vue.ts +2 -0
- package/dist/components/more-button/index.vue +1 -1
- package/dist/components/more-button/index.vue.d.ts +2 -0
- package/dist/components/number-input/index.d.vue.ts +3 -1
- package/dist/components/number-input/index.vue +4 -3
- package/dist/components/number-input/index.vue.d.ts +3 -1
- package/dist/components/overlay/index.vue +23 -61
- package/dist/components/pin-input/index.d.vue.ts +2 -0
- package/dist/components/pin-input/index.vue +1 -1
- package/dist/components/pin-input/index.vue.d.ts +2 -0
- package/dist/components/popover/index.d.vue.ts +8 -3
- package/dist/components/popover/index.vue +68 -56
- package/dist/components/popover/index.vue.d.ts +8 -3
- package/dist/components/progress/index.d.vue.ts +3 -1
- package/dist/components/progress/index.vue +1 -1
- package/dist/components/progress/index.vue.d.ts +3 -1
- package/dist/components/radio/index.d.vue.ts +2 -0
- package/dist/components/radio/index.vue +1 -1
- package/dist/components/radio/index.vue.d.ts +2 -0
- package/dist/components/radio-group/index.d.vue.ts +2 -2
- package/dist/components/radio-group/index.vue.d.ts +2 -2
- package/dist/components/slider/index.d.vue.ts +3 -1
- package/dist/components/slider/index.vue +1 -1
- package/dist/components/slider/index.vue.d.ts +3 -1
- package/dist/components/switch/index.vue +7 -1
- package/dist/components/switch-group/index.d.vue.ts +2 -0
- package/dist/components/switch-group/index.vue +1 -1
- package/dist/components/switch-group/index.vue.d.ts +2 -0
- package/dist/components/textarea/index.d.vue.ts +2 -2
- package/dist/components/textarea/index.vue +2 -2
- package/dist/components/textarea/index.vue.d.ts +2 -2
- package/dist/components/theme-switcher/index.vue +1 -3
- package/dist/components/time-picker/index.d.vue.ts +5 -3
- package/dist/components/time-picker/index.vue +34 -22
- package/dist/components/time-picker/index.vue.d.ts +5 -3
- package/dist/components/toggle/index.d.vue.ts +2 -2
- package/dist/components/toggle/index.vue +5 -5
- package/dist/components/toggle/index.vue.d.ts +2 -2
- package/dist/components/tooltip/index.vue +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +2 -0
- package/dist/composables/use-document-hidden.d.ts +2 -1
- package/dist/composables/use-document-hidden.js +2 -1
- package/dist/composables/use-lock-scroll.d.ts +3 -3
- package/dist/composables/use-lock-scroll.js +10 -20
- package/dist/composables/use-media-query.d.ts +1 -0
- package/dist/composables/use-media-query.js +41 -29
- package/dist/composables/use-message.d.ts +10 -6
- package/dist/composables/use-message.js +0 -1
- package/dist/composables/use-model-value.d.ts +5 -3
- package/dist/composables/use-model-value.js +4 -1
- package/dist/composables/use-popover-responsive.d.ts +12 -0
- package/dist/composables/use-popover-responsive.js +24 -0
- package/dist/composables/use-toggle-value.d.ts +9 -0
- package/dist/composables/use-toggle-value.js +15 -0
- package/dist/locales/en-us.d.ts +2 -0
- package/dist/locales/en-us.js +3 -1
- package/dist/locales/zh-cn.d.ts +2 -0
- package/dist/locales/zh-cn.js +3 -1
- package/dist/styles/source.css +43 -37
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +43 -37
- package/dist/types/components/input.d.ts +4 -1
- package/dist/utils/date.js +25 -24
- package/dist/utils/event.d.ts +1 -0
- package/dist/utils/event.js +2 -0
- package/package.json +9 -9
- package/volar.d.ts +1 -0
- package/dist/components/_internal/fragment-container.d.ts +0 -2
- package/dist/components/_internal/fragment-container.js +0 -15
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# PXD
|
|
2
|
-
|
|
2
|
+
A universal UI component library for Vue@2.7+ & Vue@3.2+
|
|
3
3
|
|
|
4
4
|
- [Geist Design System](https://vercel.com/geist/introduction)
|
|
5
5
|
- [Figma(Community)](https://www.figma.com/design/1234567890/PXD-UI?node-id=0-1&t=1234567890-0)
|
|
@@ -12,7 +12,7 @@ Realizing (slightly adjusting) the general component library of Vue2&3 based on
|
|
|
12
12
|
## Features
|
|
13
13
|
|
|
14
14
|
- Vue 3 Composition API
|
|
15
|
-
- 100% compatible with Vue2&
|
|
15
|
+
- 100% compatible with Vue2.7+ & Vue3.2+
|
|
16
16
|
- Complete tree-shaking support
|
|
17
17
|
|
|
18
18
|
## Contribution
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -39,8 +39,8 @@ defineExpose({
|
|
|
39
39
|
|
|
40
40
|
<template>
|
|
41
41
|
<div
|
|
42
|
-
class="pxd-avatar relative inline-flex size-(--
|
|
43
|
-
:style="{ '--
|
|
42
|
+
class="pxd-avatar relative inline-flex size-(--avatar-size) items-center justify-center rounded-full border border-background-100 select-none"
|
|
43
|
+
:style="{ '--avatar-size': computedSize }"
|
|
44
44
|
>
|
|
45
45
|
<slot>
|
|
46
46
|
<img
|
|
@@ -30,7 +30,7 @@ const computedStyle = computed(() => {
|
|
|
30
30
|
const { color } = props;
|
|
31
31
|
return {
|
|
32
32
|
...formattedWidth.value,
|
|
33
|
-
"--
|
|
33
|
+
"--book-background-color": color
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
const computedClass = computed(() => {
|
|
@@ -49,7 +49,7 @@ const computedClass = computed(() => {
|
|
|
49
49
|
<div
|
|
50
50
|
v-if="variant === 'stripe'"
|
|
51
51
|
class="translate-z-0 relative flex w-full flex-1 shrink-0 overflow-hidden"
|
|
52
|
-
style="background-color: var(--
|
|
52
|
+
style="background-color: var(--book-background-color, var(--color-amber-600))"
|
|
53
53
|
>
|
|
54
54
|
<div class="absolute flex w-full flex-col object-cover">
|
|
55
55
|
<slot name="icon" />
|
|
@@ -138,7 +138,7 @@ const computedClass = computed(() => {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.pxd-book--cover-simple {
|
|
141
|
-
background-color: var(--
|
|
141
|
+
background-color: var(--book-background-color, var(--color-gray-200));
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.pxd-book--textured {
|
|
@@ -13,14 +13,14 @@ declare const __VLS_base: import("vue").DefineComponent<CarouselGroupProps, {},
|
|
|
13
13
|
}, string, import("vue").PublicProps, Readonly<CarouselGroupProps> & Readonly<{
|
|
14
14
|
onChange?: ((index: number) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
index: number;
|
|
17
16
|
height: number | string;
|
|
17
|
+
index: number;
|
|
18
|
+
direction: import("../../types/shared").ComponentDirection;
|
|
18
19
|
loop: boolean;
|
|
19
20
|
arrow: boolean;
|
|
20
21
|
autoplay: boolean;
|
|
21
22
|
interval: number;
|
|
22
23
|
indicator: boolean;
|
|
23
|
-
direction: import("../../types/shared").ComponentDirection;
|
|
24
24
|
indicatorType: "dot" | "line";
|
|
25
25
|
indicatorPosition: import("../../types/shared").BasePosition;
|
|
26
26
|
pauseOnHover: boolean;
|
|
@@ -239,7 +239,7 @@ onBeforeUnmount(() => {
|
|
|
239
239
|
v-for="(_, i) in carousels.length"
|
|
240
240
|
:key="i"
|
|
241
241
|
:data-index="i"
|
|
242
|
-
class="pxd-carousel-group--indicator-item relative h-(--
|
|
242
|
+
class="pxd-carousel-group--indicator-item relative h-(--carousel-dot-height) w-(--carousel-dot-width) cursor-pointer appearance-none rounded-full bg-gray-alpha-200 self-focus-ring outline-none hover:bg-gray-alpha-400 motion-safe:transition-colors"
|
|
243
243
|
:class="{ 'bg-primary!': i === correctIndex }"
|
|
244
244
|
/>
|
|
245
245
|
</slot>
|
|
@@ -270,21 +270,21 @@ onBeforeUnmount(() => {
|
|
|
270
270
|
<style lang="postcss">
|
|
271
271
|
.pxd-carousel-group {
|
|
272
272
|
&[data-indicator-type="dot"] {
|
|
273
|
-
--
|
|
274
|
-
--
|
|
273
|
+
--carousel-dot-width: 8px;
|
|
274
|
+
--carousel-dot-height: 8px;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
&[data-indicator-type="line"] {
|
|
278
278
|
&[data-indicator-position="top"],
|
|
279
279
|
&[data-indicator-position="bottom"] {
|
|
280
|
-
--
|
|
281
|
-
--
|
|
280
|
+
--carousel-dot-width: 16px;
|
|
281
|
+
--carousel-dot-height: 4px;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
&[data-indicator-position="left"],
|
|
285
285
|
&[data-indicator-position="right"] {
|
|
286
|
-
--
|
|
287
|
-
--
|
|
286
|
+
--carousel-dot-width: 4px;
|
|
287
|
+
--carousel-dot-height: 16px;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -13,14 +13,14 @@ declare const __VLS_base: import("vue").DefineComponent<CarouselGroupProps, {},
|
|
|
13
13
|
}, string, import("vue").PublicProps, Readonly<CarouselGroupProps> & Readonly<{
|
|
14
14
|
onChange?: ((index: number) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
index: number;
|
|
17
16
|
height: number | string;
|
|
17
|
+
index: number;
|
|
18
|
+
direction: import("../../types/shared").ComponentDirection;
|
|
18
19
|
loop: boolean;
|
|
19
20
|
arrow: boolean;
|
|
20
21
|
autoplay: boolean;
|
|
21
22
|
interval: number;
|
|
22
23
|
indicator: boolean;
|
|
23
|
-
direction: import("../../types/shared").ComponentDirection;
|
|
24
24
|
indicatorType: "dot" | "line";
|
|
25
25
|
indicatorPosition: import("../../types/shared").BasePosition;
|
|
26
26
|
pauseOnHover: boolean;
|
|
@@ -7,8 +7,10 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<CheckboxProps, {
|
|
8
8
|
getCheckedState: typeof getCheckedState;
|
|
9
9
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
change: (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
10
11
|
"update:modelValue": (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
11
12
|
}, string, import("vue").PublicProps, Readonly<CheckboxProps> & Readonly<{
|
|
13
|
+
onChange?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
12
14
|
"onUpdate:modelValue"?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
13
15
|
}>, {
|
|
14
16
|
value: import("../../types/shared").ComponentValue;
|
|
@@ -20,7 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
modelValue: { type: [String, Number, Boolean, Array], required: false, default: () => [] },
|
|
21
21
|
indeterminate: { type: Boolean, required: false }
|
|
22
22
|
});
|
|
23
|
-
const emits = defineEmits(["update:modelValue"]);
|
|
23
|
+
const emits = defineEmits(["change", "update:modelValue"]);
|
|
24
24
|
const uniqueId = getUniqueId();
|
|
25
25
|
const modelValue = useModelValue(props, emits);
|
|
26
26
|
const checkboxGroupContext = useCheckboxGroupContext();
|
|
@@ -7,8 +7,10 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<CheckboxProps, {
|
|
8
8
|
getCheckedState: typeof getCheckedState;
|
|
9
9
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
change: (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
10
11
|
"update:modelValue": (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
11
12
|
}, string, import("vue").PublicProps, Readonly<CheckboxProps> & Readonly<{
|
|
13
|
+
onChange?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
12
14
|
"onUpdate:modelValue"?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
13
15
|
}>, {
|
|
14
16
|
value: import("../../types/shared").ComponentValue;
|
|
@@ -9,11 +9,11 @@ declare const __VLS_base: import("vue").DefineComponent<CheckboxGroupProps, {
|
|
|
9
9
|
isCheckedAll: typeof isCheckedAll;
|
|
10
10
|
isCheckedPartial: typeof isCheckedPartial;
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
"update:modelValue": (args_0: import("../../types/shared").ComponentValue[]) => any;
|
|
13
12
|
change: (args_0: import("../../types/shared").ComponentValue[]) => any;
|
|
13
|
+
"update:modelValue": (args_0: import("../../types/shared").ComponentValue[]) => any;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<CheckboxGroupProps> & Readonly<{
|
|
15
|
-
"onUpdate:modelValue"?: ((args_0: import("../../types/shared").ComponentValue[]) => any) | undefined;
|
|
16
15
|
onChange?: ((args_0: import("../../types/shared").ComponentValue[]) => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((args_0: import("../../types/shared").ComponentValue[]) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
options: import("../../types/shared").ComponentOption[];
|
|
19
19
|
modelValue: import("../../types/shared").ComponentValue[];
|
|
@@ -9,11 +9,11 @@ declare const __VLS_base: import("vue").DefineComponent<CheckboxGroupProps, {
|
|
|
9
9
|
isCheckedAll: typeof isCheckedAll;
|
|
10
10
|
isCheckedPartial: typeof isCheckedPartial;
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
"update:modelValue": (args_0: import("../../types/shared").ComponentValue[]) => any;
|
|
13
12
|
change: (args_0: import("../../types/shared").ComponentValue[]) => any;
|
|
13
|
+
"update:modelValue": (args_0: import("../../types/shared").ComponentValue[]) => any;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<CheckboxGroupProps> & Readonly<{
|
|
15
|
-
"onUpdate:modelValue"?: ((args_0: import("../../types/shared").ComponentValue[]) => any) | undefined;
|
|
16
15
|
onChange?: ((args_0: import("../../types/shared").ComponentValue[]) => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((args_0: import("../../types/shared").ComponentValue[]) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
options: import("../../types/shared").ComponentOption[];
|
|
19
19
|
modelValue: import("../../types/shared").ComponentValue[];
|
|
@@ -19,7 +19,7 @@ const computedClass = computed(() => {
|
|
|
19
19
|
const classes = ["pxd-chip--label text-xs top-0 right-0 absolute rounded-full border border-background-100 motion-safe:transition-all"];
|
|
20
20
|
const { variant, inset, label } = props;
|
|
21
21
|
if (!label) {
|
|
22
|
-
classes.push("size-(--
|
|
22
|
+
classes.push("size-(--chip-size)");
|
|
23
23
|
}
|
|
24
24
|
if (!inset) {
|
|
25
25
|
classes.push("translate-x-1/2 -translate-y-1/3");
|
|
@@ -33,7 +33,7 @@ const computedClass = computed(() => {
|
|
|
33
33
|
<div class="pxd-chip relative inline-flex shrink-0">
|
|
34
34
|
<slot />
|
|
35
35
|
|
|
36
|
-
<span :data-label="label" :class="computedClass" :style="{ '--
|
|
36
|
+
<span :data-label="label" :class="computedClass" :style="{ '--chip-size': getCssUnitValue(size) }" />
|
|
37
37
|
</div>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
@@ -22,7 +22,7 @@ const computedAttrs = computed(() => {
|
|
|
22
22
|
value,
|
|
23
23
|
disabled,
|
|
24
24
|
required,
|
|
25
|
-
class: "pxd-choicebox justify-between border rounded-md flex-1 p-3 flex-row-reverse hover:bg-background-hover hover:border-gray-500 motion-safe:transition-colors"
|
|
25
|
+
class: "pxd-choicebox justify-between border rounded-md flex-1 w-full p-3 flex-row-reverse hover:bg-background-hover hover:border-gray-500 motion-safe:transition-colors"
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
</script>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ChoiceboxGroupProps } from '../../types/components/choicebox';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_8: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
|
|
5
|
-
} & {
|
|
6
|
-
default?: (props: typeof __VLS_9) => any;
|
|
4
|
+
default?: (props: typeof __VLS_8) => any;
|
|
7
5
|
};
|
|
8
6
|
declare const __VLS_base: import("vue").DefineComponent<ChoiceboxGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
change: (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
9
8
|
"update:modelValue": (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
10
9
|
}, string, import("vue").PublicProps, Readonly<ChoiceboxGroupProps> & Readonly<{
|
|
10
|
+
onChange?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
11
11
|
"onUpdate:modelValue"?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
13
|
disabled: boolean;
|
|
@@ -3,6 +3,7 @@ import { computed, markRaw, useAttrs } from "vue";
|
|
|
3
3
|
import { useModelValue } from "../../composables/use-model-value";
|
|
4
4
|
import { provideChoiceboxGroupContext, provideChoiceboxGroupModelValue } from "../../contexts/choicebox";
|
|
5
5
|
import PCheckboxGroup from "../checkbox-group/index.vue";
|
|
6
|
+
import PChoicebox from "../choicebox/index.vue";
|
|
6
7
|
import PRadioGroup from "../radio-group/index.vue";
|
|
7
8
|
defineOptions({
|
|
8
9
|
name: "PChoiceboxGroup",
|
|
@@ -20,23 +21,21 @@ const props = defineProps({
|
|
|
20
21
|
options: { type: Array, required: false },
|
|
21
22
|
modelValue: { type: [String, Number, Boolean, Array], required: false, default: "" }
|
|
22
23
|
});
|
|
23
|
-
const emits = defineEmits(["update:modelValue"]);
|
|
24
|
+
const emits = defineEmits(["change", "update:modelValue"]);
|
|
24
25
|
const attrs = useAttrs();
|
|
25
26
|
const modelValue = useModelValue(props, emits);
|
|
26
27
|
const renderComponent = computed(() => markRaw(props.multiple ? PCheckboxGroup : PRadioGroup));
|
|
27
28
|
const computedAttrs = computed(() => {
|
|
28
|
-
const { disabled,
|
|
29
|
+
const { disabled, multiple, required, options } = props;
|
|
29
30
|
const { class: classes, ...rest } = attrs;
|
|
30
31
|
return {
|
|
31
32
|
"role": multiple ? "group" : "radiogroup",
|
|
32
|
-
"aria-label": label,
|
|
33
33
|
"aria-required": required,
|
|
34
34
|
"aria-multiselectable": multiple,
|
|
35
35
|
"gap": attrs.gap || "3",
|
|
36
36
|
disabled,
|
|
37
37
|
required,
|
|
38
38
|
options,
|
|
39
|
-
label,
|
|
40
39
|
...rest
|
|
41
40
|
};
|
|
42
41
|
});
|
|
@@ -45,26 +44,19 @@ provideChoiceboxGroupModelValue(modelValue);
|
|
|
45
44
|
</script>
|
|
46
45
|
|
|
47
46
|
<template>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
:key="option.value"
|
|
64
|
-
v-model="modelValue"
|
|
65
|
-
v-bind="option"
|
|
66
|
-
/>
|
|
67
|
-
</slot>
|
|
68
|
-
</Component>
|
|
69
|
-
</div>
|
|
47
|
+
<Component
|
|
48
|
+
:is="renderComponent"
|
|
49
|
+
v-model="modelValue"
|
|
50
|
+
class="pxd-choicebox-group w-full"
|
|
51
|
+
v-bind="computedAttrs"
|
|
52
|
+
>
|
|
53
|
+
<slot>
|
|
54
|
+
<PChoicebox
|
|
55
|
+
v-for="option in options"
|
|
56
|
+
:key="option.value"
|
|
57
|
+
v-model="modelValue"
|
|
58
|
+
v-bind="option"
|
|
59
|
+
/>
|
|
60
|
+
</slot>
|
|
61
|
+
</Component>
|
|
70
62
|
</template>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ChoiceboxGroupProps } from '../../types/components/choicebox';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_8: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
|
|
5
|
-
} & {
|
|
6
|
-
default?: (props: typeof __VLS_9) => any;
|
|
4
|
+
default?: (props: typeof __VLS_8) => any;
|
|
7
5
|
};
|
|
8
6
|
declare const __VLS_base: import("vue").DefineComponent<ChoiceboxGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
change: (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
9
8
|
"update:modelValue": (args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any;
|
|
10
9
|
}, string, import("vue").PublicProps, Readonly<ChoiceboxGroupProps> & Readonly<{
|
|
10
|
+
onChange?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
11
11
|
"onUpdate:modelValue"?: ((args_0: NonNullable<import("../../types/shared").ComponentValue | import("../../types/shared").ComponentValue[] | undefined>) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
13
|
disabled: boolean;
|
|
@@ -95,5 +95,5 @@ onMounted(() => {
|
|
|
95
95
|
</template>
|
|
96
96
|
|
|
97
97
|
<style>
|
|
98
|
-
.pxd-collapse--trigger{font-size:var(--
|
|
98
|
+
.pxd-collapse--trigger{font-size:var(--collapse-font-size,24px);font-weight:var(--collapse-font-weight,600);padding-block:var(--collapse-padding,24px)}.pxd-transition--collapse-enter-active,.pxd-transition--collapse-leave-active{transition:height var(--default-transition-duration) var(--default-transition-timing-function)}
|
|
99
99
|
</style>
|
|
@@ -32,9 +32,9 @@ const expandedItems = ref([]);
|
|
|
32
32
|
const computedStyle = computed(() => {
|
|
33
33
|
const { padding, fontSize, fontWeight } = getFallbackValue(props.size, SIZES, config.size);
|
|
34
34
|
return {
|
|
35
|
-
"--
|
|
36
|
-
"--
|
|
37
|
-
"--
|
|
35
|
+
"--collapse-padding": padding,
|
|
36
|
+
"--collapse-font-size": fontSize,
|
|
37
|
+
"--collapse-font-weight": fontWeight
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
40
|
function toggleItem(id, expanded) {
|
|
@@ -15,11 +15,13 @@ type __VLS_Slots = {} & {
|
|
|
15
15
|
};
|
|
16
16
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
17
|
select: (args_0: MouseEvent, args_1: ListOptionSelected) => any;
|
|
18
|
+
change: (args_0: boolean) => any;
|
|
18
19
|
"update:modelValue": (args_0: boolean) => any;
|
|
19
20
|
show: () => any;
|
|
20
21
|
hide: () => any;
|
|
21
22
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
22
23
|
onSelect?: ((args_0: MouseEvent, args_1: ListOptionSelected) => any) | undefined;
|
|
24
|
+
onChange?: ((args_0: boolean) => any) | undefined;
|
|
23
25
|
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
24
26
|
onShow?: (() => any) | undefined;
|
|
25
27
|
onHide?: (() => any) | undefined;
|
|
@@ -25,7 +25,7 @@ const props = defineProps({
|
|
|
25
25
|
closeOnPressEscape: { type: Boolean, required: false, default: true },
|
|
26
26
|
closeOnClickOverlay: { type: Boolean, required: false, default: true }
|
|
27
27
|
});
|
|
28
|
-
const emits = defineEmits(["update:modelValue", "select", "show", "hide"]);
|
|
28
|
+
const emits = defineEmits(["update:modelValue", "select", "change", "show", "hide"]);
|
|
29
29
|
const uniqueId = getUniqueId();
|
|
30
30
|
const config = useConfigProvider();
|
|
31
31
|
const modelValue = useModelValue(props, emits);
|
|
@@ -15,11 +15,13 @@ type __VLS_Slots = {} & {
|
|
|
15
15
|
};
|
|
16
16
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
17
|
select: (args_0: MouseEvent, args_1: ListOptionSelected) => any;
|
|
18
|
+
change: (args_0: boolean) => any;
|
|
18
19
|
"update:modelValue": (args_0: boolean) => any;
|
|
19
20
|
show: () => any;
|
|
20
21
|
hide: () => any;
|
|
21
22
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
22
23
|
onSelect?: ((args_0: MouseEvent, args_1: ListOptionSelected) => any) | undefined;
|
|
24
|
+
onChange?: ((args_0: boolean) => any) | undefined;
|
|
23
25
|
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
24
26
|
onShow?: (() => any) | undefined;
|
|
25
27
|
onHide?: (() => any) | undefined;
|
|
@@ -25,12 +25,12 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
|
25
25
|
ms: any;
|
|
26
26
|
}>;
|
|
27
27
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
-
reset: () => any;
|
|
29
28
|
change: (active: boolean) => any;
|
|
29
|
+
reset: () => any;
|
|
30
30
|
finish: () => any;
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
32
|
-
onReset?: (() => any) | undefined;
|
|
33
32
|
onChange?: ((active: boolean) => any) | undefined;
|
|
33
|
+
onReset?: (() => any) | undefined;
|
|
34
34
|
onFinish?: (() => any) | undefined;
|
|
35
35
|
}>, {
|
|
36
36
|
format: string;
|
|
@@ -25,12 +25,12 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
|
25
25
|
ms: any;
|
|
26
26
|
}>;
|
|
27
27
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
-
reset: () => any;
|
|
29
28
|
change: (active: boolean) => any;
|
|
29
|
+
reset: () => any;
|
|
30
30
|
finish: () => any;
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
32
|
-
onReset?: (() => any) | undefined;
|
|
33
32
|
onChange?: ((active: boolean) => any) | undefined;
|
|
33
|
+
onReset?: (() => any) | undefined;
|
|
34
34
|
onFinish?: (() => any) | undefined;
|
|
35
35
|
}>, {
|
|
36
36
|
format: string;
|
|
@@ -28,12 +28,14 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
footer?: (props: typeof __VLS_25) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
change: (args_0: boolean) => any;
|
|
31
32
|
"update:modelValue": (args_0: boolean) => any;
|
|
32
33
|
show: () => any;
|
|
33
34
|
hide: () => any;
|
|
34
35
|
"visible-change": (args_0: boolean) => any;
|
|
35
36
|
"outside-click": (args_0: MouseEvent) => any;
|
|
36
37
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
38
|
+
onChange?: ((args_0: boolean) => any) | undefined;
|
|
37
39
|
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
38
40
|
onShow?: (() => any) | undefined;
|
|
39
41
|
onHide?: (() => any) | undefined;
|
|
@@ -28,7 +28,7 @@ const props = defineProps({
|
|
|
28
28
|
closeOnClickOverlay: { type: Boolean, required: false, default: true },
|
|
29
29
|
initialFocus: { type: [String, Boolean], required: false }
|
|
30
30
|
});
|
|
31
|
-
const emits = defineEmits(["show", "hide", "outside-click", "visible-change", "update:modelValue"]);
|
|
31
|
+
const emits = defineEmits(["show", "hide", "change", "outside-click", "visible-change", "update:modelValue"]);
|
|
32
32
|
const drawerRef = shallowRef();
|
|
33
33
|
const isVisible = useModelValue(props, emits);
|
|
34
34
|
useFocusTrap(drawerRef, {
|
|
@@ -47,7 +47,7 @@ const transitionName = computed(() => `pxd-transition--drawer-${ensurePosition.v
|
|
|
47
47
|
const computedStyle = computed(() => {
|
|
48
48
|
const styles = {};
|
|
49
49
|
if (props.size) {
|
|
50
|
-
styles["--
|
|
50
|
+
styles["--drawer-size"] = getCssUnitValue(props.size);
|
|
51
51
|
}
|
|
52
52
|
return styles;
|
|
53
53
|
});
|
|
@@ -89,7 +89,7 @@ watch(() => isVisible.value, (visible) => {
|
|
|
89
89
|
aria-modal="true"
|
|
90
90
|
role="dialog"
|
|
91
91
|
tabindex="-1"
|
|
92
|
-
class="pxd-drawer group/drawer translate-z-0 sm:[--
|
|
92
|
+
class="pxd-drawer group/drawer translate-z-0 sm:[--drawer-width:30vw] sm:[--drawer-height:30vw] pointer-events-auto fixed z-10 flex max-h-full max-w-full flex-col bg-background-100 shadow-border-modal outline-none"
|
|
93
93
|
:class="wrapperClass"
|
|
94
94
|
:style="computedStyle"
|
|
95
95
|
:data-position="ensurePosition"
|
|
@@ -133,5 +133,5 @@ watch(() => isVisible.value, (visible) => {
|
|
|
133
133
|
</template>
|
|
134
134
|
|
|
135
135
|
<style>
|
|
136
|
-
.pxd-drawer[data-position=left]{bottom:0;left:0;top:0}.pxd-drawer[data-position=top]{left:0;right:0;top:0}.pxd-drawer[data-position=right]{bottom:0;right:0;top:0}.pxd-drawer[data-position=bottom]{bottom:0;left:0;right:0}.pxd-drawer[data-position=left],.pxd-drawer[data-position=right]{width:var(--
|
|
136
|
+
.pxd-drawer[data-position=left]{bottom:0;left:0;top:0}.pxd-drawer[data-position=top]{left:0;right:0;top:0}.pxd-drawer[data-position=right]{bottom:0;right:0;top:0}.pxd-drawer[data-position=bottom]{bottom:0;left:0;right:0}.pxd-drawer[data-position=left],.pxd-drawer[data-position=right]{width:var(--drawer-size,var(--drawer-width,80vw))}.pxd-drawer[data-position=bottom],.pxd-drawer[data-position=top]{height:var(--drawer-size,var(--drawer-height,80vw))}.pxd-transition--drawer-bottom-enter-active,.pxd-transition--drawer-bottom-leave-active,.pxd-transition--drawer-left-enter-active,.pxd-transition--drawer-left-leave-active,.pxd-transition--drawer-right-enter-active,.pxd-transition--drawer-right-leave-active,.pxd-transition--drawer-top-enter-active,.pxd-transition--drawer-top-leave-active{transition:transform var(--default-transition-duration,.3s) var(--default-transition-timing-function)}.pxd-transition--drawer-right-enter-from,.pxd-transition--drawer-right-leave-to{transform:translateX(100%)}.pxd-transition--drawer-left-enter-from,.pxd-transition--drawer-left-leave-to{transform:translateX(-100%)}.pxd-transition--drawer-top-enter-from,.pxd-transition--drawer-top-leave-to{transform:translateY(-100%)}.pxd-transition--drawer-bottom-enter-from,.pxd-transition--drawer-bottom-leave-to{transform:translateY(100%)}
|
|
137
137
|
</style>
|
|
@@ -28,12 +28,14 @@ type __VLS_Slots = {} & {
|
|
|
28
28
|
footer?: (props: typeof __VLS_25) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
change: (args_0: boolean) => any;
|
|
31
32
|
"update:modelValue": (args_0: boolean) => any;
|
|
32
33
|
show: () => any;
|
|
33
34
|
hide: () => any;
|
|
34
35
|
"visible-change": (args_0: boolean) => any;
|
|
35
36
|
"outside-click": (args_0: MouseEvent) => any;
|
|
36
37
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
38
|
+
onChange?: ((args_0: boolean) => any) | undefined;
|
|
37
39
|
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
38
40
|
onShow?: (() => any) | undefined;
|
|
39
41
|
onHide?: (() => any) | undefined;
|
|
@@ -41,8 +41,8 @@ const computedStyle = computed(() => {
|
|
|
41
41
|
_durations = 2e3;
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
|
-
"--
|
|
45
|
-
"--
|
|
44
|
+
"--hold-button-durations": `${_durations}ms`,
|
|
45
|
+
"--hold-button-mask-color": maskColor
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
48
|
function onTriggerVibrate() {
|
|
@@ -136,7 +136,7 @@ onBeforeUnmount(() => {
|
|
|
136
136
|
<template #suffix>
|
|
137
137
|
<slot name="suffix" />
|
|
138
138
|
<div
|
|
139
|
-
class="pxd-hold-button--overlay pointer-events-none absolute -inset-px rounded-inherit bg-(--
|
|
139
|
+
class="pxd-hold-button--overlay pointer-events-none absolute -inset-px rounded-inherit bg-(--hold-button-mask-color)"
|
|
140
140
|
:class="{ finished: status === 'confirmed' }"
|
|
141
141
|
:style="computedStyle"
|
|
142
142
|
@transitionend="onTransitionEnd"
|
|
@@ -170,7 +170,7 @@ onBeforeUnmount(() => {
|
|
|
170
170
|
|
|
171
171
|
&.effective:not(.is-disabled):active .pxd-hold-button--overlay {
|
|
172
172
|
clip-path: inset(0px);
|
|
173
|
-
transition: clip-path var(--
|
|
173
|
+
transition: clip-path var(--hold-button-durations) var(--default-transition-timing-function), opacity var(--default-transition-duration) var(--default-transition-timing-function);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
</style>
|
|
@@ -33,6 +33,7 @@ export { default as HoldButton } from './hold-button/index.vue';
|
|
|
33
33
|
export { default as Input } from './input/index.vue';
|
|
34
34
|
export { default as IntersectionObserver } from './intersection-observer/index.vue';
|
|
35
35
|
export { default as Kbd } from './kbd/index.vue';
|
|
36
|
+
export { default as Label } from './label/index.vue';
|
|
36
37
|
export { default as LinkButton } from './link-button/index.vue';
|
|
37
38
|
export { default as List } from './list/index.vue';
|
|
38
39
|
export { default as ListItem } from './list-item/index.vue';
|
package/dist/components/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export { default as HoldButton } from "./hold-button/index.vue";
|
|
|
33
33
|
export { default as Input } from "./input/index.vue";
|
|
34
34
|
export { default as IntersectionObserver } from "./intersection-observer/index.vue";
|
|
35
35
|
export { default as Kbd } from "./kbd/index.vue";
|
|
36
|
+
export { default as Label } from "./label/index.vue";
|
|
36
37
|
export { default as LinkButton } from "./link-button/index.vue";
|
|
37
38
|
export { default as List } from "./list/index.vue";
|
|
38
39
|
export { default as ListItem } from "./list-item/index.vue";
|