@schukai/monster 3.58.2 → 3.58.4

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 CHANGED
@@ -1,9 +1,27 @@
1
1
 
2
+ ## [3.58.4] - 2024-03-18
3
+
4
+ ### Bug Fixes
5
+
6
+ - store lists [#139](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/139)
7
+
8
+ ## [3.58.3] - 2024-03-18
9
+
10
+ ### Bug Fixes
11
+
12
+ - datatable colum with [#143](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/143)
13
+ ### Changes
14
+
15
+ - release and publish to npm new version 3.58.3
16
+
2
17
  ## [3.58.2] - 2024-03-17
3
18
 
4
19
  ### Bug Fixes
5
20
 
6
21
  - playground missing js and remove flex [#144](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/144)
22
+ ### Changes
23
+
24
+ - release and publish to npm new version 3.58.2
7
25
 
8
26
  ## [3.58.1] - 2024-03-17
9
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schukai/monster",
3
- "version": "3.58.2",
3
+ "version": "3.58.4",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -137,7 +137,6 @@ class DataSet extends CustomElement {
137
137
  }
138
138
 
139
139
  write() {
140
-
141
140
  return new Promise((resolve, reject) => {
142
141
  if (!this[datasourceLinkedElementSymbol]) {
143
142
  reject(new Error("No datasource"));
@@ -40,7 +40,6 @@ import {
40
40
  DIRECTION_DESC,
41
41
  DIRECTION_NONE,
42
42
  } from "./datatable/header.mjs";
43
- import { getStoredFilterConfigKey } from "./filter/util.mjs";
44
43
  import { DatatableStyleSheet } from "./stylesheet/datatable.mjs";
45
44
  import {
46
45
  handleDataSourceChanges,
@@ -366,12 +366,23 @@ function initControlReferences() {
366
366
  return this;
367
367
  }
368
368
 
369
+ function updateFilterSelections() {
370
+ setTimeout(() => {
371
+ const options = this[settingsSymbol].getOptions();
372
+ this[filterSelectElementSymbol].setOption("options", options);
373
+ setTimeout(() => {
374
+ this[filterSelectElementSymbol].value =
375
+ this[settingsSymbol].getSelected();
376
+ }, 10);
377
+ }, 10);
378
+ }
379
+
369
380
  /**
370
381
  * @private
371
382
  * @throws {Error} no filter label is defined
372
383
  */
373
384
  function initFilter() {
374
- const storedConfig = this[settingsSymbol];
385
+ const storedSetting = this[settingsSymbol];
375
386
  this[settingsSymbol] = new Settings();
376
387
 
377
388
  const result = parseBracketedKeyValueHash(getGlobal().location.hash);
@@ -397,7 +408,7 @@ function initFilter() {
397
408
  element.id = value;
398
409
  }
399
410
 
400
- let setting = storedConfig.get(value);
411
+ let setting = storedSetting.get(value);
401
412
 
402
413
  if (setting) {
403
414
  this[settingsSymbol].set(setting);
@@ -407,31 +418,22 @@ function initFilter() {
407
418
  const v = escapeAttributeValue(valuesFromHash[element.id]);
408
419
  const searchInput = element.firstElementChild;
409
420
  try {
410
- // searchInput.value = valuesFromHash[element.id];
411
- searchInput.value = v; //valuesFromHash[element.id];
421
+ searchInput.value = v;
412
422
  } catch (error) {}
413
423
  }
414
424
 
415
425
  setting = this[settingsSymbol].get(value);
426
+ let visible = false;
416
427
  if (setting) {
417
428
  setSlotAttribute(element, setting.visible);
418
- //style.display = setting.visible ? "block" : "none";
429
+ visible = setting.visible;
430
+ } else {
431
+ visible = getVisibilityFromSlotAttribute(element);
419
432
  }
420
433
 
421
- //const visible = window.getComputedStyle(element).display !== "none";
422
- const visible = getVisibilityFromSlotAttribute(element);
423
-
424
434
  this[settingsSymbol].set({ value, label, visible });
425
435
  });
426
-
427
- this[filterSelectElementSymbol].setOption(
428
- "options",
429
- this[settingsSymbol].getOptions(),
430
- );
431
-
432
- setTimeout(() => {
433
- this[filterSelectElementSymbol].value = this[settingsSymbol].getSelected();
434
- }, 10);
436
+ updateFilterSelections.call(this);
435
437
  }
436
438
 
437
439
  /**
@@ -512,7 +514,6 @@ function initEventHandler() {
512
514
  event.detail.value,
513
515
  );
514
516
  if (filterElement) {
515
- //filterElement.style.display = event.detail.checked ? "block" : "none";
516
517
  setSlotAttribute(filterElement, event.detail.checked);
517
518
  }
518
519
 
@@ -651,15 +652,18 @@ function initEventHandler() {
651
652
  }
652
653
  });
653
654
 
654
- doSearch.call(self, { showEffect: false });
655
+ doSearch
656
+ .call(self, { showEffect: false })
657
+ .then(() => {})
658
+ .catch((e) => addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, e.message));
655
659
  });
656
660
 
657
661
  self[locationChangeHandlerSymbol] = (event) => {
658
- if (event instanceof HashChangeEvent) {
659
- if (event.oldURL === event.newURL) {
660
- return;
661
- }
662
- }
662
+ // if (event instanceof HashChangeEvent) {
663
+ // if (event.oldURL === event.newURL) {
664
+ // return;
665
+ // }
666
+ // }
663
667
  };
664
668
 
665
669
  self.addEventListener("keyup", (event) => {
@@ -788,8 +792,7 @@ function updateFilterTabs() {
788
792
 
789
793
  element.insertAdjacentHTML(
790
794
  "beforeend",
791
- `
792
- <div data-monster-button-label="${name}"
795
+ `<div data-monster-button-label="${name}"
793
796
  data-monster-removable="true"
794
797
  data-monster-query="${escapedQuery}" data-monster-role="filter-tab" >
795
798
  </div>`,
@@ -1054,7 +1057,8 @@ function getControlValuesFromLabel(label) {
1054
1057
  * @private
1055
1058
  * @returns {Promise<unknown>}
1056
1059
  */
1057
- function initFromConfig() {
1060
+ function initFromConfig() {;
1061
+
1058
1062
  const document = getDocument();
1059
1063
  const host = document.querySelector("monster-host");
1060
1064
 
@@ -1068,7 +1072,7 @@ function initFromConfig() {
1068
1072
  host
1069
1073
  .getConfig(configKey)
1070
1074
  .then((config) => {
1071
- if (config && isObject(config)) {
1075
+ if ((config && isObject(config)) || isArray(config)) {
1072
1076
  this[settingsSymbol].setOptions(config);
1073
1077
  }
1074
1078
  resolve();
@@ -76,6 +76,9 @@
76
76
  border-bottom: 1px dashed var(--monster-bg-color-primary-2);
77
77
  box-sizing: border-box;
78
78
 
79
+ min-width: 0;
80
+ overflow: auto;
81
+
79
82
  &.start {
80
83
  justify-content: flex-start;
81
84
  }
@@ -13,7 +13,6 @@
13
13
  width: 100%;
14
14
  }
15
15
 
16
-
17
16
  [data-monster-role=control] {
18
17
 
19
18
  & .hidden {
@@ -33,7 +32,7 @@
33
32
 
34
33
  align-items: flex-end;
35
34
  display: flex;
36
- justify-content: space-between;
35
+ justify-content: flex-start;
37
36
  width: 100%;
38
37
  flex-direction: column;
39
38
 
@@ -44,7 +43,7 @@
44
43
  width: 100%;
45
44
  column-gap: 1rem;
46
45
  row-gap: 0.5rem;
47
- justify-content: space-between;
46
+ justify-content: flex-start;
48
47
 
49
48
 
50
49
  & ::slotted(label) {