@conduction/nextcloud-vue 0.1.0-beta.11 → 0.1.0-beta.12

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 (78) hide show
  1. package/dist/nextcloud-vue.cjs +67614 -0
  2. package/dist/nextcloud-vue.cjs.js +13518 -13617
  3. package/dist/nextcloud-vue.cjs.js.map +1 -1
  4. package/dist/nextcloud-vue.cjs.map +1 -0
  5. package/dist/nextcloud-vue.css +1796 -1800
  6. package/dist/nextcloud-vue.esm.js +13518 -13617
  7. package/dist/nextcloud-vue.esm.js.map +1 -1
  8. package/package.json +3 -2
  9. package/src/components/CnActionsBar/CnActionsBar.vue +254 -254
  10. package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +570 -570
  11. package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -217
  12. package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -121
  13. package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +422 -422
  14. package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -247
  15. package/src/components/CnCard/CnCard.vue +415 -415
  16. package/src/components/CnCardGrid/CnCardGrid.vue +156 -156
  17. package/src/components/CnCellRenderer/CnCellRenderer.vue +132 -132
  18. package/src/components/CnChartWidget/CnChartWidget.vue +346 -346
  19. package/src/components/CnConfigurationCard/CnConfigurationCard.vue +77 -77
  20. package/src/components/CnContextMenu/CnContextMenu.vue +142 -142
  21. package/src/components/CnCopyDialog/CnCopyDialog.vue +266 -266
  22. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +229 -229
  23. package/src/components/CnDashboardPage/CnDashboardPage.vue +397 -397
  24. package/src/components/CnDataTable/CnDataTable.vue +362 -362
  25. package/src/components/CnDeleteDialog/CnDeleteDialog.vue +177 -177
  26. package/src/components/CnDetailCard/CnDetailCard.vue +225 -225
  27. package/src/components/CnDetailGrid/CnDetailGrid.vue +256 -256
  28. package/src/components/CnDetailPage/CnDetailPage.vue +432 -432
  29. package/src/components/CnFacetSidebar/CnFacetSidebar.vue +234 -234
  30. package/src/components/CnFilterBar/CnFilterBar.vue +153 -153
  31. package/src/components/CnFormDialog/CnFormDialog.vue +1047 -1047
  32. package/src/components/CnIcon/CnIcon.vue +89 -89
  33. package/src/components/CnIndexPage/CnIndexPage.vue +981 -980
  34. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +536 -536
  35. package/src/components/CnInfoWidget/CnInfoWidget.vue +219 -219
  36. package/src/components/CnItemCard/CnItemCard.vue +134 -134
  37. package/src/components/CnJsonViewer/CnJsonViewer.vue +312 -312
  38. package/src/components/CnKpiGrid/CnKpiGrid.vue +93 -93
  39. package/src/components/CnMassActionBar/CnMassActionBar.vue +161 -161
  40. package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +327 -327
  41. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +245 -245
  42. package/src/components/CnMassExportDialog/CnMassExportDialog.vue +191 -191
  43. package/src/components/CnMassImportDialog/CnMassImportDialog.vue +494 -494
  44. package/src/components/CnNoteCard/CnNoteCard.vue +149 -149
  45. package/src/components/CnNotesCard/CnNotesCard.vue +416 -416
  46. package/src/components/CnObjectCard/CnObjectCard.vue +294 -294
  47. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +854 -854
  48. package/src/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue +289 -289
  49. package/src/components/CnObjectSidebar/CnAuditTrailTab.vue +369 -369
  50. package/src/components/CnObjectSidebar/CnFilesTab.vue +287 -287
  51. package/src/components/CnObjectSidebar/CnNotesTab.vue +250 -250
  52. package/src/components/CnObjectSidebar/CnObjectSidebar.vue +255 -255
  53. package/src/components/CnObjectSidebar/CnTagsTab.vue +259 -259
  54. package/src/components/CnObjectSidebar/CnTasksTab.vue +483 -483
  55. package/src/components/CnPageHeader/CnPageHeader.vue +61 -61
  56. package/src/components/CnPagination/CnPagination.vue +253 -253
  57. package/src/components/CnProgressBar/CnProgressBar.vue +262 -262
  58. package/src/components/CnRegisterMapping/CnRegisterMapping.vue +793 -793
  59. package/src/components/CnRowActions/CnRowActions.vue +95 -95
  60. package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -226
  61. package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +788 -788
  62. package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -305
  63. package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -1398
  64. package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -236
  65. package/src/components/CnSettingsCard/CnSettingsCard.vue +92 -92
  66. package/src/components/CnSettingsSection/CnSettingsSection.vue +267 -267
  67. package/src/components/CnStatsBlock/CnStatsBlock.vue +437 -437
  68. package/src/components/CnStatsPanel/CnStatsPanel.vue +321 -321
  69. package/src/components/CnStatusBadge/CnStatusBadge.vue +90 -90
  70. package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +545 -545
  71. package/src/components/CnTableWidget/CnTableWidget.vue +333 -333
  72. package/src/components/CnTasksCard/CnTasksCard.vue +374 -374
  73. package/src/components/CnTileWidget/CnTileWidget.vue +159 -159
  74. package/src/components/CnTimelineStages/CnTimelineStages.vue +294 -294
  75. package/src/components/CnUserActionMenu/CnUserActionMenu.vue +436 -436
  76. package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +313 -313
  77. package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -180
  78. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +248 -248
@@ -1,247 +1,247 @@
1
- <template>
2
- <!-- Edit mode -->
3
- <div
4
- v-if="isEditable && (inputComponent === 'NcCheckboxRadioSwitch' || isEditing)"
5
- class="cn-advanced-form-dialog__value-input-container"
6
- @click.stop>
7
- <div
8
- v-if="inputComponent === 'NcCheckboxRadioSwitch'"
9
- class="cn-advanced-form-dialog__boolean-input-row">
10
- <NcCheckboxRadioSwitch
11
- :checked="value"
12
- type="switch"
13
- class="cn-advanced-form-dialog__boolean-input-row__input"
14
- @update:checked="emit($event)">
15
- {{ displayName }}
16
- </NcCheckboxRadioSwitch>
17
- <InformationOutline
18
- v-if="schemaProp && schemaProp.description"
19
- v-tooltip="schemaProp.description"
20
- class="cn-advanced-form-dialog__info-icon"
21
- :size="16" />
22
- </div>
23
- <NcDateTimePickerNative
24
- v-else-if="inputComponent === 'NcDateTimePickerNative'"
25
- :value="value"
26
- :type="inputType"
27
- :label="displayName"
28
- @update:value="emit($event)" />
29
- <NcTextField
30
- v-else
31
- ref="inputRef"
32
- :value="stringValue"
33
- :type="inputType"
34
- :placeholder="displayName"
35
- :min="minimum"
36
- :max="maximum"
37
- :step="step"
38
- @update:value="emitConverted($event)" />
39
- </div>
40
-
41
- <!-- Display mode -->
42
- <div
43
- v-else
44
- :title="editabilityWarning">
45
- <pre
46
- v-if="typeof value === 'object' && value !== null"
47
- class="cn-advanced-form-dialog__json-value">{{ formattedObjectValue }}</pre>
48
- <span
49
- v-else-if="inputComponent === 'NcDateTimePickerNative' && isValidDate(value)">{{
50
- new Date(value).toLocaleString()
51
- }}</span>
52
- <span v-else>{{ displayValue }}</span>
53
- </div>
54
- </template>
55
-
56
- <script>
57
- import {
58
- NcTextField,
59
- NcCheckboxRadioSwitch,
60
- NcDateTimePickerNative,
61
- } from '@nextcloud/vue'
62
- import InformationOutline from 'vue-material-design-icons/InformationOutline.vue'
63
- import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
64
- import { formatValue } from '../../utils/schema.js'
65
-
66
- export default {
67
- name: 'CnPropertyValueCell',
68
-
69
- directives: { tooltip: Tooltip },
70
-
71
- components: {
72
- NcTextField,
73
- NcCheckboxRadioSwitch,
74
- NcDateTimePickerNative,
75
- InformationOutline,
76
- },
77
-
78
- props: {
79
- /** The schema property key */
80
- propertyKey: { type: String, required: true },
81
- /** Full JSON schema object */
82
- schema: { type: Object, default: null },
83
- /** Resolved current value (formData[key] ?? objectValue) */
84
- value: { type: [String, Number, Boolean, Object, Array], default: null },
85
- /** Whether this property is editable at all */
86
- isEditable: { type: Boolean, default: true },
87
- /** Whether this row is currently selected for editing */
88
- isEditing: { type: Boolean, default: false },
89
- /** Display name for the property (used in labels/placeholders) */
90
- displayName: { type: String, default: '' },
91
- /** Editability warning message shown as title when not editable */
92
- editabilityWarning: { type: String, default: null },
93
- },
94
-
95
- computed: {
96
- schemaProp() {
97
- return this.schema?.properties?.[this.propertyKey] || null
98
- },
99
-
100
- inputComponent() {
101
- const prop = this.schemaProp
102
- if (!prop) return 'NcTextField'
103
- if (prop.type === 'boolean') return 'NcCheckboxRadioSwitch'
104
- if (prop.type === 'string' && ['date', 'time', 'date-time'].includes(prop.format)) {
105
- return 'NcDateTimePickerNative'
106
- }
107
- return 'NcTextField'
108
- },
109
-
110
- inputType() {
111
- const prop = this.schemaProp
112
- if (!prop) return 'text'
113
- const fmt = prop.format || ''
114
- if (prop.type === 'string') {
115
- if (fmt === 'date') return 'date'
116
- if (fmt === 'time') return 'time'
117
- if (fmt === 'date-time') return 'datetime-local'
118
- if (fmt === 'email') return 'email'
119
- if (fmt === 'url' || fmt === 'uri') return 'url'
120
- }
121
- if (prop.type === 'number' || prop.type === 'integer') return 'number'
122
- return 'text'
123
- },
124
-
125
- minimum() {
126
- return this.schemaProp?.minimum
127
- },
128
-
129
- maximum() {
130
- return this.schemaProp?.maximum
131
- },
132
-
133
- step() {
134
- const prop = this.schemaProp
135
- if (prop?.type === 'integer') return '1'
136
- if (prop?.type === 'number') return 'any'
137
- return undefined
138
- },
139
-
140
- stringValue() {
141
- const v = this.value
142
- if (v == null) return ''
143
- if (typeof v === 'string') return v
144
- if (typeof v === 'object') return JSON.stringify(v)
145
- return String(v)
146
- },
147
-
148
- formattedObjectValue() {
149
- return formatValue(this.value, this.schemaProp || {})
150
- },
151
-
152
- displayValue() {
153
- const prop = this.schemaProp
154
- if (prop?.const !== undefined) return prop.const
155
- const v = this.value
156
- if (v === null || v === undefined || v === '') return '—'
157
- return formatValue(v, prop || {})
158
- },
159
- },
160
-
161
- methods: {
162
- /** Focus the underlying text input (called by parent after row click) */
163
- focus() {
164
- const ref = this.$refs.inputRef
165
- if (!ref) return
166
- const input = ref.$el?.querySelector('input')
167
- if (input) {
168
- input.focus()
169
- input.select()
170
- }
171
- },
172
-
173
- emit(newVal) {
174
- this.$emit('update:value', newVal)
175
- },
176
-
177
- emitConverted(newVal) {
178
- const prop = this.schemaProp
179
- let converted = newVal
180
- if (prop) {
181
- switch (prop.type) {
182
- case 'number':
183
- converted = newVal === '' ? null : parseFloat(newVal)
184
- if (Number.isNaN(converted)) converted = null
185
- break
186
- case 'integer':
187
- converted = newVal === '' ? null : parseInt(newVal, 10)
188
- if (Number.isNaN(converted)) converted = null
189
- break
190
- case 'boolean':
191
- converted = Boolean(newVal)
192
- break
193
- default:
194
- converted = newVal
195
- }
196
- }
197
- this.$emit('update:value', converted)
198
- },
199
-
200
- isValidDate(v) {
201
- if (!v) return false
202
- const d = new Date(v)
203
- return d instanceof Date && !Number.isNaN(d.getTime())
204
- },
205
- },
206
- }
207
- </script>
208
-
209
- <style scoped>
210
- .cn-advanced-form-dialog__value-input-container :deep(.text-field) {
211
- margin: 0;
212
- padding: 0;
213
- }
214
-
215
- .cn-advanced-form-dialog__boolean-input-row {
216
- display: flex;
217
- align-items: center;
218
- gap: 6px;
219
- }
220
-
221
- /* patch extreme size in field */
222
- .cn-advanced-form-dialog__boolean-input-row__input > span {
223
- padding-left: 0;
224
- padding-block: 0;
225
- }
226
- .cn-advanced-form-dialog__boolean-input-row__input > input {
227
- margin: 0;
228
- }
229
-
230
- .cn-advanced-form-dialog__info-icon {
231
- flex-shrink: 0;
232
- color: var(--color-text-maxcontrast);
233
- cursor: help;
234
- }
235
-
236
- .cn-advanced-form-dialog__json-value {
237
- max-height: 200px;
238
- overflow-y: auto;
239
- white-space: pre-wrap;
240
- font-family: monospace;
241
- font-size: 12px;
242
- background: var(--color-background-dark);
243
- padding: 8px;
244
- border-radius: 4px;
245
- margin: 0;
246
- }
247
- </style>
1
+ <template>
2
+ <!-- Edit mode -->
3
+ <div
4
+ v-if="isEditable && (inputComponent === 'NcCheckboxRadioSwitch' || isEditing)"
5
+ class="cn-advanced-form-dialog__value-input-container"
6
+ @click.stop>
7
+ <div
8
+ v-if="inputComponent === 'NcCheckboxRadioSwitch'"
9
+ class="cn-advanced-form-dialog__boolean-input-row">
10
+ <NcCheckboxRadioSwitch
11
+ :checked="value"
12
+ type="switch"
13
+ class="cn-advanced-form-dialog__boolean-input-row__input"
14
+ @update:checked="emit($event)">
15
+ {{ displayName }}
16
+ </NcCheckboxRadioSwitch>
17
+ <InformationOutline
18
+ v-if="schemaProp && schemaProp.description"
19
+ v-tooltip="schemaProp.description"
20
+ class="cn-advanced-form-dialog__info-icon"
21
+ :size="16" />
22
+ </div>
23
+ <NcDateTimePickerNative
24
+ v-else-if="inputComponent === 'NcDateTimePickerNative'"
25
+ :value="value"
26
+ :type="inputType"
27
+ :label="displayName"
28
+ @update:value="emit($event)" />
29
+ <NcTextField
30
+ v-else
31
+ ref="inputRef"
32
+ :value="stringValue"
33
+ :type="inputType"
34
+ :placeholder="displayName"
35
+ :min="minimum"
36
+ :max="maximum"
37
+ :step="step"
38
+ @update:value="emitConverted($event)" />
39
+ </div>
40
+
41
+ <!-- Display mode -->
42
+ <div
43
+ v-else
44
+ :title="editabilityWarning">
45
+ <pre
46
+ v-if="typeof value === 'object' && value !== null"
47
+ class="cn-advanced-form-dialog__json-value">{{ formattedObjectValue }}</pre>
48
+ <span
49
+ v-else-if="inputComponent === 'NcDateTimePickerNative' && isValidDate(value)">{{
50
+ new Date(value).toLocaleString()
51
+ }}</span>
52
+ <span v-else>{{ displayValue }}</span>
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import {
58
+ NcTextField,
59
+ NcCheckboxRadioSwitch,
60
+ NcDateTimePickerNative,
61
+ } from '@nextcloud/vue'
62
+ import InformationOutline from 'vue-material-design-icons/InformationOutline.vue'
63
+ import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
64
+ import { formatValue } from '../../utils/schema.js'
65
+
66
+ export default {
67
+ name: 'CnPropertyValueCell',
68
+
69
+ directives: { tooltip: Tooltip },
70
+
71
+ components: {
72
+ NcTextField,
73
+ NcCheckboxRadioSwitch,
74
+ NcDateTimePickerNative,
75
+ InformationOutline,
76
+ },
77
+
78
+ props: {
79
+ /** The schema property key */
80
+ propertyKey: { type: String, required: true },
81
+ /** Full JSON schema object */
82
+ schema: { type: Object, default: null },
83
+ /** Resolved current value (formData[key] ?? objectValue) */
84
+ value: { type: [String, Number, Boolean, Object, Array], default: null },
85
+ /** Whether this property is editable at all */
86
+ isEditable: { type: Boolean, default: true },
87
+ /** Whether this row is currently selected for editing */
88
+ isEditing: { type: Boolean, default: false },
89
+ /** Display name for the property (used in labels/placeholders) */
90
+ displayName: { type: String, default: '' },
91
+ /** Editability warning message shown as title when not editable */
92
+ editabilityWarning: { type: String, default: null },
93
+ },
94
+
95
+ computed: {
96
+ schemaProp() {
97
+ return this.schema?.properties?.[this.propertyKey] || null
98
+ },
99
+
100
+ inputComponent() {
101
+ const prop = this.schemaProp
102
+ if (!prop) return 'NcTextField'
103
+ if (prop.type === 'boolean') return 'NcCheckboxRadioSwitch'
104
+ if (prop.type === 'string' && ['date', 'time', 'date-time'].includes(prop.format)) {
105
+ return 'NcDateTimePickerNative'
106
+ }
107
+ return 'NcTextField'
108
+ },
109
+
110
+ inputType() {
111
+ const prop = this.schemaProp
112
+ if (!prop) return 'text'
113
+ const fmt = prop.format || ''
114
+ if (prop.type === 'string') {
115
+ if (fmt === 'date') return 'date'
116
+ if (fmt === 'time') return 'time'
117
+ if (fmt === 'date-time') return 'datetime-local'
118
+ if (fmt === 'email') return 'email'
119
+ if (fmt === 'url' || fmt === 'uri') return 'url'
120
+ }
121
+ if (prop.type === 'number' || prop.type === 'integer') return 'number'
122
+ return 'text'
123
+ },
124
+
125
+ minimum() {
126
+ return this.schemaProp?.minimum
127
+ },
128
+
129
+ maximum() {
130
+ return this.schemaProp?.maximum
131
+ },
132
+
133
+ step() {
134
+ const prop = this.schemaProp
135
+ if (prop?.type === 'integer') return '1'
136
+ if (prop?.type === 'number') return 'any'
137
+ return undefined
138
+ },
139
+
140
+ stringValue() {
141
+ const v = this.value
142
+ if (v == null) return ''
143
+ if (typeof v === 'string') return v
144
+ if (typeof v === 'object') return JSON.stringify(v)
145
+ return String(v)
146
+ },
147
+
148
+ formattedObjectValue() {
149
+ return formatValue(this.value, this.schemaProp || {})
150
+ },
151
+
152
+ displayValue() {
153
+ const prop = this.schemaProp
154
+ if (prop?.const !== undefined) return prop.const
155
+ const v = this.value
156
+ if (v === null || v === undefined || v === '') return '—'
157
+ return formatValue(v, prop || {})
158
+ },
159
+ },
160
+
161
+ methods: {
162
+ /** Focus the underlying text input (called by parent after row click) */
163
+ focus() {
164
+ const ref = this.$refs.inputRef
165
+ if (!ref) return
166
+ const input = ref.$el?.querySelector('input')
167
+ if (input) {
168
+ input.focus()
169
+ input.select()
170
+ }
171
+ },
172
+
173
+ emit(newVal) {
174
+ this.$emit('update:value', newVal)
175
+ },
176
+
177
+ emitConverted(newVal) {
178
+ const prop = this.schemaProp
179
+ let converted = newVal
180
+ if (prop) {
181
+ switch (prop.type) {
182
+ case 'number':
183
+ converted = newVal === '' ? null : parseFloat(newVal)
184
+ if (Number.isNaN(converted)) converted = null
185
+ break
186
+ case 'integer':
187
+ converted = newVal === '' ? null : parseInt(newVal, 10)
188
+ if (Number.isNaN(converted)) converted = null
189
+ break
190
+ case 'boolean':
191
+ converted = Boolean(newVal)
192
+ break
193
+ default:
194
+ converted = newVal
195
+ }
196
+ }
197
+ this.$emit('update:value', converted)
198
+ },
199
+
200
+ isValidDate(v) {
201
+ if (!v) return false
202
+ const d = new Date(v)
203
+ return d instanceof Date && !Number.isNaN(d.getTime())
204
+ },
205
+ },
206
+ }
207
+ </script>
208
+
209
+ <style scoped>
210
+ .cn-advanced-form-dialog__value-input-container :deep(.text-field) {
211
+ margin: 0;
212
+ padding: 0;
213
+ }
214
+
215
+ .cn-advanced-form-dialog__boolean-input-row {
216
+ display: flex;
217
+ align-items: center;
218
+ gap: 6px;
219
+ }
220
+
221
+ /* patch extreme size in field */
222
+ .cn-advanced-form-dialog__boolean-input-row__input > span {
223
+ padding-left: 0;
224
+ padding-block: 0;
225
+ }
226
+ .cn-advanced-form-dialog__boolean-input-row__input > input {
227
+ margin: 0;
228
+ }
229
+
230
+ .cn-advanced-form-dialog__info-icon {
231
+ flex-shrink: 0;
232
+ color: var(--color-text-maxcontrast);
233
+ cursor: help;
234
+ }
235
+
236
+ .cn-advanced-form-dialog__json-value {
237
+ max-height: 200px;
238
+ overflow-y: auto;
239
+ white-space: pre-wrap;
240
+ font-family: monospace;
241
+ font-size: 12px;
242
+ background: var(--color-background-dark);
243
+ padding: 8px;
244
+ border-radius: 4px;
245
+ margin: 0;
246
+ }
247
+ </style>