@witchcraft/ui 0.3.17 → 0.3.19

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "witchcraftUi",
3
3
  "configKey": "witchcraftUi",
4
- "version": "0.3.17",
4
+ "version": "0.3.19",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -97,6 +97,8 @@
97
97
  v-bind="setSlotVar('message', {
98
98
  class: `
99
99
  notification--message
100
+ shrink-1
101
+ overflow-auto
100
102
  whitespace-pre-wrap
101
103
  text-neutral-800
102
104
  dark:text-neutral-200
@@ -29,7 +29,7 @@
29
29
  :handler="handler"
30
30
  tabindex="0"
31
31
  :notification="notification"
32
- class="overflow-hidden my-2"
32
+ class="overflow-hidden my-2 max-h-[25dvh] min-h-[300px]"
33
33
  v-for="notification of notifications"
34
34
  :key="notification.id"
35
35
  @pause="handler.pause(notification)"
@@ -68,6 +68,7 @@
68
68
  class="
69
69
  data-[state=open]:animate-contentShow
70
70
  fixed
71
+ flex
71
72
  top-[50%]
72
73
  left-[50%]
73
74
  translate-x-[-50%]
@@ -79,6 +80,8 @@
79
80
  >
80
81
  <lib-notification
81
82
  class="
83
+ max-w-full
84
+ max-h-full
82
85
  top-notification
83
86
  text-md
84
87
  gap-2
@@ -11,6 +11,7 @@ type RealProps = {
11
11
  rounded?: boolean;
12
12
  border?: boolean;
13
13
  cellBorder?: boolean;
14
+ /** Disables the header. This also sets the selector to `tr:first-child > td` instead to avoid issues with the vResizableCols directive. */
14
15
  header?: boolean;
15
16
  colConfig?: TableColConfig<T>;
16
17
  /**
@@ -36,7 +37,7 @@ type RealProps = {
36
37
  * Since the table now truncates rows by default, they will always be the same height unless you change the inner styling. In fixed mode, `forceRecalculateFixedVirtualizer` is exposed if you need to force re-calculation.
37
38
  *
38
39
  * If using slots, be sure to at least pass the `class` slot prop to the td element. `style` with width is also supplied but is not required if you're displaying the table as a table.
39
- *
40
+ *
40
41
  * ### Dynamic (experimental)
41
42
  *
42
43
  * In `dynamic` mode we use tanstack's measureElement method. This is more expensive, but it will work with any heights.
@@ -51,7 +51,7 @@
51
51
  mergedVirtualizerOpts.enabled && mergedVirtualizerOpts.method === 'dynamic' && `
52
52
  relative
53
53
  `,
54
- $attrs.wrapperClass
54
+ $attrs['wrapper-class']
55
55
  )"
56
56
  ref="parentRef"
57
57
  >
@@ -240,7 +240,7 @@ const isPostSetup = ref(false);
240
240
  const resizableOptions = computed(() => ({
241
241
  colCount: props.cols.length,
242
242
  widths,
243
- selector: ".cell",
243
+ selector: props.header ? void 0 : `tr:first-child > td`,
244
244
  ...props.resizable,
245
245
  onSetup: (el) => {
246
246
  isPostSetup.value = true;
@@ -11,6 +11,7 @@ type RealProps = {
11
11
  rounded?: boolean;
12
12
  border?: boolean;
13
13
  cellBorder?: boolean;
14
+ /** Disables the header. This also sets the selector to `tr:first-child > td` instead to avoid issues with the vResizableCols directive. */
14
15
  header?: boolean;
15
16
  colConfig?: TableColConfig<T>;
16
17
  /**
@@ -36,7 +37,7 @@ type RealProps = {
36
37
  * Since the table now truncates rows by default, they will always be the same height unless you change the inner styling. In fixed mode, `forceRecalculateFixedVirtualizer` is exposed if you need to force re-calculation.
37
38
  *
38
39
  * If using slots, be sure to at least pass the `class` slot prop to the td element. `style` with width is also supplied but is not required if you're displaying the table as a table.
39
- *
40
+ *
40
41
  * ### Dynamic (experimental)
41
42
  *
42
43
  * In `dynamic` mode we use tanstack's measureElement method. This is more expensive, but it will work with any heights.
@@ -10,14 +10,8 @@ const defaultOpts = {
10
10
  enabled: true
11
11
  };
12
12
  const callback = (_rect, el) => {
13
- const $el = getElInfo(el);
14
- if ($el.justResized) return;
15
13
  setColWidths(el);
16
- $el.justResized = true;
17
- setTimeout(() => {
18
- positionGrips(el);
19
- $el.justResized = false;
20
- }, 0);
14
+ positionGrips(el);
21
15
  };
22
16
  export const vResizableCols = {
23
17
  mounted(el, { value: opts = {} }) {
@@ -29,7 +23,7 @@ export const vResizableCols = {
29
23
  },
30
24
  updated(el, { value: opts = {} }) {
31
25
  const options = override({ ...defaultOpts }, opts);
32
- const info = el && options.enabled && getElInfo(el);
26
+ const info = el && options.enabled && getElInfo(el, { throwIfMissing: false });
33
27
  const hasGrips = el && options.enabled && elMap.get(el)?.grips;
34
28
  const colsNotEqual = info && info.colCount !== options.colCount;
35
29
  if (!options.enabled || colsNotEqual) {
@@ -54,7 +48,11 @@ function setWidth(col, amountInPx, el) {
54
48
  const width = Math.max($el.margin, amountInPx);
55
49
  const index = getColEls(el).findIndex((_) => col === _);
56
50
  if ($el.fitWidth) {
57
- $el.widths.value[index] = `${width / getBox(el).width * 100}%`;
51
+ if (amountInPx <= $el.margin) {
52
+ $el.widths.value[index] = `${$el.margin}px`;
53
+ } else {
54
+ $el.widths.value[index] = `${width / getBox(el).width * 100}%`;
55
+ }
58
56
  } else {
59
57
  $el.widths.value[index] = `${width}px`;
60
58
  }
@@ -86,6 +84,7 @@ function createPointerDownHandler(el) {
86
84
  castType(e.target);
87
85
  $el.target = e.target;
88
86
  $el.isDragging = true;
87
+ el.classList.add("dragging");
89
88
  e.preventDefault();
90
89
  document.addEventListener("pointerup", $el.pointerUpHandler);
91
90
  const { col, colNext } = getCols(el);
@@ -133,11 +132,7 @@ function createPointerMoveHandler(el) {
133
132
  setWidth(col, newWidth, el);
134
133
  }
135
134
  }
136
- $el.justResized = true;
137
- setTimeout(() => {
138
- positionGrips(el);
139
- $el.justResized = false;
140
- }, 0);
135
+ positionGrips(el);
141
136
  }
142
137
  }
143
138
  };
@@ -145,9 +140,11 @@ function createPointerMoveHandler(el) {
145
140
  function createPointerUpHandler(el) {
146
141
  return (e) => {
147
142
  const $el = getElInfo(el);
143
+ $el.pointerMoveHandler(e);
148
144
  if ($el.isDragging) {
149
145
  e.preventDefault();
150
146
  $el.isDragging = false;
147
+ el.classList.remove("dragging");
151
148
  el.classList.remove("resizable-cols-error");
152
149
  $el.offset = 0;
153
150
  delete $el.target;
@@ -187,7 +184,7 @@ function getElInfo(el, { throwIfMissing = true } = {}) {
187
184
  function getColEls(el) {
188
185
  const $el = elMap.get(el);
189
186
  if (!$el) unreachable("El went missing.");
190
- return [...el.querySelectorAll(`:scope ${$el.selector ? $el.selector : "tr > th, tr > td"}`)];
187
+ return [...el.querySelectorAll(`:scope ${$el.selector ?? "tr > th"}`)];
191
188
  }
192
189
  function setupColumns(el, opts) {
193
190
  const gripWidth = getTestGripSize(el);
@@ -206,8 +203,10 @@ function setupColumns(el, opts) {
206
203
  onTeardown: opts.onTeardown
207
204
  };
208
205
  elMap.set(el, $el);
209
- const els = getColEls(el);
210
- const headers = els.slice(0, opts.colCount);
206
+ const headers = getColEls(el);
207
+ if (headers.length !== opts.colCount) {
208
+ throw new Error(`Number of headers matched using selector ${opts.selector ?? "tr > th"} does not match number of columns.`);
209
+ }
211
210
  setColWidths(el, headers);
212
211
  el.style.width = $el.fitWidth ? "" : "min-content";
213
212
  const len = opts.colCount;
@@ -218,13 +217,9 @@ function setupColumns(el, opts) {
218
217
  el.appendChild(grip);
219
218
  $el.grips.set(grip, i);
220
219
  }
221
- $el.justResized = true;
222
- setTimeout(() => {
223
- positionGrips(el);
224
- $el.justResized = false;
225
- el.classList.add("resizable-cols-setup");
226
- opts.onSetup?.(el);
227
- }, 0);
220
+ positionGrips(el);
221
+ el.classList.add("resizable-cols-setup");
222
+ opts.onSetup?.(el);
228
223
  }
229
224
  function positionGrips(el) {
230
225
  let xPos = 0;
@@ -291,7 +286,7 @@ function setColWidths(el, children) {
291
286
  castType(col);
292
287
  const colBox = getBox(col);
293
288
  if ($el.fixedWidths[i] !== void 0) {
294
- setWidth(col, $el.fixedWidths[i], el);
289
+ $el.widths.value[i] = `${$el.fixedWidths[i]}px`;
295
290
  width += $el.fixedWidths[i];
296
291
  } else {
297
292
  if ($el.fitWidth) {
@@ -40,7 +40,7 @@ export type ResizableOptions = {
40
40
  * It can then be used as needed by the component.
41
41
  */
42
42
  widths: Ref<string[]>;
43
- /** The selector to use for the cells. "tr > td" by default. */
43
+ /** The selector to use for the header cells. "tr > th" by default. */
44
44
  selector: string;
45
45
  /** Is called just after the `resizable-cols-setup` class is added. Can be useful for controlling the styling of wrappers or doing additional things post-setup. The default table element uses it to set the class on the wrapper also. */
46
46
  onSetup?: (el: Element) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@witchcraft/ui",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "Vue component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/runtime/main.lib.js",
@@ -95,6 +95,8 @@
95
95
  v-bind="setSlotVar('message', {
96
96
  class: `
97
97
  notification--message
98
+ shrink-1
99
+ overflow-auto
98
100
  whitespace-pre-wrap
99
101
  text-neutral-800
100
102
  dark:text-neutral-200
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
+ import { faker } from "@faker-js/faker"
2
3
  import type { Meta, StoryObj } from "@storybook/vue3"
3
- import { ref } from "vue"
4
+ import { computed, ref } from "vue"
4
5
 
5
6
  import LibNotifications from "./LibNotifications.vue"
6
7
 
@@ -29,22 +30,26 @@ export const Primary: Story = {
29
30
 
30
31
  const withTitle = ref(args.withTitle)
31
32
  const disableTimeout = ref(false)
33
+ const lotsOfText = ref(false)
34
+ const paragraphs = `\n Simulating lots of text:\n${faker.lorem.paragraphs(20)}`
35
+ const extraText = computed(() => lotsOfText.value ? paragraphs : "")
32
36
 
33
37
  const notifyRequiresAction = () => {
34
38
  count++
35
39
  void handler.notify({
36
40
  title: withTitle.value ? `Notification(${count})` : undefined,
37
- message: `This is a notification that requires action. Pick an option:`,
41
+ message: `This is a notification that requires action. Pick an option:${extraText.value}`,
38
42
  requiresAction: true,
39
43
  options: ["Ok", "Default Answer", "Cancel"],
40
44
  default: "Default Answer"
41
45
  })
42
46
  }
47
+
43
48
  const notifyWithDangerousOption = () => {
44
49
  count++
45
50
  void handler.notify({
46
51
  title: withTitle.value ? `Notification(${count})` : undefined,
47
- message: `This is a notification that has a dangerous option. Pick an option:`,
52
+ message: `This is a notification that has a dangerous option. Pick an option:${extraText.value}`,
48
53
  options: ["Ok", "Default Answer", "Dangerous Option", "Cancel"],
49
54
  default: "Default Answer",
50
55
  dangerous: ["Dangerous Option"]
@@ -54,7 +59,7 @@ export const Primary: Story = {
54
59
  count++
55
60
  void handler.notify({
56
61
  title: withTitle.value ? `Notification(${count})` : undefined,
57
- message: `This is a non-cancellable notification. Pick an option:`,
62
+ message: `This is a non-cancellable notification. Pick an option:${extraText.value}`,
58
63
  options: ["Ok", "Default Answer"],
59
64
  default: "Default Answer",
60
65
  cancellable: false
@@ -64,7 +69,7 @@ export const Primary: Story = {
64
69
  count++
65
70
  void handler.notify({
66
71
  title: withTitle.value ? `Notification(${count})` : undefined,
67
- message: `This is a non-cancellable notification. Pick an option:`,
72
+ message: `This is a non-cancellable notification. Pick an option:${extraText.value}`,
68
73
  requiresAction: true,
69
74
  options: ["Ok", "Default Answer"],
70
75
  default: "Default Answer",
@@ -75,7 +80,7 @@ export const Primary: Story = {
75
80
  count++
76
81
  void handler.notify({
77
82
  title: withTitle.value ? `Notification(${count})` : undefined,
78
- message: `This is a notification. No action required.`,
83
+ message: `This is a notification. No action required.${extraText.value}`,
79
84
  timeout: disableTimeout.value ? false : 5000
80
85
  })
81
86
  }
@@ -88,6 +93,7 @@ export const Primary: Story = {
88
93
  handler,
89
94
  withTitle,
90
95
  disableTimeout,
96
+ lotsOfText,
91
97
  args: {
92
98
  outline: false,
93
99
  ...args
@@ -103,9 +109,10 @@ export const Primary: Story = {
103
109
  <lib-button :label="'Notify Non-Cancellable that RequiresAction'" @click="notifyNonCancellableRequiresAction()"></lib-button>
104
110
  <lib-button :label="'Notify With Dangerous Option'" @click="notifyWithDangerousOption()"></lib-button>
105
111
  <lib-button :label="'Notify Non-Cancellable'" @click="notifyNonCancellable()"></lib-button>
106
- <input type="checkbox" v-model="withTitle"/> With Title
107
- <input type="checkbox" v-model="disableTimeout"/> Disable Timeout
108
- <lib-notifications :handler="handler" />
112
+ <lib-checkbox v-model="lotsOfText">Use lots of text</lib-checkbox>
113
+ <lib-checkbox v-model="disableTimeout">Disable Timeout</lib-checkbox>
114
+ <lib-checkbox v-model="withTitle">With Title</lib-checkbox>
115
+ <lib-notifications :handler="handler" />
109
116
  History:
110
117
  <lib-debug>
111
118
  <template v-for="entry in handler.history">
@@ -29,7 +29,7 @@
29
29
  :handler="handler"
30
30
  tabindex="0"
31
31
  :notification="notification"
32
- class="overflow-hidden my-2"
32
+ class="overflow-hidden my-2 max-h-[25dvh] min-h-[300px]"
33
33
  v-for="notification of notifications"
34
34
  :key="notification.id"
35
35
  @pause="handler.pause(notification)"
@@ -68,6 +68,7 @@
68
68
  class="
69
69
  data-[state=open]:animate-contentShow
70
70
  fixed
71
+ flex
71
72
  top-[50%]
72
73
  left-[50%]
73
74
  translate-x-[-50%]
@@ -79,6 +80,8 @@
79
80
  >
80
81
  <lib-notification
81
82
  class="
83
+ max-w-full
84
+ max-h-full
82
85
  top-notification
83
86
  text-md
84
87
  gap-2
@@ -19,8 +19,9 @@ const meta: Meta<typeof LibTable> = {
19
19
  export default meta
20
20
  type Story = StoryObj<typeof LibTable> & { args: {
21
21
  slots?: string
22
- wrapperClass?: string
22
+ ["wrapper-class"]?: string
23
23
  } }
24
+
24
25
  export const Primary: Story = {
25
26
  render: args => ({
26
27
  components,
@@ -182,7 +183,7 @@ export const StickyHeader: Story = {
182
183
  // moving the border to the wrapper is to hide the little bits of border sticking out
183
184
  // added back the right straight border otherwise the scrollbar looks ass
184
185
  // this is ever so slightly visible if there is no scrollbar
185
- wrapperClass: `
186
+ ["wrapper-class"]: `
186
187
  max-h-[50dvh]
187
188
  `,
188
189
  values: Array.from({ length: 200 }).fill(0).map((_, i) => ({
@@ -205,7 +206,7 @@ export const VirtualizedFixedHeight: Story = {
205
206
  enabled: true
206
207
  },
207
208
  stickyHeader: true,
208
- wrapperClass: `
209
+ ["wrapper-class"]: `
209
210
  max-h-[50dvh]
210
211
  `,
211
212
  values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
@@ -258,7 +259,7 @@ export const VirtualizedFitWidthFalse: Story = {
258
259
  [&:not(.resizable-cols-setup)]:w-max
259
260
  [&:not(.resizable-cols-setup)_th]:w-max
260
261
  `,
261
- wrapperClass: `
262
+ ["wrapper-class"]: `
262
263
  max-h-[50dvh]
263
264
  `,
264
265
  values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
@@ -50,7 +50,7 @@
50
50
  mergedVirtualizerOpts.enabled && mergedVirtualizerOpts.method === 'dynamic' && `
51
51
  relative
52
52
  `,
53
- ($attrs as any).wrapperClass)"
53
+ ($attrs as any)['wrapper-class'])"
54
54
  ref="parentRef"
55
55
  >
56
56
  <div
@@ -256,7 +256,7 @@ const isPostSetup = ref(false)
256
256
  const resizableOptions = computed<MakeRequired<Partial<ResizableOptions>, "colCount" | "widths">>(() => ({
257
257
  colCount: props.cols.length,
258
258
  widths,
259
- selector: ".cell",
259
+ selector: props.header ? undefined : `tr:first-child > td`,
260
260
  ...props.resizable,
261
261
  onSetup: el => {
262
262
  isPostSetup.value = true
@@ -414,6 +414,7 @@ type RealProps = {
414
414
  rounded?: boolean
415
415
  border?: boolean
416
416
  cellBorder?: boolean
417
+ /** Disables the header. This also sets the selector to `tr:first-child > td` instead to avoid issues with the vResizableCols directive. */
417
418
  header?: boolean
418
419
  colConfig?: TableColConfig<T>
419
420
  /**
@@ -439,7 +440,7 @@ type RealProps = {
439
440
  * Since the table now truncates rows by default, they will always be the same height unless you change the inner styling. In fixed mode, `forceRecalculateFixedVirtualizer` is exposed if you need to force re-calculation.
440
441
  *
441
442
  * If using slots, be sure to at least pass the `class` slot prop to the td element. `style` with width is also supplied but is not required if you're displaying the table as a table.
442
- *
443
+ *
443
444
  * ### Dynamic (experimental)
444
445
  *
445
446
  * In `dynamic` mode we use tanstack's measureElement method. This is more expensive, but it will work with any heights.
@@ -24,7 +24,6 @@ type Data = {
24
24
  onTeardown?: (el: Element) => void
25
25
  fixedWidths?: Record<number, number>
26
26
  fluidWidthsAsPercentOfFluidWidth?: Record<number, number>
27
- justResized?: boolean
28
27
  }
29
28
  const elMap = new WeakMap<HTMLElement, Data>()
30
29
  type RawOpts = { value: Partial<ResizableOptions> }
@@ -40,14 +39,8 @@ const defaultOpts: Omit<ResizableOptions, "colCount" | "widths" | "selector"> =
40
39
  // note that while it would be nice to throttle this it seems to loose the reference to the original element
41
40
  // haven't found where the issue is yet #future
42
41
  const callback: ResizeCallback = (_rect: DOMRectReadOnly, el: Element): void => {
43
- const $el = getElInfo(el as ResizableElement)
44
- if ($el.justResized) return
45
42
  setColWidths(el as ResizableElement)
46
- $el.justResized = true
47
- setTimeout(() => {
48
- positionGrips(el as ResizableElement)
49
- $el.justResized = false
50
- }, 0)
43
+ positionGrips(el as ResizableElement)
51
44
  }
52
45
 
53
46
  /**
@@ -119,7 +112,7 @@ export const vResizableCols: Directive = {
119
112
  },
120
113
  updated(el: ResizableElement, { value: opts = {} }: RawOpts) {
121
114
  const options = override({ ...defaultOpts }, opts) as ResizableOptions
122
- const info = el && options.enabled && getElInfo(el)
115
+ const info = el && options.enabled && getElInfo(el, { throwIfMissing: false })
123
116
  const hasGrips = el && options.enabled && elMap.get(el)?.grips
124
117
  // todo, we should probably check by name
125
118
  const colsNotEqual = (info && info.colCount !== options.colCount)
@@ -148,7 +141,11 @@ function setWidth(col: HTMLElement, amountInPx: number, el: ResizableElement): v
148
141
 
149
142
  const index = getColEls(el).findIndex(_ => col === _)
150
143
  if ($el.fitWidth) {
151
- $el.widths.value[index] = `${width / getBox(el).width * 100}%`
144
+ if (amountInPx <= $el.margin) {
145
+ $el.widths.value[index] = `${$el.margin}px`
146
+ } else {
147
+ $el.widths.value[index] = `${width / getBox(el).width * 100}%`
148
+ }
152
149
  } else {
153
150
  $el.widths.value[index] = `${width}px`
154
151
  }
@@ -186,6 +183,7 @@ function createPointerDownHandler(el: ResizableElement) {
186
183
  castType<HTMLElement>(e.target)
187
184
  $el.target = e.target
188
185
  $el.isDragging = true
186
+ el.classList.add("dragging")
189
187
  e.preventDefault()
190
188
 
191
189
  // in case any errors happen, we want the pointer up to still be called
@@ -245,11 +243,7 @@ function createPointerMoveHandler(el: ResizableElement) {
245
243
  }
246
244
  }
247
245
 
248
- $el.justResized = true
249
- setTimeout(() => {
250
- positionGrips(el)
251
- $el.justResized = false
252
- }, 0)
246
+ positionGrips(el)
253
247
  }
254
248
  }
255
249
  }
@@ -258,9 +252,11 @@ function createPointerMoveHandler(el: ResizableElement) {
258
252
  function createPointerUpHandler(el: ResizableElement) {
259
253
  return (e: PointerEvent) => {
260
254
  const $el = getElInfo(el)
255
+ $el.pointerMoveHandler(e)
261
256
  if ($el.isDragging) {
262
257
  e.preventDefault()
263
258
  $el.isDragging = false
259
+ el.classList.remove("dragging")
264
260
  el.classList.remove("resizable-cols-error")
265
261
  $el.offset = 0
266
262
  delete $el.target
@@ -303,7 +299,7 @@ function getElInfo<T extends boolean = true>(el: ResizableElement, { throwIfMiss
303
299
  function getColEls(el: ResizableElement): HTMLElement[] {
304
300
  const $el = elMap.get(el)
305
301
  if (!$el) unreachable("El went missing.")
306
- return [...el.querySelectorAll(`:scope ${$el.selector ? $el.selector : "tr > th, tr > td"}`)] as any
302
+ return [...el.querySelectorAll(`:scope ${$el.selector ?? "tr > th"}`)] as any
307
303
  }
308
304
 
309
305
  function setupColumns(el: ResizableElement, opts: ResizableOptions): void {
@@ -323,9 +319,10 @@ function setupColumns(el: ResizableElement, opts: ResizableOptions): void {
323
319
  onTeardown: opts.onTeardown
324
320
  }
325
321
  elMap.set(el, $el)
326
- const els = getColEls(el)
327
-
328
- const headers = els.slice(0, opts.colCount)
322
+ const headers = getColEls(el)
323
+ if (headers.length !== opts.colCount) {
324
+ throw new Error(`Number of headers matched using selector ${opts.selector ?? "tr > th"} does not match number of columns.`)
325
+ }
329
326
 
330
327
  setColWidths(el, headers)
331
328
  el.style.width = $el.fitWidth ? "" : "min-content"
@@ -338,13 +335,9 @@ function setupColumns(el: ResizableElement, opts: ResizableOptions): void {
338
335
  el.appendChild(grip)
339
336
  $el.grips.set(grip, i)
340
337
  }
341
- $el.justResized = true
342
- setTimeout(() => {
343
- positionGrips(el)
344
- $el.justResized = false
345
- el.classList.add("resizable-cols-setup")
346
- opts.onSetup?.(el)
347
- }, 0)
338
+ positionGrips(el)
339
+ el.classList.add("resizable-cols-setup")
340
+ opts.onSetup?.(el)
348
341
  }
349
342
 
350
343
  function positionGrips(el: ResizableElement): void {
@@ -412,7 +405,6 @@ function setColWidths(el: ResizableElement, children?: Element[]): void {
412
405
  const minFlexWidth = (totalFluidCount * $el.margin)
413
406
  const minTotalWidth = minFlexWidth + fixedTotalPx
414
407
 
415
-
416
408
  let leftOverFluidWidth = elWidth - fixedTotalPx
417
409
  if (leftOverFluidWidth < minFlexWidth) {
418
410
  leftOverFluidWidth = minFlexWidth
@@ -428,7 +420,7 @@ function setColWidths(el: ResizableElement, children?: Element[]): void {
428
420
  */
429
421
  const colBox = getBox(col)
430
422
  if ($el.fixedWidths![i] !== undefined) {
431
- setWidth(col, $el.fixedWidths![i]!, el)
423
+ $el.widths.value[i] = `${$el.fixedWidths![i]!}px`
432
424
  width += $el.fixedWidths![i]!
433
425
  } else {
434
426
  if ($el.fitWidth) {
@@ -41,7 +41,7 @@ export type ResizableOptions = {
41
41
  * It can then be used as needed by the component.
42
42
  */
43
43
  widths: Ref<string[]>
44
- /** The selector to use for the cells. "tr > td" by default. */
44
+ /** The selector to use for the header cells. "tr > th" by default. */
45
45
  selector: string
46
46
  /** Is called just after the `resizable-cols-setup` class is added. Can be useful for controlling the styling of wrappers or doing additional things post-setup. The default table element uses it to set the class on the wrapper also. */
47
47
  onSetup?: (el: Element) => void