diff --git a/resources/css/components/tabs.css b/resources/css/components/tabs.css index 22c9b7f2ca4..0f5feb22a08 100644 --- a/resources/css/components/tabs.css +++ b/resources/css/components/tabs.css @@ -88,3 +88,15 @@ @screen md { .tabs .tab-button { @apply text-base; } } + +.pill-tab { + @apply text-gray-700 flex items-center focus:outline-none px-2 py-1 rounded; + + &:hover { + @apply text-gray-900; + } + + &.active { + @apply bg-blue-100 text-blue-900; + } +} diff --git a/resources/css/elements/badges.css b/resources/css/elements/badges.css index f0b3c4f22e0..3ca495a000e 100644 --- a/resources/css/elements/badges.css +++ b/resources/css/elements/badges.css @@ -27,19 +27,23 @@ } .filter-badge { - @apply text-2xs text-gray-800 bg-gray-300 flex items-center; - height: 1.625rem; /* 24px */ + @apply text-2xs text-gray-800 bg-white border flex items-center rounded-full; + height: 1.625rem; padding-left: 10px; button { - @apply px-2 text-base text-gray-500 flex items-center rounded; + @apply px-2 text-base text-gray-600 flex items-center rounded; &:hover { - @apply text-gray-700; + @apply text-gray-800; } &:focus { @apply focus-outline; } } + + &.filter-badge-control { + @apply bg-gray-200 border border-gray-500 border-dashed hover:border-gray-600 hover:bg-gray-300; + } } diff --git a/resources/css/elements/buttons.css b/resources/css/elements/buttons.css index 4e37adaccc5..103c883038d 100644 --- a/resources/css/elements/buttons.css +++ b/resources/css/elements/buttons.css @@ -97,7 +97,7 @@ button { } &:focus { - @apply focus-outline bg-gray-300; + @apply ring-2 outline-none; } &:active, &:focus:active { diff --git a/resources/css/elements/forms.css b/resources/css/elements/forms.css index f8e82b455d1..560c4a255c6 100644 --- a/resources/css/elements/forms.css +++ b/resources/css/elements/forms.css @@ -142,7 +142,10 @@ input.input-text-minimal:read-only, .radio-fieldtype .option, .checkboxes-fieldtype .option { - @apply mt-3 flex items-center; + @apply flex items-center; + &:not(:first-child) { + @apply mt-3; + } input { @apply leading-normal mr-1; diff --git a/resources/css/elements/tables.css b/resources/css/elements/tables.css index 7cda6424471..721e009095b 100644 --- a/resources/css/elements/tables.css +++ b/resources/css/elements/tables.css @@ -16,7 +16,7 @@ } .data-list-bulk-actions { - @apply bg-white absolute w-full py-3 z-10; + @apply bg-white absolute w-full py-2 z-10; padding-left: 56px; } @@ -37,16 +37,16 @@ overflow-x: auto; thead { - @apply text-sm text-gray-700 text-gray-900; + @apply bg-gray-100 text-xs text-gray-700 text-gray-900; tr { @apply border-b; } th { - @apply font-medium px-4 py-3; - &:first-child { @apply rounded-tl; } - &:last-child { @apply rounded-tr; } + @apply font-medium px-4 py-2; + &:first-child { @apply rounded-tl-lg; } + &:last-child { @apply rounded-tr-lg; } &:hover { @apply text-gray-900; } @@ -127,12 +127,10 @@ } &.current-column { - @apply font-bold; svg { opacity: 1; } } svg { - /* transition: all 150ms ease; */ opacity: 0; } diff --git a/resources/js/components/DropdownList.vue b/resources/js/components/DropdownList.vue index cc78b5dbc3b..576061d93f6 100644 --- a/resources/js/components/DropdownList.vue +++ b/resources/js/components/DropdownList.vue @@ -20,7 +20,7 @@ export default { }, placement: { type: String, - default: 'bottom-end' + default: 'bottom' }, scroll: { type: Boolean, diff --git a/resources/js/components/Popover.vue b/resources/js/components/Popover.vue index ee15514833e..4dcf1a27aa9 100644 --- a/resources/js/components/Popover.vue +++ b/resources/js/components/Popover.vue @@ -26,7 +26,7 @@ export default { }, placement: { type: String, - default: 'bottom-end', + default: 'bottom', }, offset: { type: Array, diff --git a/resources/js/components/data-list/BulkActions.vue b/resources/js/components/data-list/BulkActions.vue index 6f4e246407f..ec1db482be7 100644 --- a/resources/js/components/data-list/BulkActions.vue +++ b/resources/js/components/data-list/BulkActions.vue @@ -3,8 +3,9 @@
-
+
diff --git a/resources/js/components/data-list/Filter.vue b/resources/js/components/data-list/Filter.vue index e5765c689a8..f64f0415cb0 100644 --- a/resources/js/components/data-list/Filter.vue +++ b/resources/js/components/data-list/Filter.vue @@ -2,7 +2,7 @@
-
+
+
-
+ + + + +
@@ -16,13 +47,21 @@ export default { props: { + activeFilters: Object, activePreset: String, + activePresetPayload: Object, + hasActiveFilters: Boolean, preferencesPrefix: String, + searchQuery: String, }, data() { return { presets: [], + showDeleteModal: false, + showSaveModal: false, + savingPresetName: null, + test: 'hello!' } }, @@ -30,6 +69,17 @@ export default { preferencesKey() { return this.preferencesPrefix ? `${this.preferencesPrefix}.filters` : null; }, + + presetPreferencesPayload() { + let payload = { + display: this.savingPresetName || this.activePresetPayload.display, + }; + + if (this.searchQuery) payload.query = this.searchQuery; + if (this.hasActiveFilters) payload.filters = clone(this.activeFilters); + + return payload; + }, }, created() { @@ -48,11 +98,62 @@ export default { this.viewPreset(handle) }, + deletePreset() { + this.$preferences.remove(`${this.preferencesKey}.${this.activePreset}`) + .then(response => { + this.$emit('deleted', this.activePreset); + this.$toast.success(__('View deleted')); + this.showDeleteModal = false; + this.refreshPresets(); + }) + .catch(error => { + this.$toast.error(__('Unable to delete view')); + this.showDeleteModal = false; + }); + }, + + savePreset() { + if (!this.activePreset) { + this.showSaveModal = true; + return; + } + + this.handleSavePreset(); + }, + + createNewEmptyPreset() { + this.savingPresetName = null; + this.showSaveModal = true; + }, + + handleSavePreset() { + let presetHandle = this.activePreset || this.$slugify(this.savingPresetName, '_'); + + this.$preferences.set(`${this.preferencesKey}.${presetHandle}`, this.presetPreferencesPayload) + .then(response => { + this.$toast.success(__('View saved')); + this.showSaveModal = false; + this.getPresets(); + this.viewPreset(presetHandle); + this.hasActiveFilters ? this.refreshPreset() : this.$emit('show-filters'); + }) + .catch(error => { + this.$toast.error(__('Unable to save view')); + this.showSaveModal = false; + }); + }, + refreshPresets() { this.getPresets(); this.viewAll(); }, + refreshPreset() { + this.getPresets(); + this.$emit('hide-filters'); + this.viewPreset(this.activePreset); + }, + viewAll() { this.$emit('reset'); }, diff --git a/resources/js/components/data-list/Filters.vue b/resources/js/components/data-list/Filters.vue index becb28080ae..b7eb311adf2 100644 --- a/resources/js/components/data-list/Filters.vue +++ b/resources/js/components/data-list/Filters.vue @@ -1,29 +1,19 @@