@weni/unnnic-system 3.32.0 → 3.32.1
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/index.d.ts +3561 -7757
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +11448 -11797
- package/dist/unnnic.umd.js +32 -32
- package/package.json +1 -1
- package/src/components/AvatarIcon/AvatarIcon.vue +35 -49
- package/src/components/Breadcrumb/Breadcrumb.vue +20 -14
- package/src/components/Checkbox/Checkbox.vue +44 -57
- package/src/components/DatePicker/DatePicker.vue +53 -35
- package/src/components/DatePicker/{translations.js → translations.ts} +17 -5
- package/src/components/Input/BaseInput.vue +67 -75
- package/src/components/Input/Input.vue +84 -132
- package/src/components/Input/TextInput.vue +119 -136
- package/src/components/Input/__test__/TextInput.spec.js +10 -14
- package/src/components/Pagination/Pagination.vue +124 -141
- package/src/components/Radio/Radio.vue +36 -31
- package/src/components/Select/SelectItem.vue +24 -24
- package/src/components/SkeletonLoading/SkeletonLoading.vue +87 -88
- package/src/components/SkeletonLoading/skeletonTheme.vue +49 -44
|
@@ -10,57 +10,62 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script>
|
|
14
|
-
import { ref, provide } from 'vue';
|
|
15
|
-
|
|
13
|
+
<script lang="ts">
|
|
16
14
|
export const DEFAULT_BACKGROUND = 'var(--unnnic-color-bg-muted)';
|
|
17
15
|
export const DEFAULT_HIGHLIGHT = 'var(--unnnic-color-bg-base-soft)';
|
|
18
|
-
|
|
16
|
+
|
|
17
|
+
export type SkeletonStyleVars = {
|
|
18
|
+
'--skeleton-bg': string;
|
|
19
|
+
'--skeleton-highlight': string;
|
|
20
|
+
'--skeleton-duration': string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const SkeletonStyle: SkeletonStyleVars = {
|
|
19
24
|
'--skeleton-bg': DEFAULT_BACKGROUND,
|
|
20
25
|
'--skeleton-highlight': DEFAULT_HIGHLIGHT,
|
|
21
26
|
'--skeleton-duration': '2s',
|
|
22
27
|
};
|
|
23
|
-
|
|
28
|
+
|
|
29
|
+
export interface SkeletonThemeProps {
|
|
30
|
+
color?: string;
|
|
31
|
+
highlight?: string;
|
|
32
|
+
duration?: number;
|
|
33
|
+
tag?: string;
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { ref, provide, onMounted } from 'vue';
|
|
40
|
+
|
|
41
|
+
defineOptions({
|
|
24
42
|
name: 'UnnnicSkeletonTheme',
|
|
25
|
-
|
|
26
|
-
color: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: DEFAULT_BACKGROUND,
|
|
29
|
-
},
|
|
30
|
-
highlight: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: DEFAULT_HIGHLIGHT,
|
|
33
|
-
},
|
|
34
|
-
duration: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 2,
|
|
37
|
-
},
|
|
38
|
-
tag: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: 'div',
|
|
41
|
-
},
|
|
42
|
-
loading: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: undefined,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
setup() {
|
|
48
|
-
const themeStyle = ref({ ...SkeletonStyle });
|
|
49
|
-
const theme = ref({});
|
|
43
|
+
});
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const props = withDefaults(defineProps<SkeletonThemeProps>(), {
|
|
46
|
+
color: DEFAULT_BACKGROUND,
|
|
47
|
+
highlight: DEFAULT_HIGHLIGHT,
|
|
48
|
+
duration: 2,
|
|
49
|
+
tag: 'div',
|
|
50
|
+
loading: undefined,
|
|
51
|
+
});
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
const themeStyle = ref<SkeletonStyleVars>({ ...SkeletonStyle });
|
|
54
|
+
const theme = ref<Record<string, unknown>>({});
|
|
55
|
+
|
|
56
|
+
provide('_themeStyle', themeStyle);
|
|
57
|
+
provide('_skeletonTheme', theme);
|
|
58
|
+
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
themeStyle.value['--skeleton-bg'] = props.color;
|
|
61
|
+
themeStyle.value['--skeleton-highlight'] = props.highlight;
|
|
62
|
+
themeStyle.value['--skeleton-duration'] = props.duration
|
|
63
|
+
? `${props.duration}s`
|
|
64
|
+
: '0s';
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
defineExpose({
|
|
68
|
+
themeStyle,
|
|
69
|
+
theme,
|
|
70
|
+
});
|
|
66
71
|
</script>
|