@bitforgehq/ui 0.3.2 → 0.3.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.
@@ -44,6 +44,7 @@ const BF_DEFAULT_LABELS = {
44
44
  notifications: "Notifications",
45
45
  tableSelectAll: "Select all rows",
46
46
  tableSortBy: "Sort by",
47
+ tableSortNone: "Not sorted",
47
48
  tableSortAscending: (column) => `${column}, ascending`,
48
49
  tableSortDescending: (column) => `${column}, descending`,
49
50
  theme: "Theme",
@@ -145,6 +146,7 @@ function mergeLabels(parent, o) {
145
146
  notifications: o.notifications ?? parent.notifications,
146
147
  tableSelectAll: o.tableSelectAll ?? parent.tableSelectAll,
147
148
  tableSortBy: o.tableSortBy ?? parent.tableSortBy,
149
+ tableSortNone: o.tableSortNone ?? parent.tableSortNone,
148
150
  tableSortAscending: o.tableSortAscending ?? parent.tableSortAscending,
149
151
  tableSortDescending: o.tableSortDescending ?? parent.tableSortDescending,
150
152
  theme: o.theme ?? parent.theme,
@@ -9306,9 +9308,10 @@ const STACK_FIRST_CELL = {
9306
9308
  };
9307
9309
  const STACK_CELL = {
9308
9310
  never: "",
9309
- narrow: "@max-xl:col-span-full @max-xl:flex @max-xl:h-auto @max-xl:items-baseline @max-xl:justify-between @max-xl:gap-3 @max-xl:px-0 @max-xl:py-1 @max-xl:text-end @max-xl:before:shrink-0 @max-xl:before:text-start @max-xl:before:text-label-xs @max-xl:before:font-bold @max-xl:before:text-text-muted @max-xl:before:content-[attr(data-label)_/_\"\"]",
9310
- coarse: "pointer-coarse:col-span-full pointer-coarse:flex pointer-coarse:h-auto pointer-coarse:items-baseline pointer-coarse:justify-between pointer-coarse:gap-3 pointer-coarse:px-0 pointer-coarse:py-1 pointer-coarse:text-end pointer-coarse:before:shrink-0 pointer-coarse:before:text-start pointer-coarse:before:text-label-xs pointer-coarse:before:font-bold pointer-coarse:before:text-text-muted pointer-coarse:before:content-[attr(data-label)_/_\"\"]"
9311
+ narrow: "@max-xl:col-span-full @max-xl:flex @max-xl:h-auto @max-xl:items-baseline @max-xl:justify-between @max-xl:gap-3 @max-xl:px-0 @max-xl:py-1 @max-xl:text-end @max-xl:before:shrink-0 @max-xl:before:text-start @max-xl:before:text-label-xs @max-xl:before:font-bold @max-xl:before:text-text-muted @max-xl:before:content-data-label",
9312
+ coarse: "pointer-coarse:col-span-full pointer-coarse:flex pointer-coarse:h-auto pointer-coarse:items-baseline pointer-coarse:justify-between pointer-coarse:gap-3 pointer-coarse:px-0 pointer-coarse:py-1 pointer-coarse:text-end pointer-coarse:before:shrink-0 pointer-coarse:before:text-start pointer-coarse:before:text-label-xs pointer-coarse:before:font-bold pointer-coarse:before:text-text-muted pointer-coarse:before:content-data-label"
9311
9313
  };
9314
+ const SORT_NONE = "";
9312
9315
  const STACK_EMPTY = {
9313
9316
  never: "",
9314
9317
  narrow: "@max-xl:block",
@@ -9357,16 +9360,23 @@ var BfTableComponent = class BfTableComponent {
9357
9360
  }, ...ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []);
9358
9361
  columnCount = computed(() => this.columns().length + (this.selectable() ? 1 : 0), ...ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []);
9359
9362
  stacks = computed(() => this.stack() !== "never", ...ngDevMode ? [{ debugName: "stacks" }] : /* istanbul ignore next */ []);
9360
- sortOptions = computed(() => this.columns().filter((column) => column.sortable).flatMap((column) => [{
9361
- value: `${column.key}:ascending`,
9362
- label: this.labels.tableSortAscending(column.label)
9363
- }, {
9364
- value: `${column.key}:descending`,
9365
- label: this.labels.tableSortDescending(column.label)
9366
- }]), ...ngDevMode ? [{ debugName: "sortOptions" }] : /* istanbul ignore next */ []);
9363
+ sortOptions = computed(() => {
9364
+ const sortable = this.columns().filter((column) => column.sortable);
9365
+ if (sortable.length === 0) return [];
9366
+ return [{
9367
+ value: SORT_NONE,
9368
+ label: this.labels.tableSortNone
9369
+ }, ...sortable.flatMap((column) => [{
9370
+ value: `${column.key}:ascending`,
9371
+ label: this.labels.tableSortAscending(column.label)
9372
+ }, {
9373
+ value: `${column.key}:descending`,
9374
+ label: this.labels.tableSortDescending(column.label)
9375
+ }])];
9376
+ }, ...ngDevMode ? [{ debugName: "sortOptions" }] : /* istanbul ignore next */ []);
9367
9377
  sortValue = computed(() => {
9368
9378
  const sort = this.sort();
9369
- return sort ? `${sort.column}:${sort.direction}` : null;
9379
+ return sort ? `${sort.column}:${sort.direction}` : SORT_NONE;
9370
9380
  }, ...ngDevMode ? [{ debugName: "sortValue" }] : /* istanbul ignore next */ []);
9371
9381
  hostClasses = computed(() => STACK_HOST[this.stack()], ...ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []);
9372
9382
  stackBarClasses = computed(() => `${STACK_BAR[this.stack()]} flex-wrap items-end justify-between gap-x-4 gap-y-2 pb-3`, ...ngDevMode ? [{ debugName: "stackBarClasses" }] : /* istanbul ignore next */ []);
@@ -9425,6 +9435,10 @@ var BfTableComponent = class BfTableComponent {
9425
9435
  });
9426
9436
  }
9427
9437
  sortFromOption(value) {
9438
+ if (value === SORT_NONE) {
9439
+ this.sort.set(null);
9440
+ return;
9441
+ }
9428
9442
  const at = value.lastIndexOf(":");
9429
9443
  const direction = value.slice(at + 1);
9430
9444
  if (at > 0 && (direction === "ascending" || direction === "descending")) this.sort.set({
@@ -11277,12 +11291,14 @@ var BfAppFrameComponent = class BfAppFrameComponent {
11277
11291
  headerClasses()
11278
11292
  }}"
11279
11293
  >
11280
- <div data-brand class="flex min-w-0 items-center empty:hidden">
11281
- <ng-content select="[bfSlot=brand]" />
11282
- </div>
11294
+ <!-- The menu at the inline start, then the brand: the top app bar convention, and the
11295
+ menu comes first in the tab order too. -->
11283
11296
  <div data-menu class="flex items-center empty:hidden">
11284
11297
  <ng-content select="[bfSlot=menu]" />
11285
11298
  </div>
11299
+ <div data-brand class="flex min-w-0 items-center empty:hidden">
11300
+ <ng-content select="[bfSlot=brand]" />
11301
+ </div>
11286
11302
  <div data-actions class="ms-auto flex items-center gap-2 empty:hidden">
11287
11303
  <ng-content select="[bfSlot=actions]" />
11288
11304
  </div>
@@ -11340,12 +11356,14 @@ i0.ɵɵngDeclareClassMetadata({
11340
11356
  headerClasses()
11341
11357
  }}"
11342
11358
  >
11343
- <div data-brand class="flex min-w-0 items-center empty:hidden">
11344
- <ng-content select="[bfSlot=brand]" />
11345
- </div>
11359
+ <!-- The menu at the inline start, then the brand: the top app bar convention, and the
11360
+ menu comes first in the tab order too. -->
11346
11361
  <div data-menu class="flex items-center empty:hidden">
11347
11362
  <ng-content select="[bfSlot=menu]" />
11348
11363
  </div>
11364
+ <div data-brand class="flex min-w-0 items-center empty:hidden">
11365
+ <ng-content select="[bfSlot=brand]" />
11366
+ </div>
11349
11367
  <div data-actions class="ms-auto flex items-center gap-2 empty:hidden">
11350
11368
  <ng-content select="[bfSlot=actions]" />
11351
11369
  </div>