@paperless/core 3.17.2 → 3.17.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.
@@ -1 +1,7 @@
1
+ export declare const getOS: () => "MacOS" | "iOS" | "Windows" | "Android" | "Linux" | "Unkown";
2
+ export declare const isApple: () => boolean;
3
+ export declare const isMac: () => boolean;
1
4
  export declare const isIOS: () => boolean;
5
+ export declare const isWindows: () => boolean;
6
+ export declare const isLinux: () => boolean;
7
+ export declare const isAndroid: () => boolean;
package/hydrate/index.js CHANGED
@@ -8747,16 +8747,35 @@ const isMobileBrowser = () => {
8747
8747
  return false;
8748
8748
  };
8749
8749
 
8750
- const isIOS = () => [
8751
- 'iPad Simulator',
8752
- 'iPhone Simulator',
8753
- 'iPod Simulator',
8754
- 'iPad',
8755
- 'iPhone',
8756
- 'iPod',
8757
- ].includes(navigator.platform) ||
8758
- // iPad on iOS 13 detection
8759
- (navigator.userAgent.includes('Mac') && 'ontouchend' in document);
8750
+ const getOS = () => {
8751
+ const userAgent = navigator.userAgent;
8752
+ const platform =
8753
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8754
+ navigator?.userAgentData?.platform || navigator.platform;
8755
+ const macosPlatforms = ['macintosh', 'macintel', 'macppc', 'mac68k', 'macos'];
8756
+ const windowsPlatforms = ['win32', 'win64', 'windows', 'wince'];
8757
+ const iosPlatforms = ['iphone', 'ipad', 'ipod'];
8758
+ if (macosPlatforms.includes(platform.toLowerCase())) {
8759
+ return 'MacOS';
8760
+ }
8761
+ if (iosPlatforms.includes(platform.toLowerCase())) {
8762
+ return 'iOS';
8763
+ }
8764
+ if (windowsPlatforms.includes(platform.toLowerCase())) {
8765
+ return 'Windows';
8766
+ }
8767
+ if (/Android/.test(userAgent)) {
8768
+ return 'Android';
8769
+ }
8770
+ if (/Linux/.test(platform)) {
8771
+ return 'Linux';
8772
+ }
8773
+ return 'Unkown';
8774
+ };
8775
+ const isApple = () => {
8776
+ const os = getOS();
8777
+ return os === 'MacOS' || os === 'iOS';
8778
+ };
8760
8779
 
8761
8780
  var bundleCjs = {};
8762
8781
 
@@ -100569,7 +100588,7 @@ class Table {
100569
100588
  this.hasRendered.emit();
100570
100589
  }
100571
100590
  render() {
100572
- return (hAsync(Host, { key: '3b12dc119714044252913dcbcd90a131e5b46608', class: 'z-0 flex flex-col' }, hAsync("p-table-container", { key: '0f924438556a3a035672270ae88208fbcc8f1319' }, this.enableHeader && (hAsync("p-table-header", { key: '0eb96826bf1b2b18281cf4e75e7e6c2100071678', actionButtonTemplate: this.actionButtonTemplate, actionIcon: this.actionButtonIcon, actionLoading: this.actionButtonLoading, actionText: this.actionButtonText, activeQuickFilterIdentifier: this.activeQuickFilterIdentifier, canUseAction: this.actionButtonEnabled, class: 'mb-8', enableAction: this.enableAction, enableExport: this.enableExport, enableFilter: this.enableFilter, enableFilterDesktop: this.enableFilterDesktop, enableSearch: this.enableSearch, filterButtonTemplate: this.filterButtonTemplate, itemsSelectedAmount: this.selectedRows?.length, loading: this.headerLoading, query: this.query, quickFilters: this.quickFilters, selectedFiltersAmount: this.selectedFiltersAmount, onAction: () => this.action.emit(), onExport: () => this.export.emit(), onFilter: () => this.filter.emit(), onQueryChange: ({ detail }) => this.queryChange.emit(detail), onQuickFilter: ({ detail }) => this.quickFilter.emit(detail) }, this._hasCustomFilterSlot && (hAsync("slot", { key: '059f2a7e21d36f0d45ca644fddfe10d6ec897662', name: 'custom-filter', slot: 'custom-filter' })), this._hasCustomActionsSlot && (hAsync("slot", { key: '493b58b1674665f8020bd160efe2e1eabcca5aa1', name: 'custom-actions', slot: 'custom-actions' })))), this._getExtraHeader(), this._getHeader(), hAsync("div", { key: 'a245efe796c78f59419f14193f27753a4aa36180', class: 'flex flex-1 flex-col' }, this._getRows(), hAsync("slot", { key: '080691433b5037f3d809075cf2ccdadb86dc9fcd', name: 'custom-rows' })), this.enableFloatingMenu && this._enableRowSelection ? (hAsync("p-floating-menu-container", { amount: this.selectedRows?.length, amountSelectedTemplate: this.floatingMenuAmountSelectedTemplate, class: floatingMenuContainerClass({
100591
+ return (hAsync(Host, { key: '425442ed379af6ed510015af1c215a243d14a709', class: 'z-0 flex flex-col' }, hAsync("p-table-container", { key: 'f4a76f0df1ff84f4cef210c3721e32f160df7e3b' }, this.enableHeader && (hAsync("p-table-header", { key: 'f621cdc3fce191ec8a921a1bbba6f67212fda95b', actionButtonTemplate: this.actionButtonTemplate, actionIcon: this.actionButtonIcon, actionLoading: this.actionButtonLoading, actionText: this.actionButtonText, activeQuickFilterIdentifier: this.activeQuickFilterIdentifier, canUseAction: this.actionButtonEnabled, class: 'mb-8', enableAction: this.enableAction, enableExport: this.enableExport, enableFilter: this.enableFilter, enableFilterDesktop: this.enableFilterDesktop, enableSearch: this.enableSearch, filterButtonTemplate: this.filterButtonTemplate, itemsSelectedAmount: this.selectedRows?.length, loading: this.headerLoading, query: this.query, quickFilters: this.quickFilters, selectedFiltersAmount: this.selectedFiltersAmount, onAction: () => this.action.emit(), onExport: () => this.export.emit(), onFilter: () => this.filter.emit(), onQueryChange: ({ detail }) => this.queryChange.emit(detail), onQuickFilter: ({ detail }) => this.quickFilter.emit(detail) }, this._hasCustomFilterSlot && (hAsync("slot", { key: '6ad3e112ed8d23bdf8c1ba550071b7bf6deb9fc1', name: 'custom-filter', slot: 'custom-filter' })), this._hasCustomActionsSlot && (hAsync("slot", { key: '1a5aeaa7135c9a91fb624e46bb66a281bff81735', name: 'custom-actions', slot: 'custom-actions' })))), this._getExtraHeader(), this._getHeader(), hAsync("div", { key: '02e8e776a8f52f98eac3524fac5099d3ce59a43f', class: 'flex flex-1 flex-col' }, this._getRows(), hAsync("slot", { key: '4682df30035958e2c07533eb9103d827c60e2ecf', name: 'custom-rows' })), this.enableFloatingMenu && this._enableRowSelection ? (hAsync("p-floating-menu-container", { amount: this.selectedRows?.length, amountSelectedTemplate: this.floatingMenuAmountSelectedTemplate, class: floatingMenuContainerClass({
100573
100592
  hasFooter: this.enableFooter && !this._footerHidden,
100574
100593
  active: !!this.selectedRows?.length,
100575
100594
  shown: this._floatingMenuShown,
@@ -100579,7 +100598,7 @@ class Table {
100579
100598
  !!a.action &&
100580
100599
  a.type === 'single'
100581
100600
  ? a.action(this.selectedRows[0], false)
100582
- : a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (hAsync("p-table-footer", { key: '9b9ee0b74fd7691bed78fa064c745ead40b5a2c1', enablePaginationPages: this.enablePaginationPages, enablePaginationSize: this.enablePaginationSize, hideOnSinglePage: this.hideOnSinglePage, loading: this.footerLoading, page: this.page, pageSize: this.pageSize, pageSizeOptions: this.pageSizeOptions, tableHeaderHasAction: this.enableHeader &&
100601
+ : a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (hAsync("p-table-footer", { key: '28611ac3b55ea811d39a349edf7698b19b48b264', enablePaginationPages: this.enablePaginationPages, enablePaginationSize: this.enablePaginationSize, hideOnSinglePage: this.hideOnSinglePage, loading: this.footerLoading, page: this.page, pageSize: this.pageSize, pageSizeOptions: this.pageSizeOptions, tableHeaderHasAction: this.enableHeader &&
100583
100602
  this.enableAction &&
100584
100603
  this.actionButtonEnabled, total: this.total, onHiddenChange: ({ detail }) => (this._footerHidden = detail), onPageChange: ({ detail }) => this.pageChange.emit(detail), onPageSizeChange: ({ detail }) => this.pageSizeChange.emit(detail) })))));
100585
100604
  }
@@ -100590,18 +100609,18 @@ class Table {
100590
100609
  this._generateColumns();
100591
100610
  }
100592
100611
  keyDown({ ctrlKey, metaKey }) {
100593
- const iOS = isIOS();
100594
- const isMeta = metaKey && iOS;
100595
- const isCtrl = ctrlKey && !iOS;
100612
+ const apple = isApple();
100613
+ const isMeta = metaKey && apple;
100614
+ const isCtrl = ctrlKey && !apple;
100596
100615
  if ((!isMeta && !isCtrl) || this._ctrlDown === true) {
100597
100616
  return;
100598
100617
  }
100599
100618
  this._ctrlDown = true;
100600
100619
  }
100601
100620
  keyUp({ code }) {
100602
- const iOS = isIOS();
100603
- const isMeta = ['MetaLeft', 'MetaRight'].includes(code) && iOS;
100604
- const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !iOS;
100621
+ const apple = isApple();
100622
+ const isMeta = ['MetaLeft', 'MetaRight'].includes(code) && apple;
100623
+ const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !apple;
100605
100624
  if ((!isMeta && !isCtrl) || this._ctrlDown === false) {
100606
100625
  return;
100607
100626
  }
package/hydrate/index.mjs CHANGED
@@ -8745,16 +8745,35 @@ const isMobileBrowser = () => {
8745
8745
  return false;
8746
8746
  };
8747
8747
 
8748
- const isIOS = () => [
8749
- 'iPad Simulator',
8750
- 'iPhone Simulator',
8751
- 'iPod Simulator',
8752
- 'iPad',
8753
- 'iPhone',
8754
- 'iPod',
8755
- ].includes(navigator.platform) ||
8756
- // iPad on iOS 13 detection
8757
- (navigator.userAgent.includes('Mac') && 'ontouchend' in document);
8748
+ const getOS = () => {
8749
+ const userAgent = navigator.userAgent;
8750
+ const platform =
8751
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8752
+ navigator?.userAgentData?.platform || navigator.platform;
8753
+ const macosPlatforms = ['macintosh', 'macintel', 'macppc', 'mac68k', 'macos'];
8754
+ const windowsPlatforms = ['win32', 'win64', 'windows', 'wince'];
8755
+ const iosPlatforms = ['iphone', 'ipad', 'ipod'];
8756
+ if (macosPlatforms.includes(platform.toLowerCase())) {
8757
+ return 'MacOS';
8758
+ }
8759
+ if (iosPlatforms.includes(platform.toLowerCase())) {
8760
+ return 'iOS';
8761
+ }
8762
+ if (windowsPlatforms.includes(platform.toLowerCase())) {
8763
+ return 'Windows';
8764
+ }
8765
+ if (/Android/.test(userAgent)) {
8766
+ return 'Android';
8767
+ }
8768
+ if (/Linux/.test(platform)) {
8769
+ return 'Linux';
8770
+ }
8771
+ return 'Unkown';
8772
+ };
8773
+ const isApple = () => {
8774
+ const os = getOS();
8775
+ return os === 'MacOS' || os === 'iOS';
8776
+ };
8758
8777
 
8759
8778
  var bundleCjs = {};
8760
8779
 
@@ -100567,7 +100586,7 @@ class Table {
100567
100586
  this.hasRendered.emit();
100568
100587
  }
100569
100588
  render() {
100570
- return (hAsync(Host, { key: '3b12dc119714044252913dcbcd90a131e5b46608', class: 'z-0 flex flex-col' }, hAsync("p-table-container", { key: '0f924438556a3a035672270ae88208fbcc8f1319' }, this.enableHeader && (hAsync("p-table-header", { key: '0eb96826bf1b2b18281cf4e75e7e6c2100071678', actionButtonTemplate: this.actionButtonTemplate, actionIcon: this.actionButtonIcon, actionLoading: this.actionButtonLoading, actionText: this.actionButtonText, activeQuickFilterIdentifier: this.activeQuickFilterIdentifier, canUseAction: this.actionButtonEnabled, class: 'mb-8', enableAction: this.enableAction, enableExport: this.enableExport, enableFilter: this.enableFilter, enableFilterDesktop: this.enableFilterDesktop, enableSearch: this.enableSearch, filterButtonTemplate: this.filterButtonTemplate, itemsSelectedAmount: this.selectedRows?.length, loading: this.headerLoading, query: this.query, quickFilters: this.quickFilters, selectedFiltersAmount: this.selectedFiltersAmount, onAction: () => this.action.emit(), onExport: () => this.export.emit(), onFilter: () => this.filter.emit(), onQueryChange: ({ detail }) => this.queryChange.emit(detail), onQuickFilter: ({ detail }) => this.quickFilter.emit(detail) }, this._hasCustomFilterSlot && (hAsync("slot", { key: '059f2a7e21d36f0d45ca644fddfe10d6ec897662', name: 'custom-filter', slot: 'custom-filter' })), this._hasCustomActionsSlot && (hAsync("slot", { key: '493b58b1674665f8020bd160efe2e1eabcca5aa1', name: 'custom-actions', slot: 'custom-actions' })))), this._getExtraHeader(), this._getHeader(), hAsync("div", { key: 'a245efe796c78f59419f14193f27753a4aa36180', class: 'flex flex-1 flex-col' }, this._getRows(), hAsync("slot", { key: '080691433b5037f3d809075cf2ccdadb86dc9fcd', name: 'custom-rows' })), this.enableFloatingMenu && this._enableRowSelection ? (hAsync("p-floating-menu-container", { amount: this.selectedRows?.length, amountSelectedTemplate: this.floatingMenuAmountSelectedTemplate, class: floatingMenuContainerClass({
100589
+ return (hAsync(Host, { key: '425442ed379af6ed510015af1c215a243d14a709', class: 'z-0 flex flex-col' }, hAsync("p-table-container", { key: 'f4a76f0df1ff84f4cef210c3721e32f160df7e3b' }, this.enableHeader && (hAsync("p-table-header", { key: 'f621cdc3fce191ec8a921a1bbba6f67212fda95b', actionButtonTemplate: this.actionButtonTemplate, actionIcon: this.actionButtonIcon, actionLoading: this.actionButtonLoading, actionText: this.actionButtonText, activeQuickFilterIdentifier: this.activeQuickFilterIdentifier, canUseAction: this.actionButtonEnabled, class: 'mb-8', enableAction: this.enableAction, enableExport: this.enableExport, enableFilter: this.enableFilter, enableFilterDesktop: this.enableFilterDesktop, enableSearch: this.enableSearch, filterButtonTemplate: this.filterButtonTemplate, itemsSelectedAmount: this.selectedRows?.length, loading: this.headerLoading, query: this.query, quickFilters: this.quickFilters, selectedFiltersAmount: this.selectedFiltersAmount, onAction: () => this.action.emit(), onExport: () => this.export.emit(), onFilter: () => this.filter.emit(), onQueryChange: ({ detail }) => this.queryChange.emit(detail), onQuickFilter: ({ detail }) => this.quickFilter.emit(detail) }, this._hasCustomFilterSlot && (hAsync("slot", { key: '6ad3e112ed8d23bdf8c1ba550071b7bf6deb9fc1', name: 'custom-filter', slot: 'custom-filter' })), this._hasCustomActionsSlot && (hAsync("slot", { key: '1a5aeaa7135c9a91fb624e46bb66a281bff81735', name: 'custom-actions', slot: 'custom-actions' })))), this._getExtraHeader(), this._getHeader(), hAsync("div", { key: '02e8e776a8f52f98eac3524fac5099d3ce59a43f', class: 'flex flex-1 flex-col' }, this._getRows(), hAsync("slot", { key: '4682df30035958e2c07533eb9103d827c60e2ecf', name: 'custom-rows' })), this.enableFloatingMenu && this._enableRowSelection ? (hAsync("p-floating-menu-container", { amount: this.selectedRows?.length, amountSelectedTemplate: this.floatingMenuAmountSelectedTemplate, class: floatingMenuContainerClass({
100571
100590
  hasFooter: this.enableFooter && !this._footerHidden,
100572
100591
  active: !!this.selectedRows?.length,
100573
100592
  shown: this._floatingMenuShown,
@@ -100577,7 +100596,7 @@ class Table {
100577
100596
  !!a.action &&
100578
100597
  a.type === 'single'
100579
100598
  ? a.action(this.selectedRows[0], false)
100580
- : a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (hAsync("p-table-footer", { key: '9b9ee0b74fd7691bed78fa064c745ead40b5a2c1', enablePaginationPages: this.enablePaginationPages, enablePaginationSize: this.enablePaginationSize, hideOnSinglePage: this.hideOnSinglePage, loading: this.footerLoading, page: this.page, pageSize: this.pageSize, pageSizeOptions: this.pageSizeOptions, tableHeaderHasAction: this.enableHeader &&
100599
+ : a.action(this.selectedRows, true) }, a.label))))) : (''), this.enableFooter && (hAsync("p-table-footer", { key: '28611ac3b55ea811d39a349edf7698b19b48b264', enablePaginationPages: this.enablePaginationPages, enablePaginationSize: this.enablePaginationSize, hideOnSinglePage: this.hideOnSinglePage, loading: this.footerLoading, page: this.page, pageSize: this.pageSize, pageSizeOptions: this.pageSizeOptions, tableHeaderHasAction: this.enableHeader &&
100581
100600
  this.enableAction &&
100582
100601
  this.actionButtonEnabled, total: this.total, onHiddenChange: ({ detail }) => (this._footerHidden = detail), onPageChange: ({ detail }) => this.pageChange.emit(detail), onPageSizeChange: ({ detail }) => this.pageSizeChange.emit(detail) })))));
100583
100602
  }
@@ -100588,18 +100607,18 @@ class Table {
100588
100607
  this._generateColumns();
100589
100608
  }
100590
100609
  keyDown({ ctrlKey, metaKey }) {
100591
- const iOS = isIOS();
100592
- const isMeta = metaKey && iOS;
100593
- const isCtrl = ctrlKey && !iOS;
100610
+ const apple = isApple();
100611
+ const isMeta = metaKey && apple;
100612
+ const isCtrl = ctrlKey && !apple;
100594
100613
  if ((!isMeta && !isCtrl) || this._ctrlDown === true) {
100595
100614
  return;
100596
100615
  }
100597
100616
  this._ctrlDown = true;
100598
100617
  }
100599
100618
  keyUp({ code }) {
100600
- const iOS = isIOS();
100601
- const isMeta = ['MetaLeft', 'MetaRight'].includes(code) && iOS;
100602
- const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !iOS;
100619
+ const apple = isApple();
100620
+ const isMeta = ['MetaLeft', 'MetaRight'].includes(code) && apple;
100621
+ const isCtrl = ['ControlLeft', 'ControlRight'].includes(code) && !apple;
100603
100622
  if ((!isMeta && !isCtrl) || this._ctrlDown === false) {
100604
100623
  return;
100605
100624
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paperless/core",
3
- "version": "3.17.2",
3
+ "version": "3.17.3",
4
4
  "description": "Stencil Component Starter",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -1 +0,0 @@
1
- const o=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document;export{o as i}
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- const isIOS = () => [
4
- 'iPad Simulator',
5
- 'iPhone Simulator',
6
- 'iPod Simulator',
7
- 'iPad',
8
- 'iPhone',
9
- 'iPod',
10
- ].includes(navigator.platform) ||
11
- // iPad on iOS 13 detection
12
- (navigator.userAgent.includes('Mac') && 'ontouchend' in document);
13
-
14
- exports.isIOS = isIOS;
@@ -1 +0,0 @@
1
- const o=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document;export{o as i}
@@ -1,12 +0,0 @@
1
- const isIOS = () => [
2
- 'iPad Simulator',
3
- 'iPhone Simulator',
4
- 'iPod Simulator',
5
- 'iPad',
6
- 'iPhone',
7
- 'iPod',
8
- ].includes(navigator.platform) ||
9
- // iPad on iOS 13 detection
10
- (navigator.userAgent.includes('Mac') && 'ontouchend' in document);
11
-
12
- export { isIOS as i };
@@ -1 +0,0 @@
1
- const o=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document;export{o as i}