@awes-io/ui 2.142.3 → 2.144.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/assets/css/components/_index.css +7 -1
- package/assets/css/components/action-card.css +1 -0
- package/assets/css/components/action-icon.css +2 -2
- package/assets/css/components/alert.css +28 -22
- package/assets/css/components/animation.css +52 -32
- package/assets/css/components/badge.css +1 -0
- package/assets/css/components/banner-text.css +15 -4
- package/assets/css/components/card.css +0 -1
- package/assets/css/components/content-placeholder.css +104 -0
- package/assets/css/components/dropdown.css +20 -7
- package/assets/css/components/empty-container.css +69 -1
- package/assets/css/components/filter-chosen.css +6 -0
- package/assets/css/components/filter-date-range.css +17 -1
- package/assets/css/components/filter-month.css +23 -17
- package/assets/css/components/filter-select.css +11 -0
- package/assets/css/components/icon-menu-item.css +12 -7
- package/assets/css/components/layout.css +1 -32
- package/assets/css/components/mobile-menu-nav.css +8 -4
- package/assets/css/components/modal.css +1 -1
- package/assets/css/components/number.css +12 -0
- package/assets/css/components/page-aside.css +54 -0
- package/assets/css/components/text-field.css +4 -0
- package/assets/js/css.js +1 -1
- package/assets/js/icons/mono.js +59 -91
- package/assets/js/icons/multicolor.js +1 -31
- package/components/1_atoms/AwActionIcon.vue +11 -2
- package/components/1_atoms/AwContentPlaceholder.vue +60 -0
- package/components/1_atoms/AwFlow.vue +37 -49
- package/components/1_atoms/AwGrid.vue +11 -3
- package/components/1_atoms/AwIcon/AwIcon.vue +5 -3
- package/components/1_atoms/AwIcon/AwIconSystemMono.vue +3 -2
- package/components/1_atoms/AwInput.vue +2 -2
- package/components/1_atoms/AwLabel.vue +1 -1
- package/components/1_atoms/AwList.vue +3 -1
- package/components/1_atoms/AwRadio.vue +1 -1
- package/components/1_atoms/AwSlider.vue +15 -1
- package/components/1_atoms/AwTag.vue +6 -1
- package/components/2_molecules/AwAlert.vue +63 -42
- package/components/2_molecules/AwBadge.vue +1 -1
- package/components/2_molecules/AwBannerText.vue +8 -2
- package/components/2_molecules/AwButton.vue +1 -1
- package/components/2_molecules/AwDescriptionInput.vue +19 -1
- package/components/2_molecules/AwEmptyContainer.vue +74 -72
- package/components/2_molecules/AwNumber.vue +180 -0
- package/components/2_molecules/AwSelect.vue +11 -4
- package/components/3_organisms/AwBottomBar.vue +22 -4
- package/components/3_organisms/AwFilterChosen.vue +73 -0
- package/components/3_organisms/AwFilterDateRange.vue +177 -0
- package/components/3_organisms/AwFilterMonth.vue +37 -40
- package/components/3_organisms/AwFilterSelect.vue +368 -0
- package/components/3_organisms/AwMultiBlockBuilder.vue +1 -1
- package/components/3_organisms/AwSubnav.vue +11 -1
- package/components/3_organisms/AwTable/AwTableBuilder.vue +20 -60
- package/components/3_organisms/AwTable/_AwTableCellDropdown.vue +6 -1
- package/components/3_organisms/AwTable/_AwTableRow.vue +2 -1
- package/components/4_pages/AwPage.vue +1 -0
- package/components/4_pages/AwPageAside.vue +108 -0
- package/components/5_layouts/AwLayoutCenter.vue +3 -8
- package/components/5_layouts/_AwMenuItemIcon.vue +9 -2
- package/components/5_layouts/_AwMobileMenuItem.vue +5 -3
- package/components/5_layouts/_AwUserMenu.vue +1 -1
- package/components/_config.js +26 -1
- package/docs/_template.md +80 -0
- package/docs/components/atoms/aw-accordion-fold.md +129 -0
- package/docs/components/atoms/aw-action-card-body.md +99 -0
- package/docs/components/atoms/aw-action-card.md +130 -0
- package/docs/components/atoms/aw-action-icon.md +126 -0
- package/docs/components/atoms/aw-avatar.md +106 -0
- package/docs/components/atoms/aw-card.md +137 -0
- package/docs/components/atoms/aw-checkbox.md +288 -0
- package/docs/components/atoms/aw-content-placeholder.md +147 -0
- package/docs/components/atoms/aw-description.md +83 -0
- package/docs/components/atoms/aw-dock.md +90 -0
- package/docs/components/atoms/aw-dropdown-button.md +94 -0
- package/docs/components/atoms/aw-dropdown.md +178 -0
- package/docs/components/atoms/aw-file.md +73 -0
- package/docs/components/atoms/aw-flow.md +140 -0
- package/docs/components/atoms/aw-grid.md +109 -0
- package/docs/components/atoms/aw-headline.md +71 -0
- package/docs/components/atoms/aw-icon-system-color.md +122 -0
- package/docs/components/atoms/aw-icon-system-mono.md +206 -0
- package/docs/components/atoms/aw-icon.md +235 -0
- package/docs/components/atoms/aw-info.md +123 -0
- package/docs/components/atoms/aw-input.md +212 -0
- package/docs/components/atoms/aw-label.md +136 -0
- package/docs/components/atoms/aw-link.md +151 -0
- package/docs/components/atoms/aw-list.md +152 -0
- package/docs/components/atoms/aw-progress.md +119 -0
- package/docs/components/atoms/aw-radio.md +182 -0
- package/docs/components/atoms/aw-refresh-wrapper.md +81 -0
- package/docs/components/atoms/aw-select-native.md +234 -0
- package/docs/components/atoms/aw-slider.md +189 -0
- package/docs/components/atoms/aw-sub-headline.md +73 -0
- package/docs/components/atoms/aw-switcher.md +192 -0
- package/docs/components/atoms/aw-tag.md +144 -0
- package/docs/components/atoms/aw-title.md +70 -0
- package/docs/components/atoms/aw-toggler.md +90 -0
- package/docs/components/layouts/aw-layout-center.md +168 -0
- package/docs/components/layouts/aw-layout-error.md +153 -0
- package/docs/components/layouts/aw-layout-provider.md +238 -0
- package/docs/components/layouts/aw-layout.md +88 -0
- package/docs/components/molecules/aw-action-button.md +138 -0
- package/docs/components/molecules/aw-alert.md +191 -0
- package/docs/components/molecules/aw-badge.md +129 -0
- package/docs/components/molecules/aw-banner-text.md +156 -0
- package/docs/components/molecules/aw-button-nav.md +111 -0
- package/docs/components/molecules/aw-button.md +193 -0
- package/docs/components/molecules/aw-description-input.md +124 -0
- package/docs/components/molecules/aw-empty-container.md +235 -0
- package/docs/components/molecules/aw-island.md +506 -0
- package/docs/components/molecules/aw-number.md +138 -0
- package/docs/components/molecules/aw-select-object.md +401 -0
- package/docs/components/molecules/aw-select.md +215 -0
- package/docs/components/molecules/aw-tab-nav.md +108 -0
- package/docs/components/molecules/aw-tel.md +129 -0
- package/docs/components/molecules/aw-textarea.md +83 -0
- package/docs/components/molecules/aw-userpic.md +115 -0
- package/docs/components/organisms/aw-address-block.md +64 -0
- package/docs/components/organisms/aw-address.md +132 -0
- package/docs/components/organisms/aw-birthday-picker.md +73 -0
- package/docs/components/organisms/aw-bottom-bar.md +66 -0
- package/docs/components/organisms/aw-calendar-days.md +115 -0
- package/docs/components/organisms/aw-calendar-nav.md +98 -0
- package/docs/components/organisms/aw-calendar-view.md +98 -0
- package/docs/components/organisms/aw-calendar.md +166 -0
- package/docs/components/organisms/aw-chart.md +154 -0
- package/docs/components/organisms/aw-chip-select.md +164 -0
- package/docs/components/organisms/aw-chip.md +126 -0
- package/docs/components/organisms/aw-code-snippet.md +94 -0
- package/docs/components/organisms/aw-code.md +132 -0
- package/docs/components/organisms/aw-context-menu.md +117 -0
- package/docs/components/organisms/aw-cropper.md +151 -0
- package/docs/components/organisms/aw-date.md +161 -0
- package/docs/components/organisms/aw-display-date.md +33 -0
- package/docs/components/organisms/aw-download-link.md +46 -0
- package/docs/components/organisms/aw-fetch-data.md +161 -0
- package/docs/components/organisms/aw-filter-chosen.md +226 -0
- package/docs/components/organisms/aw-filter-date-range.md +205 -0
- package/docs/components/organisms/aw-filter-month.md +43 -0
- package/docs/components/organisms/aw-filter-select.md +239 -0
- package/docs/components/organisms/aw-form.md +174 -0
- package/docs/components/organisms/aw-gmap-marker.md +86 -0
- package/docs/components/organisms/aw-gmap.md +90 -0
- package/docs/components/organisms/aw-image-upload.md +56 -0
- package/docs/components/organisms/aw-island-avatar.md +87 -0
- package/docs/components/organisms/aw-markdown-editor.md +104 -0
- package/docs/components/organisms/aw-modal-buttons.md +57 -0
- package/docs/components/organisms/aw-modal.md +246 -0
- package/docs/components/organisms/aw-model-edit.md +74 -0
- package/docs/components/organisms/aw-money.md +53 -0
- package/docs/components/organisms/aw-multi-block-builder.md +165 -0
- package/docs/components/organisms/aw-pagination.md +121 -0
- package/docs/components/organisms/aw-password.md +103 -0
- package/docs/components/organisms/aw-preview-card.md +45 -0
- package/docs/components/organisms/aw-search.md +116 -0
- package/docs/components/organisms/aw-subnav.md +122 -0
- package/docs/components/organisms/aw-table-builder.md +165 -0
- package/docs/components/organisms/aw-table-col.md +123 -0
- package/docs/components/organisms/aw-table-head.md +92 -0
- package/docs/components/organisms/aw-table-row.md +91 -0
- package/docs/components/organisms/aw-table.md +172 -0
- package/docs/components/organisms/aw-tags.md +54 -0
- package/docs/components/organisms/aw-toggle-show-aside.md +43 -0
- package/docs/components/organisms/aw-uploader-files.md +125 -0
- package/docs/components/organisms/aw-uploader.md +163 -0
- package/docs/components/organisms/aw-user-menu.md +87 -0
- package/docs/components/pages/aw-page-aside.md +296 -0
- package/docs/components/pages/aw-page-menu-buttons.md +172 -0
- package/docs/components/pages/aw-page-modal.md +198 -0
- package/docs/components/pages/aw-page-single.md +300 -0
- package/docs/components/pages/aw-page.md +194 -0
- package/docs/configuration.md +493 -0
- package/docs/cookbook/advanced-patterns.md +1388 -0
- package/docs/cookbook/common-patterns.md +965 -0
- package/docs/cookbook/index.md +786 -0
- package/docs/getting-started.md +596 -0
- package/docs/guides/best-practices.md +1106 -0
- package/docs/guides/data-fetching.md +852 -0
- package/docs/guides/error-handling.md +1172 -0
- package/docs/guides/forms-guide.md +1329 -0
- package/docs/guides/mobile-subnavigation.md +359 -0
- package/docs/guides/page-patterns/aside-pages.md +1418 -0
- package/docs/guides/page-patterns/dashboard-pages.md +990 -0
- package/docs/guides/page-patterns/detail-pages.md +1556 -0
- package/docs/guides/page-patterns/list-pages.md +1242 -0
- package/docs/index.md +263 -1
- package/docs/integrations.md +870 -0
- package/docs/reference/colors.md +232 -0
- package/docs/reference/icons.md +163 -0
- package/docs/reference/menu.md +462 -0
- package/docs/reference/plugins.md +970 -0
- package/docs/reference/troubleshooting.md +964 -0
- package/nuxt/awes.config.js +9 -8
- package/nuxt/index.js +2 -2
- package/nuxt/pages/more.vue +1 -1
- package/package.json +5 -3
- package/readme.md +171 -1
- package/store/awesIo.js +11 -0
- package/CHANGELOG.md +0 -4520
- package/docs/aw-accordion-fold.md +0 -46
- package/docs/aw-address.md +0 -44
- package/docs/aw-avatar.md +0 -51
- package/docs/aw-badge.md +0 -32
- package/docs/aw-button-nav.md +0 -44
- package/docs/aw-button.md +0 -50
- package/docs/aw-calendar-days.md +0 -46
- package/docs/aw-calendar-nav.md +0 -25
- package/docs/aw-calendar-view.md +0 -12
- package/docs/aw-calendar.md +0 -59
- package/docs/aw-card.md +0 -48
- package/docs/aw-chart.md +0 -51
- package/docs/aw-checkbox.md +0 -56
- package/docs/aw-chip-select.md +0 -46
- package/docs/aw-chip.md +0 -53
- package/docs/aw-code-snippet.md +0 -18
- package/docs/aw-code.md +0 -56
- package/docs/aw-content-wrapper.md +0 -40
- package/docs/aw-context-menu.md +0 -31
- package/docs/aw-cropper.md +0 -60
- package/docs/aw-dashboard-card.md +0 -37
- package/docs/aw-dashboard-donut.md +0 -30
- package/docs/aw-dashboard-line.md +0 -20
- package/docs/aw-dashboard-progress.md +0 -33
- package/docs/aw-dashboard-section.md +0 -32
- package/docs/aw-dashboard-speed.md +0 -30
- package/docs/aw-date.md +0 -52
- package/docs/aw-dropdown-button.md +0 -31
- package/docs/aw-dropdown.md +0 -69
- package/docs/aw-fetch-data.md +0 -45
- package/docs/aw-form.md +0 -52
- package/docs/aw-grid.md +0 -48
- package/docs/aw-icon.md +0 -50
- package/docs/aw-info.md +0 -53
- package/docs/aw-input.md +0 -55
- package/docs/aw-layout-default.md +0 -30
- package/docs/aw-layout-frame-center.md +0 -29
- package/docs/aw-layout-simple.md +0 -49
- package/docs/aw-link.md +0 -54
- package/docs/aw-markdown-editor.md +0 -51
- package/docs/aw-modal.md +0 -63
- package/docs/aw-multi-block-builder.md +0 -66
- package/docs/aw-page.md +0 -36
- package/docs/aw-pagination.md +0 -54
- package/docs/aw-password.md +0 -48
- package/docs/aw-radio.md +0 -54
- package/docs/aw-search.md +0 -49
- package/docs/aw-select.md +0 -93
- package/docs/aw-slider.md +0 -40
- package/docs/aw-svg-image.md +0 -19
- package/docs/aw-switcher.md +0 -51
- package/docs/aw-tab-nav.md +0 -55
- package/docs/aw-table-builder.md +0 -58
- package/docs/aw-table-col.md +0 -33
- package/docs/aw-table-head.md +0 -28
- package/docs/aw-table-row.md +0 -33
- package/docs/aw-table.md +0 -59
- package/docs/aw-tel.md +0 -47
- package/docs/aw-textarea.md +0 -47
- package/docs/aw-toggler.md +0 -41
- package/docs/aw-uploader-files.md +0 -20
- package/docs/aw-uploader.md +0 -60
- package/docs/aw-user-menu.md +0 -34
- package/docs/aw-userpic.md +0 -34
- /package/components/{3_organisms → 2_molecules}/AwTel.vue +0 -0
|
@@ -1,104 +1,106 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
<Component
|
|
3
|
+
:is="theme === 'card' ? 'AwCard' : 'div'"
|
|
4
|
+
:class="{
|
|
5
|
+
'aw-empty-container--visible': isVisible,
|
|
6
|
+
'aw-empty-container--padding': theme !== 'card' && theme !== 'empty'
|
|
7
|
+
}"
|
|
8
|
+
class="aw-empty-container"
|
|
9
|
+
:style="{ '--card-padding-y': theme === 'card' ? '2.5rem' : '1.5rem' }"
|
|
10
|
+
>
|
|
11
|
+
<!-- image -->
|
|
12
|
+
<slot name="image">
|
|
13
|
+
<img
|
|
14
|
+
v-if="image"
|
|
15
|
+
:src="image"
|
|
16
|
+
:alt="title"
|
|
17
|
+
class="w-64 max-w-full"
|
|
18
|
+
aria-hidden="true"
|
|
19
|
+
/>
|
|
20
|
+
<AwIcon
|
|
21
|
+
v-else-if="icon"
|
|
22
|
+
:name="icon"
|
|
23
|
+
size="80"
|
|
24
|
+
class="aw-empty-container__icon"
|
|
25
|
+
/>
|
|
26
|
+
</slot>
|
|
27
|
+
|
|
28
|
+
<!-- title -->
|
|
29
|
+
<AwHeadline v-if="title" class="text-center my-0">{{
|
|
30
|
+
title
|
|
31
|
+
}}</AwHeadline>
|
|
32
|
+
|
|
33
|
+
<!-- description -->
|
|
34
|
+
<AwDescription
|
|
35
|
+
v-if="message || description"
|
|
36
|
+
class="text-center aw-empty-container__description"
|
|
37
|
+
v-html="$sanitize(message || description)"
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<!-- content -->
|
|
41
|
+
<slot name="button">
|
|
42
|
+
<div
|
|
43
|
+
v-if="ctaButton"
|
|
44
|
+
class="flex flex-wrap justify-center gap-4 flex-col w-full md:flex-row"
|
|
45
|
+
>
|
|
46
|
+
<AwButton v-if="ctaButton" v-bind="ctaButton" />
|
|
47
|
+
</div>
|
|
48
|
+
</slot>
|
|
49
|
+
</Component>
|
|
22
50
|
</template>
|
|
23
51
|
|
|
24
52
|
<script>
|
|
25
|
-
import anime from 'animejs'
|
|
26
|
-
import { toColor } from '@AwUtils/styles'
|
|
27
|
-
|
|
28
53
|
export default {
|
|
29
54
|
name: 'AwEmptyContainer',
|
|
30
55
|
|
|
31
56
|
props: {
|
|
57
|
+
image: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ''
|
|
60
|
+
},
|
|
61
|
+
|
|
32
62
|
icon: {
|
|
33
63
|
type: String,
|
|
34
64
|
default: ''
|
|
35
65
|
},
|
|
36
66
|
|
|
37
|
-
|
|
38
|
-
type:
|
|
39
|
-
default:
|
|
67
|
+
title: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ''
|
|
40
70
|
},
|
|
41
71
|
|
|
42
|
-
|
|
72
|
+
message: {
|
|
43
73
|
type: String,
|
|
44
|
-
default: '
|
|
74
|
+
default: ''
|
|
45
75
|
},
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
description: {
|
|
48
78
|
type: String,
|
|
49
79
|
default: ''
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
theme: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: 'card' // card, empty, transparent
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
ctaButton: {
|
|
88
|
+
type: Object,
|
|
89
|
+
default: null
|
|
50
90
|
}
|
|
51
91
|
},
|
|
52
92
|
|
|
53
93
|
data() {
|
|
54
94
|
return {
|
|
55
|
-
isVisible:
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
computed: {
|
|
60
|
-
_iconColor() {
|
|
61
|
-
return this.iconColor ? toColor(this.iconColor) : null
|
|
95
|
+
isVisible: false
|
|
62
96
|
}
|
|
63
97
|
},
|
|
64
98
|
|
|
65
|
-
beforeMount() {
|
|
66
|
-
this.isVisible = false
|
|
67
|
-
},
|
|
68
|
-
|
|
69
99
|
mounted() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
setTimeout(this.animate, 200)
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
methods: {
|
|
78
|
-
prepare() {
|
|
79
|
-
anime.set(this._getElements(), {
|
|
80
|
-
opacity: 0,
|
|
81
|
-
translateY: '0.5rem',
|
|
82
|
-
transition: 'none'
|
|
83
|
-
})
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
animate() {
|
|
87
|
-
anime.set(this._getElements(), { transition: null })
|
|
88
|
-
|
|
89
|
-
anime({
|
|
90
|
-
targets: this._getElements(),
|
|
91
|
-
opacity: 1,
|
|
92
|
-
translateY: 0,
|
|
93
|
-
delay: anime.stagger(120),
|
|
94
|
-
easing: 'easeOutCirc',
|
|
95
|
-
duration: 240
|
|
96
|
-
})
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
_getElements() {
|
|
100
|
-
return this.$refs.container?.children || []
|
|
101
|
-
}
|
|
100
|
+
/* add class through timeout to force initial animation */
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
this.isVisible = true
|
|
103
|
+
}, 300)
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
</script>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AwInput
|
|
3
|
+
v-model="_value"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
inputmode="numeric"
|
|
6
|
+
:max="isFinite(_max) ? _max : null"
|
|
7
|
+
:min="isFinite(_min) ? _min : null"
|
|
8
|
+
theme="uncolor-postfix"
|
|
9
|
+
class="aw-number"
|
|
10
|
+
@paste="_onPaste"
|
|
11
|
+
@blur="_clamp"
|
|
12
|
+
@keypress="_onKeypress"
|
|
13
|
+
@input="_onInput"
|
|
14
|
+
>
|
|
15
|
+
<template
|
|
16
|
+
#element="{ cssClass, value, errorTooltip, mergedListeners, mergedAttributes, errorText, errorId }"
|
|
17
|
+
>
|
|
18
|
+
<input
|
|
19
|
+
v-tooltip.show.prepend="errorTooltip"
|
|
20
|
+
:class="cssClass"
|
|
21
|
+
v-bind="mergedAttributes"
|
|
22
|
+
type="tel"
|
|
23
|
+
:value="value"
|
|
24
|
+
:aria-describedby="errorText ? errorId : null"
|
|
25
|
+
:data-error="errorText || null"
|
|
26
|
+
v-on="mergedListeners"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
<template #postfix>
|
|
30
|
+
<slot v-if="!hideButtons" name="postfix">
|
|
31
|
+
<AwButton
|
|
32
|
+
type="button"
|
|
33
|
+
tag="span"
|
|
34
|
+
role="button"
|
|
35
|
+
color="mono"
|
|
36
|
+
size="md"
|
|
37
|
+
class="aw-number__button"
|
|
38
|
+
icon="awesio/minus"
|
|
39
|
+
:disabled="_reachMin"
|
|
40
|
+
@click="subtract"
|
|
41
|
+
/>
|
|
42
|
+
<AwButton
|
|
43
|
+
type="button"
|
|
44
|
+
tag="span"
|
|
45
|
+
role="button"
|
|
46
|
+
color="mono"
|
|
47
|
+
size="md"
|
|
48
|
+
class="aw-number__button"
|
|
49
|
+
icon="awesio/plus"
|
|
50
|
+
:disabled="_reachMax"
|
|
51
|
+
@click="add"
|
|
52
|
+
/>
|
|
53
|
+
</slot>
|
|
54
|
+
</template>
|
|
55
|
+
</AwInput>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
import { clamp } from 'rambdax'
|
|
60
|
+
|
|
61
|
+
const toNumber = (val) => Number(val) || 0
|
|
62
|
+
|
|
63
|
+
const PREVENT_KEYS = ['-', '+', 'e']
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
name: 'AwNumber',
|
|
67
|
+
|
|
68
|
+
inheritAttrs: false,
|
|
69
|
+
|
|
70
|
+
props: {
|
|
71
|
+
value: {
|
|
72
|
+
type: [Number, String],
|
|
73
|
+
default: 0
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
min: {
|
|
77
|
+
type: [Number, String],
|
|
78
|
+
default: -Infinity
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
max: {
|
|
82
|
+
type: [Number, String],
|
|
83
|
+
default: Infinity
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
step: {
|
|
87
|
+
type: [Number, String],
|
|
88
|
+
default: 1
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
integer: Boolean,
|
|
92
|
+
|
|
93
|
+
hideButtons: Boolean
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
computed: {
|
|
97
|
+
_value: {
|
|
98
|
+
get() {
|
|
99
|
+
return this.value ? toNumber(this.value) : null
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
set(val) {
|
|
103
|
+
this.$emit('input', val)
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
_min() {
|
|
108
|
+
return toNumber(this.min)
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
_max() {
|
|
112
|
+
return toNumber(this.max)
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
_step() {
|
|
116
|
+
return toNumber(this.step)
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
_reachMax() {
|
|
120
|
+
return this._value >= this._max
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
_reachMin() {
|
|
124
|
+
return this._value <= this._min
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
methods: {
|
|
129
|
+
/**
|
|
130
|
+
* @vuese
|
|
131
|
+
* Increment the value by step amount
|
|
132
|
+
*/
|
|
133
|
+
add() {
|
|
134
|
+
const newValue = Math.min(this._max, this._value + this._step)
|
|
135
|
+
|
|
136
|
+
this._value = newValue
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @vuese
|
|
141
|
+
* Decrement the value by step amount
|
|
142
|
+
*/
|
|
143
|
+
subtract() {
|
|
144
|
+
const newValue = Math.max(this._min, this._value - this._step)
|
|
145
|
+
|
|
146
|
+
this._value = newValue
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
_clamp() {
|
|
150
|
+
this._value = clamp(this._min, this._max, this._value)
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
_onKeypress($event) {
|
|
154
|
+
if (
|
|
155
|
+
PREVENT_KEYS.includes($event.key) ||
|
|
156
|
+
(this.integer && isNaN($event.key))
|
|
157
|
+
) {
|
|
158
|
+
$event.preventDefault()
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
_onPaste($event) {
|
|
163
|
+
const paseted = $event.clipboardData.getData('text')
|
|
164
|
+
const value = Number(paseted)
|
|
165
|
+
|
|
166
|
+
if (!value || value < this.min || value > this.max) {
|
|
167
|
+
$event.preventDefault()
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
_onInput(value) {
|
|
172
|
+
const number = Number(value)
|
|
173
|
+
|
|
174
|
+
if (this._max && number > this.max) {
|
|
175
|
+
this._value = this.max
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
</script>
|
|
@@ -896,6 +896,7 @@ export default {
|
|
|
896
896
|
|
|
897
897
|
// ajax
|
|
898
898
|
_preloadOptions() {
|
|
899
|
+
console.log('preloadOptions', this.searchPreload, typeof this.searchPreload)
|
|
899
900
|
switch (typeof this.searchPreload) {
|
|
900
901
|
case 'boolean':
|
|
901
902
|
this.searchPreload &&
|
|
@@ -930,14 +931,20 @@ export default {
|
|
|
930
931
|
this.cancellation = CancelToken.source()
|
|
931
932
|
|
|
932
933
|
try {
|
|
933
|
-
|
|
934
|
+
let config = this.options(
|
|
934
935
|
encodeURIComponent(this.searchPhrase)
|
|
935
936
|
)
|
|
936
937
|
|
|
938
|
+
if (typeof config === 'string') {
|
|
939
|
+
config = {
|
|
940
|
+
method: 'get',
|
|
941
|
+
url: config
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
937
945
|
const { data } = await this.$axios.request({
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
url: fetchUrl
|
|
946
|
+
...config,
|
|
947
|
+
cancelToken: this.cancellation.token
|
|
941
948
|
})
|
|
942
949
|
|
|
943
950
|
this.selectOptions = pathOr([], 'data', data)
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-if="showMenu"
|
|
4
|
+
class="aw-bottom-bar"
|
|
5
|
+
:style="itemMaxWidthVar"
|
|
6
|
+
@click="scrollToTopOnCurrent"
|
|
7
|
+
>
|
|
3
8
|
<slot name="bottom-bar-items">
|
|
4
9
|
<AwMenuItemIcon
|
|
5
10
|
v-for="(item, i) in items"
|
|
@@ -11,7 +16,13 @@
|
|
|
11
16
|
</slot>
|
|
12
17
|
|
|
13
18
|
<slot name="bottom-bar-toggler">
|
|
19
|
+
<Component
|
|
20
|
+
v-if="bottomBarMoreMenuItemComponent"
|
|
21
|
+
:is="bottomBarMoreMenuItemComponent.is"
|
|
22
|
+
/>
|
|
23
|
+
|
|
14
24
|
<AwMenuItemIcon
|
|
25
|
+
v-else
|
|
15
26
|
:text="$t('Menu')"
|
|
16
27
|
icon="menu-dots"
|
|
17
28
|
:size="$options.ICON_SIZE"
|
|
@@ -43,6 +54,7 @@
|
|
|
43
54
|
import { viewOr, lensProp, omit } from 'rambdax'
|
|
44
55
|
import { getPath } from '@AwUtils/router'
|
|
45
56
|
import AwMenuItemIcon from '@AwLayouts/_AwMenuItemIcon.vue'
|
|
57
|
+
import { mapGetters } from 'vuex'
|
|
46
58
|
|
|
47
59
|
export const VISIBLE_ITEMS_COUNT = 4
|
|
48
60
|
|
|
@@ -66,8 +78,10 @@ export default {
|
|
|
66
78
|
},
|
|
67
79
|
|
|
68
80
|
computed: {
|
|
81
|
+
...mapGetters('awesIo', ['bottomBarMoreMenuItemComponent']),
|
|
82
|
+
|
|
69
83
|
itemMaxWidthVar() {
|
|
70
|
-
return { '--item-width-percent':
|
|
84
|
+
return { '--item-width-percent': 100 / this.items.length + 1 + '%' }
|
|
71
85
|
},
|
|
72
86
|
|
|
73
87
|
actionButton() {
|
|
@@ -135,11 +149,15 @@ export default {
|
|
|
135
149
|
},
|
|
136
150
|
|
|
137
151
|
scrollToTopOnCurrent($event) {
|
|
138
|
-
const link = $event.target.matches('a')
|
|
152
|
+
const link = $event.target.matches('a')
|
|
153
|
+
? $event.target
|
|
154
|
+
: $event.target.closest('a')
|
|
139
155
|
|
|
140
156
|
if (!link) return
|
|
141
157
|
|
|
142
|
-
if (
|
|
158
|
+
if (
|
|
159
|
+
getPath(link.getAttribute('href')) === getPath(this.$route.path)
|
|
160
|
+
) {
|
|
143
161
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
|
144
162
|
}
|
|
145
163
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="chips.length" class="aw-filter-chosen -mx-1">
|
|
3
|
+
<AwSlider>
|
|
4
|
+
<button v-for="{ prop, val } in chips" :key="`${prop}-${val}`" class="mx-1" @click="reset(prop, val)">
|
|
5
|
+
<AwChip class="bg-mono-800 hover:bg-error">
|
|
6
|
+
<template #left><span class="-ml-1"></span></template>
|
|
7
|
+
<slot :name="prop" :value="val" :pathOr="pathOr">
|
|
8
|
+
<slot :value="val" :prop="prop">
|
|
9
|
+
<span class="opacity-50 mr-1">{{ prop }}:</span> {{ val }}
|
|
10
|
+
</slot>
|
|
11
|
+
</slot>
|
|
12
|
+
<template #right>
|
|
13
|
+
<AwIcon name="awesio/close" size="16" class="mr-1 opacity-50" />
|
|
14
|
+
</template>
|
|
15
|
+
</AwChip>
|
|
16
|
+
</button>
|
|
17
|
+
<AwLink class="text-sm text-mono-400 mx-1" @click="reset()">
|
|
18
|
+
{{ $t('Reset') }}
|
|
19
|
+
</AwLink>
|
|
20
|
+
</AwSlider>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import { pick, omit, toPairs, isType, pathOr } from 'rambdax'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'AwFilterChosen',
|
|
29
|
+
|
|
30
|
+
props: {
|
|
31
|
+
watchParams: {
|
|
32
|
+
type: Array,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
computed: {
|
|
38
|
+
chips() {
|
|
39
|
+
return toPairs(pick(this.watchParams, this.$route.query)).reduce((acc, [prop, val]) => {
|
|
40
|
+
if (isType('Array', val)) {
|
|
41
|
+
return acc.concat(val.map((_val) => ({ prop, val: _val })))
|
|
42
|
+
} else {
|
|
43
|
+
return acc.concat([{ prop, val }])
|
|
44
|
+
}
|
|
45
|
+
}, [])
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
methods: {
|
|
50
|
+
reset(prop, val) {
|
|
51
|
+
let query
|
|
52
|
+
|
|
53
|
+
if (!prop) {
|
|
54
|
+
query = omit([...this.watchParams, 'page', 'search'], this.$route.query)
|
|
55
|
+
} else if (Array.isArray(this.$route.query[prop])) {
|
|
56
|
+
query = {
|
|
57
|
+
...omit('page,search', this.$route.query),
|
|
58
|
+
[prop]: this.$route.query[prop].filter((_val) => _val != val)
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
query = omit([prop, 'page', 'search'], this.$route.query)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
this.$router.replace({ ...this.$route, query }).catch((e) => {
|
|
65
|
+
console.log(e)
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
pathOr
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="aw-filter-date-range">
|
|
3
|
+
<!-- toggler -->
|
|
4
|
+
<AwButton theme="outline" color="default" class="filter-button" @click.stop="isVisible = !isVisible">
|
|
5
|
+
<AwIcon v-if="icon" :name="icon" class="mr-1" />
|
|
6
|
+
<slot name="label">
|
|
7
|
+
<span class="normal-case font-normal">
|
|
8
|
+
{{ formattedRange ? formattedRange : label }}
|
|
9
|
+
</span>
|
|
10
|
+
</slot>
|
|
11
|
+
<AwIcon name="awesio/triangle" size="16" class="caret" :class="{ 'rotate-180': isVisible }" />
|
|
12
|
+
</AwButton>
|
|
13
|
+
|
|
14
|
+
<!-- options -->
|
|
15
|
+
<slot name="dropdown" v-bind="{ isVisible, open, close, set }">
|
|
16
|
+
<AwDropdown class="aw-filter-date-range__dropdown" :close-on-action="false" :show="isVisible" @update:show="_onShowChange">
|
|
17
|
+
<slot name="calendar">
|
|
18
|
+
<AwCalendar v-model="value" :output-format="dateFormat" range />
|
|
19
|
+
</slot>
|
|
20
|
+
|
|
21
|
+
<!-- reset button -->
|
|
22
|
+
<slot name="reset" :reset="reset">
|
|
23
|
+
<template v-if="!noReset && !isDefaultDateRange">
|
|
24
|
+
<hr style="margin: 0.25rem 0" />
|
|
25
|
+
<AwDropdownButton @click="reset">
|
|
26
|
+
{{ $t('Reset') }}
|
|
27
|
+
</AwDropdownButton>
|
|
28
|
+
</template>
|
|
29
|
+
</slot>
|
|
30
|
+
</AwDropdown>
|
|
31
|
+
</slot>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import { omit, F } from 'rambdax'
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
name: '',
|
|
40
|
+
|
|
41
|
+
props: {
|
|
42
|
+
startParam: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'start_date'
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
endParam: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'end_date'
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
icon: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ''
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
label: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'Dates'
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
dateFormat: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'YYYY-MM-DD'
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
defaultDateRange: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: null
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* If true, reset button is hidden
|
|
74
|
+
*/
|
|
75
|
+
noReset: Boolean
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
isVisible: false
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
computed: {
|
|
85
|
+
startValue() {
|
|
86
|
+
return this.$route.query[this.startParam] || null
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
endValue() {
|
|
90
|
+
return this.$route.query[this.endParam] || null
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
value: {
|
|
94
|
+
get() {
|
|
95
|
+
return {
|
|
96
|
+
start: this.startValue,
|
|
97
|
+
end: this.endValue
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
set(value) {
|
|
102
|
+
if (!value) return
|
|
103
|
+
|
|
104
|
+
if (!value.start && !value.end) {
|
|
105
|
+
// remove param from query
|
|
106
|
+
if (this.$route.query[this.startParam] && this.$route.query[this.endParam]) {
|
|
107
|
+
this.$router
|
|
108
|
+
.replace({
|
|
109
|
+
...this.$route,
|
|
110
|
+
query: omit([this.startParam, this.endParam, 'page', 'search'], this.$route.query)
|
|
111
|
+
})
|
|
112
|
+
.catch(F)
|
|
113
|
+
}
|
|
114
|
+
} else if (!(value.start === this.startValue && value.end === this.endValue)) {
|
|
115
|
+
this.$router
|
|
116
|
+
.replace({
|
|
117
|
+
...this.$route,
|
|
118
|
+
query: {
|
|
119
|
+
...omit('page,search', this.$route.query),
|
|
120
|
+
[this.startParam]: value.start,
|
|
121
|
+
[this.endParam]: value.end
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
.catch(F)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.isVisible = false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
isDefaultDateRange() {
|
|
132
|
+
return (
|
|
133
|
+
!!this.defaultDateRange &&
|
|
134
|
+
this.$route.query.start === this.defaultDateRange[this.startParam] &&
|
|
135
|
+
this.$route.query.end === this.defaultDateRange[this.endParam]
|
|
136
|
+
)
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
formattedRange() {
|
|
140
|
+
if (this.startValue && this.endValue) {
|
|
141
|
+
return [this.startValue, this.endValue].map((val) => this.$dayjs(val, this.dateFormat).format('ll')).join(' - ')
|
|
142
|
+
} else {
|
|
143
|
+
return ''
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
methods: {
|
|
149
|
+
open() {
|
|
150
|
+
this.isVisible = true
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
close() {
|
|
154
|
+
this.isVisible = false
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
set(val) {
|
|
158
|
+
this.value = val
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
reset() {
|
|
162
|
+
this.value = {
|
|
163
|
+
start: this.defaultDateRange?.[this.startParam] ?? null,
|
|
164
|
+
end: this.defaultDateRange?.[this.endParam] ?? null
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
_onShowChange(show) {
|
|
169
|
+
setTimeout(() => {
|
|
170
|
+
if (this.isVisible && !show) {
|
|
171
|
+
this.close()
|
|
172
|
+
}
|
|
173
|
+
}, 60)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
</script>
|