@economic/taco 3.0.2-row-active-search.1 → 3.0.2

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/taco.d.ts CHANGED
@@ -1674,7 +1674,7 @@ export declare type IconButtonProps = Omit<ButtonPrimitive.ButtonProps, 'childre
1674
1674
  tooltip?: string | JSX.Element;
1675
1675
  };
1676
1676
 
1677
- export declare type IconName = 'account-preview' | 'accounting-year-cancel' | 'accounting-year' | 'accounting' | 'ai-chat-solid' | 'ai-stars' | 'arrow-bottom' | 'arrow-down' | 'arrow-end' | 'arrow-left' | 'arrow-right' | 'arrow-start' | 'arrow-top' | 'arrow-up' | 'attach-auto' | 'attach-cancel' | 'attach-warning' | 'attach' | 'autopay-paused' | 'autopay' | 'autotext-insert' | 'autotext' | 'basic-tabs' | 'basic' | 'bell-solid' | 'book' | 'booking' | 'budget' | 'calendar' | 'cash-account' | 'cash-reports' | 'chart-area' | 'chart-bar' | 'chart-line' | 'chart-pie' | 'chart-table' | 'chat-solid' | 'chat' | 'chevron-down-double' | 'chevron-down-solid' | 'chevron-down' | 'chevron-left-double' | 'chevron-left-solid' | 'chevron-left' | 'chevron-right-double' | 'chevron-right-solid' | 'chevron-right' | 'chevron-up-double' | 'chevron-up-solid' | 'chevron-up' | 'circle-close' | 'circle-information' | 'circle-minus' | 'circle-plus' | 'circle-questionmark' | 'circle-tick' | 'circle-warning' | 'clamp-open' | 'clamp' | 'close' | 'column-freeze' | 'column-unfreeze' | 'columns' | 'connection-enable' | 'connection-revoke' | 'contacts' | 'copy' | 'courses' | 'credit' | 'delete-permanently' | 'delete' | 'depecriate' | 'developer' | 'distribution-template' | 'document-approve' | 'document-create-entry' | 'document-cut' | 'document-error' | 'document-isolate-page' | 'document-merge' | 'document-move' | 'document-preview' | 'document-received' | 'document-rejected-request' | 'document-signed-solid' | 'document-signed' | 'document-split' | 'document-time' | 'document' | 'download' | 'drag' | 'e-copedia' | 'edit-simple' | 'edit' | 'ellipsis-horizontal' | 'ellipsis-vertical' | 'entries-on-account' | 'entries-open' | 'entries-warning' | 'entry-type-customer-invoice' | 'entry-type-customer-payment' | 'entry-type-journal-entry' | 'entry-type-manual-customer-invoice' | 'entry-type-supplier-invoice' | 'entry-type-supplier-payment' | 'envelope-approved' | 'envelope-solid' | 'envelope' | 'expand-view' | 'expenses' | 'experiment' | 'export-to-excel' | 'export-to-pdf' | 'export' | 'eye-off' | 'eye-on' | 'filter-solid' | 'filter' | 'font-size' | 'graph-solid' | 'hash' | 'height-extra-tall' | 'height-medium' | 'height-short' | 'height-tall' | 'house-solid' | 'house' | 'id' | 'images' | 'import' | 'inbox-einvoicing' | 'inbox-scanning' | 'inbox-smart' | 'inbox' | 'info' | 'inventory-matrix' | 'inventory' | 'journal-pro' | 'layout-both' | 'layout-first' | 'layout-last' | 'layout-none' | 'layout' | 'ledger-card-customer-reminder' | 'ledger-card-manual-customer-invoice' | 'ledger-card-obsolete-stock' | 'ledger-card-opening-entry' | 'ledger-card-reserved-entry' | 'ledger-card-shrinkage-pilferage' | 'ledger-card-stock-adjustment' | 'ledger-card-transferred-opening-entry' | 'ledger-card' | 'lightbulb' | 'line' | 'link-external' | 'list-bulleted' | 'list-search' | 'list' | 'location' | 'lock-open' | 'lock' | 'log-out' | 'log' | 'market' | 'mastercard-os' | 'match-amount' | 'match-entries' | 'menu' | 'mileage' | 'modal-resize' | 'modal-shrink' | 'more-solid' | 'more' | 'move' | 'navigation-list' | 'note-follow-up' | 'note-read' | 'note' | 'november-first' | 'numbers' | 'partner-api' | 'payment-paid' | 'payment-unpaid' | 'period' | 'person-change' | 'person-minus' | 'person-plus' | 'person-solid' | 'person-tick' | 'person' | 'phone-solid' | 'phone' | 'play' | 'plus-minus' | 'print' | 'process-payment' | 'product-ledger-card' | 'profile' | 'project-cards' | 'projects' | 'question-mark-bold' | 'question-mark' | 'quicklinks' | 'rating-bankruptcy' | 'rating-payment-problems' | 'reconciled' | 'refresh' | 'report-solid' | 'report' | 'restore' | 'rotate-left' | 'rotate-right' | 'sales' | 'search-bold' | 'search' | 'secure-tick' | 'secure' | 'settings-solid' | 'settings' | 'shortcuts' | 'show-all' | 'show-less' | 'show-more' | 'show-template' | 'sliders' | 'smartpay' | 'sort-by' | 'star-solid' | 'star' | 'subscriptions' | 'system-entries' | 'tag' | 'template-override' | 'templates' | 'thumb-both' | 'thumb-down-solid' | 'thumb-down' | 'thumb-up-solid' | 'thumb-up' | 'tick-bold' | 'tick' | 'time' | 'transfer-cancel' | 'transfer-locked' | 'transfer' | 'undo' | 'undock' | 'unreconciled' | 'wallet' | 'warning' | 'webshop' | 'website' | 'workflow-template-basic' | 'workflow' | 'zoom';
1677
+ export declare type IconName = 'account-preview' | 'accounting-year-cancel' | 'accounting-year' | 'accounting' | 'ai-chat-solid' | 'ai-stars' | 'arrow-bottom' | 'arrow-down' | 'arrow-end' | 'arrow-left' | 'arrow-right' | 'arrow-start' | 'arrow-top' | 'arrow-up' | 'attach-auto' | 'attach-cancel' | 'attach-warning' | 'attach' | 'autopay-paused' | 'autopay' | 'autotext-insert' | 'autotext' | 'basic-tabs' | 'basic' | 'bell-solid' | 'book' | 'booking' | 'budget' | 'calendar' | 'cash-account' | 'cash-reports' | 'chart-area' | 'chart-bar' | 'chart-line' | 'chart-pie' | 'chart-table' | 'chat-solid' | 'chat' | 'chevron-down-double' | 'chevron-down-solid' | 'chevron-down' | 'chevron-left-double' | 'chevron-left-solid' | 'chevron-left' | 'chevron-right-double' | 'chevron-right-solid' | 'chevron-right' | 'chevron-up-double' | 'chevron-up-solid' | 'chevron-up' | 'circle-close' | 'circle-information' | 'circle-minus' | 'circle-plus' | 'circle-questionmark' | 'circle-tick' | 'circle-warning' | 'clamp-open' | 'clamp' | 'click-to-pay' | 'close' | 'column-freeze' | 'column-unfreeze' | 'columns' | 'connection-enable' | 'connection-revoke' | 'contacts' | 'copy' | 'courses' | 'credit' | 'delete-permanently' | 'delete' | 'depecriate' | 'developer' | 'distribution-template' | 'document-approve' | 'document-create-entry' | 'document-cut' | 'document-error' | 'document-isolate-page' | 'document-merge' | 'document-move' | 'document-preview' | 'document-received' | 'document-rejected-request' | 'document-signed-solid' | 'document-signed' | 'document-split' | 'document-time' | 'document' | 'download' | 'drag' | 'e-copedia' | 'edit-simple' | 'edit' | 'ellipsis-horizontal' | 'ellipsis-vertical' | 'entries-on-account' | 'entries-open' | 'entries-warning' | 'entry-type-customer-invoice' | 'entry-type-customer-payment' | 'entry-type-journal-entry' | 'entry-type-manual-customer-invoice' | 'entry-type-supplier-invoice' | 'entry-type-supplier-payment' | 'envelope-approved' | 'envelope-solid' | 'envelope' | 'expand-view' | 'expenses' | 'experiment' | 'export-to-excel' | 'export-to-pdf' | 'export' | 'eye-off' | 'eye-on' | 'filter-solid' | 'filter' | 'font-size' | 'graph-solid' | 'hash' | 'height-extra-tall' | 'height-medium' | 'height-short' | 'height-tall' | 'house-solid' | 'house' | 'id' | 'images' | 'import' | 'inbox-einvoicing' | 'inbox-scanning' | 'inbox-smart' | 'inbox' | 'info' | 'inventory-matrix' | 'inventory' | 'journal-pro' | 'layout-both' | 'layout-first' | 'layout-last' | 'layout-none' | 'layout' | 'ledger-card-customer-reminder' | 'ledger-card-manual-customer-invoice' | 'ledger-card-obsolete-stock' | 'ledger-card-opening-entry' | 'ledger-card-reserved-entry' | 'ledger-card-shrinkage-pilferage' | 'ledger-card-stock-adjustment' | 'ledger-card-transferred-opening-entry' | 'ledger-card' | 'lightbulb' | 'line' | 'link-external' | 'list-bulleted' | 'list-search' | 'list' | 'location' | 'lock-open' | 'lock' | 'log-out' | 'log' | 'market' | 'mastercard-os' | 'match-amount' | 'match-entries' | 'menu' | 'mileage' | 'modal-resize' | 'modal-shrink' | 'more-solid' | 'more' | 'move' | 'navigation-list' | 'note-follow-up' | 'note-read' | 'note' | 'november-first' | 'numbers' | 'partner-api' | 'payment-paid' | 'payment-unpaid' | 'period' | 'person-change' | 'person-minus' | 'person-plus' | 'person-solid' | 'person-tick' | 'person' | 'phone-solid' | 'phone' | 'play' | 'plus-minus' | 'print' | 'process-payment' | 'product-ledger-card' | 'profile' | 'project-cards' | 'projects' | 'question-mark-bold' | 'question-mark' | 'quicklinks' | 'rating-bankruptcy' | 'rating-payment-problems' | 'reconciled' | 'refresh' | 'report-solid' | 'report' | 'restore' | 'rotate-left' | 'rotate-right' | 'sales' | 'search-bold' | 'search' | 'secure-tick' | 'secure' | 'settings-solid' | 'settings' | 'shortcuts' | 'show-all' | 'show-less' | 'show-more' | 'show-template' | 'sliders' | 'smartpay' | 'sort-by' | 'star-solid' | 'star' | 'subscriptions' | 'system-entries' | 'tag' | 'template-override' | 'templates' | 'thumb-both' | 'thumb-down-solid' | 'thumb-down' | 'thumb-up-solid' | 'thumb-up' | 'tick-bold' | 'tick' | 'time' | 'transfer-cancel' | 'transfer-locked' | 'transfer' | 'undo' | 'undock' | 'unreconciled' | 'wallet' | 'warning' | 'webshop' | 'website' | 'workflow-template-basic' | 'workflow' | 'zoom';
1678
1678
 
1679
1679
  export declare type IconProps = default_2.SVGAttributes<SVGSVGElement> & {
1680
1680
  /** Set what svg icon should be rendered */
package/dist/taco.js CHANGED
@@ -793,6 +793,16 @@ function IconClamp(props, svgRef) {
793
793
  ));
794
794
  }
795
795
  const Clamp = React.forwardRef(IconClamp);
796
+ function IconClickToPay(props, svgRef) {
797
+ return /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ref: svgRef, ...props }, /* @__PURE__ */ React.createElement(
798
+ "path",
799
+ {
800
+ d: "M23.804 11.52l-5.752-6.676a.692.692 0 00-1.282.357c0 .2.086.38.224.506l5.209 6.275-5.152 6.157h-2.225l4.869-5.629.009-.01a.7.7 0 00.192-.491.7.7 0 00-.192-.492l-.01-.01-5.813-6.651-.004-.005a.692.692 0 00-.595-.337H9.2a.689.689 0 00-.691.687c0 .115.015.235.079.32l5.411 6.512-4.611 5.497c-.028.028-.425.59-1.124.59H2.757c-.75 0-1.37-.58-1.37-1.353v-9.53c0-.671.62-1.361 1.386-1.361H6.2c.403 0 .691-.274.691-.676s-.286-.7-.69-.7l-3.461.013C1.101 4.514 0 5.858 0 7.223v9.544c0 1.471 1.304 2.723 2.74 2.723h5.506c.277 0 .532-.04.76-.105l.096-.029a2.966 2.966 0 001.306-.853l5.19-6.01c.245-.277.278-.677.004-.977l-.008-.01-4.91-5.63h2.266l5.13 6.13-5.399 6.472s.001.007.01.016a.685.685 0 00.611 1.006h4.084a.69.69 0 00.594-.337s.002-.003.005-.004l5.813-6.65.009-.01c.274-.3.241-.7-.005-.977",
801
+ fill: "currentColor"
802
+ }
803
+ ));
804
+ }
805
+ const ClickToPay = React.forwardRef(IconClickToPay);
796
806
  function IconClose(props, svgRef) {
797
807
  return /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ref: svgRef, ...props }, /* @__PURE__ */ React.createElement(
798
808
  "path",
@@ -3047,6 +3057,7 @@ const icons = {
3047
3057
  "circle-warning": CircleWarning,
3048
3058
  "clamp-open": ClampOpen,
3049
3059
  clamp: Clamp,
3060
+ "click-to-pay": ClickToPay,
3050
3061
  close: Close$3,
3051
3062
  "column-freeze": ColumnFreeze,
3052
3063
  "column-unfreeze": ColumnUnfreeze,
@@ -43888,23 +43899,6 @@ const useIsHoverStatePaused = () => {
43888
43899
  }, [shouldPauseHoverState]);
43889
43900
  return [shouldPauseHoverState, setShouldPauseHoverState];
43890
43901
  };
43891
- function focusActiveRow(tableRef) {
43892
- var _a;
43893
- const activeRow = ((_a = (tableRef == null ? void 0 : tableRef.current) ?? document) == null ? void 0 : _a.querySelector('tbody tr[data-row-active="true"]')) ?? null;
43894
- if (activeRow) {
43895
- if (!isElementInsideOrTriggeredFromContainer(document.activeElement, activeRow) && !isElementInteractive(document.activeElement)) {
43896
- activeRow.focus({ preventScroll: true });
43897
- }
43898
- }
43899
- }
43900
- function useTableRowActiveListener$1(table, tableRef) {
43901
- const tableMeta = table.options.meta;
43902
- React__default.useEffect(() => {
43903
- if (tableMeta.rowActive.rowActiveIndex !== void 0) {
43904
- focusActiveRow(tableRef);
43905
- }
43906
- }, [tableMeta.rowActive.rowActiveIndex, tableRef]);
43907
- }
43908
43902
  function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
43909
43903
  const [rowActiveIndex, setRowActiveIndex] = React__default.useState(initialRowActiveIndex);
43910
43904
  const [rowHoverIndex, setRowHoverIndex] = React__default.useState(void 0);
@@ -43912,11 +43906,7 @@ function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
43912
43906
  const move = (direction, length, scrollToIndex) => {
43913
43907
  const nextIndex = rowActiveIndex === void 0 ? 0 : getNextIndex(direction, rowActiveIndex, length);
43914
43908
  scrollToIndex(nextIndex);
43915
- if (nextIndex === rowActiveIndex) {
43916
- setTimeout(() => focusActiveRow(), 0);
43917
- } else {
43918
- setTimeout(() => setRowActiveIndex(nextIndex), 50);
43919
- }
43909
+ setTimeout(() => setRowActiveIndex(nextIndex), 50);
43920
43910
  };
43921
43911
  const onKeyDown = React__default.useCallback(
43922
43912
  (event, length, scrollToIndex) => {
@@ -44633,7 +44623,7 @@ function useTableRowDrop(isEnabled = false, onRowDrop) {
44633
44623
  handleDrop: isEnabled ? onRowDrop : void 0
44634
44624
  };
44635
44625
  }
44636
- function useTableRowActiveListener(table, onRowActive) {
44626
+ function useTableRowActiveListener$1(table, onRowActive) {
44637
44627
  var _a;
44638
44628
  const meta = table.options.meta;
44639
44629
  const rows = table.getRowModel().flatRows;
@@ -44745,7 +44735,7 @@ function useTableManager(props, ref, meta, internalColumns) {
44745
44735
  useTableDataListener(instance, length);
44746
44736
  useTableFilterListener(instance, props.onChangeFilter);
44747
44737
  useTableFontSizeListener(instance);
44748
- useTableRowActiveListener(instance, props.onRowActive);
44738
+ useTableRowActiveListener$1(instance, props.onRowActive);
44749
44739
  useTableRowHeightListener(instance);
44750
44740
  useTableRowSelectionListener(instance, props.onRowSelect);
44751
44741
  useTableSearchListener(instance);
@@ -44947,11 +44937,6 @@ function getCellWidthPadding(fontSize) {
44947
44937
  return "16px";
44948
44938
  }
44949
44939
  }
44950
- function getReachableRowCount(table) {
44951
- const tableMeta = table.options.meta;
44952
- const isFilteringActive = table.options.enableGlobalFilter && table.getState().globalFilter;
44953
- return isFilteringActive ? table.getRowModel().rows.length + table.getBottomRows().length : tableMeta.length + table.getBottomRows().length;
44954
- }
44955
44940
  function useTableGlobalShortcuts(table, tableRef, scrollToIndex, localShortcuts = false) {
44956
44941
  const tableMeta = table.options.meta;
44957
44942
  const rows = table.getRowModel().rows;
@@ -44964,7 +44949,7 @@ function useTableGlobalShortcuts(table, tableRef, scrollToIndex, localShortcuts
44964
44949
  if (isElementInsideExternalRelatedOverlay(trigger, tableRef)) {
44965
44950
  return;
44966
44951
  }
44967
- const reachableRows = getReachableRowCount(table);
44952
+ const reachableRows = tableMeta.length + table.getBottomRows().length;
44968
44953
  tableMeta.rowActive.handleKeyDown(event, reachableRows, scrollToIndex);
44969
44954
  tableMeta.rowSelection.handleKeyDown(event, table);
44970
44955
  if (tableMeta.rowActive.rowActiveIndex !== void 0) {
@@ -45930,6 +45915,18 @@ function useRowGroupVirtualisation(table) {
45930
45915
  );
45931
45916
  return isTableGrouped ? rangeExtractor : void 0;
45932
45917
  }
45918
+ function useTableRowActiveListener(table, tableRef) {
45919
+ const tableMeta = table.options.meta;
45920
+ React__default.useEffect(() => {
45921
+ var _a, _b;
45922
+ if (tableMeta.rowActive.rowActiveIndex !== void 0) {
45923
+ const activeRow = ((_a = tableRef.current) == null ? void 0 : _a.querySelector('tbody tr[data-row-active="true"]')) ?? null;
45924
+ if (!isElementInsideOrTriggeredFromContainer(document.activeElement, activeRow) && !isElementInteractive(document.activeElement)) {
45925
+ (_b = activeRow == null ? void 0 : activeRow.focus) == null ? void 0 : _b.call(activeRow, { preventScroll: true });
45926
+ }
45927
+ }
45928
+ }, [tableMeta.rowActive.rowActiveIndex]);
45929
+ }
45933
45930
  function Actions(props) {
45934
45931
  var _a, _b;
45935
45932
  const { actions, actionsLength, data, isActiveRow, rowId, table } = props;
@@ -46264,7 +46261,7 @@ function useTable$1(props, externalRef, renderers, meta) {
46264
46261
  const { style, stylesheet } = useTableStyle(manager.id, manager.instance);
46265
46262
  useTableGlobalShortcuts(manager.instance, ref, renderer2.scrollToIndex, props.enableLocalKeyboardShortcuts);
46266
46263
  useTableRef(manager.instance, ref);
46267
- useTableRowActiveListener$1(manager.instance, ref);
46264
+ useTableRowActiveListener(manager.instance, ref);
46268
46265
  return {
46269
46266
  ...manager,
46270
46267
  props: {
@@ -47147,7 +47144,7 @@ function Body(props) {
47147
47144
  }
47148
47145
  if (tableMeta.rowActive.rowActiveIndex !== void 0) {
47149
47146
  const isFirstRow = tableMeta.rowActive.rowActiveIndex === 0;
47150
- const reachableRows = getReachableRowCount(table);
47147
+ const reachableRows = tableMeta.length + table.getBottomRows().length;
47151
47148
  const isLastRow = tableMeta.rowActive.rowActiveIndex === reachableRows - 1;
47152
47149
  if (event.key === "Tab" || enableHorizontalArrowKeyNavigation && (event.key === "ArrowLeft" || event.key === "ArrowRight")) {
47153
47150
  if (event.key === "Tab" && !hasFocusableElement(event.target.closest("tr[data-row-id]"))) {