@milaboratories/uikit 2.2.9 → 2.2.11
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/CHANGELOG.md +12 -0
- package/dist/pl-uikit.js +2301 -2166
- package/dist/pl-uikit.umd.cjs +8 -8
- package/dist/src/components/PlAccordion/ExpandTransition.vue.d.ts +16 -0
- package/dist/src/components/PlAccordion/PlAccordion.vue.d.ts +30 -0
- package/dist/src/components/PlAccordion/PlAccordionSection.vue.d.ts +33 -0
- package/dist/src/components/PlAccordion/index.d.ts +2 -0
- package/dist/src/components/PlBtnGroup/PlBtnGroup.vue.d.ts +4 -0
- package/dist/src/components/PlSectionSeparator/PlSectionSeparator.vue.d.ts +26 -0
- package/dist/src/components/PlSectionSeparator/index.d.ts +1 -0
- package/dist/src/drafts/FileBaseInput.vue.d.ts +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/layout/PlBlockPage/PlBlockPage.vue.d.ts +5 -1
- package/dist/src/layout/PlRow/PlRow.vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/assets/animations.scss +21 -0
- package/src/assets/base.scss +2 -0
- package/src/assets/icons/icons-set.scss +2 -2
- package/src/components/PlAccordion/ExpandTransition.vue +37 -0
- package/src/components/PlAccordion/PlAccordion.vue +20 -0
- package/src/components/PlAccordion/PlAccordionSection.vue +89 -0
- package/src/components/PlAccordion/index.ts +2 -0
- package/src/components/PlBtnGroup/PlBtnGroup.vue +5 -1
- package/src/components/PlBtnGroup/pl-btn-group.scss +4 -0
- package/src/components/PlSectionSeparator/PlSectionSeparator.vue +57 -0
- package/src/components/PlSectionSeparator/index.ts +1 -0
- package/src/components/PlTextField/PlTextField.vue +1 -1
- package/src/components/PlTextField/pl-text-field.scss +10 -0
- package/src/index.ts +2 -0
- package/src/layout/PlBlockPage/PlBlockPage.vue +5 -1
- package/src/layout/PlBlockPage/pl-block-page.scss +7 -1
- package/src/layout/PlRow/PlRow.vue +1 -0
- package/src/layout/PlRow/pl-row.scss +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/pl-uikit.umd.js",
|
|
6
6
|
"module": "dist/pl-uikit.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"vue-tsc": "^2.1.6",
|
|
33
33
|
"yarpm": "^1.2.0",
|
|
34
34
|
"svgo": "^3.3.2",
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
35
|
+
"@platforma-sdk/model": "^1.10.12",
|
|
36
|
+
"@milaboratories/helpers": "^1.6.7"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"dev": "vite",
|
|
@@ -58,3 +58,24 @@
|
|
|
58
58
|
transform: translateX(200%);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
.expand-panel {
|
|
63
|
+
&-enter-active {
|
|
64
|
+
transition: all 3s ease-out;
|
|
65
|
+
transition-property: height, opacity, padding, margin;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-leave-active {
|
|
70
|
+
transition: all 3s ease-in-out;
|
|
71
|
+
transition-property: height, opacity, padding, margin;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-enter-from, &-leave-to {
|
|
76
|
+
height: 0;
|
|
77
|
+
margin: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
opacity: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
package/src/assets/base.scss
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
.mask-16 {
|
|
36
36
|
--mask-size: 16px;
|
|
37
|
-
background-color:
|
|
37
|
+
background-color: var(--mask-icon-bg-color);
|
|
38
38
|
|
|
39
39
|
@each $name, $path in $icons16 {
|
|
40
40
|
&.mask-#{$name} {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
.mask-24 {
|
|
47
47
|
--mask-size: 24px;
|
|
48
|
-
background-color:
|
|
48
|
+
background-color: var(--mask-icon-bg-color);
|
|
49
49
|
|
|
50
50
|
@each $name, $path in $icons24 {
|
|
51
51
|
&.mask-#{$name} {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
const onStart = (el: Element) => {
|
|
3
|
+
(el as HTMLElement).style.setProperty('--component-height', el.scrollHeight + 'px');
|
|
4
|
+
el.classList.add('expand-collapse-fix');
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const onAfter = (el: Element) => {
|
|
8
|
+
(el as HTMLElement).style.removeProperty('--component-height');
|
|
9
|
+
el.classList.remove('expand-collapse-fix');
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<Transition name="expand-collapse" @enter="onStart" @leave="onStart" @after-enter="onAfter" @after-leave="onAfter">
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</Transition>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.expand-collapse-fix {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.expand-collapse-enter-active,
|
|
25
|
+
.expand-collapse-leave-active {
|
|
26
|
+
transition:
|
|
27
|
+
height 0.2s ease-in-out,
|
|
28
|
+
opacity 0.2s ease-in-out;
|
|
29
|
+
height: var(--component-height);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.expand-collapse-enter-from,
|
|
33
|
+
.expand-collapse-leave-to {
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
height: 0;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { provide, toRef } from 'vue';
|
|
3
|
+
|
|
4
|
+
const model = defineModel<string>();
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
/**
|
|
8
|
+
* Allow multiple accordion sections to be opened at the same time
|
|
9
|
+
*/
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
}>();
|
|
12
|
+
|
|
13
|
+
provide('pl-accordion-model', model);
|
|
14
|
+
provide('pl-accordion-props', toRef(props));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<slot name="header" />
|
|
19
|
+
<slot />
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { uniqueId } from '@milaboratories/helpers';
|
|
3
|
+
import { PlMaskIcon16 } from '../PlMaskIcon16';
|
|
4
|
+
import { PlSectionSeparator } from '../PlSectionSeparator';
|
|
5
|
+
import ExpandTransition from './ExpandTransition.vue';
|
|
6
|
+
import type { Ref } from 'vue';
|
|
7
|
+
import { computed, inject } from 'vue';
|
|
8
|
+
|
|
9
|
+
const $m = inject<Ref<string>>('pl-accordion-model');
|
|
10
|
+
|
|
11
|
+
const $p = inject<
|
|
12
|
+
Ref<{
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
}>
|
|
15
|
+
>('pl-accordion-props');
|
|
16
|
+
|
|
17
|
+
const model = defineModel<boolean>();
|
|
18
|
+
|
|
19
|
+
const id = uniqueId();
|
|
20
|
+
|
|
21
|
+
const isMulti = computed(() => !$p || $p.value.multiple);
|
|
22
|
+
|
|
23
|
+
const open = computed({
|
|
24
|
+
get() {
|
|
25
|
+
if (isMulti.value) {
|
|
26
|
+
return model.value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return $m ? $m.value === id : model.value;
|
|
30
|
+
},
|
|
31
|
+
set(on) {
|
|
32
|
+
if (isMulti.value) {
|
|
33
|
+
model.value = on;
|
|
34
|
+
} else if ($m) {
|
|
35
|
+
$m.value = $m.value === id ? '' : id;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
defineProps<{
|
|
41
|
+
/**
|
|
42
|
+
* The label text (optional)
|
|
43
|
+
*/
|
|
44
|
+
label?: string;
|
|
45
|
+
/**
|
|
46
|
+
* If `true`, remove top padding
|
|
47
|
+
*/
|
|
48
|
+
compact?: boolean;
|
|
49
|
+
}>();
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<PlSectionSeparator :class="$style.separator" :compact="compact" @click="open = !open">
|
|
54
|
+
<PlMaskIcon16 name="chevron-right" :class="[{ [$style.down]: open }, $style.chevron]" />
|
|
55
|
+
{{ label }}
|
|
56
|
+
</PlSectionSeparator>
|
|
57
|
+
<ExpandTransition>
|
|
58
|
+
<div v-if="open" :class="$style.content">
|
|
59
|
+
<slot />
|
|
60
|
+
</div>
|
|
61
|
+
</ExpandTransition>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style module>
|
|
65
|
+
.content {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: inherit;
|
|
69
|
+
will-change: height, opacity;
|
|
70
|
+
transform: translateZ(0);
|
|
71
|
+
backface-visibility: hidden;
|
|
72
|
+
perspective: 1000px;
|
|
73
|
+
margin-top: -8px;
|
|
74
|
+
padding-top: 8px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.separator:hover {
|
|
78
|
+
--pl-separator-txt-color: var(--txt-01);
|
|
79
|
+
--mask-icon-bg-color: var(--ic-01);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.chevron {
|
|
83
|
+
transition-duration: 50ms;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.down {
|
|
87
|
+
transform: rotate(90deg);
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -42,6 +42,10 @@ const props = defineProps<{
|
|
|
42
42
|
* If `true`, the component is disabled and cannot be interacted with.
|
|
43
43
|
*/
|
|
44
44
|
disabled?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* If `true`, the height of the component is 32px
|
|
47
|
+
*/
|
|
48
|
+
compact?: boolean;
|
|
45
49
|
/**
|
|
46
50
|
* A helper text displayed below the component when there are no errors (optional).
|
|
47
51
|
*/
|
|
@@ -61,7 +65,7 @@ const normalizedOptions = computed(() =>
|
|
|
61
65
|
</script>
|
|
62
66
|
|
|
63
67
|
<template>
|
|
64
|
-
<div class="pl-btn-group" :class="{ disabled }">
|
|
68
|
+
<div class="pl-btn-group" :class="{ disabled, compact }">
|
|
65
69
|
<label v-if="label">
|
|
66
70
|
<span>{{ label }}</span>
|
|
67
71
|
<PlTooltip v-if="slots.tooltip" class="info" position="top">
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
defineProps<{
|
|
3
|
+
/**
|
|
4
|
+
* If `true`, remove top padding
|
|
5
|
+
*/
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="pl-section-separator" :class="{ [$style.compact]: compact }">
|
|
12
|
+
<div :class="$style.content"><slot /></div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style module>
|
|
17
|
+
:global(.pl-section-separator) {
|
|
18
|
+
--pl-separator-padding: 20px 0 4px 0;
|
|
19
|
+
--pl-separator-txt-color: var(--txt-03);
|
|
20
|
+
--pl-separador-divider-color: var(--border-color-div-grey);
|
|
21
|
+
--mask-icon-bg-color: var(--ic-02);
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
padding: var(--pl-separator-padding);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:global(.pl-section-separator):first-child {
|
|
28
|
+
--pl-separator-padding: 4px 0 4px 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.compact {
|
|
32
|
+
--pl-separator-padding: 0 0 4px 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.content {
|
|
36
|
+
flex: 1;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 4px;
|
|
40
|
+
color: var(--pl-separator-txt-color);
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
line-height: 14px;
|
|
44
|
+
min-height: 16px;
|
|
45
|
+
letter-spacing: 0.52px;
|
|
46
|
+
text-transform: uppercase;
|
|
47
|
+
user-select: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.content::after {
|
|
51
|
+
flex: 1;
|
|
52
|
+
content: '';
|
|
53
|
+
height: 1px;
|
|
54
|
+
background-color: var(--pl-separador-divider-color);
|
|
55
|
+
margin-left: 4px;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PlSectionSeparator } from './PlSectionSeparator.vue';
|
|
@@ -205,7 +205,7 @@ useLabelNotch(rootRef);
|
|
|
205
205
|
@focusout="onFocusOut"
|
|
206
206
|
/>
|
|
207
207
|
<div class="pl-text-field__append">
|
|
208
|
-
<PlIcon16 v-if="canShowClearable" name="delete-clear" @click="clear" />
|
|
208
|
+
<PlIcon16 v-if="canShowClearable" class="pl-text-field__clearable" name="delete-clear" @click="clear" />
|
|
209
209
|
<PlIcon24 v-if="type === 'password'" :name="passwordIcon" style="cursor: pointer" @click="togglePasswordVisibility" />
|
|
210
210
|
<slot name="append" />
|
|
211
211
|
</div>
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
--label-offset-left-x: 8px;
|
|
11
11
|
--label-offset-right-x: 8px;
|
|
12
12
|
--prefix-color: var(--color-placeholder);
|
|
13
|
+
--show-clearable: none;
|
|
13
14
|
|
|
14
15
|
width: 100%;
|
|
15
16
|
min-width: 160px;
|
|
@@ -87,6 +88,10 @@
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
&__clearable {
|
|
92
|
+
display: var(--show-clearable) !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
90
95
|
&__helper {
|
|
91
96
|
@include field-helper();
|
|
92
97
|
}
|
|
@@ -97,6 +102,11 @@
|
|
|
97
102
|
|
|
98
103
|
&:hover {
|
|
99
104
|
--contour-color: var(--control-hover-color);
|
|
105
|
+
--show-clearable: inline-block;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:focus-within {
|
|
109
|
+
--show-clearable: inline-block;
|
|
100
110
|
}
|
|
101
111
|
|
|
102
112
|
&:focus-within:not(.error) {
|
package/src/index.ts
CHANGED
|
@@ -44,6 +44,8 @@ export * from './components/PlSlideModal';
|
|
|
44
44
|
export * from './components/PlToggleSwitch';
|
|
45
45
|
export * from './components/PlLogView';
|
|
46
46
|
export * from './components/PlTabs';
|
|
47
|
+
export * from './components/PlSectionSeparator';
|
|
48
|
+
export * from './components/PlAccordion';
|
|
47
49
|
|
|
48
50
|
export * from './components/PlFileDialog';
|
|
49
51
|
export * from './components/PlFileInput';
|
|
@@ -10,10 +10,14 @@ import { useSlots } from 'vue';
|
|
|
10
10
|
import './pl-block-page.scss';
|
|
11
11
|
|
|
12
12
|
const slots = useSlots();
|
|
13
|
+
|
|
14
|
+
defineProps<{
|
|
15
|
+
noBodyGutters?: boolean;
|
|
16
|
+
}>();
|
|
13
17
|
</script>
|
|
14
18
|
|
|
15
19
|
<template>
|
|
16
|
-
<div class="pl-layout-component pl-block-page">
|
|
20
|
+
<div class="pl-layout-component pl-block-page" :class="{ noBodyGutters }">
|
|
17
21
|
<div v-if="slots.title" class="pl-block-page__title">
|
|
18
22
|
<h1><slot name="title" /></h1>
|
|
19
23
|
<div class="pl-block-page__title__append">
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@import "@/assets/mixins";
|
|
2
2
|
|
|
3
3
|
.pl-block-page {
|
|
4
|
+
--pl-block-page-body-padding: var(--main-spacing, 24px);
|
|
5
|
+
|
|
4
6
|
padding: var(--container-spacing);
|
|
5
7
|
background-color: var(--bg-elevated-01);
|
|
6
8
|
height: 100%;
|
|
@@ -8,6 +10,10 @@
|
|
|
8
10
|
display: grid;
|
|
9
11
|
grid-template-rows: auto minmax(0, 1fr);
|
|
10
12
|
|
|
13
|
+
&.noBodyGutters {
|
|
14
|
+
--pl-block-page-body-padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
&__title {
|
|
12
18
|
height: 80px;
|
|
13
19
|
display: flex;
|
|
@@ -37,7 +43,7 @@
|
|
|
37
43
|
display: flex;
|
|
38
44
|
flex-direction: column;
|
|
39
45
|
gap: var(--gap-v);
|
|
40
|
-
padding: var(--
|
|
46
|
+
padding: var(--pl-block-page-body-padding);
|
|
41
47
|
@include scrollbar(true, true);
|
|
42
48
|
}
|
|
43
49
|
}
|