@cloudparker/moldex.js 0.0.104 → 0.0.107

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.
@@ -42,14 +42,16 @@ export function toggleDropdown(ev) {
42
42
  }
43
43
  }
44
44
  function adjustDropdownPosition() {
45
- const rect = buttonElement.getBoundingClientRect();
46
- const viewportHeight = window.innerHeight;
47
- const spaceBelow = viewportHeight - rect.bottom;
48
- const dropdownHeight = 200;
49
- if (popup || spaceBelow < dropdownHeight) {
50
- openUpward = rect.top > dropdownHeight;
51
- } else {
52
- openUpward = false;
45
+ if (buttonElement) {
46
+ const rect = buttonElement?.getBoundingClientRect();
47
+ const viewportHeight = window.innerHeight;
48
+ const spaceBelow = viewportHeight - rect.bottom;
49
+ const dropdownHeight = 200;
50
+ if (popup || spaceBelow < dropdownHeight) {
51
+ openUpward = rect.top > dropdownHeight;
52
+ } else {
53
+ openUpward = false;
54
+ }
53
55
  }
54
56
  }
55
57
  onMount(() => {
@@ -121,7 +121,7 @@ let {
121
121
  <Button
122
122
  id="{id}-list-item-{index}"
123
123
  type="button"
124
- className="w-full !text-start !justify-start hover:bg-base-50 transition rounded-none dark:hover:bg-base-700 {className}"
124
+ className="w-full !text-start !justify-start gap-4 hover:bg-base-50 transition rounded-none dark:hover:bg-base-700 {className}"
125
125
  {onClick}
126
126
  {disabled}
127
127
  {appearance}
@@ -5,5 +5,5 @@ let { circleClassName, iconPath, iconClassName = "w-5 h-5 text-primary" } = $pro
5
5
  <div
6
6
  class="aspect-square bg-primary-100 rounded-full w-10 h-10 flex items-center justify-center {circleClassName}"
7
7
  >
8
- <Icon path={iconPath!} className={iconClassName} />
8
+ <Icon path={iconPath!} className=" text-primary {iconClassName}" />
9
9
  </div>
@@ -58,7 +58,7 @@ let {
58
58
  subtitleFieldName,
59
59
  titleClassName,
60
60
  titleFieldName = "name",
61
- value = $bindable(),
61
+ value = $bindable(null),
62
62
  checkboxIconPath = mdiCheckCircle,
63
63
  uncheckboxIconPath = mdiCheckCircleOutline,
64
64
  checkboxIconClassName = "",
@@ -86,7 +86,7 @@ let isUpward = $derived.by(() => {
86
86
  }
87
87
  });
88
88
  let placementClassName = $derived(isUpward ? "bottom-full mb-1" : "mt-1");
89
- let selectedItemsSet = $state(
89
+ let selectedItemsSet = $derived(
90
90
  value ? new SvelteSet(Array.isArray(value) ? value : [value]) : new SvelteSet()
91
91
  );
92
92
  let comboboxIconSizeClassName = $derived.by(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "0.0.104",
3
+ "version": "0.0.107",
4
4
  "author": "cloudparker.com",
5
5
  "license": "MIT",
6
6
  "keywords": [