@geckou/ui-vue 0.3.1 → 0.4.0
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/README.md +8 -1
- package/dist/components/ArticleList/Card/Artistic.vue.d.ts +10 -0
- package/dist/components/ArticleList/Card/Entertainment.vue.d.ts +10 -0
- package/dist/components/ArticleList/Card/Gallery.vue.d.ts +10 -0
- package/dist/components/ArticleList/Card/Grid.vue.d.ts +11 -0
- package/dist/components/ArticleList/Card/News.vue.d.ts +9 -0
- package/dist/components/ArticleList/Card/Rounded.vue.d.ts +10 -0
- package/dist/components/ArticleList/Card/Row.vue.d.ts +9 -0
- package/dist/components/ArticleList/Card/Simple.vue.d.ts +10 -0
- package/dist/components/ArticleList/Card/Standard.vue.d.ts +10 -0
- package/dist/components/ArticleList/Card/Tile.vue.d.ts +10 -0
- package/dist/components/ArticleList/GenericArticleList.vue.d.ts +11 -0
- package/dist/components/ArticleList/List/Artistic.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Entertainment.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Gallery.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Grid.vue.d.ts +11 -0
- package/dist/components/ArticleList/List/News.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Rounded.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Row.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Simple.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Standard.vue.d.ts +8 -0
- package/dist/components/ArticleList/List/Tile.vue.d.ts +8 -0
- package/dist/components/ArticleList/Parts/AuthorInfo.vue.d.ts +31 -0
- package/dist/components/ArticleList/Parts/CardContainer.vue.d.ts +20 -0
- package/dist/components/ArticleList/Parts/CardHeading.vue.d.ts +12 -0
- package/dist/components/ArticleList/Parts/CategoryList.vue.d.ts +19 -0
- package/dist/components/ArticleList/Parts/ExcerptText.vue.d.ts +12 -0
- package/dist/components/ArticleList/Parts/MetadataList.vue.d.ts +32 -0
- package/dist/components/ArticleList/Parts/NoImage.vue.d.ts +2 -0
- package/dist/components/ArticleList/Parts/PostedDate.vue.d.ts +14 -0
- package/dist/components/ArticleList/Parts/TagList.vue.d.ts +18 -0
- package/dist/components/ArticleList/Parts/ThumbnailImage.vue.d.ts +17 -0
- package/dist/components/BasicButton.vue.d.ts +26 -0
- package/dist/components/CheckBox.vue.d.ts +34 -0
- package/dist/components/CheckBoxes.vue.d.ts +18 -0
- package/dist/components/CheckButton.vue.d.ts +31 -0
- package/dist/components/DatePicker.vue.d.ts +27 -0
- package/dist/components/DateRangePicker.vue.d.ts +31 -0
- package/dist/components/DateSelector.vue.d.ts +17 -0
- package/dist/components/DropdownUi.vue.d.ts +37 -0
- package/dist/components/ErrorMessage.vue.d.ts +9 -0
- package/dist/components/Icon/CalendarIcon.vue.d.ts +2 -0
- package/dist/components/Icon/CheckIcon.vue.d.ts +2 -0
- package/dist/components/Icon/CloseIcon.vue.d.ts +2 -0
- package/dist/components/Icon/Folder.vue.d.ts +2 -0
- package/dist/components/Icon/Image.vue.d.ts +2 -0
- package/dist/components/Icon/KeyboardArrowDownIcon.vue.d.ts +2 -0
- package/dist/components/Icon/Tag.vue.d.ts +2 -0
- package/dist/components/InputBox.vue.d.ts +27 -0
- package/dist/components/InputGroup.vue.d.ts +17 -0
- package/dist/components/LabeledCheckbox.vue.d.ts +20 -0
- package/dist/components/LabeledFieldset.vue.d.ts +21 -0
- package/dist/components/LoadingSpinner.vue.d.ts +2 -0
- package/dist/components/ModalBox.vue.d.ts +27 -0
- package/dist/components/PopupBox.vue.d.ts +30 -0
- package/dist/components/RadioButtons.vue.d.ts +20 -0
- package/dist/components/SelectBox.vue.d.ts +37 -0
- package/dist/components/SlideDownUi.vue.d.ts +37 -0
- package/dist/components/TabUI.vue.d.ts +54 -0
- package/dist/components/TextArea.vue.d.ts +33 -0
- package/dist/components/TextBox.vue.d.ts +44 -0
- package/dist/components/TextButton.vue.d.ts +10 -0
- package/dist/components/ToggleButton.vue.d.ts +23 -0
- package/dist/const/index.d.ts +1 -0
- package/dist/const/list-theme.d.ts +62 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +3519 -0
- package/dist/scripts/form-validation-manager.d.ts +30 -0
- package/dist/scripts/unique-id.d.ts +1 -0
- package/dist/scripts/use-click-outside.d.ts +13 -0
- package/dist/scripts/utils.d.ts +15 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +48 -77
- package/package.json +16 -8
- package/dist/assets/scss/functions.scss +0 -6
- package/dist/assets/scss/mixin.scss +0 -33
- package/dist/components/ArticleList/Card/Artistic.vue +0 -311
- package/dist/components/ArticleList/Card/Entertainment.vue +0 -245
- package/dist/components/ArticleList/Card/Gallery.vue +0 -255
- package/dist/components/ArticleList/Card/Grid.vue +0 -248
- package/dist/components/ArticleList/Card/News.vue +0 -151
- package/dist/components/ArticleList/Card/Rounded.vue +0 -155
- package/dist/components/ArticleList/Card/Row.vue +0 -168
- package/dist/components/ArticleList/Card/Simple.vue +0 -233
- package/dist/components/ArticleList/Card/Standard.vue +0 -188
- package/dist/components/ArticleList/Card/Tile.vue +0 -172
- package/dist/components/ArticleList/GenericArticleList.vue +0 -143
- package/dist/components/ArticleList/List/Artistic.vue +0 -24
- package/dist/components/ArticleList/List/Entertainment.vue +0 -24
- package/dist/components/ArticleList/List/Gallery.vue +0 -24
- package/dist/components/ArticleList/List/Grid.vue +0 -216
- package/dist/components/ArticleList/List/News.vue +0 -24
- package/dist/components/ArticleList/List/Rounded.vue +0 -24
- package/dist/components/ArticleList/List/Row.vue +0 -24
- package/dist/components/ArticleList/List/Simple.vue +0 -24
- package/dist/components/ArticleList/List/Standard.vue +0 -24
- package/dist/components/ArticleList/List/Tile.vue +0 -24
- package/dist/components/ArticleList/Parts/AuthorInfo.vue +0 -100
- package/dist/components/ArticleList/Parts/CardContainer.vue +0 -23
- package/dist/components/ArticleList/Parts/CardHeading.vue +0 -43
- package/dist/components/ArticleList/Parts/CategoryList.vue +0 -41
- package/dist/components/ArticleList/Parts/ExcerptText.vue +0 -43
- package/dist/components/ArticleList/Parts/MetadataList.vue +0 -120
- package/dist/components/ArticleList/Parts/NoImage.vue +0 -36
- package/dist/components/ArticleList/Parts/PostedDate.vue +0 -41
- package/dist/components/ArticleList/Parts/TagList.vue +0 -41
- package/dist/components/ArticleList/Parts/ThumbnailImage.vue +0 -85
- package/dist/components/BasicButton.vue +0 -143
- package/dist/components/CheckBox.vue +0 -140
- package/dist/components/CheckBoxes.vue +0 -101
- package/dist/components/CheckButton.vue +0 -127
- package/dist/components/DatePicker.vue +0 -234
- package/dist/components/DateRangePicker.vue +0 -85
- package/dist/components/DateSelector.vue +0 -273
- package/dist/components/DropdownUi.vue +0 -118
- package/dist/components/ErrorMessage.vue +0 -61
- package/dist/components/Icon/CalendarIcon.vue +0 -8
- package/dist/components/Icon/CheckIcon.vue +0 -8
- package/dist/components/Icon/CloseIcon.vue +0 -8
- package/dist/components/Icon/Folder.vue +0 -8
- package/dist/components/Icon/Image.vue +0 -14
- package/dist/components/Icon/KeyboardArrowDownIcon.vue +0 -8
- package/dist/components/Icon/Tag.vue +0 -8
- package/dist/components/InputBox.vue +0 -134
- package/dist/components/InputGroup.vue +0 -41
- package/dist/components/LabeledCheckbox.vue +0 -82
- package/dist/components/LabeledFieldset.vue +0 -41
- package/dist/components/LoadingSpinner.vue +0 -56
- package/dist/components/ModalBox.vue +0 -192
- package/dist/components/PopupBox.vue +0 -93
- package/dist/components/RadioButtons.vue +0 -163
- package/dist/components/SelectBox.vue +0 -166
- package/dist/components/SlideDownUi.vue +0 -123
- package/dist/components/TabUI.vue +0 -123
- package/dist/components/TextArea.vue +0 -115
- package/dist/components/TextBox.vue +0 -111
- package/dist/components/TextButton.vue +0 -47
- package/dist/components/ToggleButton.vue +0 -179
- package/dist/const/index.ts +0 -2
- package/dist/const/list-theme.ts +0 -62
- package/dist/index.ts +0 -126
- package/dist/scripts/form-validation-manager.ts +0 -63
- package/dist/scripts/utils.ts +0 -44
- package/dist/types/custom.d.ts +0 -1
- package/dist/types/vue-shim.d.ts +0 -5
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, onMounted, onUpdated } from 'vue'
|
|
3
|
-
import IconChevronDown from '../components/Icon/KeyboardArrowDownIcon.vue'
|
|
4
|
-
withDefaults(defineProps<{
|
|
5
|
-
isHiddenArrow?: boolean,
|
|
6
|
-
contentAlignment?: 'left' | 'center' | 'right',
|
|
7
|
-
isDisabled?: boolean
|
|
8
|
-
contentsWidth?: string
|
|
9
|
-
}>(), {
|
|
10
|
-
isHiddenArrow : false,
|
|
11
|
-
contentAlignment: 'left',
|
|
12
|
-
isDisabled : false,
|
|
13
|
-
contentsWidth : 'auto',
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const isContentsOpened = ref(false)
|
|
17
|
-
const contents = ref<HTMLElement | null>(null)
|
|
18
|
-
const contentsHeight = ref(0)
|
|
19
|
-
const toggleBox = () => isContentsOpened.value = !isContentsOpened.value
|
|
20
|
-
const closeDropDown = () => isContentsOpened.value = false
|
|
21
|
-
|
|
22
|
-
const updateContentsHeight = () => {
|
|
23
|
-
const contentsValue = contents.value
|
|
24
|
-
if (contentsValue) {
|
|
25
|
-
contentsHeight.value = contentsValue.clientHeight
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
onMounted(()=> updateContentsHeight())
|
|
30
|
-
onUpdated(() => updateContentsHeight())
|
|
31
|
-
defineExpose({ isContentsOpened })
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div
|
|
36
|
-
v-click-outside="closeDropDown"
|
|
37
|
-
:class="$style.drop_down_box"
|
|
38
|
-
>
|
|
39
|
-
<button
|
|
40
|
-
:class="$style.button"
|
|
41
|
-
:disabled="isDisabled"
|
|
42
|
-
type="button"
|
|
43
|
-
:style="{
|
|
44
|
-
'--trigger-color': isDisabled || !$slots.contents ? 'var(--text-color)' : 'var(--link-color)',
|
|
45
|
-
cursor: isDisabled || !$slots.contents ? 'auto' : 'pointer',
|
|
46
|
-
}"
|
|
47
|
-
@click.prevent="toggleBox"
|
|
48
|
-
>
|
|
49
|
-
<slot name="trigger" />
|
|
50
|
-
<IconChevronDown
|
|
51
|
-
v-if="!(isHiddenArrow || !$slots.contents || isDisabled)"
|
|
52
|
-
:class="[$style.icon, { [$style.open]: isContentsOpened }]"
|
|
53
|
-
/>
|
|
54
|
-
</button>
|
|
55
|
-
<div
|
|
56
|
-
v-if="$slots.contents"
|
|
57
|
-
:class="$style.contents"
|
|
58
|
-
:style="{
|
|
59
|
-
boxShadow: isContentsOpened ? 'var(--box-shadow)' : 'none',
|
|
60
|
-
blockSize: isContentsOpened ? `${contentsHeight}px` : 0,
|
|
61
|
-
inlineSize: contentsWidth,
|
|
62
|
-
right: contentAlignment === 'right' ? 'calc(var(--bv) * -0.5)' : 'auto',
|
|
63
|
-
left: contentAlignment === 'left' ? 'calc(var(--bv) * -0.5)' : 'auto',
|
|
64
|
-
zIndex: '2',
|
|
65
|
-
}"
|
|
66
|
-
>
|
|
67
|
-
<div
|
|
68
|
-
ref="contents"
|
|
69
|
-
@click="closeDropDown"
|
|
70
|
-
>
|
|
71
|
-
<slot name="contents" />
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
</template>
|
|
76
|
-
|
|
77
|
-
<style lang="scss" module>
|
|
78
|
-
@use '../assets/scss/mixin' as *;
|
|
79
|
-
|
|
80
|
-
.drop_down_box {
|
|
81
|
-
position: relative;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.button {
|
|
85
|
-
display : flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
inline-size: 100%;
|
|
88
|
-
block-size : 100%;
|
|
89
|
-
gap : var(--sp-small);
|
|
90
|
-
color : var(--trigger-color);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.icon {
|
|
94
|
-
@include icon($size: var(--icon-small));
|
|
95
|
-
flex : 0 0 auto;
|
|
96
|
-
transition: all .1s;
|
|
97
|
-
|
|
98
|
-
&.open {
|
|
99
|
-
transform: rotate(180deg);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.contents {
|
|
104
|
-
border-radius: var(--radius-small);
|
|
105
|
-
position : absolute;
|
|
106
|
-
top : calc(100% - var(--sp-min));
|
|
107
|
-
transition : block-size .1s;
|
|
108
|
-
overflow : hidden;
|
|
109
|
-
cursor : pointer;
|
|
110
|
-
|
|
111
|
-
> div {
|
|
112
|
-
max-block-size : calc(var(--bv) * 48);
|
|
113
|
-
min-inline-size : calc(var(--bv) * 20);
|
|
114
|
-
background-color: var(--white);
|
|
115
|
-
overflow : auto;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
</style>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { COLOR } from '../const'
|
|
3
|
-
const { red: cautionColor } = COLOR
|
|
4
|
-
|
|
5
|
-
defineProps<{
|
|
6
|
-
cssStyle?: {
|
|
7
|
-
textColor: string | undefined
|
|
8
|
-
backgroundColor: string | undefined
|
|
9
|
-
}
|
|
10
|
-
errorMessages?: Array<string>
|
|
11
|
-
}>()
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<div
|
|
16
|
-
v-show="errorMessages && errorMessages.length"
|
|
17
|
-
:class="$style.error_messages"
|
|
18
|
-
:style="{
|
|
19
|
-
'--error-text-color': cssStyle?.textColor || '#fff',
|
|
20
|
-
'--error-background-color': cssStyle?.backgroundColor || cautionColor,
|
|
21
|
-
}"
|
|
22
|
-
>
|
|
23
|
-
<span
|
|
24
|
-
v-for="message in errorMessages"
|
|
25
|
-
:key="message"
|
|
26
|
-
>
|
|
27
|
-
{{ message }}
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<style lang="scss" module>
|
|
33
|
-
:is(.error_messages) {
|
|
34
|
-
inline-size: max-content;
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
gap: .5rem;
|
|
38
|
-
padding: .5rem .75rem;
|
|
39
|
-
font-size: small;
|
|
40
|
-
color: var(--error-text-color);
|
|
41
|
-
background-color: var(--error-background-color);
|
|
42
|
-
box-shadow: 0 0 .5rem .25rem #33333322;
|
|
43
|
-
border-radius: .25rem;
|
|
44
|
-
line-height: 1;
|
|
45
|
-
position: absolute;
|
|
46
|
-
inset-block-start: calc(100% + .25rem);
|
|
47
|
-
|
|
48
|
-
&::before {
|
|
49
|
-
--tail-size: .85rem;
|
|
50
|
-
content: '';
|
|
51
|
-
display: block;
|
|
52
|
-
background-color: var(--error-background-color);
|
|
53
|
-
inline-size: var(--tail-size);
|
|
54
|
-
block-size: calc(var(--tail-size) * .625);
|
|
55
|
-
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
|
|
56
|
-
position: absolute;
|
|
57
|
-
bottom: calc(100% - 1px);
|
|
58
|
-
inset-inline-start: .85rem;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
</style>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
-
viewBox="0 -960 960 960"
|
|
5
|
-
>
|
|
6
|
-
<path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm280 240q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z" />
|
|
7
|
-
</svg>
|
|
8
|
-
</template>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
-
viewBox="0 0 24 24"
|
|
5
|
-
>
|
|
6
|
-
<circle
|
|
7
|
-
cx="7.499"
|
|
8
|
-
cy="9.5"
|
|
9
|
-
r="1.5"
|
|
10
|
-
/>
|
|
11
|
-
<path d="m10.499 14-1.5-2-3 4h12l-4.5-6z" />
|
|
12
|
-
<path d="M19.999 4h-16c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2zm-16 14V6h16l.002 12H3.999z" />
|
|
13
|
-
</svg>
|
|
14
|
-
</template>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
-
viewBox="0 0 24 24"
|
|
5
|
-
>
|
|
6
|
-
<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8 8a2 2 0 0 0 2.828 0l7.172-7.172a2 2 0 0 0 0-2.828l-8-8zM7 9a2 2 0 1 1 .001-4.001A2 2 0 0 1 7 9z" />
|
|
7
|
-
</svg>
|
|
8
|
-
</template>
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
StateVariation,
|
|
4
|
-
InputBoxStyle,
|
|
5
|
-
InputBoxStyleForEachStatus,
|
|
6
|
-
} from '../types'
|
|
7
|
-
import {
|
|
8
|
-
ref,
|
|
9
|
-
computed,
|
|
10
|
-
onMounted,
|
|
11
|
-
onUnmounted,
|
|
12
|
-
watch,
|
|
13
|
-
} from 'vue'
|
|
14
|
-
import { INPUT_BOX_DEFAULT_STYLES } from '../const'
|
|
15
|
-
|
|
16
|
-
const props = defineProps<{
|
|
17
|
-
cssStyle?: InputBoxStyleForEachStatus
|
|
18
|
-
isErrored?: boolean
|
|
19
|
-
isDisabled?: boolean
|
|
20
|
-
}>()
|
|
21
|
-
|
|
22
|
-
const inputBox = ref<HTMLElement | null>(null)
|
|
23
|
-
|
|
24
|
-
const cssStylesUsed = computed<InputBoxStyleForEachStatus>(() => ({
|
|
25
|
-
...INPUT_BOX_DEFAULT_STYLES,
|
|
26
|
-
...(props.cssStyle ?? {}),
|
|
27
|
-
}))
|
|
28
|
-
|
|
29
|
-
const currentCssStyle = computed<InputBoxStyle>(() => cssStylesUsed.value[currentState.value as StateVariation] ?? cssStylesUsed.value.default)
|
|
30
|
-
const currentState = ref<StateVariation>('default')
|
|
31
|
-
|
|
32
|
-
const checkElementState = (el: Element | null | undefined) => {
|
|
33
|
-
if (!el) return currentState.value = 'default'
|
|
34
|
-
if (el.matches(':disabled')) return currentState.value = 'disabled'
|
|
35
|
-
if (el.matches(':focus')) return currentState.value = 'focus'
|
|
36
|
-
if (el.tagName.toLowerCase() === 'select') return currentState.value = ((el as HTMLSelectElement).required && !(el as HTMLSelectElement).value) ? 'error' : 'valid'
|
|
37
|
-
if (props.isErrored || el.matches(':invalid')) return currentState.value = 'error'
|
|
38
|
-
if (el.matches(':valid') && el.matches(':not(:placeholder-shown)') && el.matches(':not(:invalid)')) return currentState.value = 'valid'
|
|
39
|
-
return currentState.value = 'default'
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const updateState = () => {
|
|
43
|
-
const el = inputBox.value?.querySelector('input, textarea, select')
|
|
44
|
-
checkElementState(el)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
onMounted(() => {
|
|
48
|
-
if (!inputBox.value) return
|
|
49
|
-
const observer = new MutationObserver(updateState)
|
|
50
|
-
observer.observe(inputBox.value, { childList: true, subtree: true })
|
|
51
|
-
inputBox.value.addEventListener('focusin', updateState, true)
|
|
52
|
-
inputBox.value.addEventListener('blur', updateState, true)
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
onUnmounted(() => {
|
|
56
|
-
if (!inputBox.value) return
|
|
57
|
-
inputBox.value.removeEventListener('focusin', updateState, true)
|
|
58
|
-
inputBox.value.removeEventListener('blur', updateState, true)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
watch(() => props.isDisabled, () => currentState.value = props.isDisabled ? 'disabled' : 'default', { immediate: true })
|
|
62
|
-
|
|
63
|
-
// isErrored の変化は focus / blur を伴わないため、明示的に再判定する
|
|
64
|
-
// (以前は次に focus か blur が起きるまでエラー配色にならなかった)
|
|
65
|
-
watch(() => props.isErrored, () => {
|
|
66
|
-
if (props.isDisabled) return
|
|
67
|
-
updateState()
|
|
68
|
-
})
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<template>
|
|
72
|
-
<div
|
|
73
|
-
ref="inputBox"
|
|
74
|
-
:class="$style.input_box"
|
|
75
|
-
:style="{
|
|
76
|
-
'--text-color': currentCssStyle.textColor,
|
|
77
|
-
'--placeholder-color': currentCssStyle.placeholderColor,
|
|
78
|
-
'--background-color': currentCssStyle.backgroundColor,
|
|
79
|
-
'--border-style': `0 0 0 ${ currentCssStyle.border?.size || '1px' } ${ currentCssStyle.border?.color } inset`,
|
|
80
|
-
'--radius-size': currentCssStyle.border?.radius || '.25rem',
|
|
81
|
-
'--box-shadow': currentCssStyle.boxShadow || '0 0 0 0 rgba(0, 0, 0, 0)',
|
|
82
|
-
}"
|
|
83
|
-
>
|
|
84
|
-
<slot />
|
|
85
|
-
</div>
|
|
86
|
-
</template>
|
|
87
|
-
|
|
88
|
-
<style lang="scss" module>
|
|
89
|
-
:is(.input_box) {
|
|
90
|
-
display: inline-flex;
|
|
91
|
-
max-inline-size: 100%;
|
|
92
|
-
background-color: var(--background-color);
|
|
93
|
-
box-shadow:
|
|
94
|
-
var(--border-style),
|
|
95
|
-
var(--box-shadow);
|
|
96
|
-
border-radius: var(--radius-size);
|
|
97
|
-
color: var(--text-color);
|
|
98
|
-
position: relative;
|
|
99
|
-
|
|
100
|
-
input,
|
|
101
|
-
textarea,
|
|
102
|
-
select {
|
|
103
|
-
inline-size: 100%;
|
|
104
|
-
padding: 1rem;
|
|
105
|
-
background-color: transparent;
|
|
106
|
-
border: none;
|
|
107
|
-
outline: none;
|
|
108
|
-
appearance: none;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
*::placeholder {
|
|
112
|
-
color: var(--placeholder-color);
|
|
113
|
-
font-weight: normal;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
*:focus,
|
|
117
|
-
*:focus:not(:focus-visible) {
|
|
118
|
-
outline: none;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&:has(> *:disabled) {
|
|
122
|
-
pointer-events: none !important;
|
|
123
|
-
position: relative;
|
|
124
|
-
|
|
125
|
-
&::before {
|
|
126
|
-
content: '';
|
|
127
|
-
position: absolute;
|
|
128
|
-
inset: 0;
|
|
129
|
-
pointer-events: all;
|
|
130
|
-
cursor: not-allowed !important;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="$style.input_group">
|
|
3
|
-
<slot />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<style lang="scss" module>
|
|
8
|
-
@use '../assets/scss/mixin' as *;
|
|
9
|
-
|
|
10
|
-
.input_group {
|
|
11
|
-
display: inline-flex;
|
|
12
|
-
gap : 1px;
|
|
13
|
-
|
|
14
|
-
@include media('mobile') {
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@mixin childItem {
|
|
19
|
-
flex : 1 1 auto;
|
|
20
|
-
border-radius: 0;
|
|
21
|
-
|
|
22
|
-
&:first-child:not(:only-child) {
|
|
23
|
-
border-top-left-radius : var(--radius-small);
|
|
24
|
-
border-bottom-left-radius: var(--radius-small);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&:last-child:not(:only-child) {
|
|
28
|
-
border-top-right-radius : var(--radius-small);
|
|
29
|
-
border-bottom-right-radius: var(--radius-small);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
> * {
|
|
34
|
-
@include childItem;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
> button {
|
|
38
|
-
flex: 0 0 auto;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { CheckBoxStyleForEachStatus } from '../types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import CheckBox from '../components/CheckBox.vue'
|
|
5
|
-
import { COLOR } from '../const'
|
|
6
|
-
|
|
7
|
-
const emit = defineEmits<{ (e: 'update:modelValue', newValue: boolean): void }>()
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(defineProps<{
|
|
10
|
-
name: string
|
|
11
|
-
label: string
|
|
12
|
-
modelValue?: boolean
|
|
13
|
-
isDisabled?: boolean
|
|
14
|
-
cssStyle?: CheckBoxStyleForEachStatus
|
|
15
|
-
isDisableAnimation?: boolean
|
|
16
|
-
}>(), {
|
|
17
|
-
cssStyle: undefined,
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const isChecked = computed<boolean>({
|
|
21
|
-
get: () => props.modelValue ?? false,
|
|
22
|
-
set: (newValue: boolean) => emit('update:modelValue', newValue),
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const currentCssStyle = computed(() => {
|
|
26
|
-
const cssStyle = props.isDisabled ? props.cssStyle?.disabled : props.cssStyle?.default
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
...{
|
|
30
|
-
textColor : props.isDisabled ? COLOR.darkGray : COLOR.black,
|
|
31
|
-
backgroundColor: props.isDisabled ? COLOR.darkGray : COLOR.blue,
|
|
32
|
-
},
|
|
33
|
-
...(cssStyle ?? {}),
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<label :class="$style.labeled_check_box">
|
|
40
|
-
<CheckBox
|
|
41
|
-
v-model="isChecked"
|
|
42
|
-
:name="name"
|
|
43
|
-
:isDisabled="isDisabled"
|
|
44
|
-
:cssStyle="cssStyle"
|
|
45
|
-
:isDisableAnimation="isDisableAnimation"
|
|
46
|
-
style="pointer-events: none;"
|
|
47
|
-
/>
|
|
48
|
-
<span
|
|
49
|
-
:class="$style.label"
|
|
50
|
-
:style="{
|
|
51
|
-
'--text-color': currentCssStyle?.textColor,
|
|
52
|
-
'--checked-color': currentCssStyle?.backgroundColor,
|
|
53
|
-
}"
|
|
54
|
-
>
|
|
55
|
-
{{ label }}
|
|
56
|
-
</span>
|
|
57
|
-
</label>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<style lang="scss" module>
|
|
61
|
-
:is(.labeled_check_box) {
|
|
62
|
-
display : inline-flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
gap : .5em;
|
|
65
|
-
cursor : pointer;
|
|
66
|
-
|
|
67
|
-
&:has(input:disabled) {
|
|
68
|
-
cursor: auto;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.label {
|
|
72
|
-
color: var(--checked-color);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:has(input:checked) {
|
|
76
|
-
.label {
|
|
77
|
-
color: var(--text-color);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineProps<{ isDisabled?: boolean }>()
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<div :class="$style.fieldset">
|
|
7
|
-
<fieldset :disabled="isDisabled">
|
|
8
|
-
<legend
|
|
9
|
-
v-if="$slots.label"
|
|
10
|
-
:class="$style.legend"
|
|
11
|
-
>
|
|
12
|
-
<slot name="label" />
|
|
13
|
-
</legend>
|
|
14
|
-
<div :class="$style.input">
|
|
15
|
-
<slot />
|
|
16
|
-
</div>
|
|
17
|
-
</fieldset>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<style lang="scss" module>
|
|
22
|
-
:is(.fieldset) {
|
|
23
|
-
display: grid;
|
|
24
|
-
gap: .5rem;
|
|
25
|
-
|
|
26
|
-
> fieldset {
|
|
27
|
-
display: contents;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:is(.legend) {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:is(.input) {
|
|
37
|
-
> * {
|
|
38
|
-
inline-size: 100%;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
viewBox="0 0 24 24"
|
|
4
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
>
|
|
6
|
-
<g>
|
|
7
|
-
<circle
|
|
8
|
-
cx="12"
|
|
9
|
-
cy="2.5"
|
|
10
|
-
r="1.5"
|
|
11
|
-
opacity=".14"
|
|
12
|
-
/><circle
|
|
13
|
-
cx="16.75"
|
|
14
|
-
cy="3.77"
|
|
15
|
-
r="1.5"
|
|
16
|
-
opacity=".29"
|
|
17
|
-
/><circle
|
|
18
|
-
cx="20.23"
|
|
19
|
-
cy="7.25"
|
|
20
|
-
r="1.5"
|
|
21
|
-
opacity=".43"
|
|
22
|
-
/>
|
|
23
|
-
<circle
|
|
24
|
-
cx="21.50"
|
|
25
|
-
cy="12.00"
|
|
26
|
-
r="1.5"
|
|
27
|
-
opacity=".57"
|
|
28
|
-
/>
|
|
29
|
-
<circle
|
|
30
|
-
cx="20.23"
|
|
31
|
-
cy="16.75"
|
|
32
|
-
r="1.5"
|
|
33
|
-
opacity=".71"
|
|
34
|
-
/>
|
|
35
|
-
<circle
|
|
36
|
-
cx="16.75"
|
|
37
|
-
cy="20.23"
|
|
38
|
-
r="1.5"
|
|
39
|
-
opacity=".86"
|
|
40
|
-
/>
|
|
41
|
-
<circle
|
|
42
|
-
cx="12"
|
|
43
|
-
cy="21.5"
|
|
44
|
-
r="1.5"
|
|
45
|
-
/>
|
|
46
|
-
<animateTransform
|
|
47
|
-
attributeName="transform"
|
|
48
|
-
type="rotate"
|
|
49
|
-
calcMode="discrete"
|
|
50
|
-
dur="0.75s"
|
|
51
|
-
values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12"
|
|
52
|
-
repeatCount="indefinite"
|
|
53
|
-
/>
|
|
54
|
-
</g>
|
|
55
|
-
</svg>
|
|
56
|
-
</template>
|