@kws3/ui 1.5.6 → 1.5.7

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.
@@ -106,19 +106,24 @@
106
106
 
107
107
  let query = "",
108
108
  _filters = [],
109
- filterVals = {};
109
+ filterVals = {},
110
+ filterWidthStyle = "";
110
111
 
111
112
  $: usedFilterComponent = filterComponent ? filterComponent : SearchFilter;
112
- $: filterWidthStyle = hasSearch
113
- ? `max-width:${(1 / (_filters.length + 2)) * 100}%`
114
- : "";
115
113
  $: changed = q && q.trim() != "";
116
114
  $: q, qHasChanged();
117
115
  $: filters, filtersHaveChanged();
118
116
 
117
+ function calculateMaxWidths() {
118
+ filterWidthStyle = hasSearch
119
+ ? `max-width:${(1 / (_filters.length + 2)) * 100}%`
120
+ : "";
121
+ }
122
+
119
123
  function filtersHaveChanged() {
120
124
  if (filters) {
121
125
  _filters = [];
126
+ let temp = [];
122
127
  for (let i in filters) {
123
128
  let obj = { name: i, options: [], type: "select" };
124
129
  if (Array.isArray(filters[i])) {
@@ -131,9 +136,12 @@
131
136
  obj.type = filters[i].type;
132
137
  }
133
138
  }
134
- _filters.push(obj);
139
+ temp.push(obj);
135
140
  }
141
+ _filters = temp;
136
142
  }
143
+
144
+ calculateMaxWidths();
137
145
  }
138
146
 
139
147
  function qHasChanged() {
@@ -16,5 +16,5 @@
16
16
  * Text to process and output
17
17
  */
18
18
  export let text = "";
19
- $: text_parts = text ? text.split("\n") : "";
19
+ $: text_parts = text && typeof text == "string" ? text.split("\n") : "";
20
20
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,5 +28,5 @@
28
28
  "text-mask-core": "^5.1.2",
29
29
  "tippy.js": "^6.3.1"
30
30
  },
31
- "gitHead": "5407d734edfb24c11ce03621e5e41ed0777fad5a"
31
+ "gitHead": "68ac0e4a0c88268dac739f25bcc16fab2b6ea941"
32
32
  }