sprintify-ui 0.10.64 → 0.10.66
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/dist/sprintify-ui.es.js +1626 -1625
- package/dist/types/components/BaseModalSide.vue.d.ts +22 -0
- package/dist/types/components/BaseSwitch.vue.d.ts +7 -6
- package/package.json +1 -1
- package/src/components/BaseDataTableTemplate.vue +14 -21
- package/src/components/BaseModalSide.stories.js +6 -0
- package/src/components/BaseModalSide.vue +16 -2
- package/src/components/BaseSwitch.vue +17 -15
|
@@ -6,6 +6,8 @@ declare const modal: {
|
|
|
6
6
|
refuseAnimation: () => void;
|
|
7
7
|
animationClasses: import("vue").Ref<string, string>;
|
|
8
8
|
};
|
|
9
|
+
declare const classAlign: import("vue").ComputedRef<"mr-0 ml-auto" | "mr-auto ml-0">;
|
|
10
|
+
declare const classButtonAlign: import("vue").ComputedRef<"|| sm:-left-[3rem] sm:top-2" | "|| sm:-right-[3rem] sm:top-2">;
|
|
9
11
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
10
12
|
declare var __VLS_21: {
|
|
11
13
|
close: () => void;
|
|
@@ -34,10 +36,16 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
34
36
|
default: string;
|
|
35
37
|
type: PropType<string | string[]>;
|
|
36
38
|
};
|
|
39
|
+
align: {
|
|
40
|
+
default: string;
|
|
41
|
+
type: PropType<"right" | "left">;
|
|
42
|
+
};
|
|
37
43
|
}>, {
|
|
38
44
|
twMerge: typeof twMerge;
|
|
39
45
|
realMaxWidth: typeof realMaxWidth;
|
|
40
46
|
modal: typeof modal;
|
|
47
|
+
classAlign: typeof classAlign;
|
|
48
|
+
classButtonAlign: typeof classButtonAlign;
|
|
41
49
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
50
|
"update:modelValue": (...args: any[]) => void;
|
|
43
51
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -61,10 +69,15 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
61
69
|
default: string;
|
|
62
70
|
type: PropType<string | string[]>;
|
|
63
71
|
};
|
|
72
|
+
align: {
|
|
73
|
+
default: string;
|
|
74
|
+
type: PropType<"right" | "left">;
|
|
75
|
+
};
|
|
64
76
|
}>> & Readonly<{
|
|
65
77
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
66
78
|
}>, {
|
|
67
79
|
modelValue: boolean;
|
|
80
|
+
align: "left" | "right";
|
|
68
81
|
closeOnOutsideClick: boolean;
|
|
69
82
|
clipped: boolean;
|
|
70
83
|
maxWidth: string;
|
|
@@ -91,6 +104,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
91
104
|
default: string;
|
|
92
105
|
type: PropType<string | string[]>;
|
|
93
106
|
};
|
|
107
|
+
align: {
|
|
108
|
+
default: string;
|
|
109
|
+
type: PropType<"right" | "left">;
|
|
110
|
+
};
|
|
94
111
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
95
112
|
"update:modelValue": (...args: any[]) => void;
|
|
96
113
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -114,10 +131,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
114
131
|
default: string;
|
|
115
132
|
type: PropType<string | string[]>;
|
|
116
133
|
};
|
|
134
|
+
align: {
|
|
135
|
+
default: string;
|
|
136
|
+
type: PropType<"right" | "left">;
|
|
137
|
+
};
|
|
117
138
|
}>> & Readonly<{
|
|
118
139
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
119
140
|
}>, {
|
|
120
141
|
modelValue: boolean;
|
|
142
|
+
align: "left" | "right";
|
|
121
143
|
closeOnOutsideClick: boolean;
|
|
122
144
|
clipped: boolean;
|
|
123
145
|
maxWidth: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Size } from '@/utils/sizes';
|
|
1
2
|
import { Switch, SwitchGroup, SwitchLabel } from '@headlessui/vue';
|
|
2
3
|
import { PropType } from 'vue';
|
|
3
4
|
declare const normalizedModelValue: import("vue").ComputedRef<boolean>;
|
|
@@ -29,7 +30,7 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
29
30
|
};
|
|
30
31
|
size: {
|
|
31
32
|
default: string;
|
|
32
|
-
type: PropType<
|
|
33
|
+
type: PropType<Size | undefined>;
|
|
33
34
|
};
|
|
34
35
|
hasError: {
|
|
35
36
|
default: boolean;
|
|
@@ -81,7 +82,7 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
81
82
|
};
|
|
82
83
|
size: {
|
|
83
84
|
default: string;
|
|
84
|
-
type: PropType<
|
|
85
|
+
type: PropType<Size | undefined>;
|
|
85
86
|
};
|
|
86
87
|
hasError: {
|
|
87
88
|
default: boolean;
|
|
@@ -106,7 +107,7 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
106
107
|
}>> & Readonly<{
|
|
107
108
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
108
109
|
}>, {
|
|
109
|
-
size: "xs" | "sm" | "lg" | "xl" |
|
|
110
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
110
111
|
required: boolean;
|
|
111
112
|
color: "dark" | "light" | "danger" | "success" | "warning" | "primary" | "info";
|
|
112
113
|
disabled: boolean;
|
|
@@ -131,7 +132,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
131
132
|
};
|
|
132
133
|
size: {
|
|
133
134
|
default: string;
|
|
134
|
-
type: PropType<
|
|
135
|
+
type: PropType<Size | undefined>;
|
|
135
136
|
};
|
|
136
137
|
hasError: {
|
|
137
138
|
default: boolean;
|
|
@@ -170,7 +171,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
170
171
|
};
|
|
171
172
|
size: {
|
|
172
173
|
default: string;
|
|
173
|
-
type: PropType<
|
|
174
|
+
type: PropType<Size | undefined>;
|
|
174
175
|
};
|
|
175
176
|
hasError: {
|
|
176
177
|
default: boolean;
|
|
@@ -195,7 +196,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
195
196
|
}>> & Readonly<{
|
|
196
197
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
197
198
|
}>, {
|
|
198
|
-
size: "xs" | "sm" | "lg" | "xl" |
|
|
199
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
199
200
|
required: boolean;
|
|
200
201
|
color: "dark" | "light" | "danger" | "success" | "warning" | "primary" | "info";
|
|
201
202
|
disabled: boolean;
|
package/package.json
CHANGED
|
@@ -33,11 +33,6 @@
|
|
|
33
33
|
>
|
|
34
34
|
<div class="flex gap-4">
|
|
35
35
|
<template v-if="index == 0">
|
|
36
|
-
<div
|
|
37
|
-
v-if="showDetailRowIcon"
|
|
38
|
-
class="flex h-5 w-5 shrink-0 grow-0"
|
|
39
|
-
/>
|
|
40
|
-
|
|
41
36
|
<div
|
|
42
37
|
v-if="checkable"
|
|
43
38
|
class="flex items-center cursor-pointer"
|
|
@@ -133,22 +128,6 @@
|
|
|
133
128
|
>
|
|
134
129
|
<div :class="[columnIndex == 0 ? 'flex items-center gap-4' : '']">
|
|
135
130
|
<template v-if="columnIndex == 0">
|
|
136
|
-
<button
|
|
137
|
-
v-if="showDetailRowIcon"
|
|
138
|
-
type="button"
|
|
139
|
-
class="relative z-[1] || flex h-5 w-5 shrink-0 grow-0 appearance-none items-center justify-center rounded-full border border-slate-300 bg-white text-slate-400 shadow duration-100 hover:text-slate-600 hover:shadow-md"
|
|
140
|
-
@click.stop="toggleDetails(row)"
|
|
141
|
-
>
|
|
142
|
-
<BaseIcon
|
|
143
|
-
v-if="hasDetailedVisible(row)"
|
|
144
|
-
icon="mdi:chevron-down"
|
|
145
|
-
class="h-5 w-5 duration-300"
|
|
146
|
-
:class="{
|
|
147
|
-
'rotate-180': isVisibleDetailRow(row)
|
|
148
|
-
}"
|
|
149
|
-
/>
|
|
150
|
-
</button>
|
|
151
|
-
|
|
152
131
|
<div
|
|
153
132
|
v-if="checkable"
|
|
154
133
|
class="relative z-[1] || flex items-center group cursor-pointer bg-white"
|
|
@@ -162,6 +141,20 @@
|
|
|
162
141
|
:class="checkboxStyle"
|
|
163
142
|
>
|
|
164
143
|
</div>
|
|
144
|
+
<button
|
|
145
|
+
v-if="showDetailRowIcon && hasDetailedVisible(row)"
|
|
146
|
+
type="button"
|
|
147
|
+
class="relative z-[1] || flex h-5 w-5 shrink-0 grow-0 appearance-none items-center justify-center rounded-full border border-slate-300 bg-white text-slate-400 shadow duration-100 hover:text-slate-600 hover:shadow-md"
|
|
148
|
+
@click.stop="toggleDetails(row)"
|
|
149
|
+
>
|
|
150
|
+
<BaseIcon
|
|
151
|
+
icon="mdi:chevron-down"
|
|
152
|
+
class="h-5 w-5 duration-300"
|
|
153
|
+
:class="{
|
|
154
|
+
'rotate-180': isVisibleDetailRow(row)
|
|
155
|
+
}"
|
|
156
|
+
/>
|
|
157
|
+
</button>
|
|
165
158
|
</template>
|
|
166
159
|
|
|
167
160
|
<SlotComponent
|
|
@@ -45,14 +45,16 @@
|
|
|
45
45
|
:style="{
|
|
46
46
|
maxWidth: realMaxWidth,
|
|
47
47
|
}"
|
|
48
|
-
class="pb-safe py-safe relative z-[1]
|
|
48
|
+
class="pb-safe py-safe relative z-[1] flex h-full w-full flex-col rounded-t-lg bg-white text-left shadow-2xl ring-1 ring-black ring-opacity-10 || sm:rounded-t-none"
|
|
49
49
|
:class="[
|
|
50
50
|
modal.animationClasses.value,
|
|
51
|
+
classAlign,
|
|
51
52
|
clipped ? 'overflow-hidden' : '',
|
|
52
53
|
]"
|
|
53
54
|
>
|
|
54
55
|
<button
|
|
55
|
-
class="absolute -top-[4.5rem] right-2 flex h-10 w-10 items-center justify-center rounded-full bg-white shadow hover:shadow-lg ring-1 ring-black ring-opacity-5 duration-300 transition-shadow
|
|
56
|
+
class="absolute -top-[4.5rem] right-2 flex h-10 w-10 items-center justify-center rounded-full bg-white shadow hover:shadow-lg ring-1 ring-black ring-opacity-5 duration-300 transition-shadow"
|
|
57
|
+
:class="classButtonAlign"
|
|
56
58
|
type="button"
|
|
57
59
|
@click="modal.close()"
|
|
58
60
|
>
|
|
@@ -99,6 +101,10 @@ const props = defineProps({
|
|
|
99
101
|
default: '',
|
|
100
102
|
type: [String, Array] as PropType<string | string[]>,
|
|
101
103
|
},
|
|
104
|
+
align: {
|
|
105
|
+
default: 'right',
|
|
106
|
+
type: String as PropType<'right' | 'left'>,
|
|
107
|
+
},
|
|
102
108
|
});
|
|
103
109
|
|
|
104
110
|
const emit = defineEmits(['update:modelValue']);
|
|
@@ -113,4 +119,12 @@ const modal = useModal(
|
|
|
113
119
|
computed(() => props.modelValue),
|
|
114
120
|
emit
|
|
115
121
|
);
|
|
122
|
+
|
|
123
|
+
const classAlign = computed(() => {
|
|
124
|
+
return props.align === 'right' ? 'mr-0 ml-auto' : 'mr-auto ml-0';
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const classButtonAlign = computed(() => {
|
|
128
|
+
return props.align === 'right' ? '|| sm:-left-[3rem] sm:top-2' : '|| sm:-right-[3rem] sm:top-2';
|
|
129
|
+
});
|
|
116
130
|
</script>
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<script lang="ts" setup>
|
|
47
47
|
import { useField } from '@/composables/field';
|
|
48
|
+
import { Size } from '@/utils/sizes';
|
|
48
49
|
import { Switch, SwitchGroup, SwitchLabel } from '@headlessui/vue';
|
|
49
50
|
import { isNumber, isString } from 'lodash';
|
|
50
51
|
import { PropType } from 'vue';
|
|
@@ -67,8 +68,8 @@ const props = defineProps({
|
|
|
67
68
|
>,
|
|
68
69
|
},
|
|
69
70
|
size: {
|
|
70
|
-
default: '
|
|
71
|
-
type: String as PropType<
|
|
71
|
+
default: 'md',
|
|
72
|
+
type: [String, undefined] as PropType<Size | undefined>,
|
|
72
73
|
},
|
|
73
74
|
hasError: {
|
|
74
75
|
default: false,
|
|
@@ -94,11 +95,12 @@ const props = defineProps({
|
|
|
94
95
|
|
|
95
96
|
const emit = defineEmits(['update:modelValue']);
|
|
96
97
|
|
|
97
|
-
const { emitUpdate } = useField({
|
|
98
|
+
const { emitUpdate, sizeInternal } = useField({
|
|
98
99
|
name: computed(() => props.name),
|
|
99
100
|
required: computed(() => props.required),
|
|
100
101
|
hasError: computed(() => props.hasError),
|
|
101
102
|
emit: emit,
|
|
103
|
+
size: computed(() => props.size ?? 'md'),
|
|
102
104
|
});
|
|
103
105
|
|
|
104
106
|
const normalizedModelValue = computed((): boolean => {
|
|
@@ -154,40 +156,40 @@ const focus = computed(() => {
|
|
|
154
156
|
return 'focus:ring-slate-900';
|
|
155
157
|
});
|
|
156
158
|
const sizePx = computed(() => {
|
|
157
|
-
if (
|
|
159
|
+
if (sizeInternal.value == 'xs') {
|
|
158
160
|
return 12;
|
|
159
161
|
}
|
|
160
|
-
if (
|
|
162
|
+
if (sizeInternal.value == 'sm') {
|
|
161
163
|
return 16;
|
|
162
164
|
}
|
|
163
|
-
if (
|
|
165
|
+
if (sizeInternal.value == 'md') {
|
|
164
166
|
return 20;
|
|
165
167
|
}
|
|
166
|
-
if (
|
|
168
|
+
if (sizeInternal.value == 'lg') {
|
|
167
169
|
return 24;
|
|
168
170
|
}
|
|
169
|
-
if (
|
|
171
|
+
if (sizeInternal.value == 'xl') {
|
|
170
172
|
return 32;
|
|
171
173
|
}
|
|
172
|
-
return
|
|
174
|
+
return 20;
|
|
173
175
|
});
|
|
174
176
|
const padding = computed(() => {
|
|
175
|
-
if (
|
|
177
|
+
if (sizeInternal.value == 'xs') {
|
|
176
178
|
return 2;
|
|
177
179
|
}
|
|
178
|
-
if (
|
|
180
|
+
if (sizeInternal.value == 'sm') {
|
|
179
181
|
return 2.5;
|
|
180
182
|
}
|
|
181
|
-
if (
|
|
183
|
+
if (sizeInternal.value == 'md') {
|
|
182
184
|
return 3;
|
|
183
185
|
}
|
|
184
|
-
if (
|
|
186
|
+
if (sizeInternal.value == 'lg') {
|
|
185
187
|
return 3;
|
|
186
188
|
}
|
|
187
|
-
if (
|
|
189
|
+
if (sizeInternal.value == 'xl') {
|
|
188
190
|
return 4;
|
|
189
191
|
}
|
|
190
|
-
return
|
|
192
|
+
return 3;
|
|
191
193
|
});
|
|
192
194
|
const height = computed(() => {
|
|
193
195
|
return sizePx.value + 2 * padding.value;
|