@sveltia/ui 0.30.2 → 0.30.3

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.
@@ -47,7 +47,7 @@
47
47
  invalid = false,
48
48
  label = undefined,
49
49
  'aria-label': ariaLabel,
50
- group = $bindable([]),
50
+ group = $bindable(),
51
51
  onChange,
52
52
  children,
53
53
  checkIcon,
@@ -67,12 +67,14 @@
67
67
 
68
68
  // Sync `checked` with `group` and `value`
69
69
  $effect(() => {
70
- if (group.includes(value)) {
71
- if (checked !== true) {
72
- checked = true;
70
+ if (Array.isArray(group)) {
71
+ if (group.includes(value)) {
72
+ if (checked !== true) {
73
+ checked = true;
74
+ }
75
+ } else if (checked !== false) {
76
+ checked = false;
73
77
  }
74
- } else if (checked !== false) {
75
- checked = false;
76
78
  }
77
79
  });
78
80
  </script>
@@ -120,12 +122,14 @@
120
122
 
121
123
  checked = indeterminate ? true : !checked;
122
124
 
123
- if (checked) {
124
- if (!group.includes(value)) {
125
- group = [...group, value];
125
+ if (Array.isArray(group)) {
126
+ if (checked) {
127
+ if (!group.includes(value)) {
128
+ group = [...group, value];
129
+ }
130
+ } else if (group.includes(value)) {
131
+ group = group.filter((v) => v !== value);
126
132
  }
127
- } else if (group.includes(value)) {
128
- group = group.filter((v) => v !== value);
129
133
  }
130
134
 
131
135
  onChange?.(new CustomEvent('Change', { detail: { checked } }));
@@ -47,7 +47,7 @@
47
47
  value = undefined,
48
48
  valueType = undefined,
49
49
  label = undefined,
50
- group = $bindable(''),
50
+ group = $bindable(),
51
51
  children,
52
52
  onChange,
53
53
  onSelect,
@@ -65,12 +65,14 @@
65
65
 
66
66
  // Sync `checked` with `group` and `value`
67
67
  $effect(() => {
68
- if (group === value) {
69
- if (!checked) {
70
- checked = true;
68
+ if (typeof group === 'string') {
69
+ if (group === value) {
70
+ if (!checked) {
71
+ checked = true;
72
+ }
73
+ } else if (checked) {
74
+ checked = false;
71
75
  }
72
- } else if (checked) {
73
- checked = false;
74
76
  }
75
77
  });
76
78
  </script>
@@ -106,7 +108,10 @@
106
108
  }
107
109
 
108
110
  checked = true;
109
- group = value;
111
+
112
+ if (typeof group === 'string') {
113
+ group = value;
114
+ }
110
115
  }}
111
116
  {onChange}
112
117
  {onSelect}
@@ -266,9 +266,10 @@
266
266
 
267
267
  const stepCount = (max - min) / step + 1;
268
268
  const stepWidth = barWidth / (stepCount - 1);
269
+ const emptyArray = Array.from({ length: stepCount });
269
270
 
270
- valueList = new Array(stepCount).fill(0).map((_, index) => index * step + min, 10);
271
- positionList = new Array(stepCount).fill(0).map((_, index) => index * stepWidth);
271
+ valueList = emptyArray.map((_, index) => index * step + min, 10);
272
+ positionList = emptyArray.map((_, index) => index * stepWidth);
272
273
 
273
274
  onValueChange();
274
275
  };
@@ -73,11 +73,11 @@
73
73
  * @type {TextEditorInlineType[]}
74
74
  */
75
75
  const inlineLevelButtons = $derived(
76
- unique([
77
- ...editorStore.config.enabledButtons.filter((type) =>
76
+ unique(
77
+ editorStore.config.enabledButtons.filter((type) =>
78
78
  INLINE_BUTTON_TYPES.includes(/** @type {any} */ (type)),
79
79
  ),
80
- ]),
80
+ ),
81
81
  );
82
82
  </script>
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.30.2",
3
+ "version": "0.30.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@sveltejs/adapter-auto": "^6.1.1",
31
- "@sveltejs/kit": "^2.44.0",
31
+ "@sveltejs/kit": "^2.46.2",
32
32
  "@sveltejs/package": "^2.5.4",
33
33
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
34
34
  "cspell": "^9.2.1",
@@ -38,6 +38,7 @@
38
38
  "eslint-plugin-import": "^2.32.0",
39
39
  "eslint-plugin-jsdoc": "^57.2.1",
40
40
  "eslint-plugin-svelte": "^2.46.1",
41
+ "oxlint": "^1.20.0",
41
42
  "postcss": "^8.5.6",
42
43
  "postcss-html": "^1.8.0",
43
44
  "prettier": "^3.6.2",
@@ -46,7 +47,7 @@
46
47
  "stylelint": "^16.25.0",
47
48
  "stylelint-config-recommended-scss": "^16.0.2",
48
49
  "stylelint-scss": "^6.12.1",
49
- "svelte": "^5.39.9",
50
+ "svelte": "^5.39.10",
50
51
  "svelte-check": "^4.3.2",
51
52
  "svelte-preprocess": "^6.0.3",
52
53
  "tslib": "^2.8.1",
@@ -87,6 +88,7 @@
87
88
  "check:svelte": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
88
89
  "check:prettier": "prettier --check .",
89
90
  "check:eslint": "eslint .",
91
+ "check:oxlint": "oxlint .",
90
92
  "check:stylelint": "stylelint '**/*.{css,scss,svelte}'",
91
93
  "test": "vitest run",
92
94
  "test:coverage": "vitest --coverage",