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
3a291d96
Commit
3a291d96
authored
1 month ago
by
Дмитрий Малюгин
Browse files
Options
Downloads
Patches
Plain Diff
fix: build
parent
ab5c73d9
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Finish "UI-library v1.0.0"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/ColorPicker/ColorPicker.vue
+11
-11
11 additions, 11 deletions
src/components/ColorPicker/ColorPicker.vue
with
11 additions
and
11 deletions
src/components/ColorPicker/ColorPicker.vue
+
11
−
11
View file @
3a291d96
...
@@ -16,11 +16,11 @@ const size = computed(() => {
...
@@ -16,11 +16,11 @@ const size = computed(() => {
if
(
size
===
'
large
'
)
return
'
40px
'
;
if
(
size
===
'
large
'
)
return
'
40px
'
;
if
(
size
===
'
huge
'
)
return
'
60px
'
;
if
(
size
===
'
huge
'
)
return
'
60px
'
;
return
'
15px
'
;
return
'
15px
'
;
});
})
as
Ref
<
string
>
;
const
borderWidth
=
computed
(()
=>
(
props
.
size
===
'
small
'
?
'
2px
'
:
'
3px
'
));
const
borderWidth
=
computed
(()
=>
(
props
.
size
===
'
small
'
?
'
2px
'
:
'
3px
'
))
as
Ref
<
string
>
;
const
borderRadius
=
computed
(()
=>
`calc(
${
size
.
value
}
* 0.3)`
);
const
borderRadius
=
computed
(()
=>
`calc(
${
size
.
value
}
* 0.3)`
);
function
wc_hex_is_light
(
color
)
{
function
wc_hex_is_light
(
color
:
string
|
undefined
)
{
if
(
!
color
)
return
true
;
if
(
!
color
)
return
true
;
const
hex
=
color
.
replace
(
'
#
'
,
''
);
const
hex
=
color
.
replace
(
'
#
'
,
''
);
const
c_r
=
parseInt
(
hex
.
substring
(
0
,
2
),
16
);
const
c_r
=
parseInt
(
hex
.
substring
(
0
,
2
),
16
);
...
@@ -31,13 +31,13 @@ function wc_hex_is_light(color) {
...
@@ -31,13 +31,13 @@ function wc_hex_is_light(color) {
}
}
const
color
=
computed
(()
=>
const
color
=
computed
(()
=>
props
.
buttonProps
.
textColor
props
.
buttonProps
?
.
textColor
?
convertThemeToColor
(
props
.
buttonProps
.
textColor
,
props
.
buttonProps
.
darknessTextColor
)
?
convertThemeToColor
(
props
.
buttonProps
.
textColor
,
props
.
buttonProps
?
.
darknessTextColor
)
:
props
.
sameButtonColor
:
props
.
sameButtonColor
?
!
wc_hex_is_light
(
value
?.
value
)
?
!
wc_hex_is_light
(
value
?.
value
)
?
'
white
'
?
'
white
'
:
'
black
'
:
'
black
'
:
convertThemeToTextColor
(
props
.
buttonProps
.
theme
??
'
white
'
,
props
.
buttonProps
.
darknessTheme
),
:
convertThemeToTextColor
(
props
.
buttonProps
?
.
theme
??
'
white
'
,
props
.
buttonProps
?
.
darknessTheme
),
);
);
const
textSize
=
computed
(()
=>
{
const
textSize
=
computed
(()
=>
{
switch
(
props
.
size
)
{
switch
(
props
.
size
)
{
...
@@ -51,7 +51,7 @@ const textSize = computed(() => {
...
@@ -51,7 +51,7 @@ const textSize = computed(() => {
return
'
16px
'
;
return
'
16px
'
;
});
});
const
buttonPadding
=
computed
(()
=>
{
const
buttonPadding
=
computed
(()
=>
{
if
(
props
.
buttonProps
.
padding
)
return
props
.
buttonProps
.
padding
;
if
(
props
.
buttonProps
?
.
padding
)
return
props
.
buttonProps
?
.
padding
;
switch
(
props
.
size
)
{
switch
(
props
.
size
)
{
case
'
small
'
:
case
'
small
'
:
return
'
0.5rem
'
;
return
'
0.5rem
'
;
...
@@ -81,8 +81,8 @@ const buttonPadding = computed(() => {
...
@@ -81,8 +81,8 @@ const buttonPadding = computed(() => {
:class="[
:class="[
'text',
'text',
{
{
bold: buttonProps?.textStyle === 'bold',
bold:
buttonProps
&&
buttonProps?.textStyle === 'bold',
italic: buttonProps?.textStyle === 'italic',
italic:
buttonProps
&&
buttonProps?.textStyle === 'italic',
},
},
]"
]"
>
{{
buttonProps
?.
label
??
'
Button
'
}}
</label
>
{{
buttonProps
?.
label
??
'
Button
'
}}
</label
...
@@ -94,8 +94,8 @@ const buttonPadding = computed(() => {
...
@@ -94,8 +94,8 @@ const buttonPadding = computed(() => {
v-model=
"value"
v-model=
"value"
:disabled=
"disabled"
:disabled=
"disabled"
:class=
"
{
:class=
"
{
noVisible: buttonProps,
noVisible:
!!
buttonProps,
disabled,
disabled:
disabled,
}"
}"
/>
/>
</div>
</div>
...
...
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