@stonecrop/beam 0.2.55 → 0.2.57
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/assets/index.css +1 -1
- package/dist/beam.js +690 -663
- package/dist/beam.js.map +1 -1
- package/dist/beam.umd.cjs +6 -6
- package/dist/beam.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionFooter.vue +16 -2
- package/src/components/BeamBtn.vue +18 -0
- package/src/components/BeamHeading.vue +12 -0
- package/src/components/BeamMetadata.vue +72 -0
- package/src/components/BeamModal.vue +16 -1
- package/src/components/Confirm.vue +24 -2
- package/src/components/ItemCount.vue +13 -0
- package/src/components/ListAnchor.vue +8 -0
- package/src/components/ListItem.vue +57 -1
- package/src/components/ListView.vue +15 -3
- package/src/components/Navbar.vue +26 -2
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<footer class="beam_action-footer">
|
|
3
3
|
<span class="footer-action-wrapper">
|
|
4
|
-
<
|
|
4
|
+
<BeamBtn @click="handleFooterAction">
|
|
5
5
|
<slot />
|
|
6
|
-
</
|
|
6
|
+
</BeamBtn>
|
|
7
7
|
</span>
|
|
8
8
|
</footer>
|
|
9
9
|
</template>
|
|
@@ -15,3 +15,17 @@ const handleFooterAction = () => {
|
|
|
15
15
|
emit('click')
|
|
16
16
|
}
|
|
17
17
|
</script>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.beam_action-footer {
|
|
21
|
+
margin-left: 0;
|
|
22
|
+
background: linear-gradient(180deg, transparent 0%, white 100%);
|
|
23
|
+
color: var(--sc-primary-text-color);
|
|
24
|
+
position: fixed;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
width: 100%;
|
|
28
|
+
padding: 0.625rem;
|
|
29
|
+
text-align: center;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -3,3 +3,21 @@
|
|
|
3
3
|
<slot>Action</slot>
|
|
4
4
|
</button>
|
|
5
5
|
</template>
|
|
6
|
+
|
|
7
|
+
<style scoped>
|
|
8
|
+
.beam_btn {
|
|
9
|
+
font-size: 0.875rem;
|
|
10
|
+
text-align: center;
|
|
11
|
+
padding: 0.3125rem 0.75rem;
|
|
12
|
+
border: 1px solid var(--sc-btn-border);
|
|
13
|
+
color: var(--sc-btn-label-color);
|
|
14
|
+
background-color: var(--sc-btn-color);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
font-family: var(--sc-font-family);
|
|
17
|
+
|
|
18
|
+
&:hover,
|
|
19
|
+
&:active {
|
|
20
|
+
background-color: var(--sc-btn-hover);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -3,3 +3,15 @@
|
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</h1>
|
|
5
5
|
</template>
|
|
6
|
+
|
|
7
|
+
<style scoped>
|
|
8
|
+
.beam_header {
|
|
9
|
+
border: 1px solid transparent;
|
|
10
|
+
text-align: left;
|
|
11
|
+
font-size: 1.125rem;
|
|
12
|
+
color: var(--sc-primary-text-color);
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
font-family: var(--sc-font-family);
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
@@ -36,3 +36,75 @@ defineProps<{
|
|
|
36
36
|
}
|
|
37
37
|
}>()
|
|
38
38
|
</script>
|
|
39
|
+
|
|
40
|
+
<style scoped>
|
|
41
|
+
.beam_metadata {
|
|
42
|
+
/* margin:3.125rem; */
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
border: 1px solid black;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
max-height: 100vh;
|
|
48
|
+
color: var(--sc-primary-text-color);
|
|
49
|
+
font-family: var(--sc-font-family);
|
|
50
|
+
}
|
|
51
|
+
.beam_metadata_content {
|
|
52
|
+
padding-top: 10px;
|
|
53
|
+
}
|
|
54
|
+
.beam_metadata_header {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
align-items: baseline;
|
|
58
|
+
padding: 0px 30px 0px 30px;
|
|
59
|
+
justify-content: space-between;
|
|
60
|
+
}
|
|
61
|
+
.beam_metadata_count {
|
|
62
|
+
font-size: 1.5rem;
|
|
63
|
+
|
|
64
|
+
& p {
|
|
65
|
+
margin: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.beam_metadata_header-order-num {
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
font-size: 1.5rem;
|
|
71
|
+
}
|
|
72
|
+
.beam_metadata_block {
|
|
73
|
+
padding: 0px 30px;
|
|
74
|
+
margin: 10px 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.beam_metadata_shipping {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: row;
|
|
80
|
+
align-items: baseline;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
|
|
83
|
+
& p {
|
|
84
|
+
line-height: 1.5rem;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
@media screen and (max-width: 600px) {
|
|
88
|
+
.beam_metadata_shipping {
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.beam_metadata_component_header {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: row;
|
|
96
|
+
justify-content: space-between;
|
|
97
|
+
align-items: baseline;
|
|
98
|
+
}
|
|
99
|
+
.beam_metadata_components {
|
|
100
|
+
overflow: scroll;
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
103
|
+
<style>
|
|
104
|
+
.beam_metadata_heading {
|
|
105
|
+
font-size: 1.125rem;
|
|
106
|
+
font-weight: bold;
|
|
107
|
+
margin: 0.625rem 0;
|
|
108
|
+
color: var(--sc-primary-text-color);
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<portal to="beam_modal_outlet">
|
|
3
3
|
<div class="beam_modal" v-show="showModal">
|
|
4
|
-
<
|
|
4
|
+
<BeamBtn @click="$emit('closemodal')">Close Modal</BeamBtn>
|
|
5
5
|
<slot @closemodal="$emit('closemodal')" @confirmmodal="$emit('confirmmodal')"></slot>
|
|
6
6
|
</div>
|
|
7
7
|
</portal>
|
|
@@ -10,3 +10,18 @@
|
|
|
10
10
|
<script setup lang="ts">
|
|
11
11
|
defineProps<{ showModal: boolean }>()
|
|
12
12
|
</script>
|
|
13
|
+
|
|
14
|
+
<style scoped>
|
|
15
|
+
.beam_modal {
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
22
|
+
backdrop-filter: blur(2px);
|
|
23
|
+
z-index: 1000;
|
|
24
|
+
text-align: center;
|
|
25
|
+
padding: 1.25rem;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="beam_modal-confirm">
|
|
3
3
|
<h2>Would you like to continue?</h2>
|
|
4
|
-
<
|
|
5
|
-
<
|
|
4
|
+
<BeamBtn @click="$emit('confirmmodal')">Yes</BeamBtn>
|
|
5
|
+
<BeamBtn @click="$emit('confirmmodal')">No</BeamBtn>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
|
+
|
|
9
|
+
<style scoped>
|
|
10
|
+
.beam_modal-confirm {
|
|
11
|
+
background: #ffffff;
|
|
12
|
+
padding: 1.25rem;
|
|
13
|
+
width: 80%;
|
|
14
|
+
max-width: 400px;
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 50%;
|
|
17
|
+
left: 50%;
|
|
18
|
+
transform: translate(-50%, -50%);
|
|
19
|
+
|
|
20
|
+
& button {
|
|
21
|
+
margin: 0.625rem;
|
|
22
|
+
}
|
|
23
|
+
& h2 {
|
|
24
|
+
border-bottom: 1px solid var(--sc-row-border-color);
|
|
25
|
+
padding-bottom: 0.625rem;
|
|
26
|
+
color: var(--sc-primary-text-color);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -40,3 +40,16 @@ const validate = (payload: ClipboardEvent | InputEvent | MouseEvent) => {
|
|
|
40
40
|
const debouncedRequest = useDebounceFn((payload: InputEvent) => validate(payload), debounce)
|
|
41
41
|
const debouncedValidate = async (payload: InputEvent) => await debouncedRequest(payload)
|
|
42
42
|
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped>
|
|
45
|
+
.beam_item-count {
|
|
46
|
+
font-size: 1.3125rem;
|
|
47
|
+
color: var(--sc-primary-text-color);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.beam_item-count span {
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -17,13 +17,69 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
|
-
import { ref } from 'vue'
|
|
20
|
+
import { ref, watch } from 'vue'
|
|
21
21
|
|
|
22
22
|
import ItemCount from '@/components/ItemCount.vue'
|
|
23
23
|
import ItemCheck from '@/components/ItemCheck.vue'
|
|
24
24
|
import type { ListViewItem } from '@/types'
|
|
25
25
|
|
|
26
26
|
const { item } = defineProps<{ item: ListViewItem }>()
|
|
27
|
+
const emit = defineEmits<{ update: [item: ListViewItem] }>()
|
|
27
28
|
|
|
28
29
|
const listItem = ref(item)
|
|
30
|
+
|
|
31
|
+
watch(
|
|
32
|
+
listItem,
|
|
33
|
+
value => {
|
|
34
|
+
emit('update', value)
|
|
35
|
+
},
|
|
36
|
+
{ deep: true }
|
|
37
|
+
)
|
|
29
38
|
</script>
|
|
39
|
+
|
|
40
|
+
<style scoped>
|
|
41
|
+
.beam_list-item {
|
|
42
|
+
padding: 0.625rem;
|
|
43
|
+
border-bottom: 1px solid var(--sc-row-border-color);
|
|
44
|
+
max-width: 100%;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-flow: row nowrap;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
gap: 1.25rem;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
outline: 2px solid transparent;
|
|
52
|
+
outline-offset: -1px;
|
|
53
|
+
|
|
54
|
+
&:focus {
|
|
55
|
+
outline: 2px solid var(--sc-focus-cell-outline);
|
|
56
|
+
background-color: var(--sc-focus-cell-background);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.beam_list-text {
|
|
61
|
+
width: 80%;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
flex-grow: 1;
|
|
66
|
+
font-size: 0.875rem;
|
|
67
|
+
color: var(--sc-primary-text-color);
|
|
68
|
+
|
|
69
|
+
& label,
|
|
70
|
+
& p {
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
width: 100%;
|
|
74
|
+
display: block;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.beam_list-item label {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.beam_list-item p {
|
|
83
|
+
margin: 0;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<li v-for="item in items" :key="item.label">
|
|
4
4
|
<template v-if="item.linkComponent">
|
|
5
5
|
<component :is="item.linkComponent" :to="item.route" tabindex="-1">
|
|
6
|
-
<ListItem :item="item"></ListItem>
|
|
6
|
+
<ListItem :item="item" @update="handleUpdate"></ListItem>
|
|
7
7
|
</component>
|
|
8
8
|
</template>
|
|
9
9
|
<template v-else>
|
|
10
|
-
<ListItem :item="item"></ListItem>
|
|
10
|
+
<ListItem :item="item" @update="handleUpdate"></ListItem>
|
|
11
11
|
</template>
|
|
12
12
|
</li>
|
|
13
13
|
</ul>
|
|
@@ -20,7 +20,7 @@ import ListItem from '@/components/ListItem.vue'
|
|
|
20
20
|
import type { ListViewItem } from '@/types'
|
|
21
21
|
|
|
22
22
|
defineProps<{ items: ListViewItem[] }>()
|
|
23
|
-
const emit = defineEmits<{ scrollbottom: [] }>()
|
|
23
|
+
const emit = defineEmits<{ update: [item: ListViewItem]; scrollbottom: [] }>()
|
|
24
24
|
|
|
25
25
|
onMounted(() => {
|
|
26
26
|
window.addEventListener('scroll', handleScroll)
|
|
@@ -30,6 +30,7 @@ onUnmounted(() => {
|
|
|
30
30
|
window.removeEventListener('scroll', handleScroll)
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
+
const handleUpdate = (item: ListViewItem) => emit('update', item)
|
|
33
34
|
const handleScroll = () => {
|
|
34
35
|
const scrollHeightDifference = document.documentElement.scrollHeight - window.innerHeight
|
|
35
36
|
const scrollposition = document.documentElement.scrollTop
|
|
@@ -38,3 +39,14 @@ const handleScroll = () => {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
</script>
|
|
42
|
+
|
|
43
|
+
<style scoped>
|
|
44
|
+
.beam_list-view {
|
|
45
|
+
list-style-type: none;
|
|
46
|
+
margin: var(--sc-list-margin);
|
|
47
|
+
padding: 0;
|
|
48
|
+
padding-bottom: 2.5em;
|
|
49
|
+
margin-top: 1px;
|
|
50
|
+
font-family: var(--sc-font-family);
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<slot name="title">
|
|
4
4
|
<BeamHeading>TITLE</BeamHeading>
|
|
5
5
|
</slot>
|
|
6
|
-
<
|
|
6
|
+
<BeamBtn @click="handlePrimaryAction">
|
|
7
7
|
<slot name="navbaraction">Action</slot>
|
|
8
|
-
</
|
|
8
|
+
</BeamBtn>
|
|
9
9
|
</nav>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
@@ -16,3 +16,27 @@ const handlePrimaryAction = () => {
|
|
|
16
16
|
emit('click')
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.beam_navbar {
|
|
22
|
+
padding: 0.625rem;
|
|
23
|
+
background-color: var(--sc-primary-color);
|
|
24
|
+
margin-left: 0;
|
|
25
|
+
min-height: 2em;
|
|
26
|
+
max-height: 2em;
|
|
27
|
+
color: var(--sc-primary-text-color);
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-flow: row nowrap;
|
|
30
|
+
align-content: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
align-items: center;
|
|
33
|
+
position: sticky;
|
|
34
|
+
top: 0;
|
|
35
|
+
font-family: var(--sc-font-family);
|
|
36
|
+
border-bottom: 1px solid var(--sc-row-border-color);
|
|
37
|
+
|
|
38
|
+
& h1 {
|
|
39
|
+
margin-left: 0.625rem;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</style>
|