@stonecrop/desktop 0.2.5
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 +11 -0
- package/dist/desktop.js +4967 -0
- package/dist/desktop.js.map +1 -0
- package/dist/desktop.umd.cjs +45 -0
- package/dist/desktop.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +54 -0
- package/src/components/ActionSet.vue +271 -0
- package/src/components/CommandPalette.vue +5 -0
- package/src/components/Desktop.vue +8 -0
- package/src/components/Doctype.vue +37 -0
- package/src/components/Records.vue +20 -0
- package/src/components/SheetNav.vue +330 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#chevron[data-v-b7fdfbec]{position:relative;transform:rotate(90deg)}.leftBar[data-v-b7fdfbec],.rightBar[data-v-b7fdfbec]{transition-duration:.225s;transition-property:transform}.leftBar[data-v-b7fdfbec],.action-set.collapse.hovered-and-closed:hover .leftBar[data-v-b7fdfbec]{transform-origin:33.4% 50%;transform:rotate(90deg)}.rightBar[data-v-b7fdfbec],.action-set.collapse.hovered-and-closed:hover .rightBar[data-v-b7fdfbec]{transform-origin:67% 50%;transform:rotate(-90deg)}.rightBar[data-v-b7fdfbec]{position:absolute;top:0;left:0}.action-set.collapse:hover .leftBar[data-v-b7fdfbec],.action-set.collapse:hover .rightBar[data-v-b7fdfbec]{transform:rotate(0)}.action-set[data-v-b7fdfbec]{position:fixed;top:10px;right:10px;padding:20px;box-shadow:0 1px 2px #1927340d,0 0 4px #1927341a;border-radius:10px;display:flex;flex-direction:row-reverse;background-color:#fff;overflow:hidden}.action-menu-icon[data-v-b7fdfbec]{position:absolute;top:6px;right:8px}.action-menu-icon svg[data-v-b7fdfbec]{fill:#333}.action-set.collapse[data-v-b7fdfbec],.action-set.collapse.hovered-and-closed[data-v-b7fdfbec]:hover{max-width:25px;overflow:hidden;-webkit-transition:max-width .5s ease-in-out;-moz-transition:max-width .5s ease-in-out;-o-transition:max-width .5s ease-in-out;transition:max-width .5s ease-in-out}.action-set.collapse .action-element[data-v-b7fdfbec],.action-set.collapse.hovered-and-closed:hover .action-element[data-v-b7fdfbec]{opacity:0;-webkit-transition:opacity .25s ease-in-out;-moz-transition:opacity .25s ease-in-out;-o-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out;transition-delay:0s}.action-set.collapse[data-v-b7fdfbec]:hover{max-width:500px}.action-set.collapse.open-set[data-v-b7fdfbec]:hover{overflow:visible!important}.action-set.collapse.hovered-and-closed:hover .action-element[data-v-b7fdfbec]{opacity:0!important}.action-set.collapse:hover .action-element[data-v-b7fdfbec]{opacity:100!important}.action-element[data-v-b7fdfbec]{margin-left:5px;margin-right:5px}button.button-default[data-v-b7fdfbec]{background-color:#fff;padding:5px 12px;border-radius:3px;box-shadow:#0000000d 0 .5px,#00000014 0 0 0 1px,#0000000d 0 2px 4px;border:none;cursor:pointer;white-space:nowrap}button.button-default[data-v-b7fdfbec]:hover{background-color:#f2f2f2}.dropdown-container[data-v-b7fdfbec]{position:relative}.dropdown[data-v-b7fdfbec]{position:absolute;top:5px;right:0;min-width:200px;box-shadow:0 .5rem 1rem #0000002e;border-radius:10px;background-color:#fff;padding:10px}button.dropdown-item[data-v-b7fdfbec]{width:100%;padding:8px 5px;text-align:left;border:none;background-color:#fff;cursor:pointer;border-radius:5px}button.dropdown-item[data-v-b7fdfbec]:hover{background-color:#f2f2f2}footer[data-v-18bfde6e]{position:fixed;bottom:0;width:100%;background-color:transparent;height:2rem;z-index:100;text-align:left;font-size:100%;display:flex;justify-content:right;padding-bottom:.2rem}ul[data-v-18bfde6e]{display:flex;flex-direction:row-reverse}.tabs li[data-v-18bfde6e]{float:left;list-style-type:none;position:relative;margin-left:-1px}.tabs a[data-v-18bfde6e]{float:left;padding:1ch 4ch 4ch;text-decoration:none;color:#000;background:#aaa;outline:2px solid inherit;outline-offset:-2px;-webkit-border-top-left-radius:15px;-webkit-border-top-right-radius:15px;-moz-border-radius-topleft:15px;-moz-border-radius-topright:15px;border-top-left-radius:15px;border-top-right-radius:15px;border:1px solid #ccc}.tabs .router-link-active[data-v-18bfde6e]{z-index:3}.router-link-active[data-v-18bfde6e]{background:#827553;color:#000;box-shadow:#999}.tabs li[data-v-18bfde6e]:before,.tabs li[data-v-18bfde6e]:after,.tabs li a[data-v-18bfde6e]:before,.tabs li a[data-v-18bfde6e]:after{position:absolute;bottom:0}.tabs li[data-v-18bfde6e]:last-child:after,.tabs li:last-child a[data-v-18bfde6e]:after,.tabs li[data-v-18bfde6e]:first-child:before,.tabs li:first-child a[data-v-18bfde6e]:before,.tabs .router-link-active[data-v-18bfde6e]:after,.tabs .router-link-active[data-v-18bfde6e]:before,.tabs .router-link-active a[data-v-18bfde6e]:after,.tabs .router-link-active a[data-v-18bfde6e]:before{content:""}.tabs .router-link-active[data-v-18bfde6e]:before,.tabs .router-link-active[data-v-18bfde6e]:after{background:transparent;z-index:1}.tabs li[data-v-18bfde6e]:before,.tabs li[data-v-18bfde6e]:after{background:transparent;width:10px;height:10px}.tabs li[data-v-18bfde6e]:before{left:-10px}.tabs li[data-v-18bfde6e]:after{right:-10px}.tabs li a[data-v-18bfde6e]:after,.tabs li a[data-v-18bfde6e]:before{width:20px;height:20px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;background:transparent;z-index:2}.tabs .router-link-active a[data-v-18bfde6e]:after,.tabs .router-link-active a[data-v-18bfde6e]:before{background:transparent}.tabs li:first-child.router-link-active a[data-v-18bfde6e]:before,.tabs li:last-child.router-link-active a[data-v-18bfde6e]:after{background:transparent}.tabs li a[data-v-18bfde6e]:before{left:-20px}.tabs li a[data-v-18bfde6e]:after{right:-20px}.hidebreadcrumbs a[data-v-18bfde6e]{width:1ch;min-width:calc(66px - 4ch);background-color:#fff;padding-left:2ch;padding-right:2ch;padding-top:3px;font-size:150%;text-align:center}.rotated[data-v-18bfde6e]{transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transition:transform .25s}.unrotated[data-v-18bfde6e]{transform:rotate(0);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform .25s}li[data-v-18bfde6e]:active,li[data-v-18bfde6e]:hover,li[data-v-18bfde6e]:focus,li>a[data-v-18bfde6e]:active,li>a[data-v-18bfde6e]:hover,li>a[data-v-18bfde6e]:focus{z-index:3}a[data-v-18bfde6e]:active,a[data-v-18bfde6e]:hover,a[data-v-18bfde6e]:focus{outline:2px solid black;z-index:3}.hometab a[data-v-18bfde6e]{width:1ch;min-width:calc(66px - 4ch);background-color:#fff;padding-left:2ch;padding-right:2ch;padding-top:6px;text-align:center}.hometab svg[data-v-18bfde6e]{height:14pt;width:14pt}.searchtab a[data-v-18bfde6e]{min-width:calc(66px - 4ch);background-color:#fff;padding-left:2ch;padding-right:2ch;padding-top:11px;font-size:150%;align-items:center}.searchtab svg[data-v-18bfde6e]{padding-left:.25ch}.searchtab input[data-v-18bfde6e]{margin-top:-4px;outline:none;border:none;border-bottom:1.5px solid black;background-color:transparent;text-align:right;font-size:11pt}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stonecrop/desktop",
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "desktop specific components for Stonecrop UI",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/desktop.js",
|
|
10
|
+
"require": "./dist/desktop.umd.cjs"
|
|
11
|
+
},
|
|
12
|
+
"./styles": "./dist/style.css"
|
|
13
|
+
},
|
|
14
|
+
"main": "dist/desktop.js",
|
|
15
|
+
"module": "dist/desktop.js",
|
|
16
|
+
"types": "src/index",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/*",
|
|
19
|
+
"src/**/*.vue"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"immutable": "^4.3.0",
|
|
23
|
+
"vue": "^3.2.47",
|
|
24
|
+
"xstate": "~4.37.2",
|
|
25
|
+
"@stonecrop/aform": "0.2.5",
|
|
26
|
+
"@stonecrop/atable": "0.2.5",
|
|
27
|
+
"@stonecrop/stonecrop": "0.2.5",
|
|
28
|
+
"@stonecrop/themes": "0.2.5"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@miragejs/graphql": "^0.1.13",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
33
|
+
"@typescript-eslint/parser": "^5.59.5",
|
|
34
|
+
"@vitejs/plugin-vue": "^4.2.1",
|
|
35
|
+
"eslint": "^8.40.0",
|
|
36
|
+
"eslint-config-prettier": "^8.8.0",
|
|
37
|
+
"eslint-plugin-vue": "^9.11.1",
|
|
38
|
+
"miragejs": "^0.1.47",
|
|
39
|
+
"typescript": "^5.0.4",
|
|
40
|
+
"vite": "^4.3.5",
|
|
41
|
+
"vue-router": "^4"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=20.11.0"
|
|
45
|
+
},
|
|
46
|
+
"umd": "dist/desktop.umd.cjs",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "vite build",
|
|
49
|
+
"dev": "vite",
|
|
50
|
+
"lint": "eslint . --ext .ts,.vue",
|
|
51
|
+
"story:build": "vite build stories/ -c stories/vite.config.ts",
|
|
52
|
+
"story:dev": "vite dev stories/ -c stories/vite.config.ts"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }"
|
|
4
|
+
class="action-set collapse"
|
|
5
|
+
@mouseover="onHover"
|
|
6
|
+
@mouseleave="onHoverLeave">
|
|
7
|
+
<div class="action-menu-icon">
|
|
8
|
+
<div id="chevron" @click="closeClicked = !closeClicked">
|
|
9
|
+
<svg
|
|
10
|
+
class="leftBar"
|
|
11
|
+
version="1.1"
|
|
12
|
+
id="Layer_1"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
15
|
+
x="0px"
|
|
16
|
+
y="0px"
|
|
17
|
+
viewBox="0 0 100 100"
|
|
18
|
+
xml:space="preserve"
|
|
19
|
+
width="50"
|
|
20
|
+
height="50">
|
|
21
|
+
<polygon points="54.2,33.4 29.2,58.8 25,54.6 50,29.2 " />
|
|
22
|
+
</svg>
|
|
23
|
+
|
|
24
|
+
<svg
|
|
25
|
+
class="rightBar"
|
|
26
|
+
version="1.1"
|
|
27
|
+
id="Layer_1"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
30
|
+
x="0px"
|
|
31
|
+
y="0px"
|
|
32
|
+
viewBox="0 0 100 100"
|
|
33
|
+
xml:space="preserve"
|
|
34
|
+
width="50"
|
|
35
|
+
height="50">
|
|
36
|
+
<polygon points="70.8,58.8 45.8,33.4 50,29.2 75,54.6 " />
|
|
37
|
+
</svg>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div style="margin-right: 30px"></div>
|
|
41
|
+
<div class="action-element" v-for="(el, index) in _elements" :key="index">
|
|
42
|
+
<button v-if="el.elementType == 'button'" :onclick="el.action" class="button-default">{{ el.label }}</button>
|
|
43
|
+
<div v-if="el.elementType == 'dropdown'">
|
|
44
|
+
<button class="button-default" @click="toggleDropdown(index)">{{ el.label }}</button>
|
|
45
|
+
<div class="dropdown-container" v-show="el.show">
|
|
46
|
+
<div class="dropdown">
|
|
47
|
+
<div v-for="item in el.actions" :key="item.label">
|
|
48
|
+
<button v-if="item.action != null" :onclick="item.action" class="dropdown-item">{{ item.label }}</button>
|
|
49
|
+
<a v-else-if="item.link != null" :href="item.link"
|
|
50
|
+
><button class="dropdown-item">{{ item.label }}</button></a
|
|
51
|
+
>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { onMounted, ref } from 'vue'
|
|
62
|
+
|
|
63
|
+
type SetAction = {
|
|
64
|
+
label: string
|
|
65
|
+
link?: string
|
|
66
|
+
action?: () => void
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type SetElement = {
|
|
70
|
+
elementType: string
|
|
71
|
+
label: string
|
|
72
|
+
link?: string
|
|
73
|
+
show?: boolean
|
|
74
|
+
action?: () => void
|
|
75
|
+
actions?: SetAction[]
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const props = defineProps<{
|
|
79
|
+
elements?: SetElement[]
|
|
80
|
+
}>()
|
|
81
|
+
|
|
82
|
+
const _elements = ref<SetElement[]>([])
|
|
83
|
+
const isOpen = ref(false)
|
|
84
|
+
const timeout = ref<NodeJS.Timeout>(null)
|
|
85
|
+
const hover = ref(false)
|
|
86
|
+
const closeClicked = ref(false)
|
|
87
|
+
|
|
88
|
+
onMounted(() => {
|
|
89
|
+
_elements.value = props.elements
|
|
90
|
+
closeDropdowns()
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const closeDropdowns = () => {
|
|
94
|
+
for (let element of _elements.value) {
|
|
95
|
+
if (element.elementType === 'dropdown') {
|
|
96
|
+
element.show = false
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const onHover = () => {
|
|
102
|
+
hover.value = true
|
|
103
|
+
timeout.value = setTimeout(() => {
|
|
104
|
+
if (hover.value) {
|
|
105
|
+
isOpen.value = true
|
|
106
|
+
}
|
|
107
|
+
}, 500)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const onHoverLeave = () => {
|
|
111
|
+
hover.value = false
|
|
112
|
+
closeClicked.value = false
|
|
113
|
+
clearTimeout(timeout.value)
|
|
114
|
+
isOpen.value = false
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const toggleDropdown = (index: number) => {
|
|
118
|
+
const showDropdown = !_elements.value[index].show
|
|
119
|
+
closeDropdowns()
|
|
120
|
+
_elements.value[index].show = showDropdown
|
|
121
|
+
}
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style scoped>
|
|
125
|
+
#chevron {
|
|
126
|
+
position: relative;
|
|
127
|
+
transform: rotate(90deg);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.leftBar,
|
|
131
|
+
.rightBar {
|
|
132
|
+
transition-duration: 0.225s;
|
|
133
|
+
transition-property: transform;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.leftBar,
|
|
137
|
+
.action-set.collapse.hovered-and-closed:hover .leftBar {
|
|
138
|
+
transform-origin: 33.4% 50%;
|
|
139
|
+
transform: rotate(90deg);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.rightBar,
|
|
143
|
+
.action-set.collapse.hovered-and-closed:hover .rightBar {
|
|
144
|
+
transform-origin: 67% 50%;
|
|
145
|
+
transform: rotate(-90deg);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.rightBar {
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 0;
|
|
151
|
+
left: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.action-set.collapse:hover .leftBar {
|
|
155
|
+
transform: rotate(0);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.action-set.collapse:hover .rightBar {
|
|
159
|
+
transform: rotate(0);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.action-set {
|
|
163
|
+
position: fixed;
|
|
164
|
+
top: 10px;
|
|
165
|
+
right: 10px;
|
|
166
|
+
padding: 20px;
|
|
167
|
+
box-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);
|
|
168
|
+
border-radius: 10px;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: row-reverse;
|
|
171
|
+
background-color: white;
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.action-menu-icon {
|
|
176
|
+
position: absolute;
|
|
177
|
+
top: 6px;
|
|
178
|
+
right: 8px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.action-menu-icon svg {
|
|
182
|
+
fill: #333333;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.action-set.collapse,
|
|
186
|
+
.action-set.collapse.hovered-and-closed:hover {
|
|
187
|
+
max-width: 25px;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
|
|
190
|
+
-webkit-transition: max-width 0.5s ease-in-out;
|
|
191
|
+
-moz-transition: max-width 0.5s ease-in-out;
|
|
192
|
+
-o-transition: max-width 0.5s ease-in-out;
|
|
193
|
+
transition: max-width 0.5s ease-in-out;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.action-set.collapse .action-element,
|
|
197
|
+
.action-set.collapse.hovered-and-closed:hover .action-element {
|
|
198
|
+
opacity: 0;
|
|
199
|
+
-webkit-transition: opacity 0.25s ease-in-out;
|
|
200
|
+
-moz-transition: opacity 0.25s ease-in-out;
|
|
201
|
+
-o-transition: opacity 0.25s ease-in-out;
|
|
202
|
+
transition: opacity 0.25s ease-in-out;
|
|
203
|
+
transition-delay: 0s;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.action-set.collapse:hover {
|
|
207
|
+
max-width: 500px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.action-set.collapse.open-set:hover {
|
|
211
|
+
overflow: visible !important;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.action-set.collapse.hovered-and-closed:hover .action-element {
|
|
215
|
+
opacity: 0 !important;
|
|
216
|
+
/* transition-delay: 0.5s; */
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.action-set.collapse:hover .action-element {
|
|
220
|
+
opacity: 100 !important;
|
|
221
|
+
/* transition-delay: 0.5s; */
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.action-element {
|
|
225
|
+
margin-left: 5px;
|
|
226
|
+
margin-right: 5px;
|
|
227
|
+
}
|
|
228
|
+
button.button-default {
|
|
229
|
+
background-color: #ffffff;
|
|
230
|
+
padding: 5px 12px;
|
|
231
|
+
border-radius: 3px;
|
|
232
|
+
box-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,
|
|
233
|
+
rgba(0, 0, 0, 0.05) 0px 2px 4px 0px;
|
|
234
|
+
border: none;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
button.button-default:hover {
|
|
240
|
+
background-color: #f2f2f2;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.dropdown-container {
|
|
244
|
+
position: relative;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.dropdown {
|
|
248
|
+
position: absolute;
|
|
249
|
+
top: 5px;
|
|
250
|
+
right: 0;
|
|
251
|
+
min-width: 200px;
|
|
252
|
+
box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);
|
|
253
|
+
border-radius: 10px;
|
|
254
|
+
background-color: #ffffff;
|
|
255
|
+
padding: 10px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
button.dropdown-item {
|
|
259
|
+
width: 100%;
|
|
260
|
+
padding: 8px 5px;
|
|
261
|
+
text-align: left;
|
|
262
|
+
border: none;
|
|
263
|
+
background-color: #ffffff;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
border-radius: 5px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
button.dropdown-item:hover {
|
|
269
|
+
background-color: #f2f2f2;
|
|
270
|
+
}
|
|
271
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AForm v-if="isReady" class="aform-main" v-model="schema" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { ref, watch } from 'vue'
|
|
7
|
+
import { useRoute } from 'vue-router'
|
|
8
|
+
|
|
9
|
+
import { AForm } from '@stonecrop/aform'
|
|
10
|
+
import type { SchemaTypes } from '@stonecrop/aform/types'
|
|
11
|
+
import { DoctypeMeta, useStonecrop } from '@stonecrop/stonecrop'
|
|
12
|
+
|
|
13
|
+
const { stonecrop, isReady } = useStonecrop()
|
|
14
|
+
const schema = ref<SchemaTypes[]>([])
|
|
15
|
+
|
|
16
|
+
watch(isReady, () => {
|
|
17
|
+
if (isReady.value) {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
19
|
+
let newSchema: SchemaTypes[] = stonecrop.value.schema.schema.toArray()
|
|
20
|
+
newSchema.forEach((item, index) => {
|
|
21
|
+
const record = stonecrop.value.store.record
|
|
22
|
+
const fieldValue = record[item.fieldname]
|
|
23
|
+
newSchema[index].value = fieldValue
|
|
24
|
+
})
|
|
25
|
+
schema.value = newSchema
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// const route = useRoute()
|
|
30
|
+
// const doctypeSlug = route.params.records?.toString().toLowerCase()
|
|
31
|
+
// const recordId = route.params.record?.toString().toLowerCase()
|
|
32
|
+
|
|
33
|
+
// const saveRecord = async () => {
|
|
34
|
+
// const doctype: DoctypeMeta = await stonecrop.value.registry.getMeta(doctypeSlug)
|
|
35
|
+
// stonecrop.value.runAction(doctype, 'save', recordId ? [recordId] : [])
|
|
36
|
+
// }
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ATable
|
|
3
|
+
v-if="isReady"
|
|
4
|
+
:columns="stonecrop.schema.schema.toArray()"
|
|
5
|
+
:rows="stonecrop.store.records"
|
|
6
|
+
:config="config" />
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { ATable } from '@stonecrop/atable'
|
|
11
|
+
import { useStonecrop } from '@stonecrop/stonecrop'
|
|
12
|
+
|
|
13
|
+
// TODO: use component if provided else call to Records Schema endpoint/ table / lookup
|
|
14
|
+
// alteratively: a view: component map, eg records: Records, gantt: GanttView
|
|
15
|
+
// default_view key in schema
|
|
16
|
+
// last_used_view_type in application state
|
|
17
|
+
|
|
18
|
+
const { stonecrop, isReady } = useStonecrop()
|
|
19
|
+
const config = { view: 'list' }
|
|
20
|
+
</script>
|