Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
UI_storybook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Дмитрий Малюгин
UI_storybook
Commits
4809c4e0
Commit
4809c4e0
authored
2 months ago
by
Дмитрий Малюгин
Browse files
Options
Downloads
Patches
Plain Diff
docs: README.md
parent
c78519c7
No related branches found
No related tags found
1 merge request
!3
Table (partially), Checkbox, Tag, Select and Knob
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+3
-2
3 additions, 2 deletions
README.md
package.json
+3
-0
3 additions, 0 deletions
package.json
src/stories/components/Knob/Knob.vue
+7
-6
7 additions, 6 deletions
src/stories/components/Knob/Knob.vue
src/stories/components/Knob/helpers.ts
+1
-1
1 addition, 1 deletion
src/stories/components/Knob/helpers.ts
with
14 additions
and
9 deletions
README.md
+
3
−
2
View file @
4809c4e0
...
...
@@ -12,6 +12,7 @@
-
Slider;
-
Drawer;
-
Modal;
-
Knob;
-
Select;
-
SelectButton;
-
Button;
...
...
@@ -22,8 +23,8 @@
---
## Общая информация
### Components count: 1
4
### Bundle size: 2
87.4
KB
### Components count: 1
5
### Bundle size: 2
92.7
KB
---
...
...
This diff is collapsed.
Click to expand it.
package.json
+
3
−
0
View file @
4809c4e0
...
...
@@ -52,5 +52,8 @@
"extends"
:
[
"plugin:storybook/recommended"
]
},
"volta"
:
{
"node"
:
"23.6.0"
}
}
This diff is collapsed.
Click to expand it.
src/stories/components/Knob/Knob.vue
+
7
−
6
View file @
4809c4e0
...
...
@@ -59,7 +59,8 @@ const buttonPadding = computed(() => {
?
'
0.5rem 0.75rem
'
:
'
0.7rem 1rem
'
;
});
const
backgroundSize
=
computed
(()
=>
`
${
containerSize
.
value
.
slice
(
0
,
-
2
)
*
0.71
}
px`
);
const
buttonWidth
=
computed
(()
=>
`
${
+
textSize
.
value
.
slice
(
0
,
-
3
)
*
0.78
}
rem`
);
const
backgroundSize
=
computed
(()
=>
`
${
+
containerSize
.
value
.
slice
(
0
,
-
2
)
*
0.71
}
px`
);
const
themeColor
=
computed
(()
=>
calcThemeColor
(
props
.
colorGaps
,
props
.
theme
,
props
.
darknessTheme
,
value
.
value
));
const
textColor
=
computed
(()
=>
convertThemeToColor
(
props
.
color
,
props
.
darknessColor
));
const
backgroundCircle
=
computed
(()
=>
{
...
...
@@ -78,7 +79,7 @@ const conicGradient = computed(() => {
return
`conic-gradient(transparent 0deg 225deg,
${
themeColor
.
value
}
225deg
${
valueDeg
}
deg, transparent
${
valueDeg
}
deg 360deg)`
;
});
const
setNewValue
=
(
$event
)
=>
{
const
setNewValue
=
(
$event
:
MouseEvent
)
=>
{
value
.
value
=
calcNewValue
(
$event
,
center
.
value
,
...
...
@@ -89,7 +90,7 @@ const setNewValue = ($event) => {
value
.
value
,
);
};
const
onPointerDown
=
(
$event
)
=>
{
const
onPointerDown
=
(
$event
:
MouseEvent
)
=>
{
isClickHold
.
value
=
true
;
setNewValue
(
$event
);
};
...
...
@@ -114,7 +115,7 @@ const onPointerDown = ($event) => {
<div
class=
"circle containerSize"
>
<div
class=
"circle containerSize selected"
></div>
</div>
<div
v-if=
"buttons"
class=
"buttons"
:style=
"`gap: $
{textSize.slice(0, -3) * 3}px`">
<div
v-if=
"buttons"
class=
"buttons"
:style=
"`gap: $
{
+
textSize.slice(0, -3) * 3}px`">
<Button
@
click=
"value++"
:theme=
"negativeTheme"
...
...
@@ -123,7 +124,7 @@ const onPointerDown = ($event) => {
label=
"+"
textStyle=
"bold"
:padding=
"buttonPadding"
:width=
"
`$
{textSize.slice(0, -3) * 0.78}rem`
"
:width=
"
buttonWidth
"
></Button>
<Button
@
click=
"value--"
...
...
@@ -133,7 +134,7 @@ const onPointerDown = ($event) => {
label=
"-"
textStyle=
"bold"
:padding=
"buttonPadding"
:width=
"
`$
{textSize.slice(0, -3) * 0.78}rem`
"
:width=
"
buttonWidth
"
></Button>
</div>
</section>
...
...
This diff is collapsed.
Click to expand it.
src/stories/components/Knob/helpers.ts
+
1
−
1
View file @
4809c4e0
...
...
@@ -40,7 +40,7 @@ export const calcStart = (container: Element) => {
};
export
const
calcThemeColor
=
(
colorGaps
:
IKnobColorGap
[],
colorGaps
:
IKnobColorGap
[]
|
undefined
,
theme
:
TThemeColor
,
darknessTheme
:
TDarkness
,
value
:
number
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment