apostrophe 3.63.1 → 4.0.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.
- package/.eslintrc +13 -4
- package/CHANGELOG.md +35 -0
- package/defaults.js +1 -0
- package/modules/@apostrophecms/admin-bar/ui/apos/apps/AposAdminBar.js +7 -17
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBar.vue +14 -16
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarLocale.vue +1 -1
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarMenu.vue +22 -15
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposAdminBarUser.vue +2 -2
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextBar.vue +13 -8
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextModeAndSettings.vue +18 -10
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextTitle.vue +4 -4
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextUndoRedo.vue +14 -8
- package/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposSavingIndicator.vue +2 -1
- package/modules/@apostrophecms/area/ui/apos/apps/AposAreas.js +36 -54
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaContextualMenu.vue +20 -25
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaEditor.vue +5 -12
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaExpandedMenu.vue +11 -3
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaMenu.vue +6 -6
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaMenuItem.vue +3 -2
- package/modules/@apostrophecms/area/ui/apos/components/AposAreaWidget.vue +31 -44
- package/modules/@apostrophecms/area/ui/apos/components/AposWidgetControls.vue +6 -6
- package/modules/@apostrophecms/asset/index.js +25 -12
- package/modules/@apostrophecms/asset/lib/webpack/apos/webpack.config.js +3 -3
- package/modules/@apostrophecms/asset/lib/webpack/apos/webpack.vue.js +7 -1
- package/modules/@apostrophecms/busy/ui/apos/apps/AposBusy.js +8 -7
- package/modules/@apostrophecms/busy/ui/apos/components/TheAposBusy.vue +1 -1
- package/modules/@apostrophecms/command-menu/ui/apos/apps/AposCommandMenu.js +11 -29
- package/modules/@apostrophecms/command-menu/ui/apos/components/AposCommandMenuShortcut.vue +6 -6
- package/modules/@apostrophecms/command-menu/ui/apos/components/TheAposCommandMenu.vue +10 -7
- package/modules/@apostrophecms/doc-type/ui/apos/components/AposDocEditor.vue +20 -15
- package/modules/@apostrophecms/doc-type/ui/apos/logic/AposDocContextMenu.js +1 -1
- package/modules/@apostrophecms/i18n/ui/apos/components/AposI18nLocalize.vue +36 -27
- package/modules/@apostrophecms/i18n/ui/apos/components/AposI18nLocalizeErrors.vue +3 -3
- package/modules/@apostrophecms/image/ui/apos/components/AposImageCropper.vue +5 -5
- package/modules/@apostrophecms/image/ui/apos/components/AposImageRelationshipEditor.vue +6 -6
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManager.vue +23 -16
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerDisplay.vue +11 -11
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerEditor.vue +28 -21
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerSelections.vue +1 -1
- package/modules/@apostrophecms/image/ui/apos/components/AposMediaUploader.vue +5 -4
- package/modules/@apostrophecms/login/ui/apos/apps/AposLogin.js +6 -7
- package/modules/@apostrophecms/login/ui/apos/components/AposForgotPasswordForm.vue +3 -3
- package/modules/@apostrophecms/login/ui/apos/components/AposLoginForm.vue +10 -10
- package/modules/@apostrophecms/login/ui/apos/components/AposResetPasswordForm.vue +1 -1
- package/modules/@apostrophecms/login/ui/apos/components/TheAposLogin.vue +2 -2
- package/modules/@apostrophecms/modal/ui/apos/apps/AposModals.js +60 -87
- package/modules/@apostrophecms/modal/ui/apos/components/AposDocsManagerToolbar.vue +15 -11
- package/modules/@apostrophecms/modal/ui/apos/components/AposModal.vue +8 -2
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalBreadcrumbs.vue +7 -4
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalConfirm.vue +5 -5
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalShareDraft.vue +8 -8
- package/modules/@apostrophecms/modal/ui/apos/components/AposModalToolbar.vue +7 -7
- package/modules/@apostrophecms/modal/ui/apos/components/TheAposModals.vue +22 -4
- package/modules/@apostrophecms/modal/ui/apos/composables/AposFocus.js +95 -0
- package/modules/@apostrophecms/modal/ui/apos/mixins/AposDocsManagerMixin.js +2 -3
- package/modules/@apostrophecms/modal/ui/apos/mixins/AposEditorMixin.js +6 -0
- package/modules/@apostrophecms/multisite-i18n/i18n/aposMultisite/en.json +48 -0
- package/modules/@apostrophecms/multisite-i18n/index.js +7 -0
- package/modules/@apostrophecms/notification/index.js +4 -4
- package/modules/@apostrophecms/notification/ui/apos/apps/AposNotification.js +6 -9
- package/modules/@apostrophecms/notification/ui/apos/components/AposNotification.vue +12 -8
- package/modules/@apostrophecms/oembed/index.js +10 -3
- package/modules/@apostrophecms/oembed-field/ui/apos/components/AposInputOembed.vue +4 -4
- package/modules/@apostrophecms/page/ui/apos/components/AposPagesManager.vue +15 -11
- package/modules/@apostrophecms/page/ui/apos/logic/AposPagesManager.js +1 -1
- package/modules/@apostrophecms/permission/ui/apos/components/AposInputRole.vue +3 -3
- package/modules/@apostrophecms/piece-type/ui/apos/components/AposDocsManager.vue +25 -17
- package/modules/@apostrophecms/piece-type/ui/apos/components/AposDocsManagerDisplay.vue +24 -20
- package/modules/@apostrophecms/piece-type/ui/apos/components/AposRelationshipEditor.vue +15 -11
- package/modules/@apostrophecms/polymorphic-type/index.js +0 -19
- package/modules/@apostrophecms/rich-text-widget/index.js +1 -0
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposImageControlDialog.vue +7 -6
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposRichTextWidgetEditor.vue +31 -30
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapAnchor.vue +12 -10
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapLink.vue +9 -8
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapStyles.vue +3 -3
- package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposTiptapTable.vue +3 -3
- package/modules/@apostrophecms/schema/index.js +30 -1
- package/modules/@apostrophecms/schema/ui/apos/components/AposArrayEditor.vue +10 -8
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputArea.vue +5 -3
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputArray.vue +81 -277
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputAttachment.vue +4 -2
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputBoolean.vue +24 -14
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputCheckboxes.vue +7 -6
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputColor.vue +10 -7
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputObject.vue +3 -3
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputRadio.vue +5 -4
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputRelationship.vue +15 -12
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputSelect.vue +1 -1
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputSlug.vue +16 -12
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputString.vue +19 -11
- package/modules/@apostrophecms/schema/ui/apos/components/AposInputWrapper.vue +1 -1
- package/modules/@apostrophecms/schema/ui/apos/components/AposSchema.vue +65 -21
- package/modules/@apostrophecms/schema/ui/apos/components/AposSubform.vue +2 -2
- package/modules/@apostrophecms/schema/ui/apos/logic/AposArrayEditor.js +0 -4
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputArea.js +3 -3
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputArray.js +15 -4
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputAttachment.js +3 -3
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputCheckboxes.js +7 -7
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputColor.js +5 -8
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputDateAndTime.js +1 -1
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputObject.js +1 -1
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputRadio.js +1 -1
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputRelationship.js +12 -9
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputSelect.js +2 -2
- package/modules/@apostrophecms/schema/ui/apos/logic/AposInputString.js +6 -8
- package/modules/@apostrophecms/schema/ui/apos/logic/AposSchema.js +39 -13
- package/modules/@apostrophecms/schema/ui/apos/logic/AposSubform.js +1 -1
- package/modules/@apostrophecms/schema/ui/apos/mixins/AposInputMixin.js +9 -9
- package/modules/@apostrophecms/schema/ui/apos/scss/AposInputArray.scss +205 -0
- package/modules/@apostrophecms/settings/ui/apos/components/AposSettingsManager.vue +4 -4
- package/modules/@apostrophecms/settings/ui/apos/logic/AposSettingsManager.js +4 -4
- package/modules/@apostrophecms/submitted-draft/ui/apos/components/AposSubmittedDraftIcon.vue +5 -4
- package/modules/@apostrophecms/ui/ui/apos/components/AposButton.vue +4 -4
- package/modules/@apostrophecms/ui/ui/apos/components/AposButtonGroup.vue +6 -6
- package/modules/@apostrophecms/ui/ui/apos/components/AposButtonSplit.vue +120 -113
- package/modules/@apostrophecms/ui/ui/apos/components/AposCheckbox.vue +19 -19
- package/modules/@apostrophecms/ui/ui/apos/components/AposCombo.vue +15 -15
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenu.vue +216 -191
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenuDialog.vue +77 -65
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenuItem.vue +1 -1
- package/modules/@apostrophecms/ui/ui/apos/components/AposContextMenuTip.vue +28 -50
- package/modules/@apostrophecms/ui/ui/apos/components/AposFile.vue +5 -5
- package/modules/@apostrophecms/ui/ui/apos/components/AposFilterMenu.vue +4 -4
- package/modules/@apostrophecms/ui/ui/apos/components/AposMinMaxCount.vue +5 -5
- package/modules/@apostrophecms/ui/ui/apos/components/AposPager.vue +14 -8
- package/modules/@apostrophecms/ui/ui/apos/components/AposSlat.vue +2 -2
- package/modules/@apostrophecms/ui/ui/apos/components/AposSlatList.vue +53 -59
- package/modules/@apostrophecms/ui/ui/apos/components/AposSubformPreview.vue +2 -2
- package/modules/@apostrophecms/ui/ui/apos/components/AposTagApply.vue +40 -35
- package/modules/@apostrophecms/ui/ui/apos/components/AposToggle.vue +2 -2
- package/modules/@apostrophecms/ui/ui/apos/components/AposTree.vue +9 -11
- package/modules/@apostrophecms/ui/ui/apos/components/AposTreeHeader.vue +5 -3
- package/modules/@apostrophecms/ui/ui/apos/components/AposTreeRows.vue +129 -129
- package/modules/@apostrophecms/ui/ui/apos/composables/AposTheme.js +11 -0
- package/modules/@apostrophecms/ui/ui/apos/lib/click-outside-element.js +4 -4
- package/modules/@apostrophecms/ui/ui/apos/lib/i18next.js +56 -50
- package/modules/@apostrophecms/ui/ui/apos/lib/tooltip.js +191 -0
- package/modules/@apostrophecms/ui/ui/apos/lib/vue.js +19 -10
- package/modules/@apostrophecms/ui/ui/apos/mixins/AposAdvisoryLockMixin.js +1 -1
- package/modules/@apostrophecms/ui/ui/apos/scss/global/_tables.scss +1 -1
- package/modules/@apostrophecms/ui/ui/apos/scss/global/_tooltips.scss +6 -22
- package/modules/@apostrophecms/ui/ui/apos/scss/shared/_table-rows.scss +1 -1
- package/modules/@apostrophecms/widget-type/index.js +8 -2
- package/modules/@apostrophecms/widget-type/ui/apos/components/AposWidgetEditor.vue +26 -22
- package/modules/@apostrophecms/widget-type/ui/apos/mixins/AposWidgetMixin.js +4 -4
- package/package.json +31 -44
- package/test/schemas.js +10 -4
- package/modules/@apostrophecms/ui/ui/apos/lib/localized-v-tooltip.js +0 -63
- package/modules/@apostrophecms/ui/ui/apos/lib/tooltip-options.js +0 -13
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
classes () {
|
|
31
|
-
return [ 'apos-input', `apos-input--${this.type}`, this.
|
|
31
|
+
return [ 'apos-input', `apos-input--${this.type}`, this.modelValue.duplicate && 'apos-input--error' ];
|
|
32
32
|
},
|
|
33
33
|
icon () {
|
|
34
34
|
if (this.error) {
|
|
@@ -78,11 +78,9 @@ export default {
|
|
|
78
78
|
this.$emit('return');
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
-
validate(value) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
if (typeof value === 'string' && !value.length) {
|
|
81
|
+
validate(value = '') {
|
|
82
|
+
const isString = typeof value === 'string';
|
|
83
|
+
if (isString && !value.length) {
|
|
86
84
|
// Also correct for float and integer because Vue coerces
|
|
87
85
|
// number fields to either a number or the empty string
|
|
88
86
|
return this.field.required ? 'required' : false;
|
|
@@ -104,12 +102,12 @@ export default {
|
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
if (this.field.min && minMaxFields.includes(this.field.type)) {
|
|
107
|
-
if ((
|
|
105
|
+
if ((!isString || value.length) && (this.minMaxComparable(value) < this.field.min)) {
|
|
108
106
|
return 'min';
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
if (this.field.max && minMaxFields.includes(this.field.type)) {
|
|
112
|
-
if ((
|
|
110
|
+
if ((!isString || value.length) && (this.minMaxComparable(value) > this.field.max)) {
|
|
113
111
|
return 'max';
|
|
114
112
|
}
|
|
115
113
|
}
|
|
@@ -4,7 +4,7 @@ import { getConditionTypesObject } from '../lib/conditionalFields';
|
|
|
4
4
|
export default {
|
|
5
5
|
name: 'AposSchema',
|
|
6
6
|
props: {
|
|
7
|
-
|
|
7
|
+
modelValue: {
|
|
8
8
|
type: Object,
|
|
9
9
|
required: true
|
|
10
10
|
},
|
|
@@ -87,7 +87,7 @@ export default {
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
emits: [
|
|
90
|
-
'
|
|
90
|
+
'update:model-value',
|
|
91
91
|
'reset',
|
|
92
92
|
'validate',
|
|
93
93
|
'update-doc-data'
|
|
@@ -120,7 +120,7 @@ export default {
|
|
|
120
120
|
required
|
|
121
121
|
},
|
|
122
122
|
value: {
|
|
123
|
-
data: this.
|
|
123
|
+
data: this.modelValue[item.name]
|
|
124
124
|
},
|
|
125
125
|
serverError: this.serverErrors && this.serverErrors[item.name],
|
|
126
126
|
modifiers: [
|
|
@@ -130,6 +130,32 @@ export default {
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
}, {});
|
|
133
|
+
},
|
|
134
|
+
hasCompareMeta() {
|
|
135
|
+
return this.schema.some(field => this.meta[field.name]?.['@apostrophecms/schema:compare']);
|
|
136
|
+
},
|
|
137
|
+
classes() {
|
|
138
|
+
const classes = [];
|
|
139
|
+
if (this.hasCompareMeta) {
|
|
140
|
+
classes.push('apos-schema--compare');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return classes;
|
|
144
|
+
},
|
|
145
|
+
compareMetaState() {
|
|
146
|
+
if (!this.hasCompareMeta) {
|
|
147
|
+
return {};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const compareMetaState = {};
|
|
151
|
+
this.schema.forEach(field => {
|
|
152
|
+
compareMetaState[field.name] = {
|
|
153
|
+
error: false,
|
|
154
|
+
data: this.meta[field.name]['@apostrophecms/schema:compare']
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
return compareMetaState;
|
|
133
159
|
}
|
|
134
160
|
},
|
|
135
161
|
watch: {
|
|
@@ -142,7 +168,7 @@ export default {
|
|
|
142
168
|
schema() {
|
|
143
169
|
this.populateDocData();
|
|
144
170
|
},
|
|
145
|
-
'
|
|
171
|
+
'modelValue.data._id'(_id) {
|
|
146
172
|
// The doc might be swapped out completely in cases such as the media
|
|
147
173
|
// library editor. Repopulate the fields if that happens.
|
|
148
174
|
if (
|
|
@@ -207,18 +233,18 @@ export default {
|
|
|
207
233
|
const fieldState = {};
|
|
208
234
|
|
|
209
235
|
// Though not in the schema, keep track of the _id field.
|
|
210
|
-
if (this.
|
|
211
|
-
next.data._id = this.
|
|
212
|
-
fieldState._id = { data: this.
|
|
236
|
+
if (this.modelValue.data._id) {
|
|
237
|
+
next.data._id = this.modelValue.data._id;
|
|
238
|
+
fieldState._id = { data: this.modelValue.data._id };
|
|
213
239
|
}
|
|
214
240
|
// Though not *always* in the schema, keep track of the archived status.
|
|
215
|
-
if (this.
|
|
216
|
-
next.data.archived = this.
|
|
217
|
-
fieldState.archived = { data: this.
|
|
241
|
+
if (this.modelValue.data.archived !== undefined) {
|
|
242
|
+
next.data.archived = this.modelValue.data.archived;
|
|
243
|
+
fieldState.archived = { data: this.modelValue.data.archived };
|
|
218
244
|
}
|
|
219
245
|
|
|
220
246
|
this.schema.forEach(field => {
|
|
221
|
-
const value = this.
|
|
247
|
+
const value = this.modelValue.data[field.name];
|
|
222
248
|
fieldState[field.name] = {
|
|
223
249
|
error: false,
|
|
224
250
|
data: (value === undefined) ? field.def : value
|
|
@@ -262,7 +288,7 @@ export default {
|
|
|
262
288
|
changeFound = true;
|
|
263
289
|
this.next.data[field.name] = this.fieldState[field.name].data;
|
|
264
290
|
} else {
|
|
265
|
-
this.next.data[field.name] = this.
|
|
291
|
+
this.next.data[field.name] = this.modelValue.data[field.name];
|
|
266
292
|
}
|
|
267
293
|
});
|
|
268
294
|
if (
|
|
@@ -275,7 +301,7 @@ export default {
|
|
|
275
301
|
|
|
276
302
|
if (changeFound) {
|
|
277
303
|
// ... removes need for deep watch at parent level
|
|
278
|
-
this.$emit('
|
|
304
|
+
this.$emit('update:model-value', { ...this.next });
|
|
279
305
|
}
|
|
280
306
|
},
|
|
281
307
|
displayComponent({ name, hidden = false }) {
|
|
@@ -2,11 +2,11 @@ import { klona } from 'klona';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
// Implements v-model pattern
|
|
5
|
-
emits: [ '
|
|
5
|
+
emits: [ 'update:modelValue' ],
|
|
6
6
|
props: {
|
|
7
7
|
// The value passed in from the parent component through the v-model
|
|
8
8
|
// directive.
|
|
9
|
-
|
|
9
|
+
modelValue: {
|
|
10
10
|
type: Object,
|
|
11
11
|
required: true
|
|
12
12
|
},
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
data () {
|
|
61
61
|
return {
|
|
62
|
-
next: (this.
|
|
62
|
+
next: (this.modelValue && this.modelValue.data !== undefined) ? this.modelValue.data : '',
|
|
63
63
|
error: false,
|
|
64
64
|
// This is just meant to be sufficient to prevent unintended collisions
|
|
65
65
|
// in the UI between id attributes
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
this.$el.addEventListener('focusin', this.focusInListener);
|
|
73
73
|
this.$el.addEventListener('focusout', this.focusOutListener);
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
unmounted () {
|
|
76
76
|
this.$el.removeEventListener('focusin', this.focusInListener);
|
|
77
77
|
this.$el.removeEventListener('focusout', this.focusOutListener);
|
|
78
78
|
},
|
|
@@ -102,7 +102,7 @@ export default {
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
watch: {
|
|
105
|
-
|
|
105
|
+
modelValue: {
|
|
106
106
|
deep: true,
|
|
107
107
|
handler (value) {
|
|
108
108
|
this.watchValue();
|
|
@@ -134,15 +134,15 @@ export default {
|
|
|
134
134
|
// If the field is conditional and isn't shown, disregard any errors.
|
|
135
135
|
const error = this.conditionMet === false ? false : this.validate(this.next);
|
|
136
136
|
|
|
137
|
-
this.$emit('
|
|
137
|
+
this.$emit('update:modelValue', {
|
|
138
138
|
data: error ? this.next : this.convert(this.next),
|
|
139
139
|
error,
|
|
140
|
-
ranValidation: this.conditionMet === false ? this.
|
|
140
|
+
ranValidation: this.conditionMet === false ? this.modelValue.ranValidation : true
|
|
141
141
|
});
|
|
142
142
|
},
|
|
143
143
|
watchValue () {
|
|
144
|
-
this.error = this.
|
|
145
|
-
this.next = this.
|
|
144
|
+
this.error = this.modelValue.error;
|
|
145
|
+
this.next = this.modelValue.data;
|
|
146
146
|
},
|
|
147
147
|
watchNext () {
|
|
148
148
|
this.validateAndEmit();
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
.apos-schema {
|
|
2
|
+
padding-top: $spacing-base;
|
|
3
|
+
padding-bottom: $spacing-base;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:deep(.apos-field--array.apos-field--error-duplicate) {
|
|
7
|
+
.apos-input {
|
|
8
|
+
border-color: var(--a-base-8);
|
|
9
|
+
}
|
|
10
|
+
.apos-input:focus {
|
|
11
|
+
box-shadow: 0 0 3px var(--a-base-8);
|
|
12
|
+
}
|
|
13
|
+
.apos-input-icon {
|
|
14
|
+
color: var(--a-base-2);
|
|
15
|
+
}
|
|
16
|
+
.apos-input--error {
|
|
17
|
+
border-color: var(--a-danger);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
:deep(.apos-input-relationship) {
|
|
21
|
+
.apos-slat__main {
|
|
22
|
+
min-width: 130px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.apos-is-dragging {
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
background: var(--a-base-4);
|
|
28
|
+
}
|
|
29
|
+
.apos-input-array-inline-empty {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
margin-bottom: $spacing-base;
|
|
35
|
+
padding: $spacing-triple 0;
|
|
36
|
+
border: 1px solid var(--a-base-9);
|
|
37
|
+
color: var(--a-base-8);
|
|
38
|
+
}
|
|
39
|
+
.apos-input-array-inline-empty-label {
|
|
40
|
+
@include type-label;
|
|
41
|
+
color: var(--a-base-3);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.apos-input-array-inline-table {
|
|
45
|
+
@include type-label;
|
|
46
|
+
position: relative;
|
|
47
|
+
left: -35px;
|
|
48
|
+
min-width: calc(100% + 35px);
|
|
49
|
+
width: max-content;
|
|
50
|
+
margin: 0 0 $spacing-base;
|
|
51
|
+
border-collapse: collapse;
|
|
52
|
+
|
|
53
|
+
th {
|
|
54
|
+
padding-left: $spacing-base;
|
|
55
|
+
padding-right: $spacing-base;
|
|
56
|
+
height: 40px;
|
|
57
|
+
border: 1px solid var(--a-base-9);
|
|
58
|
+
text-align: left;
|
|
59
|
+
background-color: var(--a-base-10);
|
|
60
|
+
}
|
|
61
|
+
.apos-table-cell--hidden {
|
|
62
|
+
padding-left: 5px;
|
|
63
|
+
border: none;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
td, :deep(td) {
|
|
69
|
+
padding: $spacing-base;
|
|
70
|
+
border: 1px solid var(--a-base-9);
|
|
71
|
+
vertical-align: middle;
|
|
72
|
+
text-align: center;
|
|
73
|
+
transition: background-color 0.3s ease;
|
|
74
|
+
background-color: var(--a-background-primary);
|
|
75
|
+
}
|
|
76
|
+
td.apos-input-array-inline-item-controls {
|
|
77
|
+
width: 15px;
|
|
78
|
+
min-width: 15px;
|
|
79
|
+
border: none;
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
tr.apos-is-dragging, :deep(tr.apos-is-dragging) {
|
|
83
|
+
td, &:hover td {
|
|
84
|
+
background: var(--a-base-4);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
tr:hover, :deep(tr:hover) {
|
|
88
|
+
td {
|
|
89
|
+
background-color: var(--a-base-10);
|
|
90
|
+
}
|
|
91
|
+
td.apos-input-array-inline-item-controls {
|
|
92
|
+
background-color: transparent;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:deep(.apos-field__info) {
|
|
97
|
+
padding-top: 0;
|
|
98
|
+
}
|
|
99
|
+
:deep(.apos-field__label) {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
:deep(.apos-input-wrapper) {
|
|
103
|
+
padding: 0 4px;
|
|
104
|
+
}
|
|
105
|
+
:deep(.apos-input--select) {
|
|
106
|
+
min-width: 130px;
|
|
107
|
+
}
|
|
108
|
+
:deep(.apos-input--relationship) {
|
|
109
|
+
width: 100%;
|
|
110
|
+
min-width: 150px;
|
|
111
|
+
}
|
|
112
|
+
:deep(.apos-schema .apos-field.apos-field--small),
|
|
113
|
+
:deep(.apos-schema .apos-field.apos-field--micro),
|
|
114
|
+
:deep(.apos-schema .apos-field.apos-field--margin-micro) {
|
|
115
|
+
margin-bottom: 0;
|
|
116
|
+
}
|
|
117
|
+
:deep(.apos-search) {
|
|
118
|
+
z-index: calc(#{$z-index-widget-focused-controls} + 1);
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 35px;
|
|
121
|
+
width: 100%;
|
|
122
|
+
min-width: 350px;
|
|
123
|
+
}
|
|
124
|
+
:deep(.apos-slat-list .apos-slat),
|
|
125
|
+
:deep(.apos-input-relationship__items) {
|
|
126
|
+
margin-top: 0;
|
|
127
|
+
margin-bottom: 0;
|
|
128
|
+
}
|
|
129
|
+
:deep(.apos-input-relationship__input-wrapper :disabled) {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
:deep(.apos-field__error) {
|
|
133
|
+
position: absolute;
|
|
134
|
+
bottom: 13px;
|
|
135
|
+
left: $spacing-base;
|
|
136
|
+
}
|
|
137
|
+
:deep(.apos-field--relationship .apos-field__error) {
|
|
138
|
+
z-index: calc(#{$z-index-widget-focused-controls} + 1);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.apos-input-array-inline-standard {
|
|
143
|
+
.apos-input-array-inline-collapse {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: $spacing-quadruple;
|
|
146
|
+
left: $spacing-base;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:deep(.apos-schema) {
|
|
150
|
+
position: relative;
|
|
151
|
+
display: grid;
|
|
152
|
+
grid-template-columns: 35px auto 35px;
|
|
153
|
+
gap: 5px;
|
|
154
|
+
width: 100%;
|
|
155
|
+
padding-bottom: $spacing-base;
|
|
156
|
+
border-bottom: 1px solid var(--a-base-9);
|
|
157
|
+
transition: background-color 0.3s ease;
|
|
158
|
+
&:hover {
|
|
159
|
+
background-color: var(--a-base-10);
|
|
160
|
+
}
|
|
161
|
+
.apos-field.apos-field--small,
|
|
162
|
+
.apos-field.apos-field--micro,
|
|
163
|
+
.apos-field.apos-field--margin-micro {
|
|
164
|
+
margin-bottom: 0;
|
|
165
|
+
}
|
|
166
|
+
& > div {
|
|
167
|
+
grid-column: 2;
|
|
168
|
+
}
|
|
169
|
+
&.apos-input-array-inline-item--active {
|
|
170
|
+
background-color: var(--a-base-10);
|
|
171
|
+
border-bottom: 1px solid var(--a-base-6);
|
|
172
|
+
}
|
|
173
|
+
&.apos-input-array-inline-item--active > div {
|
|
174
|
+
display: block;
|
|
175
|
+
}
|
|
176
|
+
.apos-input-array-inline-label,
|
|
177
|
+
.apos-input-array-inline-item-controls,
|
|
178
|
+
.apos-input-array-inline-item-controls--remove {
|
|
179
|
+
display: block;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.apos-input-array-inline-label {
|
|
183
|
+
transition: background-color 0.3s ease;
|
|
184
|
+
@include type-label;
|
|
185
|
+
margin: 0;
|
|
186
|
+
padding-top: $spacing-base;
|
|
187
|
+
padding-bottom: $spacing-base;
|
|
188
|
+
text-align: left;
|
|
189
|
+
grid-column: 2;
|
|
190
|
+
}
|
|
191
|
+
.apos-input-array-inline-label:hover {
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.apos-input-array-inline-item-controls {
|
|
196
|
+
padding: $spacing-base;
|
|
197
|
+
grid-column: 1;
|
|
198
|
+
grid-row: 1;
|
|
199
|
+
}
|
|
200
|
+
.apos-input-array-inline-item-controls--remove {
|
|
201
|
+
grid-column: 3;
|
|
202
|
+
grid-row: 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -94,7 +94,7 @@ export default {
|
|
|
94
94
|
.apos-settings {
|
|
95
95
|
@include type-base;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
:deep(.apos-modal__inner) {
|
|
98
98
|
// 1/2 or 2/3 width
|
|
99
99
|
// $width: calc(100vw / 2);
|
|
100
100
|
$width: min(700px, calc(calc(100vw / 3) * 2));
|
|
@@ -109,16 +109,16 @@ export default {
|
|
|
109
109
|
height: calc(100vh - #{$vertical-spacing * 2});
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
:deep(.apos-modal__main--with-left-rail) {
|
|
113
113
|
grid-template-columns: 25% 75%;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
:deep(.apos-modal__body-inner) {
|
|
117
117
|
// padding: $spacing-triple $spacing-triple $spacing-double;
|
|
118
118
|
padding: $spacing-double $spacing-triple;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
:deep(.apos-modal__header__main) {
|
|
122
122
|
// padding: $spacing-triple $spacing-triple $spacing-double;
|
|
123
123
|
padding: $spacing-double $spacing-triple;
|
|
124
124
|
}
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
beforeUnmount() {
|
|
81
81
|
clearTimeout(this.restoreRefTimeout);
|
|
82
82
|
Object.values(this.subformUpdateTimeouts)
|
|
83
83
|
.forEach(clearTimeout);
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
this.expanded = event.value ? event.name : null;
|
|
91
91
|
if (this.expanded) {
|
|
92
92
|
clearTimeout(this.subformUpdateTimeouts[event.name]);
|
|
93
|
-
|
|
93
|
+
delete this.setSubformValues[event.name];
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
async submit(event) {
|
|
@@ -125,9 +125,9 @@ export default {
|
|
|
125
125
|
},
|
|
126
126
|
setUpdatedTimeout(name, ms = 3000) {
|
|
127
127
|
const updateTimeout = setTimeout(() => {
|
|
128
|
-
|
|
128
|
+
delete this.subformUpdateTimeouts[name];
|
|
129
129
|
}, ms);
|
|
130
|
-
this
|
|
130
|
+
this.subformUpdateTimeouts[name] = updateTimeout;
|
|
131
131
|
},
|
|
132
132
|
async loadData() {
|
|
133
133
|
const result = await apos.http.get(this.action, {
|
package/modules/@apostrophecms/submitted-draft/ui/apos/components/AposSubmittedDraftIcon.vue
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<AposButton
|
|
3
3
|
icon="tray-full-icon"
|
|
4
|
-
type="subtle"
|
|
5
|
-
|
|
4
|
+
type="subtle"
|
|
5
|
+
:modifiers="['small', 'no-motion']"
|
|
6
6
|
:disabled="count <= 0"
|
|
7
7
|
:tooltip="tooltip"
|
|
8
8
|
:icon-only="true"
|
|
9
|
+
@click="open"
|
|
9
10
|
>
|
|
10
11
|
<template #label>
|
|
11
12
|
<span v-if="canPublish && count > 0" class="apos-submitted-drafts__counter">
|
|
@@ -37,7 +38,7 @@ export default {
|
|
|
37
38
|
mounted() {
|
|
38
39
|
this.updateCount();
|
|
39
40
|
},
|
|
40
|
-
|
|
41
|
+
unmounted() {
|
|
41
42
|
if (this.timeout) {
|
|
42
43
|
clearTimeout(this.timeout);
|
|
43
44
|
}
|
|
@@ -69,7 +70,7 @@ export default {
|
|
|
69
70
|
</script>
|
|
70
71
|
|
|
71
72
|
<style lang="scss" scoped>
|
|
72
|
-
|
|
73
|
+
:deep(.apos-submitted-drafts__counter) {
|
|
73
74
|
display: inline-flex;
|
|
74
75
|
margin-left: $spacing-half;
|
|
75
76
|
padding: 3px;
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
:data-apos-test="actionTestLabel"
|
|
7
7
|
>
|
|
8
8
|
<component
|
|
9
|
+
v-bind="attrs"
|
|
9
10
|
:is="href ? 'a' : 'button'"
|
|
10
|
-
|
|
11
|
+
:id="attrs.id ? attrs.id : id"
|
|
11
12
|
:href="href.length ? href : false"
|
|
12
13
|
class="apos-button"
|
|
13
14
|
:class="modifierClass"
|
|
@@ -15,12 +16,11 @@
|
|
|
15
16
|
:disabled="isDisabled"
|
|
16
17
|
:type="buttonType"
|
|
17
18
|
:role="role"
|
|
18
|
-
:id="attrs.id ? attrs.id : id"
|
|
19
19
|
:style="{color: textColor}"
|
|
20
|
-
v-
|
|
20
|
+
v-on="href ? {} : {click: click}"
|
|
21
21
|
>
|
|
22
22
|
<transition name="fade">
|
|
23
|
-
<AposSpinner
|
|
23
|
+
<AposSpinner v-if="busy" :color="spinnerColor" />
|
|
24
24
|
</transition>
|
|
25
25
|
<span
|
|
26
26
|
v-if="colorStyle"
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
52
52
|
display: inline-flex;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.apos-button-group
|
|
55
|
+
.apos-button-group :deep(.apos-button) {
|
|
56
56
|
background-color: var(--a-background-primary);
|
|
57
57
|
border: none;
|
|
58
58
|
&:hover {
|
|
@@ -81,13 +81,13 @@ export default {
|
|
|
81
81
|
// group-specific style overrides
|
|
82
82
|
|
|
83
83
|
// transform weirds this out
|
|
84
|
-
.apos-button-group
|
|
85
|
-
.apos-button-group
|
|
84
|
+
.apos-button-group :deep(.apos-button:hover,)
|
|
85
|
+
.apos-button-group :deep(.apos-button:focus) {
|
|
86
86
|
transform: none;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// border throws off bounding shell
|
|
90
|
-
.apos-button-group
|
|
90
|
+
.apos-button-group :deep(.apos-button:focus) {
|
|
91
91
|
border: none;
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -97,7 +97,7 @@ export default {
|
|
|
97
97
|
background-color: var(--a-background-inverted);
|
|
98
98
|
color: var(--a-text-inverted);
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
&:deep(.apos-button) {
|
|
101
101
|
border: none;
|
|
102
102
|
background-color: var(--a-background-inverted);
|
|
103
103
|
color: var(--a-text-inverted);
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
border: 1px solid var(--a-primary-dark-10);
|
|
117
117
|
color: var(--a-primary-dark-10);
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
&:deep(.apos-button) {
|
|
120
120
|
background-color: var(--a-background-primary);
|
|
121
121
|
color: var(--a-primary-dark-10);
|
|
122
122
|
&:hover {
|