@servicetitan/anvil2 3.12.1 → 3.13.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{DataTable-DTAbOaPM.js → DataTable-ZczGbHZT.js} +14 -4
  3. package/dist/DataTable-ZczGbHZT.js.map +1 -0
  4. package/dist/{Drawer-C73Ka9ra.js → Drawer-CEsvth0Z.js} +2 -2
  5. package/dist/{Drawer-C73Ka9ra.js.map → Drawer-CEsvth0Z.js.map} +1 -1
  6. package/dist/Drawer.js +1 -1
  7. package/dist/{FilterBar-D2NDYqTs.js → FilterBar-lIGh4xIl.js} +2 -2
  8. package/dist/{FilterBar-D2NDYqTs.js.map → FilterBar-lIGh4xIl.js.map} +1 -1
  9. package/dist/FilterBar.js +1 -1
  10. package/dist/{Menu-BMn1CSr1.js → Menu-CM0EndhK.js} +22 -11
  11. package/dist/Menu-CM0EndhK.js.map +1 -0
  12. package/dist/Menu.js +1 -1
  13. package/dist/{Page-B5yLLq76.js → Page-D5NbV2Y8.js} +60 -48
  14. package/dist/Page-D5NbV2Y8.js.map +1 -0
  15. package/dist/Page.js +1 -1
  16. package/dist/{Pagination-BcW9WJ2b.js → Pagination-B4HCZNYw.js} +2 -2
  17. package/dist/{Pagination-BcW9WJ2b.js.map → Pagination-B4HCZNYw.js.map} +1 -1
  18. package/dist/Pagination.js +1 -1
  19. package/dist/{RichTextEditor-C8V3BajN.js → RichTextEditor-C7CCeqGW.js} +3 -3
  20. package/dist/{RichTextEditor-C8V3BajN.js.map → RichTextEditor-C7CCeqGW.js.map} +1 -1
  21. package/dist/RichTextEditor.js +1 -1
  22. package/dist/{SavedFiltersButton-ClghkFdA.js → SavedFiltersButton-BwnP6fuk.js} +2 -2
  23. package/dist/{SavedFiltersButton-ClghkFdA.js.map → SavedFiltersButton-BwnP6fuk.js.map} +1 -1
  24. package/dist/SavedFiltersButton.js +1 -1
  25. package/dist/Table.js +1 -1
  26. package/dist/{TimeField-BY_hasgp.js → TimeField-BZQP8KSf.js} +2 -2
  27. package/dist/{TimeField-BY_hasgp.js.map → TimeField-BZQP8KSf.js.map} +1 -1
  28. package/dist/TimeField.css +1 -3
  29. package/dist/TimeField.js +1 -1
  30. package/dist/beta.js +4 -4
  31. package/dist/{index-BY2uMI6I.js → index-lV_kQQH8.js} +2 -2
  32. package/dist/{index-BY2uMI6I.js.map → index-lV_kQQH8.js.map} +1 -1
  33. package/dist/index.js +5 -5
  34. package/dist/src/beta/components/Table/DataTable/internal/constants.d.ts +35 -0
  35. package/dist/src/components/Page/Page.d.ts +8 -2
  36. package/dist/src/components/Page/PageHeader.d.ts +15 -2
  37. package/package.json +3 -2
  38. package/dist/DataTable-DTAbOaPM.js.map +0 -1
  39. package/dist/Menu-BMn1CSr1.js.map +0 -1
  40. package/dist/Page-B5yLLq76.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @servicetitan/anvil2
2
2
 
3
+ ## 3.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2746](https://github.com/servicetitan/hammer/pull/2746) [`ec6d604`](https://github.com/servicetitan/hammer/commit/ec6d6040dc705ad316ea897e27e876bcc5b33eed) Thanks [@Diveafall](https://github.com/Diveafall)! - [Page] Add `items` to `Page.Header` `actions.primary` for a primary action that opens a menu
8
+
9
+ ### Patch Changes
10
+
11
+ - [#2762](https://github.com/servicetitan/hammer/pull/2762) [`dc83d43`](https://github.com/servicetitan/hammer/commit/dc83d43675172d15ba83a8eefcf039a5fffbcfcf) Thanks [@tounsoo](https://github.com/tounsoo)! - [Menu, Page] Fix the Page Header more menu staying open after focus leaves the trigger
12
+
13
+ ## 3.12.2
14
+
15
+ ### Patch Changes
16
+
17
+ - [#2754](https://github.com/servicetitan/hammer/pull/2754) [`55684fd`](https://github.com/servicetitan/hammer/commit/55684fdd082023d3d54fb8c2e3def8de894d3f4d) Thanks [@AdamLantz](https://github.com/AdamLantz)! - [TimeField] Fix input shrinking when a value is entered
18
+
19
+ - [#2715](https://github.com/servicetitan/hammer/pull/2715) [`10fe003`](https://github.com/servicetitan/hammer/commit/10fe003868af70208d1ae87f85cc437585660700) Thanks [@Diveafall](https://github.com/Diveafall)! - **BETA** [DataTable] Cap the loading spacer's first-load height so a large `rowsPerPage` no longer reserves a viewport-sized empty area
20
+
3
21
  ## 3.12.1
4
22
 
5
23
  ### Patch Changes
@@ -30,7 +30,7 @@ import { flushSync } from 'react-dom';
30
30
  import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DjqeAJZ9.js';
31
31
  import { S as SvgKeyboardArrowLeft } from './keyboard_arrow_left-CiE1n99w.js';
32
32
  import { S as SvgKeyboardArrowRight } from './keyboard_arrow_right-DMloHg_F.js';
33
- import { a as PARTS$1, b as Pagination, P as Pagination$1 } from './Pagination-BcW9WJ2b.js';
33
+ import { a as PARTS$1, b as Pagination, P as Pagination$1 } from './Pagination-B4HCZNYw.js';
34
34
  import { useTrackingId } from './useTrackingId.js';
35
35
  import { T as ThemeProviderContext } from './ThemeProviderContext-l52GohYT.js';
36
36
  import { u as useVirtualizer } from './index-DXeGMe23.js';
@@ -5247,6 +5247,10 @@ function getManagedInteractives(cellEl) {
5247
5247
 
5248
5248
  const INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID = "a2-table-internal-row-action-primary";
5249
5249
  const INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID = "a2-table-internal-row-action-secondary";
5250
+ const DEFAULT_ESTIMATED_ROW_HEIGHT = 35;
5251
+ const MAX_INITIAL_LOADING_HEIGHT = 400;
5252
+ const MIN_INITIAL_LOADING_HEIGHT = 80;
5253
+ const DEFAULT_INITIAL_LOADING_HEIGHT = 200;
5250
5254
 
5251
5255
  function DataTableBodyImmutableCell(props) {
5252
5256
  const { cell, cellPosition, children, ...rest } = props;
@@ -9470,7 +9474,6 @@ function DataTableRowClickProvider({
9470
9474
  }
9471
9475
 
9472
9476
  const VIRTUALIZATION_THRESHOLD = 50;
9473
- const DEFAULT_ESTIMATED_ROW_HEIGHT = 35;
9474
9477
  function useDataTableVirtualizer({
9475
9478
  rowCount,
9476
9479
  scrollRef,
@@ -9665,6 +9668,13 @@ function DataTableInner(props, ref) {
9665
9668
  lastBodyHeightRef.current = body.offsetHeight;
9666
9669
  }
9667
9670
  }, [isLoading]);
9671
+ const loadingSpacerHeight = lastBodyHeightRef.current ?? (rowsPerPage > 0 ? Math.min(
9672
+ Math.max(
9673
+ rowsPerPage * DEFAULT_ESTIMATED_ROW_HEIGHT,
9674
+ MIN_INITIAL_LOADING_HEIGHT
9675
+ ),
9676
+ MAX_INITIAL_LOADING_HEIGHT
9677
+ ) : DEFAULT_INITIAL_LOADING_HEIGHT);
9668
9678
  const hasRowStatus = useMemo(() => {
9669
9679
  return tableData?.some((row) => {
9670
9680
  const meta = row.meta;
@@ -10036,7 +10046,7 @@ function DataTableInner(props, ref) {
10036
10046
  "div",
10037
10047
  {
10038
10048
  style: {
10039
- height: `${lastBodyHeightRef.current ?? (rowsPerPage ? rowsPerPage * 35 : 200)}px`
10049
+ height: `${loadingSpacerHeight}px`
10040
10050
  },
10041
10051
  role: "presentation",
10042
10052
  "aria-hidden": "true",
@@ -10112,4 +10122,4 @@ function DataTableInner(props, ref) {
10112
10122
  const DataTable = forwardRef(DataTableInner);
10113
10123
 
10114
10124
  export { COLUMN_TYPE_DEFAULTS as C, DataTable as D, chipsFormatter as a, booleanFormatter as b, createColumnHelper$1 as c, currencyFormatter as d, dateFormatter as e, dateTimeFormatter as f, getColumnTypeDefaults as g, htmlFormatter as h, dateFormatPresets as i, timeFormatter as j, markdownFormatter as m, numberFormatter as n, percentFormatter as p, resolveColumnTypeConfig as r, timeFormatPresets as t, yearlessDateFormatter as y };
10115
- //# sourceMappingURL=DataTable-DTAbOaPM.js.map
10125
+ //# sourceMappingURL=DataTable-ZczGbHZT.js.map