@jskit-ai/users-web 0.1.178-oldline.2 → 0.1.178

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.
Files changed (124) hide show
  1. package/package.json +197 -45
  2. package/patterns/account-settings/PATTERN.md +61 -0
  3. package/src/client/bootstrap/user-bootstrap-handler.js +2 -12
  4. package/src/client/composables/account-settings/accountSettingsAvatarUploadRuntime.js +2 -2
  5. package/src/client/composables/useAccountSettingsRuntime.js +3 -3
  6. package/src/client/index.js +0 -16
  7. package/src/client/providers/UsersWebClientProvider.js +13 -14
  8. package/test/bootstrap.test.js +6 -41
  9. package/test/exportsContract.test.js +3 -29
  10. package/test/packageMetadataOwnership.test.js +19 -0
  11. package/test/settingsPlacementContract.test.js +93 -405
  12. package/fixtures/crud-list-date-filters/App.vue +0 -107
  13. package/fixtures/crud-list-date-filters/index.html +0 -12
  14. package/fixtures/crud-list-date-filters/main.js +0 -24
  15. package/fixtures/crud-list-date-filters/vite.config.mjs +0 -18
  16. package/package.descriptor.mjs +0 -468
  17. package/src/client/bulkActions.js +0 -47
  18. package/src/client/components/CrudAddEditScreen.vue +0 -186
  19. package/src/client/components/CrudListBulkActionSurface.vue +0 -126
  20. package/src/client/components/CrudListDateFilterControl.vue +0 -188
  21. package/src/client/components/CrudListFilterSurface.vue +0 -388
  22. package/src/client/components/CrudListRecordActionMenu.vue +0 -120
  23. package/src/client/components/CrudListScreen.vue +0 -501
  24. package/src/client/components/CrudViewScreen.vue +0 -197
  25. package/src/client/composables/crud/crudBindingSupport.js +0 -75
  26. package/src/client/composables/crud/crudHttpClientSupport.js +0 -57
  27. package/src/client/composables/crud/crudJsonApiTransportSupport.js +0 -145
  28. package/src/client/composables/crud/crudLookupFieldLabelSupport.js +0 -151
  29. package/src/client/composables/crud/crudLookupFieldRuntime.js +0 -251
  30. package/src/client/composables/crud/crudSchemaFormHelpers.js +0 -464
  31. package/src/client/composables/internal/crudListFilterLookupSupport.js +0 -161
  32. package/src/client/composables/internal/crudListParentTitleSupport.js +0 -171
  33. package/src/client/composables/internal/useOperationScope.js +0 -144
  34. package/src/client/composables/records/useAddEdit.js +0 -224
  35. package/src/client/composables/records/useCrudAddEdit.js +0 -227
  36. package/src/client/composables/records/useCrudList.js +0 -101
  37. package/src/client/composables/records/useCrudView.js +0 -47
  38. package/src/client/composables/records/useList.js +0 -500
  39. package/src/client/composables/records/useView.js +0 -164
  40. package/src/client/composables/runtime/addEditUiRuntime.js +0 -130
  41. package/src/client/composables/runtime/listUiRuntime.js +0 -123
  42. package/src/client/composables/runtime/modelStateHelpers.js +0 -90
  43. package/src/client/composables/runtime/operationAdapters.js +0 -34
  44. package/src/client/composables/runtime/operationUiHelpers.js +0 -125
  45. package/src/client/composables/runtime/operationValidationHelpers.js +0 -51
  46. package/src/client/composables/runtime/useAddEditCore.js +0 -112
  47. package/src/client/composables/runtime/useCommandCore.js +0 -123
  48. package/src/client/composables/runtime/useEndpointResource.js +0 -199
  49. package/src/client/composables/runtime/useFieldErrorBag.js +0 -61
  50. package/src/client/composables/runtime/useListCore.js +0 -112
  51. package/src/client/composables/runtime/useUiFeedback.js +0 -98
  52. package/src/client/composables/runtime/useViewCore.js +0 -93
  53. package/src/client/composables/runtime/viewUiRuntime.js +0 -96
  54. package/src/client/composables/support/errorMessageHelpers.js +0 -66
  55. package/src/client/composables/support/listQueryParamSupport.js +0 -473
  56. package/src/client/composables/support/listSearchSupport.js +0 -70
  57. package/src/client/composables/support/refValueHelpers.js +0 -19
  58. package/src/client/composables/support/requestQueryRuntimeSupport.js +0 -141
  59. package/src/client/composables/support/resourceLoadStateHelpers.js +0 -229
  60. package/src/client/composables/support/routeTemplateHelpers.js +0 -285
  61. package/src/client/composables/support/scopeHelpers.js +0 -145
  62. package/src/client/composables/useAccess.js +0 -109
  63. package/src/client/composables/useCommand.js +0 -118
  64. package/src/client/composables/useCrudAddEditScreen.js +0 -88
  65. package/src/client/composables/useCrudDeleteAction.js +0 -160
  66. package/src/client/composables/useCrudListBulkActions.js +0 -147
  67. package/src/client/composables/useCrudListFilterLookups.js +0 -146
  68. package/src/client/composables/useCrudListFilters.js +0 -339
  69. package/src/client/composables/useCrudListParentTitle.js +0 -151
  70. package/src/client/composables/useCrudListRowActions.js +0 -144
  71. package/src/client/composables/useCrudListScreen.js +0 -237
  72. package/src/client/composables/useCrudViewScreen.js +0 -77
  73. package/src/client/composables/usePagedCollection.js +0 -181
  74. package/src/client/composables/usePaths.js +0 -120
  75. package/src/client/composables/useRealtimeQueryInvalidation.js +0 -156
  76. package/src/client/composables/useScopeRuntime.js +0 -135
  77. package/src/client/composables/useSurfaceRouteContext.js +0 -25
  78. package/src/client/filters.js +0 -15
  79. package/src/client/lib/httpClient.js +0 -47
  80. package/src/client/lib/permissions.js +0 -34
  81. package/src/client/rowActions.js +0 -47
  82. package/src/client/support/contractGuards.js +0 -34
  83. package/src/client/support/crudListDateFilterSupport.js +0 -91
  84. package/test/addEditUiRuntime.test.js +0 -110
  85. package/test/crudBindingSupport.test.js +0 -110
  86. package/test/crudHttpClientSupport.test.js +0 -77
  87. package/test/crudJsonApiTransportSupport.test.js +0 -179
  88. package/test/crudListBulkActionSurface.test.js +0 -27
  89. package/test/crudListDateFilterSupport.test.js +0 -92
  90. package/test/crudListDateFilterSurface.browser.test.js +0 -273
  91. package/test/crudListFilterSurface.test.js +0 -90
  92. package/test/crudLookupFieldRuntime.test.js +0 -264
  93. package/test/crudScreenComponents.test.js +0 -108
  94. package/test/errorIntentContract.test.js +0 -31
  95. package/test/errorMessageHelpers.test.js +0 -28
  96. package/test/listQueryParamSupport.test.js +0 -223
  97. package/test/listUiRuntime.test.js +0 -102
  98. package/test/operationValidationHelpers.test.js +0 -64
  99. package/test/packageDescriptorOwnership.test.js +0 -18
  100. package/test/permissions.test.js +0 -35
  101. package/test/refValueHelpers.test.js +0 -14
  102. package/test/requestTransportOptions.test.js +0 -457
  103. package/test/resourceLoadStateHelpers.test.js +0 -189
  104. package/test/routeTemplateHelpers.test.js +0 -85
  105. package/test/scopeHelpers.test.js +0 -57
  106. package/test/useAddEditCore.test.js +0 -124
  107. package/test/useAddEditRequestQueryParams.test.js +0 -190
  108. package/test/useCrudAddEdit.test.js +0 -435
  109. package/test/useCrudDeleteAction.test.js +0 -139
  110. package/test/useCrudListBulkActions.test.js +0 -65
  111. package/test/useCrudListFilterLookups.test.js +0 -114
  112. package/test/useCrudListFilters.test.js +0 -293
  113. package/test/useCrudListParentTitle.test.js +0 -262
  114. package/test/useCrudListRowActions.test.js +0 -77
  115. package/test/useListRouteInitialization.test.js +0 -337
  116. package/test/useListSearchSupport.test.js +0 -61
  117. package/test/usePagedCollection.test.js +0 -53
  118. package/test/useViewRequestQueryParams.test.js +0 -20
  119. package/test/viewCoreLoading.test.js +0 -44
  120. package/test/viewUiRuntime.test.js +0 -95
  121. /package/{templates → patterns/account-settings/example}/src/components/account/settings/AccountSettingsNotificationsSection.vue +0 -0
  122. /package/{templates → patterns/account-settings/example}/src/components/account/settings/AccountSettingsPreferencesSection.vue +0 -0
  123. /package/{templates → patterns/account-settings/example}/src/components/account/settings/AccountSettingsProfileSection.vue +0 -0
  124. /package/{templates → patterns/account-settings/example}/src/pages/account/index.vue +0 -0
@@ -1,501 +0,0 @@
1
- <script setup>
2
- import { computed, unref } from "vue";
3
- import { useRoute } from "vue-router";
4
- import CrudListBulkActionSurface from "./CrudListBulkActionSurface.vue";
5
- import CrudListFilterSurface from "./CrudListFilterSurface.vue";
6
- import CrudListRecordActionMenu from "./CrudListRecordActionMenu.vue";
7
-
8
- const props = defineProps({
9
- screen: {
10
- type: Object,
11
- required: true
12
- },
13
- titleLabel: {
14
- type: String,
15
- default: "Records"
16
- },
17
- headingTitle: {
18
- type: String,
19
- default: ""
20
- },
21
- subtitle: {
22
- type: String,
23
- default: ""
24
- },
25
- createLabel: {
26
- type: String,
27
- default: "New record"
28
- },
29
- loadErrorTitle: {
30
- type: String,
31
- default: "Unable to load records"
32
- },
33
- loadErrorBody: {
34
- type: String,
35
- default: "Check the connection and try again."
36
- },
37
- emptyTitle: {
38
- type: String,
39
- default: "No records yet"
40
- },
41
- emptyBody: {
42
- type: String,
43
- default: "Create the first record to start using this workflow."
44
- }
45
- });
46
-
47
- const route = useRoute();
48
- const records = computed(() => props.screen?.records || {});
49
- const bulkActions = computed(() => props.screen?.bulkActions || {});
50
- const rowActions = computed(() => props.screen?.rowActions || {});
51
- const listFilters = computed(() => props.screen?.listFilters || {});
52
- const filterRuntime = computed(() => props.screen?.filterRuntime || null);
53
- const displayRows = computed(() => unref(props.screen?.displayRows) || []);
54
- const selectableRows = computed(() => unref(props.screen?.selectableRows) || []);
55
- const listPrimaryAction = computed(() => unref(props.screen?.listPrimaryAction) || "");
56
- const hasBulkActions = computed(() => Boolean(unref(bulkActions.value?.hasActions)));
57
- const hasRowActions = computed(() => Boolean(unref(rowActions.value?.hasActions)));
58
- const hasViewUrl = computed(() => Boolean(props.screen?.hasViewUrl));
59
- const hasEditUrl = computed(() => Boolean(props.screen?.hasEditUrl));
60
- const resolvedHeadingTitle = computed(() => String(props.headingTitle || props.titleLabel || "").trim());
61
- const resolvedSubtitle = computed(() =>
62
- String(props.subtitle || `Search, review, and update ${props.titleLabel} from this screen.`).trim()
63
- );
64
-
65
- function resolveListRecordTitle(record) {
66
- if (typeof props.screen?.resolveRecordTitle === "function") {
67
- return props.screen.resolveRecordTitle(record);
68
- }
69
- return "Record";
70
- }
71
-
72
- function formatListCardValue(value) {
73
- if (typeof props.screen?.formatListCardValue === "function") {
74
- return props.screen.formatListCardValue(value);
75
- }
76
- return value;
77
- }
78
-
79
- function resolveViewLocation(record) {
80
- const path = typeof records.value?.resolveViewUrl === "function"
81
- ? records.value.resolveViewUrl(record)
82
- : "";
83
- return path ? { path, query: route.query } : null;
84
- }
85
-
86
- function resolveEditLocation(record) {
87
- const path = typeof records.value?.resolveEditUrl === "function"
88
- ? records.value.resolveEditUrl(record)
89
- : "";
90
- return path ? { path, query: route.query } : null;
91
- }
92
-
93
- function hasRowActionsFor(record, index) {
94
- return typeof rowActions.value?.hasVisibleActionsFor === "function" &&
95
- rowActions.value.hasVisibleActionsFor(record, index);
96
- }
97
-
98
- function isBulkRowSelected(row = {}) {
99
- return typeof bulkActions.value?.isRecordSelected === "function" &&
100
- bulkActions.value.isRecordSelected(row.record, row.index);
101
- }
102
-
103
- function setBulkRowSelected(row = {}, selected = true) {
104
- if (typeof bulkActions.value?.setRecordSelected !== "function") {
105
- return;
106
- }
107
- bulkActions.value.setRecordSelected(row.record, row.index, selected);
108
- }
109
-
110
- function allSelectableRowsSelected() {
111
- return selectableRows.value.length > 0 && selectableRows.value.every((row) => isBulkRowSelected(row));
112
- }
113
-
114
- function someSelectableRowsSelected() {
115
- return selectableRows.value.some((row) => isBulkRowSelected(row));
116
- }
117
-
118
- function setSelectableRowsSelected(selected = true) {
119
- if (typeof bulkActions.value?.setRecordSelected !== "function") {
120
- return;
121
- }
122
- for (const row of selectableRows.value) {
123
- bulkActions.value.setRecordSelected(row.record, row.index, selected);
124
- }
125
- }
126
- </script>
127
-
128
- <template>
129
- <section class="generated-ui-screen generated-ui-screen--operator ui-generator-list-element d-flex flex-column ga-4">
130
- <header class="ui-generator-list-header">
131
- <div class="ui-generator-list-header__copy">
132
- <p class="text-overline text-medium-emphasis mb-1">{{ titleLabel }}</p>
133
- <h1 class="ui-generator-list-header__title">{{ resolvedHeadingTitle }}</h1>
134
- <p class="text-body-2 text-medium-emphasis mb-0">{{ resolvedSubtitle }}</p>
135
- </div>
136
- <div class="ui-generator-list-header__actions">
137
- <v-btn color="primary" variant="tonal" :loading="records.isFetching" @click="records.reload">Refresh</v-btn>
138
- <v-btn
139
- v-if="listPrimaryAction"
140
- class="ui-generator-list-header__primary-action"
141
- color="primary"
142
- variant="flat"
143
- :to="listPrimaryAction"
144
- >
145
- {{ createLabel }}
146
- </v-btn>
147
- </div>
148
- </header>
149
-
150
- <v-sheet rounded="lg" border class="ui-generator-list-panel">
151
- <div class="ui-generator-list-toolbar">
152
- <v-text-field
153
- v-if="records.searchEnabled"
154
- v-model="records.searchQuery"
155
- :label="records.searchLabel"
156
- :placeholder="records.searchPlaceholder"
157
- variant="outlined"
158
- density="comfortable"
159
- hide-details="auto"
160
- clearable
161
- class="ui-generator-list-search"
162
- :loading="records.isSearchDebouncing"
163
- />
164
- <CrudListFilterSurface
165
- :filters="listFilters"
166
- :runtime="filterRuntime"
167
- />
168
- </div>
169
- <CrudListBulkActionSurface :runtime="bulkActions" />
170
-
171
- <template v-if="records.showListSkeleton">
172
- <div class="pa-4">
173
- <v-skeleton-loader type="text@2, list-item-two-line@5" />
174
- </div>
175
- </template>
176
- <template v-else>
177
- <v-progress-linear v-if="records.isRefetching" indeterminate />
178
-
179
- <div v-if="records.loadError" class="ui-generator-list-state">
180
- <h2 class="text-h6 mb-2">{{ loadErrorTitle }}</h2>
181
- <p class="text-body-2 text-medium-emphasis mb-4">{{ loadErrorBody }}</p>
182
- <v-btn color="primary" variant="tonal" :loading="records.isFetching" @click="records.reload">Retry</v-btn>
183
- </div>
184
-
185
- <div v-else-if="displayRows.length < 1" class="ui-generator-list-state">
186
- <h2 class="text-h6 mb-2">{{ emptyTitle }}</h2>
187
- <p class="text-body-2 text-medium-emphasis mb-4">{{ emptyBody }}</p>
188
- <v-btn v-if="listPrimaryAction" color="primary" variant="flat" :to="listPrimaryAction">
189
- {{ createLabel }}
190
- </v-btn>
191
- </div>
192
-
193
- <template v-else>
194
- <div class="ui-generator-list-cards">
195
- <v-sheet
196
- v-for="row in displayRows"
197
- :key="row.key"
198
- rounded="lg"
199
- border
200
- class="ui-generator-list-card"
201
- >
202
- <div class="ui-generator-list-card__header">
203
- <v-checkbox-btn
204
- v-if="hasBulkActions && row.selectable !== false"
205
- :model-value="isBulkRowSelected(row)"
206
- :aria-label="`Select ${resolveListRecordTitle(row.record)}`"
207
- class="ui-generator-list-card__select"
208
- @update:model-value="setBulkRowSelected(row, $event)"
209
- />
210
- <div class="min-w-0">
211
- <div class="ui-generator-list-card__title">{{ resolveListRecordTitle(row.record) }}</div>
212
- <div class="text-caption text-medium-emphasis">
213
- {{ row.recordKey }}
214
- </div>
215
- </div>
216
- <CrudListRecordActionMenu
217
- v-if="hasViewUrl || hasEditUrl || hasRowActionsFor(row.record, row.index)"
218
- :record="row.record"
219
- :index="row.index"
220
- :row-actions="rowActions"
221
- :show-view="hasViewUrl && !row.synthetic"
222
- :show-edit="hasEditUrl && !row.synthetic"
223
- :view-location="resolveViewLocation(row.record)"
224
- :edit-location="resolveEditLocation(row.record)"
225
- />
226
- </div>
227
- <div class="ui-generator-list-card__fields">
228
- <slot
229
- name="card-fields"
230
- :record="row.record"
231
- :records="records"
232
- :index="row.index"
233
- :row="row"
234
- :format-list-card-value="formatListCardValue"
235
- />
236
- </div>
237
- </v-sheet>
238
- </div>
239
-
240
- <div class="ui-generator-list-table">
241
- <v-table density="comfortable">
242
- <thead>
243
- <tr>
244
- <th v-if="hasBulkActions" class="ui-generator-list-table__select">
245
- <v-checkbox-btn
246
- :model-value="allSelectableRowsSelected()"
247
- :indeterminate="
248
- someSelectableRowsSelected() &&
249
- !allSelectableRowsSelected()
250
- "
251
- aria-label="Select visible rows"
252
- @update:model-value="setSelectableRowsSelected($event)"
253
- />
254
- </th>
255
- <slot name="table-header" />
256
- <th v-if="hasViewUrl" class="text-right" />
257
- <th v-if="hasEditUrl" class="text-right" />
258
- <th v-if="hasRowActions" class="text-right" />
259
- </tr>
260
- </thead>
261
- <tbody>
262
- <tr v-for="row in displayRows" :key="row.key">
263
- <td v-if="hasBulkActions" class="ui-generator-list-table__select">
264
- <v-checkbox-btn
265
- v-if="row.selectable !== false"
266
- :model-value="isBulkRowSelected(row)"
267
- :aria-label="`Select ${resolveListRecordTitle(row.record)}`"
268
- @update:model-value="setBulkRowSelected(row, $event)"
269
- />
270
- </td>
271
- <slot
272
- name="table-row"
273
- :record="row.record"
274
- :records="records"
275
- :index="row.index"
276
- :row="row"
277
- />
278
- <td v-if="hasViewUrl" class="text-right">
279
- <v-btn
280
- v-if="!row.synthetic"
281
- size="small"
282
- color="primary"
283
- variant="outlined"
284
- :to="resolveViewLocation(row.record)"
285
- :disabled="!resolveViewLocation(row.record)"
286
- >
287
- Open
288
- </v-btn>
289
- </td>
290
- <td v-if="hasEditUrl" class="text-right">
291
- <v-btn
292
- v-if="!row.synthetic"
293
- size="small"
294
- color="primary"
295
- variant="tonal"
296
- :to="resolveEditLocation(row.record)"
297
- :disabled="!resolveEditLocation(row.record)"
298
- >
299
- Edit
300
- </v-btn>
301
- </td>
302
- <td v-if="hasRowActions" class="text-right">
303
- <CrudListRecordActionMenu
304
- v-if="hasRowActionsFor(row.record, row.index)"
305
- :record="row.record"
306
- :index="row.index"
307
- :row-actions="rowActions"
308
- button-label="More"
309
- button-variant="outlined"
310
- />
311
- </td>
312
- </tr>
313
- </tbody>
314
- </v-table>
315
- </div>
316
- </template>
317
-
318
- <div v-if="records.hasMore" class="d-flex justify-center pa-4">
319
- <v-btn color="primary" variant="outlined" :loading="records.isLoadingMore" @click="records.loadMore">
320
- Load more
321
- </v-btn>
322
- </div>
323
- </template>
324
- </v-sheet>
325
-
326
- <v-btn
327
- v-if="listPrimaryAction"
328
- class="ui-generator-list-fab"
329
- color="primary"
330
- variant="flat"
331
- :to="listPrimaryAction"
332
- >
333
- New
334
- </v-btn>
335
- </section>
336
- </template>
337
-
338
- <style scoped>
339
- .generated-ui-screen {
340
- --generated-ui-screen-title-size: clamp(1.35rem, 2vw, 1.85rem);
341
- --generated-ui-screen-state-padding: 2.5rem 1.25rem;
342
- }
343
-
344
- .generated-ui-screen--operator {
345
- --generated-ui-screen-state-padding: 2rem 1rem;
346
- }
347
-
348
- .ui-generator-list-header {
349
- align-items: flex-start;
350
- display: flex;
351
- gap: 1rem;
352
- justify-content: space-between;
353
- }
354
-
355
- .ui-generator-list-header__copy {
356
- min-width: 0;
357
- }
358
-
359
- .ui-generator-list-header__title {
360
- font-size: var(--generated-ui-screen-title-size);
361
- font-weight: 650;
362
- letter-spacing: -0.02em;
363
- line-height: 1.15;
364
- margin: 0 0 0.35rem;
365
- }
366
-
367
- .ui-generator-list-header__actions {
368
- display: flex;
369
- flex-wrap: wrap;
370
- gap: 0.5rem;
371
- justify-content: flex-end;
372
- }
373
-
374
- .ui-generator-list-panel {
375
- overflow: hidden;
376
- }
377
-
378
- .ui-generator-list-toolbar {
379
- padding: 1rem;
380
- }
381
-
382
- .ui-generator-list-search {
383
- max-width: 26rem;
384
- }
385
-
386
- .ui-generator-list-state {
387
- margin-inline: auto;
388
- max-width: 30rem;
389
- padding: var(--generated-ui-screen-state-padding);
390
- text-align: center;
391
- }
392
-
393
- .ui-generator-list-cards {
394
- display: flex;
395
- flex-direction: column;
396
- gap: 0.75rem;
397
- padding: 0 1rem 1rem;
398
- }
399
-
400
- .ui-generator-list-card {
401
- padding: 0.875rem;
402
- }
403
-
404
- .ui-generator-list-card__header {
405
- align-items: flex-start;
406
- display: flex;
407
- gap: 0.75rem;
408
- justify-content: space-between;
409
- }
410
-
411
- .ui-generator-list-card__select {
412
- flex: 0 0 auto;
413
- margin-inline-start: -0.35rem;
414
- margin-top: -0.35rem;
415
- }
416
-
417
- .ui-generator-list-card__title {
418
- font-size: 1rem;
419
- font-weight: 650;
420
- line-height: 1.25;
421
- overflow-wrap: anywhere;
422
- }
423
-
424
- .ui-generator-list-card__fields {
425
- display: grid;
426
- gap: 0.65rem;
427
- margin-top: 0.85rem;
428
- }
429
-
430
- .ui-generator-list-card__field {
431
- display: grid;
432
- gap: 0.15rem;
433
- }
434
-
435
- .ui-generator-list-card__field-label {
436
- color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
437
- font-size: 0.72rem;
438
- letter-spacing: 0.04em;
439
- line-height: 1.2;
440
- text-transform: uppercase;
441
- }
442
-
443
- .ui-generator-list-card__field-value {
444
- font-size: 0.95rem;
445
- line-height: 1.35;
446
- overflow-wrap: anywhere;
447
- }
448
-
449
- .ui-generator-list-table {
450
- display: none;
451
- overflow-x: auto;
452
- }
453
-
454
- .ui-generator-list-table__select {
455
- width: 3rem;
456
- }
457
-
458
- .ui-generator-list-fab {
459
- bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
460
- display: flex;
461
- position: fixed;
462
- right: 1rem;
463
- z-index: 6;
464
- }
465
-
466
- @media (min-width: 960px) {
467
- .ui-generator-list-cards {
468
- display: none;
469
- }
470
-
471
- .ui-generator-list-table {
472
- display: block;
473
- }
474
-
475
- .ui-generator-list-fab {
476
- display: none;
477
- }
478
- }
479
-
480
- @media (max-width: 960px) {
481
- .ui-generator-list-header {
482
- flex-direction: column;
483
- }
484
-
485
- .ui-generator-list-header__actions {
486
- width: 100%;
487
- }
488
-
489
- .ui-generator-list-header__actions :deep(.v-btn) {
490
- min-height: 48px;
491
- }
492
-
493
- .ui-generator-list-header__primary-action {
494
- display: none;
495
- }
496
-
497
- .ui-generator-list-search {
498
- max-width: none;
499
- }
500
- }
501
- </style>
@@ -1,197 +0,0 @@
1
- <script setup>
2
- import { computed, unref } from "vue";
3
-
4
- const props = defineProps({
5
- screen: {
6
- type: Object,
7
- required: true
8
- },
9
- resourceSingularTitle: {
10
- type: String,
11
- default: "Record"
12
- },
13
- resourcePluralTitle: {
14
- type: String,
15
- default: "Records"
16
- },
17
- description: {
18
- type: String,
19
- default: ""
20
- },
21
- unavailableTitle: {
22
- type: String,
23
- default: "Record unavailable"
24
- }
25
- });
26
-
27
- const view = computed(() => props.screen?.view || {});
28
- const recordTitle = computed(() => unref(props.screen?.recordTitle) || props.resourceSingularTitle);
29
- const listLocation = computed(() => unref(props.screen?.listLocation) || null);
30
- const editLocation = computed(() => unref(props.screen?.editLocation) || null);
31
- const resolvedDescription = computed(() =>
32
- String(props.description || `Review this ${props.resourceSingularTitle} record.`).trim()
33
- );
34
- </script>
35
-
36
- <template>
37
- <section class="generated-ui-screen generated-ui-screen--operator ui-generator-view-element d-flex flex-column ga-4">
38
- <header class="ui-generator-view-header">
39
- <div class="ui-generator-view-header__copy">
40
- <p class="text-overline text-medium-emphasis mb-1">{{ resourceSingularTitle }}</p>
41
- <h1 class="ui-generator-view-header__title">{{ recordTitle }}</h1>
42
- <p class="text-body-2 text-medium-emphasis mb-0">{{ resolvedDescription }}</p>
43
- </div>
44
- <div class="ui-generator-view-header__actions">
45
- <v-btn
46
- v-if="listLocation"
47
- color="primary"
48
- variant="outlined"
49
- :to="listLocation"
50
- >
51
- Back to {{ resourcePluralTitle }}
52
- </v-btn>
53
- <slot name="actions" :screen="screen" :view="view" />
54
- <v-btn
55
- v-if="editLocation"
56
- color="primary"
57
- variant="flat"
58
- :to="editLocation"
59
- >
60
- Edit
61
- </v-btn>
62
- </div>
63
- </header>
64
-
65
- <v-sheet rounded="lg" border class="ui-generator-view-panel">
66
- <div v-if="view.loadError || view.isNotFound" class="ui-generator-view-state">
67
- <h2 class="text-h6 mb-2">{{ unavailableTitle }}</h2>
68
- <p class="text-body-2 text-medium-emphasis mb-4">
69
- {{ view.loadError || `This ${resourceSingularTitle} could not be found.` }}
70
- </p>
71
- <div class="ui-generator-view-state__actions">
72
- <v-btn
73
- v-if="view.loadError"
74
- color="primary"
75
- variant="tonal"
76
- :loading="view.isFetching"
77
- @click="view.refresh"
78
- >
79
- Retry
80
- </v-btn>
81
- <v-btn
82
- v-else-if="listLocation"
83
- color="primary"
84
- variant="tonal"
85
- :to="listLocation"
86
- >
87
- Back to {{ resourcePluralTitle }}
88
- </v-btn>
89
- </div>
90
- </div>
91
-
92
- <template v-else-if="view.isLoading">
93
- <div class="pa-4">
94
- <v-skeleton-loader type="text@2, list-item-two-line@5" />
95
- </div>
96
- </template>
97
-
98
- <template v-else>
99
- <v-progress-linear v-if="view.isRefetching" indeterminate />
100
- <div class="pa-4">
101
- <slot name="before-fields" :view="view" />
102
- <v-row class="ui-generator-view-fields">
103
- <slot name="fields" :view="view" />
104
- </v-row>
105
- <slot name="after-fields" :view="view" />
106
- </div>
107
- </template>
108
- </v-sheet>
109
-
110
- <div v-if="$slots['supporting-content']" class="ui-generator-view-supporting-content">
111
- <slot name="supporting-content" :view="view" />
112
- </div>
113
- </section>
114
- </template>
115
-
116
- <style scoped>
117
- .generated-ui-screen {
118
- --generated-ui-screen-title-size: clamp(1.35rem, 2vw, 1.85rem);
119
- --generated-ui-screen-state-padding: 2.5rem 1.25rem;
120
- }
121
-
122
- .generated-ui-screen--operator {
123
- --generated-ui-screen-state-padding: 2rem 1rem;
124
- }
125
-
126
- .ui-generator-view-header {
127
- align-items: flex-start;
128
- display: flex;
129
- gap: 1rem;
130
- justify-content: space-between;
131
- }
132
-
133
- .ui-generator-view-header__copy {
134
- min-width: 0;
135
- }
136
-
137
- .ui-generator-view-header__title {
138
- font-size: var(--generated-ui-screen-title-size);
139
- font-weight: 650;
140
- letter-spacing: -0.02em;
141
- line-height: 1.15;
142
- margin: 0 0 0.35rem;
143
- overflow-wrap: anywhere;
144
- }
145
-
146
- .ui-generator-view-header__actions {
147
- display: flex;
148
- flex-wrap: wrap;
149
- gap: 0.5rem;
150
- justify-content: flex-end;
151
- }
152
-
153
- .ui-generator-view-panel {
154
- overflow: hidden;
155
- }
156
-
157
- .ui-generator-view-state {
158
- margin-inline: auto;
159
- max-width: 30rem;
160
- padding: var(--generated-ui-screen-state-padding);
161
- text-align: center;
162
- }
163
-
164
- .ui-generator-view-state__actions {
165
- display: flex;
166
- flex-wrap: wrap;
167
- gap: 0.5rem;
168
- justify-content: center;
169
- }
170
-
171
- .ui-generator-view-fields :deep(.v-col) {
172
- min-width: 0;
173
- }
174
-
175
- .ui-generator-view-supporting-content {
176
- min-width: 0;
177
- }
178
-
179
- @media (max-width: 960px) {
180
- .ui-generator-view-header {
181
- flex-direction: column;
182
- }
183
-
184
- .ui-generator-view-header__actions {
185
- width: 100%;
186
- }
187
-
188
- .ui-generator-view-header__actions :deep(.v-btn) {
189
- min-height: 48px;
190
- flex: 1 1 10rem;
191
- }
192
-
193
- .ui-generator-view-state__actions :deep(.v-btn) {
194
- min-height: 48px;
195
- }
196
- }
197
- </style>