@stonecrop/desktop 0.4.37 → 0.6.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.
@@ -9,7 +9,7 @@
9
9
  :style="{ display: breadcrumbsVisibile ? 'block' : 'none' }"
10
10
  @click="navigateHome"
11
11
  @keydown.enter="navigateHome">
12
- <router-link to="/home" tabindex="0">
12
+ <router-link to="/" tabindex="0">
13
13
  <svg
14
14
  id="Capa_1"
15
15
  version="1.1"
@@ -94,7 +94,7 @@ const toggleBreadcrumbs = () => {
94
94
  const toggleSearch = async () => {
95
95
  searchVisibile.value = !searchVisibile.value
96
96
  await nextTick(() => {
97
- inputRef.value.focus()
97
+ inputRef.value?.focus()
98
98
  })
99
99
  }
100
100
 
@@ -120,17 +120,22 @@ footer {
120
120
  bottom: 0px;
121
121
  width: 100%;
122
122
  background-color: transparent;
123
- height: 2rem;
123
+ height: auto; /* Allow footer to grow with content */
124
+ min-height: 2rem;
124
125
  z-index: 100;
125
126
  text-align: left;
126
127
  font-size: 100%;
127
128
  display: flex;
128
129
  justify-content: right;
129
- padding-bottom: 0.2rem;
130
+ padding-right: 2rem; /* Match view-wrapper horizontal padding */
131
+ box-sizing: border-box; /* Include padding in width calculation */
130
132
  }
131
133
  ul {
132
134
  display: flex;
133
135
  flex-direction: row-reverse;
136
+ margin: 0;
137
+ padding: 0;
138
+ list-style: none;
134
139
  }
135
140
 
136
141
  .tabs li {
@@ -144,7 +149,12 @@ ul {
144
149
  }
145
150
  .tabs a {
146
151
  float: left;
147
- padding: 1ch 4ch 4ch 4ch;
152
+ padding: 0.5rem 1.5rem; /* Reduced padding for reasonable tab height */
153
+ height: 2.25rem; /* Fixed height for consistency across all tabs */
154
+ box-sizing: border-box; /* Include padding in height calculation */
155
+ display: flex;
156
+ align-items: center;
157
+ justify-content: center;
148
158
  text-decoration: none;
149
159
  color: black;
150
160
  background: #aaa;
@@ -243,14 +253,16 @@ ul {
243
253
  right: -20px;
244
254
  }
245
255
  .hidebreadcrumbs a {
246
- width: 1ch;
247
- min-width: calc(66px - 4ch);
256
+ min-width: 2.5rem;
257
+ width: 2.5rem;
258
+ height: 2.25rem; /* Fixed height for consistency */
248
259
  background-color: #ffffff;
249
- padding-left: 2ch;
250
- padding-right: 2ch;
251
- padding-top: 3px;
252
- font-size: 150%;
260
+ padding: 0.5rem;
261
+ font-size: 1.25rem;
253
262
  text-align: center;
263
+ display: flex;
264
+ align-items: center;
265
+ justify-content: center;
254
266
  }
255
267
  .rotated {
256
268
  /* border: 1px solid red; */
@@ -286,38 +298,39 @@ a:focus {
286
298
  z-index: 3;
287
299
  }
288
300
  .hometab a {
289
- width: 1ch;
290
- min-width: calc(66px - 4ch);
301
+ min-width: 2.5rem;
302
+ height: 2.25rem; /* Fixed height for consistency */
291
303
  background-color: #ffffff;
292
- padding-left: 2ch;
293
- padding-right: 2ch;
294
- padding-top: 6px;
304
+ padding: 0.5rem;
295
305
  text-align: center;
306
+ display: flex;
307
+ align-items: center;
308
+ justify-content: center;
296
309
  }
297
310
  .hometab svg {
298
- height: 14pt;
299
- width: 14pt;
311
+ height: 1rem;
312
+ width: 1rem;
300
313
  }
301
314
  .searchtab a {
302
- /* width: 100%; */
303
- min-width: calc(66px - 4ch);
315
+ min-width: 2.5rem;
316
+ height: 2.25rem; /* Fixed height for consistency */
304
317
  background-color: #ffffff;
305
- padding-left: 2ch;
306
- padding-right: 2ch;
307
- padding-top: 11px;
308
- font-size: 150%;
318
+ padding: 0.5rem;
319
+ display: flex;
309
320
  align-items: center;
321
+ justify-content: center;
310
322
  }
311
323
  .searchtab svg {
312
- padding-left: 0.25ch;
324
+ width: 0.875rem;
325
+ height: 0.875rem;
313
326
  }
314
327
  .searchtab input {
315
- margin-top: -4px;
316
328
  outline: none;
317
329
  border: none;
318
330
  border-bottom: 1.5px solid black;
319
331
  background-color: transparent;
320
332
  text-align: right;
321
- font-size: 11pt;
333
+ font-size: 0.875rem;
334
+ padding: 0.25rem;
322
335
  }
323
336
  </style>
package/src/index.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import ActionSet from './components/ActionSet.vue'
2
2
  import CommandPalette from './components/CommandPalette.vue'
3
- import Doctype from './components/Doctype.vue'
4
- import Records from './components/Records.vue'
3
+ import Desktop from './components/Desktop.vue'
5
4
  import SheetNav from './components/SheetNav.vue'
6
5
  import StonecropDesktop from './plugins'
7
6
  export type * from './types'
8
7
 
9
- export { ActionSet, CommandPalette, Doctype, Records, SheetNav, StonecropDesktop }
8
+ export { ActionSet, CommandPalette, Desktop, SheetNav, StonecropDesktop }
@@ -2,8 +2,7 @@ import { App, type Plugin } from 'vue'
2
2
 
3
3
  import ActionSet from '../components/ActionSet.vue'
4
4
  import CommandPalette from '../components/CommandPalette.vue'
5
- import Doctype from '../components/Doctype.vue'
6
- import Records from '../components/Records.vue'
5
+ import Desktop from '../components/Desktop.vue'
7
6
  import SheetNav from '../components/SheetNav.vue'
8
7
 
9
8
  /**
@@ -14,8 +13,7 @@ const plugin: Plugin = {
14
13
  install: (app: App) => {
15
14
  app.component('ActionSet', ActionSet)
16
15
  app.component('CommandPalette', CommandPalette)
17
- app.component('Doctype', Doctype)
18
- app.component('Records', Records)
16
+ app.component('Desktop', Desktop)
19
17
  app.component('SheetNav', SheetNav)
20
18
  },
21
19
  }
@@ -23,6 +23,7 @@ export type ElementAction = BaseElement & {
23
23
  export type ButtonElement = BaseElement &
24
24
  ElementAction & {
25
25
  type: 'button'
26
+ disabled?: boolean
26
27
  }
27
28
 
28
29
  /**
@@ -1,45 +0,0 @@
1
- <template>
2
- <AForm v-model="schema" class="aform-main" />
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'
11
- import { /* DoctypeMeta, */ useStonecrop } from '@stonecrop/stonecrop'
12
-
13
- const { stonecrop } = useStonecrop()
14
- const schema = ref<SchemaTypes[]>([])
15
-
16
- watch(stonecrop, () => {
17
- if (stonecrop.value) {
18
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
19
- let newSchema = stonecrop.value.schema?.schema.toArray()
20
- if (!newSchema) {
21
- newSchema = []
22
- }
23
-
24
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
25
- newSchema.forEach((item, index) => {
26
- const record = stonecrop.value?.store.record
27
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
28
- const fieldValue = record?.[item.fieldname]
29
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
30
- newSchema[index].value = fieldValue
31
- })
32
-
33
- schema.value = newSchema
34
- }
35
- })
36
-
37
- // const route = useRoute()
38
- // const doctypeSlug = route.params.records?.toString().toLowerCase()
39
- // const recordId = route.params.record?.toString().toLowerCase()
40
-
41
- // const saveRecord = async () => {
42
- // const doctype: DoctypeMeta = await stonecrop.value.registry.getMeta(doctypeSlug)
43
- // stonecrop.value.runAction(doctype, 'save', recordId ? [recordId] : [])
44
- // }
45
- </script>
@@ -1,20 +0,0 @@
1
- <template>
2
- <ATable v-model:rows="rows" v-model:columns="columns" :config="config" />
3
- </template>
4
-
5
- <script setup lang="ts">
6
- import { ATable, TableColumn } from '@stonecrop/atable'
7
- import { useStonecrop } from '@stonecrop/stonecrop'
8
- import { computed } from 'vue'
9
-
10
- // TODO: use component if provided else call to Records Schema endpoint/ table / lookup
11
- // alteratively: a view: component map, eg records: Records, gantt: GanttView
12
- // default_view key in schema
13
- // last_used_view_type in application state
14
-
15
- const { stonecrop } = useStonecrop()
16
- const rows = computed(() => stonecrop.value?.store.records)
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
18
- const columns = computed((): TableColumn[] => stonecrop.value?.schema?.schema?.toArray())
19
- const config = { view: 'list' }
20
- </script>