@iris-ui-kit/vue 0.1.0 → 0.2.0

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/index.js CHANGED
@@ -12,7 +12,7 @@ import { IrisCheckbox } from './chunk-QLUIKEMJ.js';
12
12
  export { IrisAlert, IrisButton, IrisCheckbox, IrisDashboardTemplate, IrisDivider, IrisFormField, IrisInput, IrisLoginTemplate, IrisPasswordInput } from './chunk-QLUIKEMJ.js';
13
13
  export { IrisContainer, IrisDashboardCard, IrisDashboardGrid, IrisStack } from './chunk-3R3QDLJC.js';
14
14
  export { IrisSkinKey, SkinProvider, SkinResolutionError, applySkin, builtinSkins, createSkinCatalog, createSkinEngine, createSkinRegistry, darkSkin, lightSkin, loadSkin, localStorageSkinStorage, memorySkinStorage, renderSkinStyle, resolveSkin, skinBootScript, skinError, skinToCssEntries, useSkin, useSkinContext, validateSkin } from './chunk-H7HVVPYR.js';
15
- export { DropdownContextKey, IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisBreadcrumb, IrisBreadcrumbItem, IrisDropdown, IrisDropdownItem, IrisDropdownMenu, IrisDropdownSeparator, IrisDropdownTrigger, IrisIcon, IrisNavMenu, createTabsNav, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, useAdminShell, useTabsNav, visibleNav } from './chunk-FJBYAIL4.js';
15
+ export { DropdownContextKey, IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisBreadcrumb, IrisBreadcrumbItem, IrisDropdown, IrisDropdownItem, IrisDropdownMenu, IrisDropdownSeparator, IrisDropdownTrigger, IrisIcon, IrisNavMenu, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useTabsNav, visibleNav } from './chunk-4V4CT3Z4.js';
16
16
  import { useFloating, useDismiss } from './chunk-3FJUCHCC.js';
17
17
  export { useDismiss, useFloating } from './chunk-3FJUCHCC.js';
18
18
  import { useMachine } from './chunk-TQB5LVOH.js';
@@ -22,8 +22,9 @@ export { IrisSlot, composeRefs, findFirstElement, mergeSlotProps } from './chunk
22
22
  export { IrisHeaderLayout, IrisSidebarLayout } from './chunk-I6D5VXQK.js';
23
23
  export { IrisThemeKey, ThemeProvider, useColorScheme, useDirection, useTheme, useThemeContext } from './chunk-72PZMU6R.js';
24
24
  export { useAsyncResource, usePaginatedResource } from './chunk-ZY4NLITM.js';
25
- import { useDrag } from './chunk-CIZGSGXN.js';
26
- export { IrisClickOutside, IrisHotkey, IrisLongPress, IrisMovable, IrisResizable, IrisSortable, SORTABLE_ITEM_ATTR, useDrag } from './chunk-CIZGSGXN.js';
25
+ import { useDrag } from './chunk-CWXH44OF.js';
26
+ export { IrisClickOutside, IrisHotkey, IrisLongPress, IrisMovable, IrisResizable, useDrag } from './chunk-CWXH44OF.js';
27
+ export { IrisSortable, SORTABLE_ITEM_ATTR } from './chunk-W3B6E5GN.js';
27
28
  export { createClientDataSource, createDataSource, createGroupedView, useDataSource, useGroupedView } from './chunk-7IOJADZC.js';
28
29
  import { useStore } from './chunk-75GSYEJS.js';
29
30
  export { useStore, useStoreSelector } from './chunk-75GSYEJS.js';
@@ -31,14 +32,50 @@ export { IrisErrorBoundary } from './chunk-PPYNXNGZ.js';
31
32
  export { FormInjectionKey, IrisForm, useField, useFieldArray, useForm, useFormContext } from './chunk-4FLIW67H.js';
32
33
  import { useI18n } from './chunk-TCAXRWT6.js';
33
34
  export { I18nInjectionKey, IrisI18nProvider, useI18n } from './chunk-TCAXRWT6.js';
34
- import { defineComponent, computed, watch, ref, useId, provide, inject, h, nextTick, Teleport, onScopeDispose, Fragment, onMounted, onBeforeUnmount, onBeforeMount, shallowRef, Comment } from 'vue';
35
- import { createFloatingMachine, createHoverIntent, createKeyboardNav, getPageRange, createSelectionModel, flattenLeafColumns, buildHeaderMatrix, compareValues, createExpansion, flattenTree, withSortedChildren, createCellRange, computeVirtualRange, aggregate, createStore, createTreeSelection, firstEnabledIndex, startOfMonth, clampDate, isSameMonth, buildMonthMatrix, getWeekdayNames, formatMonthYear, startOfDay, endOfMonth, isSameDay, isOutOfRange, formatLocalISO, hexToRgba, rgbaToHsva, hsvaToRgba, rgbToHex, addMonths, createVirtualizer, nextGridCell, nextEnabledIndex, copyText, addDays, clamp01, createAutoDismiss, saveFile, toSpreadsheetXml, generateId } from '@iris-ui-kit/core';
35
+ import { defineComponent, computed, watch, ref, useId, provide, inject, h, nextTick, Teleport, onScopeDispose, Fragment, onMounted, onBeforeUnmount, onBeforeMount, shallowRef, toValue, Comment, onUnmounted } from 'vue';
36
+ import { createFloatingMachine, createHoverIntent, createKeyboardNav, getPageRange, createSelectionModel, flattenLeafColumns, buildHeaderMatrix, createExpansion, flattenTree, withSortedChildren, createCellRange, computeVirtualRange, aggregate, createStore, createTreeSelection, firstEnabledIndex, startOfMonth, clampDate, isSameMonth, buildMonthMatrix, getWeekdayNames, formatMonthYear, startOfDay, endOfMonth, isSameDay, isOutOfRange, formatLocalISO, hexToRgba, rgbaToHsva, hsvaToRgba, rgbToHex, addMonths, createVirtualizer, compareValues, nextGridCell, nextEnabledIndex, copyText, addDays, clamp01, createAutoDismiss, createReconnectingSource, createResilientFetcher, createDisposableScope, toCsv, downloadFile, toSpreadsheetXml, generateId } from '@iris-ui-kit/core';
36
37
  export { addDays, addMonths, buildMonthMatrix, clamp01, clampDate, composeEventHandlers, createFloatingMachine, createMachine, createStore, endOfMonth, formatLocalISO, formatMonthYear, generateId, getPageRange, getWeekdayNames, hexToRgba, hsvToRgb, hsvaToRgba, isOutOfRange, isSameDay, isSameMonth, mergeProps, rgbToHex, rgbToHsv, rgbaToHsva, startOfDay, startOfMonth } from '@iris-ui-kit/core';
37
38
  import { getDirection } from '@iris-ui-kit/theme';
38
39
  export { applyTheme, createThemeStore, getCssVar, toCssVarName } from '@iris-ui-kit/theme';
39
40
  export { ALL_TOKEN_NAMES, COLOR_TOKENS, RADII_TOKENS, SPACING_TOKENS, darkTheme, lightTheme } from '@iris-ui-kit/tokens';
40
41
  export { createIconRegistry, defaultIconRegistry, defaultIcons, renderIconSvg, resolveIcon, resolveThemedIcon } from '@iris-ui-kit/icons';
41
42
 
43
+ function useReconnectingSource(connect, handlers, options) {
44
+ const status = ref("idle");
45
+ const handlersRef = { current: handlers };
46
+ handlersRef.current = handlers;
47
+ const source = createReconnectingSource(
48
+ connect,
49
+ {
50
+ onMessage: (data) => handlersRef.current.onMessage?.(data),
51
+ onOpen: () => handlersRef.current.onOpen?.(),
52
+ onError: (err) => handlersRef.current.onError?.(err),
53
+ onClose: () => handlersRef.current.onClose?.(),
54
+ onStatus: (s) => {
55
+ status.value = s;
56
+ }
57
+ },
58
+ options
59
+ );
60
+ source.open();
61
+ onUnmounted(() => source.close());
62
+ return status;
63
+ }
64
+ function useResilientFetcher(options) {
65
+ const rf = createResilientFetcher(options);
66
+ onUnmounted(() => {
67
+ rf.cache.clear();
68
+ });
69
+ return rf;
70
+ }
71
+ function useDisposableScope() {
72
+ const scope = ref(createDisposableScope());
73
+ onUnmounted(() => {
74
+ scope.value.destroy();
75
+ });
76
+ return scope;
77
+ }
78
+
42
79
  // src/primitives/popover/context.ts
43
80
  var PopoverContextKey = /* @__PURE__ */ Symbol("IrisPopover");
44
81
 
@@ -2404,6 +2441,7 @@ var IrisSelect = defineComponent({
2404
2441
  props: {
2405
2442
  items: { type: Array, required: true },
2406
2443
  modelValue: { type: null },
2444
+ defaultValue: { type: null, default: void 0 },
2407
2445
  placeholder: { type: String, default: void 0 },
2408
2446
  size: { type: String, default: "md" },
2409
2447
  disabled: { type: Boolean, default: false },
@@ -2420,13 +2458,17 @@ var IrisSelect = defineComponent({
2420
2458
  }
2421
2459
  },
2422
2460
  emits: {
2423
- "update:modelValue": (_value) => true
2461
+ "update:modelValue": (_value) => true,
2462
+ valueChange: (_value) => true
2424
2463
  },
2425
2464
  setup(props, { slots, attrs, emit }) {
2426
2465
  const { t } = useI18n();
2427
2466
  const open = ref(false);
2467
+ const internalValue = ref(props.defaultValue);
2468
+ const controlled = computed(() => props.modelValue !== void 0);
2469
+ const currentValue = computed(() => controlled.value ? props.modelValue : internalValue.value);
2428
2470
  const selectedItem = computed(
2429
- () => props.items.find((item) => item.value === props.modelValue) ?? null
2471
+ () => props.items.find((item) => item.value === currentValue.value) ?? null
2430
2472
  );
2431
2473
  const triggerLabel = computed(() => {
2432
2474
  const item = selectedItem.value;
@@ -2434,7 +2476,9 @@ var IrisSelect = defineComponent({
2434
2476
  return item.label ?? String(item.value);
2435
2477
  });
2436
2478
  const onSelect = (item) => {
2479
+ if (!controlled.value) internalValue.value = item.value;
2437
2480
  emit("update:modelValue", item.value);
2481
+ emit("valueChange", item.value);
2438
2482
  open.value = false;
2439
2483
  };
2440
2484
  const sizeStyles = computed(() => {
@@ -2500,7 +2544,7 @@ var IrisSelect = defineComponent({
2500
2544
  default: () => [
2501
2545
  h(IrisPopoverTrigger, { asChild: true }, () => [
2502
2546
  slots.trigger ? slots.trigger({
2503
- value: props.modelValue,
2547
+ value: currentValue.value,
2504
2548
  label: triggerLabel.value,
2505
2549
  open: open.value
2506
2550
  }) : h(
@@ -2537,8 +2581,7 @@ var IrisSelect = defineComponent({
2537
2581
  },
2538
2582
  () => h(IrisList, {
2539
2583
  items: props.items,
2540
- modelValue: props.modelValue,
2541
- "onUpdate:modelValue": (v) => emit("update:modelValue", v),
2584
+ modelValue: currentValue.value,
2542
2585
  onSelect,
2543
2586
  ariaLabel: t("select.options")
2544
2587
  })
@@ -2923,8 +2966,8 @@ var IrisSkeleton = defineComponent({
2923
2966
  onMounted(installSkeletonStyles);
2924
2967
  const style = computed(() => {
2925
2968
  const w = props.width !== void 0 ? toCss(props.width) : defaultWidth(props.shape);
2926
- const h88 = props.height !== void 0 ? toCss(props.height) : defaultHeight(props.shape, props.width);
2927
- return { width: w, height: h88 };
2969
+ const h89 = props.height !== void 0 ? toCss(props.height) : defaultHeight(props.shape, props.width);
2970
+ return { width: w, height: h89 };
2928
2971
  });
2929
2972
  return () => h("div", {
2930
2973
  ...attrs,
@@ -5197,10 +5240,91 @@ var IrisVirtualScroll = defineComponent({
5197
5240
  };
5198
5241
  }
5199
5242
  });
5243
+
5244
+ // src/primitives/table/controlProps.ts
5245
+ var tableControlProps = {
5246
+ selectable: {
5247
+ type: String,
5248
+ default: "none"
5249
+ },
5250
+ selection: {
5251
+ type: Array,
5252
+ default: void 0
5253
+ },
5254
+ defaultSelection: {
5255
+ type: Array,
5256
+ default: void 0
5257
+ },
5258
+ sort: {
5259
+ type: Object,
5260
+ default: void 0
5261
+ },
5262
+ defaultSort: {
5263
+ type: Object,
5264
+ default: void 0
5265
+ }
5266
+ };
5200
5267
  function getCellValue(row, column) {
5201
5268
  const key = column.dataIndex ?? column.key;
5202
5269
  return row[key];
5203
5270
  }
5271
+
5272
+ // src/primitives/table/useTableSort.ts
5273
+ function useTableSort(data, options) {
5274
+ const sortProp = computed(() => options.sort === void 0 ? void 0 : toValue(options.sort));
5275
+ const internalSortValue = ref(options.defaultSort ?? null);
5276
+ const sortState = computed({
5277
+ get: () => sortProp.value === void 0 ? internalSortValue.value : sortProp.value ?? null,
5278
+ set: (val) => {
5279
+ if (sortProp.value === void 0) internalSortValue.value = val;
5280
+ options.onSortChange?.(val);
5281
+ }
5282
+ });
5283
+ const sortComparator = computed(() => {
5284
+ const s = sortState.value;
5285
+ if (!s) return null;
5286
+ const col = toValue(options.leafColumns).find((c) => c.key === s.key);
5287
+ if (!col) return null;
5288
+ const dir = s.direction === "asc" ? 1 : -1;
5289
+ const sorter = col.sorter ?? ((a, b) => compareValues(getCellValue(a, col), getCellValue(b, col)));
5290
+ return (a, b) => sorter(a, b) * dir;
5291
+ });
5292
+ const sortedData = computed(() => {
5293
+ const compare = sortComparator.value;
5294
+ if (!compare) return data.value;
5295
+ return [...data.value].sort(compare);
5296
+ });
5297
+ function setSort(next) {
5298
+ if (sortProp.value === void 0) internalSortValue.value = next;
5299
+ options.onSortChange?.(next);
5300
+ }
5301
+ function cycleSort(col) {
5302
+ if (!col.sortable) return;
5303
+ const s = sortState.value;
5304
+ if (!s || s.key !== col.key) {
5305
+ setSort({ key: col.key, direction: "asc" });
5306
+ return;
5307
+ }
5308
+ if (s.direction === "asc") {
5309
+ setSort({ key: col.key, direction: "desc" });
5310
+ return;
5311
+ }
5312
+ setSort(null);
5313
+ }
5314
+ return {
5315
+ sortState,
5316
+ cycleSort,
5317
+ setSort,
5318
+ sortComparator,
5319
+ sortedData
5320
+ };
5321
+ }
5322
+
5323
+ // src/primitives/table/Table.ts
5324
+ function getCellValue2(row, column) {
5325
+ const key = column.dataIndex ?? column.key;
5326
+ return row[key];
5327
+ }
5204
5328
  var SELECTION_COL_WIDTH = 40;
5205
5329
  var EXPAND_COL_WIDTH = 40;
5206
5330
  var DEFAULT_COL_WIDTH = 140;
@@ -5227,18 +5351,7 @@ var IrisTable = defineComponent({
5227
5351
  required: true
5228
5352
  },
5229
5353
  rowKey: { type: String, default: "id" },
5230
- selectable: {
5231
- type: String,
5232
- default: "none"
5233
- },
5234
- selection: {
5235
- type: Array,
5236
- default: void 0
5237
- },
5238
- sort: {
5239
- type: Object,
5240
- default: void 0
5241
- },
5354
+ ...tableControlProps,
5242
5355
  striped: { type: Boolean, default: false },
5243
5356
  bordered: { type: Boolean, default: true },
5244
5357
  /** Enable per-column resize handles. Combine with `v-model:columnWidths` for persistence. */
@@ -5322,31 +5435,23 @@ var IrisTable = defineComponent({
5322
5435
  () => grouped.value ? flattenLeafColumns(props.columns) : props.columns
5323
5436
  );
5324
5437
  const headerMatrix = computed(() => grouped.value ? buildHeaderMatrix(props.columns) : null);
5325
- const internalSortValue = ref(null);
5326
- const internalSort = computed({
5327
- get: () => props.sort === void 0 ? internalSortValue.value : props.sort,
5328
- set: (value) => {
5329
- if (props.sort === void 0) internalSortValue.value = value;
5330
- emit("update:sort", value);
5438
+ const {
5439
+ sortState: internalSort,
5440
+ cycleSort,
5441
+ sortComparator,
5442
+ sortedData: sortedRows
5443
+ } = useTableSort(
5444
+ computed(() => props.data ?? []),
5445
+ {
5446
+ leafColumns,
5447
+ sort: computed(() => props.sort),
5448
+ defaultSort: props.defaultSort,
5449
+ onSortChange: (next) => emit("update:sort", next)
5331
5450
  }
5332
- });
5333
- const sortComparator = computed(() => {
5334
- const state = internalSort.value;
5335
- if (!state) return null;
5336
- const column = leafColumns.value.find((c) => c.key === state.key);
5337
- if (!column) return null;
5338
- const dir = state.direction === "asc" ? 1 : -1;
5339
- const sorter = column.sorter ?? ((a, b) => compareValues(getCellValue(a, column), getCellValue(b, column)));
5340
- return (a, b) => sorter(a, b) * dir;
5341
- });
5342
- const sortedRows = computed(() => {
5343
- const compare = sortComparator.value;
5344
- if (!compare) return props.data ?? [];
5345
- return [...props.data ?? []].sort(compare);
5346
- });
5451
+ );
5347
5452
  const selControlled = computed(() => props.selection !== void 0);
5348
5453
  const selectionModel = createSelectionModel({
5349
- defaultSelected: props.selection ?? [],
5454
+ defaultSelected: props.selection ?? props.defaultSelection ?? [],
5350
5455
  onChange: (keys) => emit("update:selection", keys)
5351
5456
  });
5352
5457
  const selectedKeys = shallowRef(selectionModel.get());
@@ -5428,14 +5533,14 @@ var IrisTable = defineComponent({
5428
5533
  const beginEdit = (row, column, rowIdent) => {
5429
5534
  if (!column.editable) return;
5430
5535
  editingCellId.value = cellId(rowIdent, column.key);
5431
- const current = getCellValue(row, column);
5536
+ const current = getCellValue2(row, column);
5432
5537
  editingDraft.value = current == null ? "" : String(current);
5433
5538
  editError.value = null;
5434
5539
  void nextTick(() => editorInputRef.value?.focus());
5435
5540
  };
5436
5541
  const commitEdit = (row, column, rowIndex) => {
5437
5542
  if (editingCellId.value === null) return;
5438
- const oldValue = getCellValue(row, column);
5543
+ const oldValue = getCellValue2(row, column);
5439
5544
  const draft = editingDraft.value;
5440
5545
  const newValue = column.editor === "number" ? draft === "" || Number.isNaN(Number(draft)) ? oldValue : Number(draft) : draft;
5441
5546
  if (column.validate) {
@@ -5476,17 +5581,7 @@ var IrisTable = defineComponent({
5476
5581
  emit("update:columnWidths", next);
5477
5582
  };
5478
5583
  const onHeaderClick = (column) => {
5479
- if (!column.sortable) return;
5480
- const current = internalSort.value;
5481
- let next;
5482
- if (!current || current.key !== column.key) {
5483
- next = { key: column.key, direction: "asc" };
5484
- } else if (current.direction === "asc") {
5485
- next = { key: column.key, direction: "desc" };
5486
- } else {
5487
- next = null;
5488
- }
5489
- internalSort.value = next;
5584
+ cycleSort(column);
5490
5585
  };
5491
5586
  const sortIndicator = (col) => {
5492
5587
  if (!col.sortable) return null;
@@ -6060,7 +6155,7 @@ var IrisTable = defineComponent({
6060
6155
  )
6061
6156
  ] : input;
6062
6157
  } else {
6063
- content = cellSlot?.({ row, index, value: getCellValue(row, col) }) ?? String(getCellValue(row, col) ?? "");
6158
+ content = cellSlot?.({ row, index, value: getCellValue2(row, col) }) ?? String(getCellValue2(row, col) ?? "");
6064
6159
  }
6065
6160
  const treeIndent = treeMeta && ci === 0 ? h(
6066
6161
  "span",
@@ -6306,7 +6401,7 @@ var IrisTable = defineComponent({
6306
6401
  if (visibleColSet.value && !visibleColSet.value.has(ci)) continue;
6307
6402
  const align = col.align ?? "left";
6308
6403
  const op = col.summary;
6309
- const value = op ? aggregate(bodyData.value, (r) => getCellValue(r, col), op) : null;
6404
+ const value = op ? aggregate(bodyData.value, (r) => getCellValue2(r, col), op) : null;
6310
6405
  const summaryContent = op != null && value != null ? col.renderSummary ? col.renderSummary(value, bodyData.value) : String(value) : "";
6311
6406
  summaryCells.push(
6312
6407
  h(
@@ -6385,45 +6480,23 @@ var IrisTable = defineComponent({
6385
6480
  };
6386
6481
  }
6387
6482
  });
6388
- var FORMULA_LEAD = /^[=+\-@\t\r]/;
6389
- function neutralizeFormula(text) {
6390
- return FORMULA_LEAD.test(text) ? `'${text}` : text;
6391
- }
6392
- function csvCell(value) {
6393
- if (value == null) return "";
6394
- const isNumber = typeof value === "number" && Number.isFinite(value);
6395
- const s = isNumber ? String(value) : neutralizeFormula(String(value));
6396
- if (/[",\r\n]/.test(s)) {
6397
- return `"${s.replace(/"/g, '""')}"`;
6398
- }
6399
- return s;
6400
- }
6401
6483
  function exportCsv(rows, columns) {
6402
- const header = columns.map((c) => csvCell(c.title)).join(",");
6403
- const body = rows.map(
6404
- (row) => columns.map((col) => {
6405
- const key = col.dataIndex ?? col.key;
6406
- return csvCell(row[key]);
6407
- }).join(",")
6408
- ).join("\n");
6409
- return body.length > 0 ? `${header}
6410
- ${body}` : header;
6484
+ return toCsv(
6485
+ rows,
6486
+ columns.map((column) => ({
6487
+ key: column.key,
6488
+ title: column.title,
6489
+ dataIndex: typeof column.dataIndex === "string" ? column.dataIndex : void 0
6490
+ }))
6491
+ );
6411
6492
  }
6412
6493
  async function downloadCsv(filename, csv) {
6413
6494
  const BOM = String.fromCharCode(65279);
6414
- const content = BOM + csv;
6415
- if (await saveFile({ filename, content, mimeType: "text/csv;charset=utf-8;" })) return;
6416
- if (typeof document === "undefined") return;
6417
- const blob = new Blob([content], { type: "text/csv;charset=utf-8;" });
6418
- const url = URL.createObjectURL(blob);
6419
- const anchor = document.createElement("a");
6420
- anchor.href = url;
6421
- anchor.download = filename;
6422
- anchor.style.display = "none";
6423
- document.body.appendChild(anchor);
6424
- anchor.click();
6425
- document.body.removeChild(anchor);
6426
- setTimeout(() => URL.revokeObjectURL(url), 0);
6495
+ await downloadFile({
6496
+ filename,
6497
+ content: BOM + csv,
6498
+ mimeType: "text/csv;charset=utf-8;"
6499
+ });
6427
6500
  }
6428
6501
  function exportExcel(rows, columns, options) {
6429
6502
  return toSpreadsheetXml(
@@ -6437,20 +6510,11 @@ function exportExcel(rows, columns, options) {
6437
6510
  );
6438
6511
  }
6439
6512
  async function downloadExcel(filename, xml) {
6440
- if (await saveFile({ filename, content: xml, mimeType: "application/vnd.ms-excel" })) {
6441
- return;
6442
- }
6443
- if (typeof document === "undefined") return;
6444
- const blob = new Blob([xml], { type: "application/vnd.ms-excel" });
6445
- const url = URL.createObjectURL(blob);
6446
- const anchor = document.createElement("a");
6447
- anchor.href = url;
6448
- anchor.download = filename;
6449
- anchor.style.display = "none";
6450
- document.body.appendChild(anchor);
6451
- anchor.click();
6452
- document.body.removeChild(anchor);
6453
- setTimeout(() => URL.revokeObjectURL(url), 0);
6513
+ await downloadFile({
6514
+ filename,
6515
+ content: xml,
6516
+ mimeType: "application/vnd.ms-excel;charset=utf-8"
6517
+ });
6454
6518
  }
6455
6519
 
6456
6520
  // src/primitives/tabs/context.ts
@@ -12842,12 +12906,12 @@ function defaultFilter(query, item) {
12842
12906
  if (!q) return 0;
12843
12907
  const haystacks = [item.label, ...item.keywords ?? []].map((s) => s.toLowerCase());
12844
12908
  let best = null;
12845
- for (const h88 of haystacks) {
12909
+ for (const h89 of haystacks) {
12846
12910
  let qi = 0;
12847
12911
  let lastIdx = -1;
12848
12912
  let score = 0;
12849
- for (let i = 0; i < h88.length && qi < q.length; i += 1) {
12850
- if (h88[i] === q[qi]) {
12913
+ for (let i = 0; i < h89.length && qi < q.length; i += 1) {
12914
+ if (h89[i] === q[qi]) {
12851
12915
  score += lastIdx === -1 ? i : i - lastIdx - 1;
12852
12916
  lastIdx = i;
12853
12917
  qi += 1;
@@ -13520,6 +13584,6 @@ var IrisDateRangePicker = defineComponent({
13520
13584
  }
13521
13585
  });
13522
13586
 
13523
- export { AccordionContextKey, DialogContextKey, DrawerContextKey, IrisAccordion, IrisAccordionItem, IrisAffix, IrisAnchor, IrisAspectRatio, IrisAvatar, IrisBackTop, IrisBadge, IrisBanner, IrisCalendar, IrisCard, IrisCarousel, IrisCascader, IrisChip, IrisColorPicker, IrisCombobox, IrisCommandPalette, IrisCopyButton, IrisCountdown, IrisDatePicker, IrisDateRangePicker, IrisDescriptions, IrisDialog, IrisDialogClose, IrisDialogContent, IrisDialogDescription, IrisDialogTitle, IrisDialogTrigger, IrisDragger, IrisDrawer, IrisDrawerClose, IrisDrawerContent, IrisDrawerTitle, IrisDrawerTrigger, IrisEmptyState, IrisFieldset, IrisFileUpload, IrisFloatButton, IrisGauge, IrisImage, IrisKbd, IrisList, IrisMarquee, IrisMasonry, IrisMentions, IrisMenu, IrisMenuContent, IrisMenuItem, IrisMenuSeparator, IrisMenuSub, IrisMenuTrigger, IrisNumberInput, IrisOtpInput, IrisPagination, IrisPopover, IrisPopoverContent, IrisPopoverTrigger, IrisProgress, IrisProgressCircle, IrisRadio, IrisRadioGroup, IrisRangeSlider, IrisRating, IrisResizer, IrisResult, IrisRibbon, IrisScrollArea, IrisSegmented, IrisSelect, IrisSkeleton, IrisSlider, IrisSpinner, IrisSplitButton, IrisSplitter, IrisStatistic, IrisStepper, IrisStepperStep, IrisSwitch, IrisTable, IrisTabs, IrisTabsContent, IrisTabsList, IrisTabsTrigger, IrisTagInput, IrisTextarea, IrisTimePicker, IrisTimeline, IrisToastViewport, IrisToggleGroup, IrisToggleGroupItem, IrisToolbar, IrisTooltip, IrisTour, IrisTransfer, IrisTree, IrisTreeSelect, IrisVirtualScroll, IrisVisuallyHidden, IrisWatermark, MenuContextKey, PopoverContextKey, StepperContextKey, TabsContextKey, ToggleGroupContextKey, __PROGRESS_STYLE_ID, __SKELETON_STYLE_ID, __SPINNER_STYLE_ID, __resetProgressStyles, __resetSkeletonStyles, __resetSpinnerStyles, clearToasts, defaultFilter, dismissToast, downloadCsv, downloadExcel, exportCsv, exportExcel, formatBytes, formatRemaining, getToasts, pushToast, subscribeToasts, useToast };
13587
+ export { AccordionContextKey, DialogContextKey, DrawerContextKey, IrisAccordion, IrisAccordionItem, IrisAffix, IrisAnchor, IrisAspectRatio, IrisAvatar, IrisBackTop, IrisBadge, IrisBanner, IrisCalendar, IrisCard, IrisCarousel, IrisCascader, IrisChip, IrisColorPicker, IrisCombobox, IrisCommandPalette, IrisCopyButton, IrisCountdown, IrisDatePicker, IrisDateRangePicker, IrisDescriptions, IrisDialog, IrisDialogClose, IrisDialogContent, IrisDialogDescription, IrisDialogTitle, IrisDialogTrigger, IrisDragger, IrisDrawer, IrisDrawerClose, IrisDrawerContent, IrisDrawerTitle, IrisDrawerTrigger, IrisEmptyState, IrisFieldset, IrisFileUpload, IrisFloatButton, IrisGauge, IrisImage, IrisKbd, IrisList, IrisMarquee, IrisMasonry, IrisMentions, IrisMenu, IrisMenuContent, IrisMenuItem, IrisMenuSeparator, IrisMenuSub, IrisMenuTrigger, IrisNumberInput, IrisOtpInput, IrisPagination, IrisPopover, IrisPopoverContent, IrisPopoverTrigger, IrisProgress, IrisProgressCircle, IrisRadio, IrisRadioGroup, IrisRangeSlider, IrisRating, IrisResizer, IrisResult, IrisRibbon, IrisScrollArea, IrisSegmented, IrisSelect, IrisSkeleton, IrisSlider, IrisSpinner, IrisSplitButton, IrisSplitter, IrisStatistic, IrisStepper, IrisStepperStep, IrisSwitch, IrisTable, IrisTabs, IrisTabsContent, IrisTabsList, IrisTabsTrigger, IrisTagInput, IrisTextarea, IrisTimePicker, IrisTimeline, IrisToastViewport, IrisToggleGroup, IrisToggleGroupItem, IrisToolbar, IrisTooltip, IrisTour, IrisTransfer, IrisTree, IrisTreeSelect, IrisVirtualScroll, IrisVisuallyHidden, IrisWatermark, MenuContextKey, PopoverContextKey, StepperContextKey, TabsContextKey, ToggleGroupContextKey, __PROGRESS_STYLE_ID, __SKELETON_STYLE_ID, __SPINNER_STYLE_ID, __resetProgressStyles, __resetSkeletonStyles, __resetSpinnerStyles, clearToasts, defaultFilter, dismissToast, downloadCsv, downloadExcel, exportCsv, exportExcel, formatBytes, formatRemaining, getToasts, pushToast, subscribeToasts, useDisposableScope, useReconnectingSource, useResilientFetcher, useToast };
13524
13588
  //# sourceMappingURL=index.js.map
13525
13589
  //# sourceMappingURL=index.js.map