@enso-ui/filters 3.1.8 → 3.2.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017 laravel-enso
3
+ Copyright (c) 2026 laravel-enso
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -24,4 +24,4 @@ Thank you to all the people who already contributed to Enso!
24
24
 
25
25
  ## License
26
26
 
27
- [ISC](https://opensource.org/licenses/ISC)
27
+ [MIT](https://opensource.org/licenses/MIT)
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@enso-ui/filters",
3
- "version": "3.1.8",
3
+ "version": "3.2.0",
4
4
  "description": "Renderless Vue Filter Components",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
5
+ "main": "bulma/index.js",
9
6
  "repository": {
10
7
  "type": "git",
11
8
  "url": "git+https://github.com/enso-ui/filters.git"
@@ -18,35 +15,25 @@
18
15
  "filter"
19
16
  ],
20
17
  "author": "Adrian Ocneanu <aocneanu@gmail.com>",
21
- "license": "ISC",
18
+ "license": "MIT",
22
19
  "bugs": {
23
20
  "url": "https://github.com/enso-ui/filters/issues"
24
21
  },
25
22
  "homepage": "https://github.com/enso-ui/filters#readme",
26
23
  "dependencies": {
27
- "@enso-ui/datepicker": "^2.0",
28
- "@enso-ui/select": "^3.0",
24
+ "@enso-ui/datepicker": "^3.0.0",
25
+ "@enso-ui/select": "^4.0.0",
29
26
  "@enso-ui/strings": "^2.0",
30
27
  "@enso-ui/switch": "^2.0",
31
28
  "@enso-ui/transitions": "^2.0",
32
- "@fortawesome/fontawesome-svg-core": "^1.2.2",
33
- "@fortawesome/free-solid-svg-icons": "^5.11.2",
34
- "@fortawesome/vue-fontawesome": "3.0.0-5",
29
+ "@enso-ui/ui": "^7.0.0",
30
+ "@fortawesome/fontawesome-svg-core": "^7.2.0",
31
+ "@fortawesome/free-solid-svg-icons": "^7.2.0",
32
+ "@fortawesome/vue-fontawesome": "3.1.3",
35
33
  "bulma": "^0.9.0",
36
34
  "date-fns": "^2.0.0",
37
- "v-tooltip": "^4.0.0-beta.2",
38
- "vue": "^3.0",
39
- "vuex": "^4.0.0"
40
- },
41
- "devDependencies": {
42
- "@vue/cli-plugin-babel": "5.0.0-beta.6",
43
- "@vue/cli-plugin-eslint": "5.0.0-beta.6",
44
- "@vue/eslint-config-airbnb": "^5.0.0",
45
- "autoprefixer": "^9.6.1",
46
- "babel-eslint": "^10.0.1",
47
- "cross-env": "^6.0.0",
48
- "eslint": "^7.0.0",
49
- "eslint-import-resolver-alias": "^1.1.2",
50
- "eslint-plugin-vue": "^8.0.0"
35
+ "pinia": "^3.0.3",
36
+ "v-tooltip": "^4.0.0-beta.17",
37
+ "vue": "^3.0"
51
38
  }
52
39
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class="vue-filter is-paddingless">
2
+ <div class="vue-filter p-0">
3
3
  <div v-if="!compact"
4
- class="header has-text-centered has-background-light px-2">
4
+ class="header filter-header has-text-centered px-2">
5
5
  <b>{{ i18n(name) }}</b>
6
6
  </div>
7
7
  <slot/>
@@ -34,17 +34,3 @@ export default {
34
34
  };
35
35
 
36
36
  </script>
37
-
38
- <style lang="scss">
39
- .vue-filter {
40
- .header {
41
- border-top-left-radius: inherit;
42
- border-top-right-radius: inherit;
43
- padding-top: 0.5em;
44
- }
45
-
46
- .select-wrapper {
47
- padding: 0.25em;
48
- }
49
- }
50
- </style>
@@ -4,12 +4,9 @@
4
4
  </template>
5
5
 
6
6
  <script>
7
- import { library } from '@fortawesome/fontawesome-svg-core';
8
7
  import { faCheck, faTimes } from '@fortawesome/free-solid-svg-icons';
9
8
  import VueFilter from './VueFilter.vue';
10
9
 
11
- library.add(faCheck, faTimes);
12
-
13
10
  export default {
14
11
  name: 'BooleanFilter',
15
12
 
@@ -25,11 +22,11 @@ export default {
25
22
  data: v => ({
26
23
  options: [{
27
24
  value: v.numeric ? 1 : true,
28
- icon: 'check',
25
+ icon: faCheck,
29
26
  class: 'has-text-success',
30
27
  }, {
31
28
  value: v.numeric ? 0 : false,
32
- icon: 'times',
29
+ icon: faTimes,
33
30
  class: 'has-text-danger',
34
31
  }],
35
32
  }),
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div class="date-filter is-paddingless"
2
+ <div class="date-filter p-0"
3
3
  :class="$attrs.class">
4
4
  <core-date-filter v-bind="$attrs">
5
5
  <template #default="{
6
6
  filters, filter, custom, minBindings, minEvents, maxBindings, maxEvents,
7
7
  direction, directionBindings, directionEvents, backEvents, filterEvents,
8
8
  }">
9
- <div class="header has-text-centered has-background-light px-2"
9
+ <div class="header filter-header has-text-centered"
10
10
  v-if="!compact">
11
11
  <strong>
12
12
  {{ label(custom) }}
@@ -14,13 +14,14 @@
14
14
  </div>
15
15
  <div v-tooltip="compact ? label(custom) : null"
16
16
  class="filter-wrapper"
17
- :class="{ 'has-background-light': compact }">
17
+ :class="{ 'filter-surface': compact }">
18
18
  <fade mode="out-in">
19
19
  <div class="tags-wrapper has-text-centered"
20
20
  key="tags"
21
21
  v-if="!custom">
22
22
  <div class="filter-tags">
23
- <span v-if="direction">
23
+ <span v-if="direction"
24
+ class="direction-wrapper px-2">
24
25
  <vue-switch v-bind="directionBindings"
25
26
  class="is-small direction"
26
27
  v-on="directionEvents"/>
@@ -36,13 +37,13 @@
36
37
  </div>
37
38
  <div v-else
38
39
  key="dates"
39
- class="dates-wrapper animated">
40
+ class="dates-wrapper animate__animated">
40
41
  <div class="columns is-mobile is-variable is-0 is-centered">
41
42
  <div class="column is-narrow">
42
43
  <a class="button is-naked p-2">
43
44
  <span class="icon is-small"
44
45
  v-on="backEvents">
45
- <fa icon="arrow-left"
46
+ <fa :icon="faArrowLeft"
46
47
  size="sm"/>
47
48
  </span>
48
49
  </a>
@@ -74,15 +75,12 @@
74
75
  import 'v-tooltip/dist/v-tooltip.css';
75
76
  import { VTooltip } from 'v-tooltip';
76
77
  import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
77
- import { library } from '@fortawesome/fontawesome-svg-core';
78
78
  import { faArrowLeft } from '@fortawesome/free-solid-svg-icons';
79
79
  import { Datepicker } from '@enso-ui/datepicker/bulma';
80
80
  import { Fade } from '@enso-ui/transitions';
81
81
  import VueSwitch from '@enso-ui/switch/bulma';
82
82
  import CoreDateFilter from '../renderless/CoreDateFilter.vue';
83
83
 
84
- library.add(faArrowLeft);
85
-
86
84
  export default {
87
85
  name: 'DateFilter',
88
86
 
@@ -115,6 +113,10 @@ export default {
115
113
  },
116
114
  },
117
115
 
116
+ data: () => ({
117
+ faArrowLeft,
118
+ }),
119
+
118
120
  methods: {
119
121
  label(custom) {
120
122
  return `${custom ? this.i18n('Between') : this.i18n('When')}
@@ -123,38 +125,3 @@ export default {
123
125
  },
124
126
  };
125
127
  </script>
126
-
127
- <style lang="scss">
128
- .date-filter {
129
- .header {
130
- border-top-left-radius: inherit;
131
- border-top-right-radius: inherit;
132
- padding-top: 0.5em;
133
- }
134
-
135
- .control {
136
- max-width: 13.3em;
137
- }
138
-
139
- .tag {
140
- cursor: pointer;
141
- margin: 2px;
142
- }
143
-
144
- .filter-wrapper {
145
- border-radius: inherit;
146
- padding: 0.25em;
147
- }
148
-
149
- .tags-wrapper {
150
- .filter-tags {
151
- min-height: 2.25em;
152
- padding: 0.2em;
153
-
154
- .direction {
155
- vertical-align: middle;
156
- }
157
- }
158
- }
159
- }
160
- </style>
@@ -6,7 +6,7 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
- import { mapState, mapGetters } from 'vuex';
9
+ import { useStore } from '../utils/pinia';
10
10
  import DateFilter from './DateFilter.vue';
11
11
 
12
12
  export default {
@@ -24,8 +24,12 @@ export default {
24
24
  },
25
25
 
26
26
  computed: {
27
- ...mapState(['meta']),
28
- ...mapGetters('preferences', ['lang']),
27
+ meta() {
28
+ return useStore('app').meta;
29
+ },
30
+ lang() {
31
+ return useStore('preferences').lang;
32
+ },
29
33
  },
30
34
  };
31
35
  </script>
@@ -4,7 +4,6 @@
4
4
  :i18n="i18n"
5
5
  :name="name">
6
6
  <enso-select v-bind="{...$attrs, class: 'select-wrapper'}"
7
- :class="{'has-background-light': compact}"
8
7
  v-tooltip="compact ? i18n(name) : null"
9
8
  ref="select"/>
10
9
  </base-select-filter>
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div class="input-filter is-paddingless"
2
+ <div class="input-filter p-0"
3
3
  :class="$attrs.class">
4
4
  <div v-if="!compact"
5
- class="header has-text-centered has-background-light px-2">
5
+ class="header filter-header has-text-centered px-2">
6
6
  <b>{{ i18n(name) }}</b>
7
7
  </div>
8
8
  <div v-tooltip="compact ? i18n(name) : null"
9
- :class="['input-wrapper', {'has-background-light': compact}]">
9
+ :class="['input-wrapper', { 'filter-surface': compact }]">
10
10
  <core-input-filter v-bind="$attrs">
11
11
  <template #default="{
12
12
  modelValue, bindings, events, clearEvents,
@@ -62,22 +62,3 @@ export default {
62
62
  },
63
63
  };
64
64
  </script>
65
-
66
- <style lang="scss">
67
- .input-filter {
68
- .header {
69
- border-top-left-radius: inherit;
70
- border-top-right-radius: inherit;
71
- padding-top: 0.5em;
72
- }
73
-
74
- .input-wrapper {
75
- border-radius: inherit;
76
- padding: 0.25em;
77
- }
78
-
79
- .control.has-icons-right .icon.clear-button {
80
- pointer-events: all;
81
- }
82
- }
83
- </style>
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div class="interval-filter is-paddingless"
2
+ <div class="interval-filter p-0"
3
3
  :class="$attrs.class">
4
4
  <div v-if="!compact"
5
- class="header has-text-centered has-background-light px-2">
5
+ class="header filter-header has-text-centered px-2">
6
6
  <b>{{ i18n(name) }}</b>
7
7
  </div>
8
8
  <div v-tooltip="compact ? i18n(name) : null"
9
- :class="['input-wrapper', {'has-background-light': compact}]">
9
+ :class="['input-wrapper', { 'filter-surface': compact }]">
10
10
  <core-interval-filter v-bind="$attrs">
11
11
  <template #default="{
12
12
  modelValue, invalid, minBindings, minEvents, maxBindings,
@@ -86,22 +86,3 @@ export default {
86
86
  },
87
87
  };
88
88
  </script>
89
-
90
- <style lang="scss">
91
- .interval-filter {
92
- .header {
93
- border-top-left-radius: inherit;
94
- border-top-right-radius: inherit;
95
- padding-top: 0.5em;
96
- }
97
-
98
- .input-wrapper {
99
- border-radius: inherit;
100
- padding: 0.25em;
101
- }
102
-
103
- .control.has-icons-right .icon.clear-button {
104
- pointer-events: all;
105
- }
106
- }
107
- </style>
@@ -4,7 +4,6 @@
4
4
  :i18n="i18n"
5
5
  :name="name">
6
6
  <vue-select v-bind="{...$attrs, class: 'select-wrapper'}"
7
- :class="{'has-background-light': compact}"
8
7
  :i18n="i18n"
9
8
  v-tooltip="compact ? i18n(name) : null"
10
9
  ref="select"/>
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <div class="vue-filter is-paddingless">
2
+ <div class="vue-filter p-0">
3
3
  <div v-if="!compact"
4
- class="header has-text-centered has-background-light px-2">
4
+ class="header filter-header has-text-centered px-2">
5
5
  <strong>{{ i18n(name) }}</strong>
6
6
  <span v-if="readonly"
7
7
  class="icon lock has-text-muted">
8
- <fa icon="lock"
8
+ <fa :icon="faLock"
9
9
  size="xs"/>
10
10
  </span>
11
11
  </div>
12
12
  <div v-tooltip="compact ? i18n(name) : null"
13
13
  class="tabs-wrapper"
14
- :class="{ 'has-background-light': compact }">
14
+ :class="{ 'filter-surface': compact }">
15
15
  <div class="tabs is-toggle is-fullwidth filter-tabs">
16
16
  <ul>
17
17
  <li :class="{ 'is-active': modelValue }">
@@ -36,6 +36,7 @@
36
36
  import 'v-tooltip/dist/v-tooltip.css';
37
37
  import { VTooltip } from 'v-tooltip';
38
38
  import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
39
+ import { faLock } from '@fortawesome/free-solid-svg-icons';
39
40
 
40
41
  export default {
41
42
  name: 'ToggleFilter',
@@ -70,13 +71,17 @@ export default {
70
71
  default: null,
71
72
  },
72
73
  modelValue: {
73
- type: Boolean,
74
+ type: [Boolean, null],
74
75
  required: true,
75
76
  },
76
77
  },
77
78
 
78
79
  emits: ['change', 'update:modelValue'],
79
80
 
81
+ data: () => ({
82
+ faLock,
83
+ }),
84
+
80
85
  methods: {
81
86
  update() {
82
87
  if (!this.readonly) {
@@ -86,28 +91,3 @@ export default {
86
91
  },
87
92
  };
88
93
  </script>
89
-
90
- <style lang="scss">
91
- .vue-filter {
92
- .header {
93
- border-top-left-radius: inherit;
94
- border-top-right-radius: inherit;
95
- padding-top: 0.5em;
96
- }
97
-
98
- .tabs-wrapper {
99
- border-radius: inherit;
100
- padding: 0.25em;
101
-
102
- .tabs {
103
- height: 2.25em;
104
-
105
- li {
106
- a {
107
- padding: 0.25em;
108
- }
109
- }
110
- }
111
- }
112
- }
113
- </style>
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <div class="vue-filter is-paddingless">
2
+ <div class="vue-filter p-0">
3
3
  <div v-if="!compact && name"
4
- class="header has-text-centered has-background-light px-2">
4
+ class="header filter-header has-text-centered px-2">
5
5
  <strong>{{ i18n(name) }}</strong>
6
6
  <span v-if="readonly"
7
7
  class="icon lock has-text-muted">
8
- <fa icon="lock"
8
+ <fa :icon="faLock"
9
9
  size="xs"/>
10
10
  </span>
11
11
  </div>
12
12
  <div v-tooltip="compact ? i18n(name) : null"
13
13
  class="tabs-wrapper"
14
- :class="{ 'has-background-light': compact }">
14
+ :class="{ 'filter-surface': compact }">
15
15
  <div class="tabs is-toggle is-fullwidth filter-tabs no-scrollbars">
16
16
  <ul>
17
17
  <li v-for="(option, index) in options"
@@ -36,7 +36,7 @@
36
36
  :class="emptyModel
37
37
  ? 'has-text-danger'
38
38
  : 'has-text-success'">
39
- <fa icon="power-off"/>
39
+ <fa :icon="faPowerOff"/>
40
40
  </span>
41
41
  <span v-if="!icons && offLabel"
42
42
  class="filter-label">
@@ -53,14 +53,14 @@
53
53
  <script setup>
54
54
  import 'v-tooltip/dist/v-tooltip.css';
55
55
  import {
56
- computed, defineProps, defineModel, defineOptions,
56
+ computed
57
57
  } from 'vue';
58
58
  import { VTooltip } from 'v-tooltip';
59
59
  import { FontAwesomeIcon as Fa } from '@fortawesome/vue-fontawesome';
60
- import { library } from '@fortawesome/fontawesome-svg-core';
61
60
  import { faPowerOff, faLock } from '@fortawesome/free-solid-svg-icons';
62
-
63
- library.add(faPowerOff, faLock);
61
+ import {
62
+ defineModel, defineOptions, defineProps,
63
+ } from 'vue';
64
64
 
65
65
  defineOptions({
66
66
  directives: {
@@ -152,28 +152,3 @@ const update = (value = null) => {
152
152
  model.value = current;
153
153
  };
154
154
  </script>
155
-
156
- <style lang="scss">
157
- .vue-filter {
158
- .header {
159
- border-top-left-radius: inherit;
160
- border-top-right-radius: inherit;
161
- padding-top: 0.5em;
162
- }
163
-
164
- .tabs-wrapper {
165
- border-radius: inherit;
166
- padding: 0.25em;
167
-
168
- .tabs {
169
- height: 2.25em;
170
-
171
- li {
172
- a {
173
- padding: 0.25em;
174
- }
175
- }
176
- }
177
- }
178
- }
179
- </style>
@@ -0,0 +1,11 @@
1
+ import { getActivePinia } from 'pinia';
2
+
3
+ export const useStore = id => {
4
+ const store = getActivePinia()?._s?.get(id);
5
+
6
+ if (!store) {
7
+ throw new Error(`Missing Pinia store: ${id}`);
8
+ }
9
+
10
+ return store;
11
+ };