@empathyco/x-components 5.0.0-alpha.39 → 5.0.0-alpha.40
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/CHANGELOG.md +9 -0
- package/design-system/deprecated-full-theme.css +63 -63
- package/docs/API-reference/api/x-components.clearhistoryqueries.md +8 -4
- package/docs/API-reference/api/x-components.historyqueries.md +6 -4
- package/docs/API-reference/api/x-components.historyqueriesswitch.md +5 -11
- package/docs/API-reference/api/x-components.historyquery.md +19 -10
- package/docs/API-reference/api/x-components.md +6 -6
- package/docs/API-reference/api/x-components.myhistory.md +32 -10
- package/docs/API-reference/api/x-components.removehistoryquery.md +16 -4
- package/docs/API-reference/components/history-queries/x-components.history-query.md +5 -3
- package/docs/API-reference/components/history-queries/x-components.my-history.md +5 -4
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/clear-history-queries.vue2.js +37 -39
- package/js/x-modules/history-queries/components/clear-history-queries.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries-switch.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries-switch.vue2.js +42 -39
- package/js/x-modules/history-queries/components/history-queries-switch.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue2.js +24 -18
- package/js/x-modules/history-queries/components/history-queries.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue2.js +43 -31
- package/js/x-modules/history-queries/components/history-query.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue2.js +113 -93
- package/js/x-modules/history-queries/components/my-history.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue3.js +1 -1
- package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/remove-history-query.vue2.js +33 -27
- package/js/x-modules/history-queries/components/remove-history-query.vue2.js.map +1 -1
- package/js/x-modules/history-queries/x-module.js +3 -1
- package/js/x-modules/history-queries/x-module.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +1216 -478
- package/report/x-components.api.md +74 -51
- package/types/x-modules/history-queries/components/clear-history-queries.vue.d.ts +6 -31
- package/types/x-modules/history-queries/components/clear-history-queries.vue.d.ts.map +1 -1
- package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts +5 -26
- package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts.map +1 -1
- package/types/x-modules/history-queries/components/history-queries.vue.d.ts +4 -10
- package/types/x-modules/history-queries/components/history-queries.vue.d.ts.map +1 -1
- package/types/x-modules/history-queries/components/history-query.vue.d.ts +26 -15
- package/types/x-modules/history-queries/components/history-query.vue.d.ts.map +1 -1
- package/types/x-modules/history-queries/components/my-history.vue.d.ts +39 -67
- package/types/x-modules/history-queries/components/my-history.vue.d.ts.map +1 -1
- package/types/x-modules/history-queries/components/remove-history-query.vue.d.ts +16 -10
- package/types/x-modules/history-queries/components/remove-history-query.vue.d.ts.map +1 -1
- package/types/x-modules/history-queries/x-module.d.ts.map +1 -1
- package/docs/API-reference/api/x-components.historyqueriesswitch.hashistoryqueries.md +0 -13
- package/docs/API-reference/api/x-components.historyqueriesswitch.historyqueries.md +0 -13
- package/docs/API-reference/api/x-components.historyquery.suggestion.md +0 -13
- package/docs/API-reference/api/x-components.myhistory.animation.md +0 -13
- package/docs/API-reference/api/x-components.myhistory.locale.md +0 -13
- package/docs/API-reference/api/x-components.removehistoryquery.historyquery.md +0 -13
- package/docs/API-reference/api/x-components.removehistoryquery.removehistoryqueryevent.md +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.0-alpha.40](https://github.com/empathyco/x/compare/@empathyco/x-components@5.0.0-alpha.39...@empathyco/x-components@5.0.0-alpha.40) (2024-06-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* migrate history queries x module to composition api (#1494) ([cd51e9b](https://github.com/empathyco/x/commit/cd51e9bb2afb77bbb8f935445bfda360dcfaafde))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [5.0.0-alpha.39](https://github.com/empathyco/x/compare/@empathyco/x-components@5.0.0-alpha.34...@empathyco/x-components@5.0.0-alpha.39) (2024-06-11)
|
|
7
16
|
|
|
8
17
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
2
3
|
.x-uppercase {
|
|
3
4
|
text-transform: uppercase;
|
|
4
5
|
}
|
|
@@ -493,7 +494,6 @@
|
|
|
493
494
|
[dir="rtl"] .x-padding--left-20 {
|
|
494
495
|
padding-right: var(--x-size-base-20) !important;
|
|
495
496
|
}
|
|
496
|
-
|
|
497
497
|
.x-margin--auto {
|
|
498
498
|
margin: auto !important;
|
|
499
499
|
}
|
|
@@ -956,6 +956,29 @@
|
|
|
956
956
|
[dir="rtl"] .x-margin--left-20 {
|
|
957
957
|
margin-right: var(--x-size-base-20) !important;
|
|
958
958
|
}
|
|
959
|
+
.x-line-height--none {
|
|
960
|
+
line-height: 1 !important;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.x-line-height--tight {
|
|
964
|
+
line-height: 1.25 !important;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
.x-line-height--snug {
|
|
968
|
+
line-height: 1.375 !important;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.x-line-height--normal {
|
|
972
|
+
line-height: 1.5 !important;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.x-line-height--relaxed {
|
|
976
|
+
line-height: 1.625 !important;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
.x-line-height--loose {
|
|
980
|
+
line-height: 2 !important;
|
|
981
|
+
}
|
|
959
982
|
.x-line-clamp--2 {
|
|
960
983
|
overflow: hidden !important;
|
|
961
984
|
display: -webkit-box !important;
|
|
@@ -990,29 +1013,6 @@
|
|
|
990
1013
|
-webkit-box-orient: vertical !important;
|
|
991
1014
|
-webkit-line-clamp: 6 !important;
|
|
992
1015
|
}
|
|
993
|
-
.x-line-height--none {
|
|
994
|
-
line-height: 1 !important;
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
.x-line-height--tight {
|
|
998
|
-
line-height: 1.25 !important;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
.x-line-height--snug {
|
|
1002
|
-
line-height: 1.375 !important;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.x-line-height--normal {
|
|
1006
|
-
line-height: 1.5 !important;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
.x-line-height--relaxed {
|
|
1010
|
-
line-height: 1.625 !important;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
.x-line-height--loose {
|
|
1014
|
-
line-height: 2 !important;
|
|
1015
|
-
}
|
|
1016
1016
|
.x-font-weight--light {
|
|
1017
1017
|
font-weight: var(--x-number-font-weight-base-light) !important;
|
|
1018
1018
|
}
|
|
@@ -3329,21 +3329,6 @@
|
|
|
3329
3329
|
.x-border-color--transparent {
|
|
3330
3330
|
border-color: var(--x-color-base-transparent) !important;
|
|
3331
3331
|
}
|
|
3332
|
-
.x-text--stroke.x-text {
|
|
3333
|
-
--x-string-text-decoration: line-through;
|
|
3334
|
-
}
|
|
3335
|
-
.x-text--stroke.x-title1 {
|
|
3336
|
-
--x-string-text-decoration-title1: line-through;
|
|
3337
|
-
}
|
|
3338
|
-
.x-text--stroke.x-title2 {
|
|
3339
|
-
--x-string-text-decoration-title2: line-through;
|
|
3340
|
-
}
|
|
3341
|
-
.x-text--stroke.x-title3 {
|
|
3342
|
-
--x-string-text-decoration-title3: line-through;
|
|
3343
|
-
}
|
|
3344
|
-
.x-text--stroke.x-small {
|
|
3345
|
-
--x-string-text-decoration-small: line-through;
|
|
3346
|
-
}
|
|
3347
3332
|
.x-background--lead {
|
|
3348
3333
|
background-color: var(--x-color-base-lead) !important;
|
|
3349
3334
|
}
|
|
@@ -3387,6 +3372,24 @@
|
|
|
3387
3372
|
.x-background--transparent {
|
|
3388
3373
|
background-color: var(--x-color-base-transparent) !important;
|
|
3389
3374
|
}
|
|
3375
|
+
.x-text--stroke.x-text {
|
|
3376
|
+
--x-string-text-decoration: line-through;
|
|
3377
|
+
}
|
|
3378
|
+
.x-text--stroke.x-title1 {
|
|
3379
|
+
--x-string-text-decoration-title1: line-through;
|
|
3380
|
+
}
|
|
3381
|
+
.x-text--stroke.x-title2 {
|
|
3382
|
+
--x-string-text-decoration-title2: line-through;
|
|
3383
|
+
}
|
|
3384
|
+
.x-text--stroke.x-title3 {
|
|
3385
|
+
--x-string-text-decoration-title3: line-through;
|
|
3386
|
+
}
|
|
3387
|
+
.x-text--stroke.x-small {
|
|
3388
|
+
--x-string-text-decoration-small: line-through;
|
|
3389
|
+
}
|
|
3390
|
+
:root {
|
|
3391
|
+
--x-color-text-secondary: var(--x-color-base-neutral-35);
|
|
3392
|
+
}
|
|
3390
3393
|
.x-text--secondary {
|
|
3391
3394
|
--x-color-text-default: var(--x-color-text-secondary);
|
|
3392
3395
|
}
|
|
@@ -3909,6 +3912,13 @@
|
|
|
3909
3912
|
--x-size-border-radius-bottom-right-tag-card: var(--x-size-border-radius-tag-card);
|
|
3910
3913
|
--x-size-border-radius-bottom-left-tag-card: var(--x-size-border-radius-tag-card);
|
|
3911
3914
|
}
|
|
3915
|
+
:root {
|
|
3916
|
+
--x-size-border-radius-tag-card: var(--x-size-border-radius-base-s);
|
|
3917
|
+
--x-size-border-radius-top-left-tag-card: var(--x-size-border-radius-tag-card);
|
|
3918
|
+
--x-size-border-radius-top-right-tag-card: var(--x-size-border-radius-tag-card);
|
|
3919
|
+
--x-size-border-radius-bottom-right-tag-card: var(--x-size-border-radius-tag-card);
|
|
3920
|
+
--x-size-border-radius-bottom-left-tag-card: var(--x-size-border-radius-tag-card);
|
|
3921
|
+
}
|
|
3912
3922
|
|
|
3913
3923
|
.x-tag--card.x-tag,
|
|
3914
3924
|
.x-tag--card .x-tag {
|
|
@@ -3920,13 +3930,6 @@
|
|
|
3920
3930
|
);
|
|
3921
3931
|
--x-size-border-radius-bottom-left-tag-default: var(--x-size-border-radius-bottom-left-tag-card);
|
|
3922
3932
|
}
|
|
3923
|
-
:root {
|
|
3924
|
-
--x-size-border-radius-tag-card: var(--x-size-border-radius-base-s);
|
|
3925
|
-
--x-size-border-radius-top-left-tag-card: var(--x-size-border-radius-tag-card);
|
|
3926
|
-
--x-size-border-radius-top-right-tag-card: var(--x-size-border-radius-tag-card);
|
|
3927
|
-
--x-size-border-radius-bottom-right-tag-card: var(--x-size-border-radius-tag-card);
|
|
3928
|
-
--x-size-border-radius-bottom-left-tag-card: var(--x-size-border-radius-tag-card);
|
|
3929
|
-
}
|
|
3930
3933
|
:root {
|
|
3931
3934
|
--x-color-text-suggestion-group-default: var(--x-color-text-suggestion-default);
|
|
3932
3935
|
--x-color-text-suggestion-group-matching-part-default: var(
|
|
@@ -5038,6 +5041,10 @@
|
|
|
5038
5041
|
--x-color-background-picture-cover-hover-from: rgba(0, 0, 0, 0);
|
|
5039
5042
|
--x-color-background-picture-cover-hover-to: rgba(0, 0, 0, 0.5);
|
|
5040
5043
|
}
|
|
5044
|
+
:root {
|
|
5045
|
+
--x-color-background-picture-cover-hover-from: rgba(0, 0, 0, 0);
|
|
5046
|
+
--x-color-background-picture-cover-hover-to: rgba(0, 0, 0, 0.5);
|
|
5047
|
+
}
|
|
5041
5048
|
|
|
5042
5049
|
.x-picture--cover.x-picture {
|
|
5043
5050
|
position: relative;
|
|
@@ -5054,10 +5061,6 @@
|
|
|
5054
5061
|
width: 100%;
|
|
5055
5062
|
height: 100%;
|
|
5056
5063
|
}
|
|
5057
|
-
:root {
|
|
5058
|
-
--x-color-background-picture-cover-hover-from: rgba(0, 0, 0, 0);
|
|
5059
|
-
--x-color-background-picture-cover-hover-to: rgba(0, 0, 0, 0.5);
|
|
5060
|
-
}
|
|
5061
5064
|
:root {
|
|
5062
5065
|
--x-color-background-picture-colored: var(--x-color-base-neutral-95);
|
|
5063
5066
|
--x-mix-blend-mode-picture-colored: multiply;
|
|
@@ -7874,6 +7877,13 @@
|
|
|
7874
7877
|
:root {
|
|
7875
7878
|
--x-size-width-dropdown-xl: 282px;
|
|
7876
7879
|
}
|
|
7880
|
+
:root {
|
|
7881
|
+
--x-size-width-dropdown-xl: 282px;
|
|
7882
|
+
}
|
|
7883
|
+
|
|
7884
|
+
.x-dropdown.x-dropdown--xl {
|
|
7885
|
+
--x-size-width-dropdown-toggle-default: var(--x-size-width-dropdown-xl);
|
|
7886
|
+
}
|
|
7877
7887
|
:root {
|
|
7878
7888
|
--x-size-width-dropdown-s: 74px;
|
|
7879
7889
|
}
|
|
@@ -7945,13 +7955,6 @@
|
|
|
7945
7955
|
.x-dropdown.x-dropdown--m {
|
|
7946
7956
|
--x-size-width-dropdown-toggle-default: var(--x-size-width-dropdown-m);
|
|
7947
7957
|
}
|
|
7948
|
-
:root {
|
|
7949
|
-
--x-size-width-dropdown-xl: 282px;
|
|
7950
|
-
}
|
|
7951
|
-
|
|
7952
|
-
.x-dropdown.x-dropdown--xl {
|
|
7953
|
-
--x-size-width-dropdown-toggle-default: var(--x-size-width-dropdown-xl);
|
|
7954
|
-
}
|
|
7955
7958
|
:root {
|
|
7956
7959
|
--x-size-padding-block-dropdown-item-line: var(--x-size-base-03);
|
|
7957
7960
|
--x-size-padding-inline-dropdown-item-line: 0 var(--x-size-base-03);
|
|
@@ -7976,9 +7979,6 @@
|
|
|
7976
7979
|
--x-size-border-width-bottom-dropdown-list-line: var(--x-size-border-width-dropdown-list-line);
|
|
7977
7980
|
--x-size-border-width-left-dropdown-list-line: var(--x-size-border-width-dropdown-list-line);
|
|
7978
7981
|
}
|
|
7979
|
-
:root {
|
|
7980
|
-
--x-size-width-dropdown-l: 202px;
|
|
7981
|
-
}
|
|
7982
7982
|
:root {
|
|
7983
7983
|
--x-size-padding-block-dropdown-item-line: var(--x-size-base-03);
|
|
7984
7984
|
--x-size-padding-inline-dropdown-item-line: 0 var(--x-size-base-03);
|
|
@@ -8045,6 +8045,9 @@
|
|
|
8045
8045
|
:root {
|
|
8046
8046
|
--x-size-width-dropdown-l: 202px;
|
|
8047
8047
|
}
|
|
8048
|
+
:root {
|
|
8049
|
+
--x-size-width-dropdown-l: 202px;
|
|
8050
|
+
}
|
|
8048
8051
|
|
|
8049
8052
|
.x-dropdown.x-dropdown--l {
|
|
8050
8053
|
--x-size-width-dropdown-toggle-default: var(--x-size-width-dropdown-l);
|
|
@@ -8838,7 +8841,4 @@
|
|
|
8838
8841
|
--x-size-border-radius-base-m: var(--x-size-base-06);
|
|
8839
8842
|
--x-size-border-radius-base-pill: 99999px;
|
|
8840
8843
|
--x-size-border-width-base: 1px;
|
|
8841
|
-
}
|
|
8842
|
-
:root {
|
|
8843
|
-
--x-color-text-secondary: var(--x-color-base-neutral-35);
|
|
8844
8844
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
2
|
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [ClearHistoryQueries](./x-components.clearhistoryqueries.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ClearHistoryQueries variable
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A button that when is pressed, emits the [HistoryQueriesXEvents.UserPressedClearHistoryQueries](./x-components.historyqueriesxevents.userpressedclearhistoryqueries.md) event, expressing the user intention to clear the whole history of queries.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{}, {
|
|
13
|
+
dynamicClasses: import("vue").ComputedRef<VueCSSClasses>;
|
|
14
|
+
clearHistoryQueriesEvents: Partial<XEventsTypes>;
|
|
15
|
+
isHistoryQueriesEmpty: import("vue").ComputedRef<boolean>;
|
|
16
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>
|
|
13
17
|
```
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
2
|
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [HistoryQueries](./x-components.historyqueries.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## HistoryQueries variable
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This component renders a list of suggestions coming from the user queries history. Allows the user to select one of them, emitting the needed events. A history query is just another type of suggestion that contains a query that the user has made in the past.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{}, {
|
|
13
|
+
historyQueriesWithResults: import("vue").ComputedRef<any>;
|
|
14
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>
|
|
13
15
|
```
|
|
@@ -2,21 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [HistoryQueriesSwitch](./x-components.historyqueriesswitch.md)
|
|
4
4
|
|
|
5
|
-
## HistoryQueriesSwitch
|
|
5
|
+
## HistoryQueriesSwitch variable
|
|
6
6
|
|
|
7
7
|
History Queries Switch is a component to activate or deactivate the history queries. This component emits events depending on the `isEnabled` value.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{}, {
|
|
13
|
+
toggle: () => void;
|
|
14
|
+
isEnabled: import("vue").ComputedRef<any>;
|
|
15
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>
|
|
13
16
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [hasHistoryQueries](./x-components.historyqueriesswitch.hashistoryqueries.md) | <p><code>protected</code></p><p><code>readonly</code></p> | boolean | Checks if there are history queries. |
|
|
21
|
-
| [historyQueries](./x-components.historyqueriesswitch.historyqueries.md) | | HistoryQuery\[\] | The history queries from the state. |
|
|
22
|
-
|
|
@@ -2,20 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [HistoryQuery](./x-components.historyquery.md)
|
|
4
4
|
|
|
5
|
-
## HistoryQuery
|
|
5
|
+
## HistoryQuery variable
|
|
6
6
|
|
|
7
7
|
This component renders a history query suggestion combining two buttons: one for selecting this suggestion as the search query, and another one to remove this query suggestion from the history queries.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
suggestion: {
|
|
14
|
+
type: PropType<HistoryQueryModel>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
removeButtonClass: StringConstructor;
|
|
18
|
+
suggestionClass: StringConstructor;
|
|
19
|
+
}, {
|
|
20
|
+
query: import("vue").ComputedRef<any>;
|
|
21
|
+
suggestionSelectedEvents: import("vue").ComputedRef<Partial<XEventsTypes>>;
|
|
22
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, "click"[], string, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
suggestion: {
|
|
24
|
+
type: PropType<HistoryQueryModel>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
removeButtonClass: StringConstructor;
|
|
28
|
+
suggestionClass: StringConstructor;
|
|
29
|
+
}>>, {}>
|
|
13
30
|
```
|
|
14
|
-
**Extends:** HistoryQuery\_base
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Modifiers | Type | Description |
|
|
19
|
-
| --- | --- | --- | --- |
|
|
20
|
-
| [suggestion](./x-components.historyquery.suggestion.md) | <code>protected</code> | HistoryQueryModel | The history query suggestion to render. |
|
|
21
|
-
|
|
@@ -14,7 +14,6 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
14
14
|
| [AllFilter](./x-components.allfilter.md) | This component receives a required <code>facet</code> with [BooleanFilter](./x-types.booleanfilter.md) as prop and renders a button, which on clicked emits the [FacetsXEvents.UserClickedAllFilter](./x-components.facetsxevents.userclickedallfilter.md) event. By default the rendered button displays a message with the facet label but this content is customizable through the default slot. |
|
|
15
15
|
| [Banner](./x-components.banner.md) | <p>. A banner result is just an item that has been inserted into the search results to advertise something. Usually it is the first item in the grid or it can be placed in the middle of them and fill the whole row where appears. The banner may be clickable or non-clickable depending on whether it has an associated URL or not. It contains an image and, optionally, a title. In case the image does not load due to an error the banner will not be rendered.</p><p>Additionally, this component exposes the following props to modify the classes of the elements: <code>titleClass</code>.</p> |
|
|
16
16
|
| [BaseXAPI](./x-components.basexapi.md) | Default implementation for [XAPI](./x-components.xapi.md)<!-- -->. |
|
|
17
|
-
| [ClearHistoryQueries](./x-components.clearhistoryqueries.md) | A button that when is pressed, emits the [HistoryQueriesXEvents.UserPressedClearHistoryQueries](./x-components.historyqueriesxevents.userpressedclearhistoryqueries.md) event, expressing the user intention to clear the whole history of queries. |
|
|
18
17
|
| [DefaultFacetsService](./x-components.defaultfacetsservice.md) | Default implementation for the [FacetsService](./x-components.facetsservice.md)<!-- -->. |
|
|
19
18
|
| [DefaultPDPAddToCartService](./x-components.defaultpdpaddtocartservice.md) | Default implementation for the [PDPAddToCartService](./x-components.pdpaddtocartservice.md)<!-- -->. |
|
|
20
19
|
| [DeviceDetector](./x-components.devicedetector.md) | This component helps to detect or setting a device, that can be used later to create different layouts optimized for different devices. This detected device is available under the [XComponentAliasAPI.device](./x-components.xcomponentaliasapi.device.md) property. |
|
|
@@ -27,13 +26,9 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
27
26
|
| [FadeAndSlide](./x-components.fadeandslide.md) | Renders a transition group wrapping the elements passed in the default slot and animating them with a fade and slide animation. |
|
|
28
27
|
| [FallbackDisclaimer](./x-components.fallbackdisclaimer.md) | The <code>FallbackDisclaimer</code> component shows a message if the filters have been removed from the current search because there were no results. |
|
|
29
28
|
| [HierarchicalFilter](./x-components.hierarchicalfilter.md) | Renders a hierarchical filter recursively, emitting the needed events when clicked. |
|
|
30
|
-
| [HistoryQueries](./x-components.historyqueries.md) | This component renders a list of suggestions coming from the user queries history. Allows the user to select one of them, emitting the needed events. A history query is just another type of suggestion that contains a query that the user has made in the past. |
|
|
31
29
|
| [HistoryQueriesGetter](./x-components.historyqueriesgetter.md) | Class implementation for the [HistoryQueriesGetters.historyQueries](./x-components.historyqueriesgetters.historyqueries.md) getter. |
|
|
32
|
-
| [HistoryQueriesSwitch](./x-components.historyqueriesswitch.md) | History Queries Switch is a component to activate or deactivate the history queries. This component emits events depending on the <code>isEnabled</code> value. |
|
|
33
|
-
| [HistoryQuery](./x-components.historyquery.md) | This component renders a history query suggestion combining two buttons: one for selecting this suggestion as the search query, and another one to remove this query suggestion from the history queries. |
|
|
34
30
|
| [IdentifierResult](./x-components.identifierresult.md) | This component renders an identifier result value and highlights its matching part with the query from the state. Receives as prop the [Result](./x-types.result.md) data. |
|
|
35
31
|
| [IdentifierResults](./x-components.identifierresults.md) | Paints the list of identifier results stored in the state. Each identifier result should be represented by a [IdentifierResult](./x-components.identifierresult.md) component besides any other component. |
|
|
36
|
-
| [MyHistory](./x-components.myhistory.md) | The component renders the full history of user searched queries grouped by the day they were performed. |
|
|
37
32
|
| [NextQueries](./x-components.nextqueries.md) | Simple next-queries component that renders a list of \[<code>BaseSuggestions</code>\](./x-components.base-suggestions.md), allowing the user to select one of them, and emitting the needed events. A next query is a suggestion for a new search, related to your previous query. I.e. If people normally search for <code>shirts</code>, and then <code>trousers</code>, <code>trousers</code> would be a next query of <code>shirts</code>. |
|
|
38
33
|
| [NextQuery](./x-components.nextquery.md) | Renders a next query item which receives the suggestion that will be rendered as a prop. It exposes a default slot to change the next query content. If the slot is not overridden, it will render the suggestion query by default. |
|
|
39
34
|
| [NextQueryPreview](./x-components.nextquerypreview.md) | Retrieves a preview of the results of a next query and exposes them in the default slot, along with the next query and the totalResults of the search request. By default, it renders the names of the results. |
|
|
@@ -49,7 +44,6 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
49
44
|
| [Redirection](./x-components.redirection.md) | A redirection is a component that sends the user to a link in the website. It is helpful when there are queries like <code>help</code>, <code>shipping costs</code>, <code>my account</code>, where a link to a section in the website will be more helpful than the set of results returned. |
|
|
50
45
|
| [RelatedTag](./x-components.relatedtag.md) | This component renders a related tag for a query. A related tag is a descriptive keyword related to the current query to fine-tune the search. For example, if you are searching for \*lego\*, a related tag could be \*city\*, refining the search with \*lego city\*. |
|
|
51
46
|
| [RelatedTags](./x-components.relatedtags.md) | This component renders a set of \[<code>RelatedTag</code>\](./x-components.related-tag) components by default to select from after a query is performed to fine-tune search. For example, if you are searching for \*lego\*, different related tags could be \*city\*, \*friends\*, or \*harry potter\*, refining the search with \*lego city\*, \*lego friends\*, or \*lego harry potter\*. |
|
|
52
|
-
| [RemoveHistoryQuery](./x-components.removehistoryquery.md) | Button that when it is pressed emits the [HistoryQueriesXEvents.UserPressedRemoveHistoryQuery](./x-components.historyqueriesxevents.userpressedremovehistoryquery.md) event, expressing the user intention to remove a query in the history. |
|
|
53
47
|
| [RenderlessExtraParams](./x-components.renderlessextraparams.md) | It emits a [ExtraParamsXEvents.UserChangedExtraParams](./x-components.extraparamsxevents.userchangedextraparams.md) when the <code>updateValue</code> is called. |
|
|
54
48
|
| [RenderlessFilter](./x-components.renderlessfilter.md) | Renders default slot content. It binds to the default slot a [BooleanFilter](./x-types.booleanfilter.md)<!-- -->, the [XEvent](./x-components.xevent.md) that will be emitted when clicking the content, the css classes and if the content should be deactivated. |
|
|
55
49
|
| [Scroll](./x-components.scroll.md) | Scrollable container that emits scroll related X Events. It exposes all the listeners and props from the [BaseScroll](./x-components.basescroll.md) component. |
|
|
@@ -409,6 +403,7 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
409
403
|
| [ChevronUpIcon](./x-components.chevronupicon.md) | |
|
|
410
404
|
| [ClearFilters](./x-components.clearfilters.md) | Renders a simple button, emitting the needed events when clicked. |
|
|
411
405
|
| [clearHistoryQueries](./x-components.clearhistoryqueries.md) | Clears the history queries. |
|
|
406
|
+
| [ClearHistoryQueries](./x-components.clearhistoryqueries.md) | A button that when is pressed, emits the [HistoryQueriesXEvents.UserPressedClearHistoryQueries](./x-components.historyqueriesxevents.userpressedclearhistoryqueries.md) event, expressing the user intention to clear the whole history of queries. |
|
|
412
407
|
| [clearHistoryQueriesQuery](./x-components.clearhistoryqueriesquery.md) | Sets the query of the history queries module to an empty string. |
|
|
413
408
|
| [clearIdentifierResultsQuery](./x-components.clearidentifierresultsquery.md) | Clears the identifier-results module query. |
|
|
414
409
|
| [clearPendingScrollToWire](./x-components.clearpendingscrolltowire.md) | Resets the selector of the scroll that is pending to restore. |
|
|
@@ -495,7 +490,10 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
495
490
|
| [Highlight](./x-components.highlight.md) | Highlights the given part of the text. The component is smart enough to do matches between special characters like tilde, cedilla, eñe, capital letters... |
|
|
496
491
|
| [HistoryIcon](./x-components.historyicon.md) | |
|
|
497
492
|
| [historyQueries](./x-components.historyqueries.md) | Default implementation for the [HistoryQueriesGetters.historyQueries](./x-components.historyqueriesgetters.historyqueries.md) getter. |
|
|
493
|
+
| [HistoryQueries](./x-components.historyqueries.md) | This component renders a list of suggestions coming from the user queries history. Allows the user to select one of them, emitting the needed events. A history query is just another type of suggestion that contains a query that the user has made in the past. |
|
|
494
|
+
| [HistoryQueriesSwitch](./x-components.historyqueriesswitch.md) | History Queries Switch is a component to activate or deactivate the history queries. This component emits events depending on the <code>isEnabled</code> value. |
|
|
498
495
|
| [historyQueriesXModule](./x-components.historyqueriesxmodule.md) | HistoryQueries [XModule](./x-components.xmodule.md) implementation. This module is auto-registered as soon as you import any component from the <code>history-queries</code> entry point. |
|
|
496
|
+
| [HistoryQuery](./x-components.historyquery.md) | This component renders a history query suggestion combining two buttons: one for selecting this suggestion as the search query, and another one to remove this query suggestion from the history queries. |
|
|
499
497
|
| [HistoryTinyIcon](./x-components.historytinyicon.md) | |
|
|
500
498
|
| [identifierDetectionRegexp](./x-components.identifierdetectionregexp.md) | Default implementation for the [IdentifierResultsGetters.identifierDetectionRegexp](./x-components.identifierresultsgetters.identifierdetectionregexp.md) getter. |
|
|
501
499
|
| [identifierHighlightRegexp](./x-components.identifierhighlightregexp.md) | Default implementation for the [IdentifierResultsGetters.identifierHighlightRegexp](./x-components.identifierresultsgetters.identifierhighlightregexp.md) getter. |
|
|
@@ -517,6 +515,7 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
517
515
|
| [MinusIcon](./x-components.minusicon.md) | |
|
|
518
516
|
| [MinusTinyIcon](./x-components.minustinyicon.md) | |
|
|
519
517
|
| [MultiColumnMaxWidthLayout](./x-components.multicolumnmaxwidthlayout.md) | Component for use as Layout to be filled with the rest of the Components. |
|
|
518
|
+
| [MyHistory](./x-components.myhistory.md) | The component renders the full history of user searched queries grouped by the day they were performed. |
|
|
520
519
|
| [nextQueries](./x-components.nextqueries.md) | Default implementation for the [NextQueriesGetters.nextQueries](./x-components.nextqueriesgetters.nextqueries.md) getter. |
|
|
521
520
|
| [NextQueriesList](./x-components.nextquerieslist.md) | Component that inserts groups of next queries in different positions of the injected search items list, based on the provided configuration. |
|
|
522
521
|
| [nextQueriesRequest](./x-components.nextqueriesrequest.md) | Default implementation for the [NextQueriesGetters.request](./x-components.nextqueriesgetters.request.md) getter. |
|
|
@@ -553,6 +552,7 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
553
552
|
| [relatedTagsXModule](./x-components.relatedtagsxmodule.md) | RelatedTags [XModule](./x-components.xmodule.md) implementation. This module is auto-registered as soon as you import any component from the <code>related-tags</code> entry point. |
|
|
554
553
|
| [removeFromHistory](./x-components.removefromhistory.md) | Default implementation for the [HistoryQueriesActions.removeFromHistory()](./x-components.historyqueriesactions.removefromhistory.md)<!-- -->. |
|
|
555
554
|
| [removeHistoryQuery](./x-components.removehistoryquery.md) | Removes a single history query from the history queries. |
|
|
555
|
+
| [RemoveHistoryQuery](./x-components.removehistoryquery.md) | Button that when it is pressed emits the [HistoryQueriesXEvents.UserPressedRemoveHistoryQuery](./x-components.historyqueriesxevents.userpressedremovehistoryquery.md) event, expressing the user intention to remove a query in the history. |
|
|
556
556
|
| [removeQueryPreviewInstanceWire](./x-components.removequerypreviewinstancewire.md) | Removes an instance in a query preview. |
|
|
557
557
|
| [resetAppending](./x-components.resetappending.md) | Resets the search state <code>isAppendingResults</code>. |
|
|
558
558
|
| [resetFromNoResultsWithFilters](./x-components.resetfromnoresultswithfilters.md) | Resets the search state <code>fromNoResultsWithFilters</code>. |
|
|
@@ -2,25 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [MyHistory](./x-components.myhistory.md)
|
|
4
4
|
|
|
5
|
-
## MyHistory
|
|
5
|
+
## MyHistory variable
|
|
6
6
|
|
|
7
7
|
The component renders the full history of user searched queries grouped by the day they were performed.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
animation: {
|
|
14
|
+
type: import("vue").PropType<string | import("vue").DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
locale: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
queriesListClass: StringConstructor;
|
|
22
|
+
}, {
|
|
23
|
+
hasHistoryQueries: import("vue").ComputedRef<boolean>;
|
|
24
|
+
groupByDate: import("vue").ComputedRef<Dictionary<HistoryQueryType[]>>;
|
|
25
|
+
historyQueries: import("vue").ComputedRef<any>;
|
|
26
|
+
formatTime: (timestamp: number) => string;
|
|
27
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
animation: {
|
|
29
|
+
type: import("vue").PropType<string | import("vue").DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
locale: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
queriesListClass: StringConstructor;
|
|
37
|
+
}>>, {
|
|
38
|
+
animation: string | import("vue").DefineComponent<{}, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}> | (import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue").ExtractPropTypes<{}>>, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue").ExtractPropTypes<{}>>> & import("vue").ShallowUnwrapRef<{}> & import("vue/types/v3-component-options").ExtractComputedReturns<import("vue").ComponentComputedOptions> & import("vue").ComponentMethodOptions & import("vue").ComponentCustomProperties & Readonly<import("vue").ExtractPropTypes<{}>>, any, any, any, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, import("vue").ComponentComputedOptions, import("vue").ComponentMethodOptions, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {}> & {
|
|
39
|
+
props: {};
|
|
40
|
+
});
|
|
41
|
+
locale: string;
|
|
42
|
+
}>
|
|
13
43
|
```
|
|
14
|
-
**Extends:** Vue
|
|
15
44
|
|
|
16
45
|
## Remarks
|
|
17
46
|
|
|
18
47
|
Allows the user to select one of them, emitting the needed events. A history query is just another type of suggestion that contains a query that the user has made in the past.
|
|
19
48
|
|
|
20
|
-
## Properties
|
|
21
|
-
|
|
22
|
-
| Property | Modifiers | Type | Description |
|
|
23
|
-
| --- | --- | --- | --- |
|
|
24
|
-
| [animation](./x-components.myhistory.animation.md) | <code>protected</code> | Vue \| string | Animation component that will be used to animate the suggestions. |
|
|
25
|
-
| [locale](./x-components.myhistory.locale.md) | <code>protected</code> | string | The current locale. |
|
|
26
|
-
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
2
|
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [RemoveHistoryQuery](./x-components.removehistoryquery.md)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## RemoveHistoryQuery variable
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Button that when it is pressed emits the [HistoryQueriesXEvents.UserPressedRemoveHistoryQuery](./x-components.historyqueriesxevents.userpressedremovehistoryquery.md) event, expressing the user intention to remove a query in the history.
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
_default: import("vue").DefineComponent<{
|
|
13
|
+
historyQuery: {
|
|
14
|
+
type: PropType<HistoryQuery>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}, {
|
|
18
|
+
removeHistoryQueryEvent: import("vue").ComputedRef<Partial<XEventsTypes>>;
|
|
19
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
historyQuery: {
|
|
21
|
+
type: PropType<HistoryQuery>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>>, {}>
|
|
13
25
|
```
|
|
@@ -12,9 +12,11 @@ queries.
|
|
|
12
12
|
|
|
13
13
|
## Props
|
|
14
14
|
|
|
15
|
-
| Name
|
|
16
|
-
|
|
|
17
|
-
| <code>suggestion</code>
|
|
15
|
+
| Name | Description | Type | Default |
|
|
16
|
+
| ------------------------------ | --------------------------------------- | ------------------------------ | ------------- |
|
|
17
|
+
| <code>suggestion</code> | The history query suggestion to render. | <code>HistoryQueryModel</code> | <code></code> |
|
|
18
|
+
| <code>removeButtonClass</code> | Class inherited by content element. | <code>string</code> | <code></code> |
|
|
19
|
+
| <code>suggestionClass</code> | Class inherited by content element. | <code>string</code> | <code></code> |
|
|
18
20
|
|
|
19
21
|
## Events
|
|
20
22
|
|
|
@@ -11,10 +11,11 @@ performed.
|
|
|
11
11
|
|
|
12
12
|
## Props
|
|
13
13
|
|
|
14
|
-
| Name
|
|
15
|
-
|
|
|
16
|
-
| <code>animation</code>
|
|
17
|
-
| <code>locale</code>
|
|
14
|
+
| Name | Description | Type | Default |
|
|
15
|
+
| ----------------------------- | ----------------------------------------------------------------- | -------------------------- | ----------------- |
|
|
16
|
+
| <code>animation</code> | Animation component that will be used to animate the suggestions. | <code>AnimationProp</code> | <code>'ul'</code> |
|
|
17
|
+
| <code>locale</code> | The current locale. | <code>string</code> | <code>'en'</code> |
|
|
18
|
+
| <code>queriesListClass</code> | Class inherited by content element. | <code>string</code> | <code></code> |
|
|
18
19
|
|
|
19
20
|
## Slots
|
|
20
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/clear-history-queries.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-history-queries x-button\"\n :class=\"dynamicClasses\"\n :disabled=\"isHistoryQueriesEmpty\"\n :events=\"clearHistoryQueriesEvents\"\n data-test=\"clear-history-queries\"\n aria-label=\"Clear all\"\n >\n <!-- @slot (Required) Button content with a message, an icon or both -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import {
|
|
1
|
+
{"version":3,"file":"clear-history-queries.vue.js","sources":["../../../../../src/x-modules/history-queries/components/clear-history-queries.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-history-queries x-button\"\n :class=\"dynamicClasses\"\n :disabled=\"isHistoryQueriesEmpty\"\n :events=\"clearHistoryQueriesEvents\"\n data-test=\"clear-history-queries\"\n aria-label=\"Clear all\"\n >\n <!-- @slot (Required) Button content with a message, an icon or both -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { XEventsTypes } from '../../../wiring/events.types';\n import { historyQueriesXModule } from '../x-module';\n import { useState } from '../../../composables/use-state';\n\n /**\n * A button that when is pressed, emits the\n * {@link HistoryQueriesXEvents.UserPressedClearHistoryQueries} event, expressing the user\n * intention to clear the whole history of queries.\n *\n * @public\n */\n export default defineComponent({\n name: 'ClearHistoryQueries',\n xModule: historyQueriesXModule.name,\n components: {\n BaseEventButton\n },\n setup() {\n /**\n * The whole history queries.\n *\n * @internal\n */\n const { historyQueries } = useState('historyQueries', ['historyQueries']);\n\n /**\n * Returns if the array of history queries is empty.\n *\n * @returns `true` if the {@link historyQueries} array is empty, `false` otherwise.\n * @internal\n */\n const isHistoryQueriesEmpty = computed(() => historyQueries.value.length === 0);\n\n /**\n * Dynamic CSS classes to add to the root element of this component.\n *\n * @returns A booleans dictionary where each key is the class name to add, and the boolean value\n * tells if it should be added or not.\n * @internal\n */\n const dynamicClasses = computed(\n (): VueCSSClasses => ({\n 'x-clear-history-queries--is-empty': isHistoryQueriesEmpty.value\n })\n );\n\n /**\n * The list of events that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearHistoryQueriesEvents: Partial<XEventsTypes> = {\n UserPressedClearHistoryQueries: undefined\n };\n\n return {\n dynamicClasses,\n clearHistoryQueriesEvents,\n isHistoryQueriesEmpty\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserPressedClearHistoryQueries`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button.\n\n## Examples\n\n### Basic example\n\nThe component exposes a single default slot, where you can add icons or text.\n\n```vue live\n<template>\n <div>\n <SearchInput />\n <ClearHistoryQueries>Clear history queries</ClearHistoryQueries>\n <HistoryQueries :animation=\"'FadeAndSlide'\" :maxItemsToRender=\"10\" />\n </div>\n</template>\n\n<script>\n import Vue from 'vue';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { HistoryQueries, ClearHistoryQueries } from '@empathyco/x-components/history-queries';\n import { FadeAndSlide } from '@empathyco/x-components';\n\n // Registering the animation as a global component\n Vue.component('FadeAndSlide', FadeAndSlide);\n export default {\n name: 'ClearHistoryQueriesDemo',\n components: {\n SearchInput,\n HistoryQueries,\n ClearHistoryQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;AAEA,MAAc,cAAA,GAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|