@pallasoft/ps-mobile-components 1.2.0 → 1.3.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/components/ps-action-menu/ps-action-menu-avatar-entry.d.ts +5 -0
- package/dist/components/ps-action-menu/ps-action-menu-avatar-entry.js +16 -0
- package/dist/components/ps-action-menu/ps-action-menu-entries.js +4 -2
- package/dist/components/ps-action-menu/ps-action-menu-labelled.d.ts +2 -1
- package/dist/components/ps-action-menu/ps-action-menu-labelled.js +2 -2
- package/dist/components/ps-action-menu/ps-action-menu.android.js +1 -1
- package/dist/components/ps-action-menu/ps-action-menu.ios.js +10 -1
- package/dist/components/ps-action-menu/ps-menu-tile-canvas.d.ts +6 -0
- package/dist/components/ps-action-menu/ps-menu-tile-canvas.js +5 -0
- package/dist/components/ps-action-menu/ps-menu-tile-drawing.d.ts +6 -0
- package/dist/components/ps-action-menu/ps-menu-tile-drawing.js +34 -0
- package/dist/components/ps-app-lock-screen/index.d.ts +2 -0
- package/dist/components/ps-app-lock-screen/index.js +2 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen-props.d.ts +9 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen-props.js +1 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen.d.ts +2 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen.js +19 -0
- package/dist/components/ps-chip/ps-chip.js +1 -1
- package/dist/components/ps-form-sheet/ps-form-sheet-props.d.ts +2 -0
- package/dist/components/ps-form-sheet/ps-form-sheet.d.ts +1 -1
- package/dist/components/ps-form-sheet/ps-form-sheet.js +17 -7
- package/dist/components/ps-list/ps-list-context-menu.js +1 -1
- package/dist/components/ps-list/ps-list-link-menu-entry.d.ts +5 -0
- package/dist/components/ps-list/ps-list-link-menu-entry.js +11 -0
- package/dist/components/ps-list/ps-list-link-menu.d.ts +10 -0
- package/dist/components/ps-list/ps-list-link-menu.js +16 -0
- package/dist/components/ps-list/ps-list-link-row.js +1 -1
- package/dist/components/ps-list/ps-list-props.d.ts +3 -1
- package/dist/components/ps-list/ps-list-row-body.js +2 -4
- package/dist/components/ps-list/ps-list-row.d.ts +1 -1
- package/dist/components/ps-list/ps-list-row.js +3 -2
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider-props.d.ts +4 -2
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.d.ts +1 -1
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.js +20 -10
- package/dist/components/ps-native-menu/ps-native-menu.android.js +1 -1
- package/dist/components/ps-option-picker/index.d.ts +2 -0
- package/dist/components/ps-option-picker/index.js +2 -0
- package/dist/components/ps-option-picker/ps-option-picker-props.d.ts +16 -0
- package/dist/components/ps-option-picker/ps-option-picker-props.js +1 -0
- package/dist/components/ps-option-picker/ps-option-picker.d.ts +2 -0
- package/dist/components/ps-option-picker/ps-option-picker.js +33 -0
- package/dist/components/ps-privacy-cover/index.d.ts +2 -0
- package/dist/components/ps-privacy-cover/index.js +2 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover-props.d.ts +4 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover-props.js +1 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover.d.ts +2 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover.js +17 -0
- package/dist/components/ps-search-select-field/index.d.ts +2 -0
- package/dist/components/ps-search-select-field/index.js +2 -0
- package/dist/components/ps-search-select-field/ps-search-select-field-props.d.ts +10 -0
- package/dist/components/ps-search-select-field/ps-search-select-field-props.js +1 -0
- package/dist/components/ps-search-select-field/ps-search-select-field.d.ts +2 -0
- package/dist/components/ps-search-select-field/ps-search-select-field.js +15 -0
- package/dist/components/ps-selection-mode/index.d.ts +2 -0
- package/dist/components/ps-selection-mode/index.js +2 -0
- package/dist/components/ps-selection-mode/ps-selection-mode-props.d.ts +13 -0
- package/dist/components/ps-selection-mode/ps-selection-mode-props.js +1 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.d.ts +2 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.js +28 -0
- package/dist/components/ps-sheet/ps-sheet-props.d.ts +4 -1
- package/dist/components/ps-sheet/ps-sheet.d.ts +1 -1
- package/dist/components/ps-sheet/ps-sheet.js +4 -5
- package/dist/components/ps-sheet-header/ps-sheet-header-props.d.ts +2 -0
- package/dist/components/ps-sheet-header/ps-sheet-header.d.ts +1 -1
- package/dist/components/ps-sheet-header/ps-sheet-header.js +2 -2
- package/dist/components/ps-sheet-page/ps-sheet-page-view.d.ts +8 -0
- package/dist/components/ps-sheet-page/ps-sheet-page-view.js +11 -0
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.ios.js +9 -2
- package/dist/components/ps-tab-bar-provider/index.d.ts +2 -0
- package/dist/components/ps-tab-bar-provider/index.js +2 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider-props.d.ts +4 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider-props.js +1 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.d.ts +2 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.js +8 -0
- package/dist/components/ps-tabs/ps-tabs.js +1 -1
- package/dist/components/ps-text-link/ps-text-link.js +1 -1
- package/dist/constants/ps-app-lock-config.d.ts +13 -0
- package/dist/constants/ps-app-lock-config.js +13 -0
- package/dist/constants/ps-app-lock-native-codes.d.ts +10 -0
- package/dist/constants/ps-app-lock-native-codes.js +10 -0
- package/dist/constants/ps-biometry-kind.d.ts +7 -0
- package/dist/constants/ps-biometry-kind.js +6 -0
- package/dist/constants/ps-list-config.d.ts +2 -0
- package/dist/constants/ps-list-config.js +2 -0
- package/dist/constants/ps-menu-tile-config.d.ts +9 -0
- package/dist/constants/ps-menu-tile-config.js +9 -0
- package/dist/constants/ps-mobile-control-config.d.ts +0 -12
- package/dist/constants/ps-mobile-control-config.js +0 -6
- package/dist/constants/ps-option-picker-config.d.ts +6 -0
- package/dist/constants/ps-option-picker-config.js +6 -0
- package/dist/constants/ps-sf-symbol-config.d.ts +92 -0
- package/dist/constants/ps-sf-symbol-config.js +92 -0
- package/dist/constants/ps-sheet-page-config.d.ts +4 -0
- package/dist/constants/ps-sheet-page-config.js +4 -0
- package/dist/contexts/ps-tab-bar-context.d.ts +2 -0
- package/dist/contexts/ps-tab-bar-context.js +5 -0
- package/dist/hooks/use-ps-app-lock.d.ts +3 -0
- package/dist/hooks/use-ps-app-lock.js +72 -0
- package/dist/hooks/use-ps-menu-tiles.d.ts +4 -0
- package/dist/hooks/use-ps-menu-tiles.js +8 -0
- package/dist/hooks/use-ps-tab-bar.d.ts +2 -0
- package/dist/hooks/use-ps-tab-bar.js +3 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +18 -0
- package/dist/interfaces/ps-action-menu-header.d.ts +1 -0
- package/dist/interfaces/ps-app-lock-native.d.ts +13 -0
- package/dist/interfaces/ps-app-lock-native.js +1 -0
- package/dist/interfaces/ps-app-lock-prompt.d.ts +4 -0
- package/dist/interfaces/ps-app-lock-prompt.js +1 -0
- package/dist/interfaces/ps-menu-item.d.ts +2 -0
- package/dist/interfaces/ps-menu-tile-request.d.ts +7 -0
- package/dist/interfaces/ps-menu-tile-request.js +1 -0
- package/dist/interfaces/ps-menu-tile-shape.d.ts +1 -0
- package/dist/interfaces/ps-menu-tile-shape.js +1 -0
- package/dist/interfaces/ps-mobile-brand-colors.d.ts +5 -0
- package/dist/interfaces/ps-mobile-brand-colors.js +1 -0
- package/dist/interfaces/ps-mobile-brand-input.d.ts +7 -0
- package/dist/interfaces/ps-mobile-brand-input.js +1 -0
- package/dist/interfaces/ps-mobile-theme-input.d.ts +1 -1
- package/dist/interfaces/ps-mobile-theme.d.ts +32 -0
- package/dist/interfaces/ps-sheet-leading-kind.d.ts +1 -0
- package/dist/interfaces/ps-sheet-leading-kind.js +1 -0
- package/dist/interfaces/ps-sheet-page.d.ts +8 -0
- package/dist/interfaces/ps-sheet-page.js +1 -0
- package/dist/interfaces/ps-tab-bar-context-data.d.ts +4 -0
- package/dist/interfaces/ps-tab-bar-context-data.js +1 -0
- package/dist/interfaces/use-ps-app-lock-options.d.ts +6 -0
- package/dist/interfaces/use-ps-app-lock-options.js +1 -0
- package/dist/interfaces/use-ps-app-lock-result.d.ts +7 -0
- package/dist/interfaces/use-ps-app-lock-result.js +1 -0
- package/dist/services/ps-action-menu-service.d.ts +4 -0
- package/dist/services/ps-action-menu-service.js +25 -2
- package/dist/services/ps-app-lock-grace-service.d.ts +6 -0
- package/dist/services/ps-app-lock-grace-service.js +17 -0
- package/dist/services/ps-app-lock-service.d.ts +10 -0
- package/dist/services/ps-app-lock-service.js +84 -0
- package/dist/services/ps-badge-tone-service.js +3 -3
- package/dist/services/ps-button-style-service.js +2 -2
- package/dist/services/ps-context-menu-service.d.ts +1 -0
- package/dist/services/ps-context-menu-service.js +13 -0
- package/dist/services/ps-list-row-style-service.d.ts +4 -0
- package/dist/services/ps-list-row-style-service.js +11 -0
- package/dist/services/ps-menu-tile-service.d.ts +16 -0
- package/dist/services/ps-menu-tile-service.js +70 -0
- package/dist/services/ps-menu-tile-style-service.d.ts +4 -0
- package/dist/services/ps-menu-tile-style-service.js +5 -0
- package/dist/services/ps-mobile-brand-service.d.ts +5 -0
- package/dist/services/ps-mobile-brand-service.js +24 -0
- package/dist/services/ps-mobile-theme-service.d.ts +0 -2
- package/dist/services/ps-mobile-theme-service.js +64 -94
- package/dist/services/ps-option-picker-service.d.ts +8 -0
- package/dist/services/ps-option-picker-service.js +10 -0
- package/dist/services/ps-selection-service.d.ts +5 -0
- package/dist/services/ps-selection-service.js +13 -0
- package/dist/services/ps-sheet-service.d.ts +5 -0
- package/dist/services/ps-sheet-service.js +11 -0
- package/dist/services/ps-text-service.js +4 -4
- package/jest-setup.js +71 -0
- package/package.json +14 -2
|
@@ -1,35 +1,127 @@
|
|
|
1
1
|
export const PsSfSymbolConfig = {
|
|
2
2
|
symbols: {
|
|
3
|
+
'arrow': 'arrow.right',
|
|
4
|
+
'audio': 'waveform',
|
|
3
5
|
'bank': 'building.columns',
|
|
4
6
|
'bell': 'bell',
|
|
7
|
+
'book': 'book',
|
|
5
8
|
'calendar': 'calendar',
|
|
6
9
|
'camera': 'camera',
|
|
10
|
+
'camera-off': 'camera.badge.ellipsis',
|
|
11
|
+
'chart': 'chart.bar',
|
|
12
|
+
'chat': 'bubble.left',
|
|
7
13
|
'check': 'checkmark',
|
|
14
|
+
'chevron': 'chevron.down',
|
|
15
|
+
'chevron-right': 'chevron.right',
|
|
16
|
+
'clipboard': 'list.clipboard',
|
|
8
17
|
'clock': 'clock',
|
|
9
18
|
'close': 'xmark',
|
|
19
|
+
'columns': 'rectangle.split.3x1',
|
|
20
|
+
'credit-card': 'creditcard',
|
|
21
|
+
'crop': 'crop',
|
|
10
22
|
'doc': 'doc.text',
|
|
11
23
|
'download': 'arrow.down.circle',
|
|
24
|
+
'expand': 'arrow.up.left.and.arrow.down.right',
|
|
12
25
|
'eye': 'eye',
|
|
26
|
+
'eye-off': 'eye.slash',
|
|
13
27
|
'file': 'doc',
|
|
28
|
+
'filter': 'line.3.horizontal.decrease',
|
|
29
|
+
'flash': 'bolt',
|
|
14
30
|
'forward': 'arrowshape.turn.up.right',
|
|
31
|
+
'globe': 'globe',
|
|
32
|
+
'help': 'questionmark.circle',
|
|
15
33
|
'home': 'house',
|
|
16
34
|
'image': 'photo',
|
|
35
|
+
'inbox': 'tray',
|
|
17
36
|
'invoice': 'doc.plaintext',
|
|
37
|
+
'layers': 'square.stack.3d.up',
|
|
38
|
+
'lifebuoy': 'lifepreserver',
|
|
39
|
+
'lightbulb': 'lightbulb',
|
|
40
|
+
'linkedin': 'link',
|
|
41
|
+
'location': 'mappin.and.ellipse',
|
|
18
42
|
'mail': 'envelope',
|
|
43
|
+
'menu': 'line.3.horizontal',
|
|
44
|
+
'minus': 'minus.circle',
|
|
45
|
+
'moon': 'moon',
|
|
19
46
|
'more': 'ellipsis',
|
|
47
|
+
'palette': 'paintpalette',
|
|
48
|
+
'pallabuzz': 'app',
|
|
49
|
+
'pallaforge': 'app',
|
|
50
|
+
'pause': 'pause',
|
|
51
|
+
'payroll': 'person.2',
|
|
20
52
|
'pencil': 'pencil',
|
|
53
|
+
'play': 'play',
|
|
21
54
|
'plus': 'plus',
|
|
22
55
|
'receipt': 'scroll',
|
|
23
56
|
'refresh': 'arrow.clockwise',
|
|
24
57
|
'reports': 'chart.bar',
|
|
58
|
+
'rewind': 'backward',
|
|
59
|
+
'rotate': 'rotate.right',
|
|
60
|
+
'scale': 'scalemass',
|
|
25
61
|
'scan': 'doc.viewfinder',
|
|
62
|
+
'search': 'magnifyingglass',
|
|
26
63
|
'settings': 'gearshape',
|
|
27
64
|
'share': 'square.and.arrow.up',
|
|
65
|
+
'sheet': 'tablecells',
|
|
66
|
+
'shield': 'shield',
|
|
28
67
|
'sign-out': 'rectangle.portrait.and.arrow.right',
|
|
68
|
+
'smile': 'face.smiling',
|
|
69
|
+
'sort': 'arrow.up.arrow.down',
|
|
70
|
+
'sort-ascending': 'arrow.up',
|
|
71
|
+
'sort-descending': 'arrow.down',
|
|
72
|
+
'spark': 'sparkles',
|
|
73
|
+
'star': 'star',
|
|
74
|
+
'sun': 'sun.max',
|
|
29
75
|
'swap': 'arrow.left.arrow.right',
|
|
76
|
+
'tax': 'percent',
|
|
77
|
+
'text': 'text.alignleft',
|
|
30
78
|
'trash': 'trash',
|
|
31
79
|
'upload': 'square.and.arrow.up',
|
|
32
80
|
'user': 'person.crop.circle',
|
|
81
|
+
'video': 'video',
|
|
82
|
+
'wallet': 'wallet.bifold',
|
|
83
|
+
'warning': 'exclamationmark.triangle',
|
|
84
|
+
'x': 'xmark',
|
|
85
|
+
'zoom-in': 'plus.magnifyingglass',
|
|
86
|
+
'zoom-out': 'minus.magnifyingglass',
|
|
87
|
+
},
|
|
88
|
+
monograms: {
|
|
89
|
+
'0': '0.circle.fill',
|
|
90
|
+
'1': '1.circle.fill',
|
|
91
|
+
'2': '2.circle.fill',
|
|
92
|
+
'3': '3.circle.fill',
|
|
93
|
+
'4': '4.circle.fill',
|
|
94
|
+
'5': '5.circle.fill',
|
|
95
|
+
'6': '6.circle.fill',
|
|
96
|
+
'7': '7.circle.fill',
|
|
97
|
+
'8': '8.circle.fill',
|
|
98
|
+
'9': '9.circle.fill',
|
|
99
|
+
'a': 'a.circle.fill',
|
|
100
|
+
'b': 'b.circle.fill',
|
|
101
|
+
'c': 'c.circle.fill',
|
|
102
|
+
'd': 'd.circle.fill',
|
|
103
|
+
'e': 'e.circle.fill',
|
|
104
|
+
'f': 'f.circle.fill',
|
|
105
|
+
'g': 'g.circle.fill',
|
|
106
|
+
'h': 'h.circle.fill',
|
|
107
|
+
'i': 'i.circle.fill',
|
|
108
|
+
'j': 'j.circle.fill',
|
|
109
|
+
'k': 'k.circle.fill',
|
|
110
|
+
'l': 'l.circle.fill',
|
|
111
|
+
'm': 'm.circle.fill',
|
|
112
|
+
'n': 'n.circle.fill',
|
|
113
|
+
'o': 'o.circle.fill',
|
|
114
|
+
'p': 'p.circle.fill',
|
|
115
|
+
'q': 'q.circle.fill',
|
|
116
|
+
'r': 'r.circle.fill',
|
|
117
|
+
's': 's.circle.fill',
|
|
118
|
+
't': 't.circle.fill',
|
|
119
|
+
'u': 'u.circle.fill',
|
|
120
|
+
'v': 'v.circle.fill',
|
|
121
|
+
'w': 'w.circle.fill',
|
|
122
|
+
'x': 'x.circle.fill',
|
|
123
|
+
'y': 'y.circle.fill',
|
|
124
|
+
'z': 'z.circle.fill',
|
|
33
125
|
},
|
|
34
126
|
checkedSymbol: 'checkmark',
|
|
35
127
|
headerSymbol: 'person.crop.circle.fill',
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { UsePsAppLockOptions } from '../interfaces/use-ps-app-lock-options';
|
|
2
|
+
import type { UsePsAppLockResult } from '../interfaces/use-ps-app-lock-result';
|
|
3
|
+
export declare const usePsAppLock: ({ graceSeconds, isEnabled, prompt, }: UsePsAppLockOptions) => UsePsAppLockResult;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Common } from '@pallasoft/ps-utilities';
|
|
3
|
+
import { AppState } from 'react-native';
|
|
4
|
+
import { PsAppLockConfig } from '../constants/ps-app-lock-config';
|
|
5
|
+
import { PsAppLockGraceService } from '../services/ps-app-lock-grace-service';
|
|
6
|
+
import { PsAppLockService } from '../services/ps-app-lock-service';
|
|
7
|
+
import { usePsHaptics } from './use-ps-haptics';
|
|
8
|
+
export const usePsAppLock = ({ graceSeconds = PsAppLockConfig.defaultGraceSeconds, isEnabled, prompt, }) => {
|
|
9
|
+
const haptics = usePsHaptics();
|
|
10
|
+
const [isHeld, setIsHeld] = useState(false);
|
|
11
|
+
const [isUnlocking, setIsUnlocking] = useState(false);
|
|
12
|
+
const [appState, setAppState] = useState(PsAppLockConfig.activeState);
|
|
13
|
+
const backgroundedAt = useRef(null);
|
|
14
|
+
const isUnlockingRef = useRef(false);
|
|
15
|
+
const latest = useRef({ haptics, prompt });
|
|
16
|
+
const isLocked = isEnabled && isHeld;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
latest.current = { haptics, prompt };
|
|
19
|
+
});
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!isEnabled)
|
|
22
|
+
setIsHeld(false);
|
|
23
|
+
}, [isEnabled]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const subscription = AppState.addEventListener('change', (next) => {
|
|
26
|
+
if (PsAppLockService.isBusy())
|
|
27
|
+
return;
|
|
28
|
+
const now = Common.DateService.nowUnixSeconds();
|
|
29
|
+
if (PsAppLockGraceService.isBackground(next))
|
|
30
|
+
backgroundedAt.current = now;
|
|
31
|
+
if (PsAppLockGraceService.isActive(next)) {
|
|
32
|
+
if (PsAppLockGraceService.isExpired(backgroundedAt.current, now, graceSeconds))
|
|
33
|
+
setIsHeld(true);
|
|
34
|
+
backgroundedAt.current = null;
|
|
35
|
+
}
|
|
36
|
+
setAppState(next);
|
|
37
|
+
});
|
|
38
|
+
return () => subscription.remove();
|
|
39
|
+
}, [graceSeconds]);
|
|
40
|
+
const lock = useCallback(() => setIsHeld(true), []);
|
|
41
|
+
const unlock = useCallback(async () => {
|
|
42
|
+
if (isUnlockingRef.current)
|
|
43
|
+
return false;
|
|
44
|
+
isUnlockingRef.current = true;
|
|
45
|
+
setIsUnlocking(true);
|
|
46
|
+
try {
|
|
47
|
+
const { haptics: play, prompt: current } = latest.current;
|
|
48
|
+
const isOk = await PsAppLockService.authenticate(current.message, current.cancelLabel);
|
|
49
|
+
if (isOk)
|
|
50
|
+
setIsHeld(false);
|
|
51
|
+
play(isOk ? 'success' : 'error');
|
|
52
|
+
return isOk;
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
isUnlockingRef.current = false;
|
|
56
|
+
setIsUnlocking(false);
|
|
57
|
+
}
|
|
58
|
+
}, []);
|
|
59
|
+
const isHidden = PsAppLockGraceService.isHidden(appState);
|
|
60
|
+
const shouldPrompt = isLocked && !isHidden;
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (shouldPrompt)
|
|
63
|
+
void unlock();
|
|
64
|
+
}, [shouldPrompt, unlock]);
|
|
65
|
+
return {
|
|
66
|
+
isCovered: isEnabled && isHidden,
|
|
67
|
+
isLocked,
|
|
68
|
+
isUnlocking,
|
|
69
|
+
lock,
|
|
70
|
+
unlock,
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export const usePsMenuTiles = () => {
|
|
3
|
+
const [tiles, setTiles] = useState({});
|
|
4
|
+
const onTile = useCallback((key, uri) => {
|
|
5
|
+
setTiles((current) => (current[key] === uri ? current : { ...current, [key]: uri }));
|
|
6
|
+
}, []);
|
|
7
|
+
return { onTile, tiles };
|
|
8
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,11 @@ export * from './components/ps-pallasoft-sign-in-button';
|
|
|
27
27
|
export * from './components/ps-color-swatches';
|
|
28
28
|
export * from './components/ps-count-badge';
|
|
29
29
|
export * from './components/ps-segmented-control';
|
|
30
|
+
export * from './components/ps-selection-mode';
|
|
31
|
+
export * from './components/ps-tab-bar-provider';
|
|
30
32
|
export * from './components/ps-tabs';
|
|
33
|
+
export * from './components/ps-option-picker';
|
|
34
|
+
export * from './components/ps-search-select-field';
|
|
31
35
|
export * from './components/ps-select';
|
|
32
36
|
export * from './components/ps-skeleton';
|
|
33
37
|
export * from './components/ps-sortable-grid';
|
|
@@ -51,12 +55,14 @@ export * from './hooks/use-ps-document-scanner';
|
|
|
51
55
|
export * from './hooks/use-ps-haptics';
|
|
52
56
|
export * from './hooks/use-ps-mobile-theme';
|
|
53
57
|
export * from './hooks/use-ps-refresh';
|
|
58
|
+
export * from './hooks/use-ps-tab-bar';
|
|
54
59
|
export * from './hooks/use-ps-toast';
|
|
55
60
|
export * from './hooks/use-ps-remote-data';
|
|
56
61
|
export * from './interfaces/ps-document-item';
|
|
57
62
|
export * from './interfaces/ps-document-labels';
|
|
58
63
|
export * from './interfaces/ps-document-scanner-options';
|
|
59
64
|
export * from './interfaces/ps-document-source';
|
|
65
|
+
export * from './interfaces/ps-tab-bar-context-data';
|
|
60
66
|
export * from './interfaces/ps-area-chart-datum';
|
|
61
67
|
export * from './interfaces/ps-cartesian-chart-series';
|
|
62
68
|
export * from './interfaces/ps-donut-chart-datum';
|
|
@@ -78,6 +84,7 @@ export * from './interfaces/ps-text-field-type';
|
|
|
78
84
|
export * from './interfaces/ps-scanned-file';
|
|
79
85
|
export * from './interfaces/use-ps-document-scanner-result';
|
|
80
86
|
export { PsActionMenuService } from './services/ps-action-menu-service';
|
|
87
|
+
export { PsSelectionService } from './services/ps-selection-service';
|
|
81
88
|
export { PsSortableGridService } from './services/ps-sortable-grid-service';
|
|
82
89
|
export { PsDocumentPagerService } from './services/ps-document-pager-service';
|
|
83
90
|
export { PsDocumentZoomService } from './services/ps-document-zoom-service';
|
|
@@ -112,3 +119,14 @@ export * from './interfaces/ps-text-align';
|
|
|
112
119
|
export * from './interfaces/ps-text-tone';
|
|
113
120
|
export * from './interfaces/ps-text-variant';
|
|
114
121
|
export * from './interfaces/ps-sheet-action';
|
|
122
|
+
export * from './interfaces/ps-sheet-leading-kind';
|
|
123
|
+
export * from './interfaces/ps-sheet-page';
|
|
124
|
+
export * from './components/ps-app-lock-screen';
|
|
125
|
+
export * from './components/ps-privacy-cover';
|
|
126
|
+
export * from './constants/ps-biometry-kind';
|
|
127
|
+
export * from './hooks/use-ps-app-lock';
|
|
128
|
+
export * from './interfaces/ps-app-lock-prompt';
|
|
129
|
+
export * from './interfaces/use-ps-app-lock-options';
|
|
130
|
+
export * from './interfaces/use-ps-app-lock-result';
|
|
131
|
+
export { PsAppLockGraceService } from './services/ps-app-lock-grace-service';
|
|
132
|
+
export { PsAppLockService } from './services/ps-app-lock-service';
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,11 @@ export * from './components/ps-pallasoft-sign-in-button';
|
|
|
27
27
|
export * from './components/ps-color-swatches';
|
|
28
28
|
export * from './components/ps-count-badge';
|
|
29
29
|
export * from './components/ps-segmented-control';
|
|
30
|
+
export * from './components/ps-selection-mode';
|
|
31
|
+
export * from './components/ps-tab-bar-provider';
|
|
30
32
|
export * from './components/ps-tabs';
|
|
33
|
+
export * from './components/ps-option-picker';
|
|
34
|
+
export * from './components/ps-search-select-field';
|
|
31
35
|
export * from './components/ps-select';
|
|
32
36
|
export * from './components/ps-skeleton';
|
|
33
37
|
export * from './components/ps-sortable-grid';
|
|
@@ -51,12 +55,14 @@ export * from './hooks/use-ps-document-scanner';
|
|
|
51
55
|
export * from './hooks/use-ps-haptics';
|
|
52
56
|
export * from './hooks/use-ps-mobile-theme';
|
|
53
57
|
export * from './hooks/use-ps-refresh';
|
|
58
|
+
export * from './hooks/use-ps-tab-bar';
|
|
54
59
|
export * from './hooks/use-ps-toast';
|
|
55
60
|
export * from './hooks/use-ps-remote-data';
|
|
56
61
|
export * from './interfaces/ps-document-item';
|
|
57
62
|
export * from './interfaces/ps-document-labels';
|
|
58
63
|
export * from './interfaces/ps-document-scanner-options';
|
|
59
64
|
export * from './interfaces/ps-document-source';
|
|
65
|
+
export * from './interfaces/ps-tab-bar-context-data';
|
|
60
66
|
export * from './interfaces/ps-area-chart-datum';
|
|
61
67
|
export * from './interfaces/ps-cartesian-chart-series';
|
|
62
68
|
export * from './interfaces/ps-donut-chart-datum';
|
|
@@ -78,6 +84,7 @@ export * from './interfaces/ps-text-field-type';
|
|
|
78
84
|
export * from './interfaces/ps-scanned-file';
|
|
79
85
|
export * from './interfaces/use-ps-document-scanner-result';
|
|
80
86
|
export { PsActionMenuService } from './services/ps-action-menu-service';
|
|
87
|
+
export { PsSelectionService } from './services/ps-selection-service';
|
|
81
88
|
export { PsSortableGridService } from './services/ps-sortable-grid-service';
|
|
82
89
|
export { PsDocumentPagerService } from './services/ps-document-pager-service';
|
|
83
90
|
export { PsDocumentZoomService } from './services/ps-document-zoom-service';
|
|
@@ -108,3 +115,14 @@ export * from './interfaces/ps-text-align';
|
|
|
108
115
|
export * from './interfaces/ps-text-tone';
|
|
109
116
|
export * from './interfaces/ps-text-variant';
|
|
110
117
|
export * from './interfaces/ps-sheet-action';
|
|
118
|
+
export * from './interfaces/ps-sheet-leading-kind';
|
|
119
|
+
export * from './interfaces/ps-sheet-page';
|
|
120
|
+
export * from './components/ps-app-lock-screen';
|
|
121
|
+
export * from './components/ps-privacy-cover';
|
|
122
|
+
export * from './constants/ps-biometry-kind';
|
|
123
|
+
export * from './hooks/use-ps-app-lock';
|
|
124
|
+
export * from './interfaces/ps-app-lock-prompt';
|
|
125
|
+
export * from './interfaces/use-ps-app-lock-options';
|
|
126
|
+
export * from './interfaces/use-ps-app-lock-result';
|
|
127
|
+
export { PsAppLockGraceService } from './services/ps-app-lock-grace-service';
|
|
128
|
+
export { PsAppLockService } from './services/ps-app-lock-service';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PsAppLockNativeOptions {
|
|
2
|
+
cancelLabel: string;
|
|
3
|
+
disableDeviceFallback: boolean;
|
|
4
|
+
promptMessage: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PsAppLockNativeResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PsAppLockNative {
|
|
10
|
+
authenticateAsync: (options: PsAppLockNativeOptions) => Promise<PsAppLockNativeResult>;
|
|
11
|
+
getEnrolledLevelAsync: () => Promise<number>;
|
|
12
|
+
supportedAuthenticationTypesAsync: () => Promise<number[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,10 +4,12 @@ export interface PsMenuItem {
|
|
|
4
4
|
children?: PsMenuItem[];
|
|
5
5
|
iconKey?: PsMobileIconKey;
|
|
6
6
|
id: string;
|
|
7
|
+
imageUri?: string;
|
|
7
8
|
isChecked?: boolean;
|
|
8
9
|
isDanger?: boolean;
|
|
9
10
|
isDisabled?: boolean;
|
|
10
11
|
label: string;
|
|
12
|
+
monogram?: string;
|
|
11
13
|
onSelect: () => void;
|
|
12
14
|
subtitle?: string;
|
|
13
15
|
tone?: PsMenuItemTone;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PsMenuTileShape = 'circle' | 'rounded';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,8 +6,12 @@ export interface PsMobileTheme {
|
|
|
6
6
|
chart: string[];
|
|
7
7
|
danger: string;
|
|
8
8
|
dangerSoft: string;
|
|
9
|
+
dangerText: string;
|
|
9
10
|
fonts: PsMobileFonts;
|
|
10
11
|
hasHaptics: boolean;
|
|
12
|
+
info: string;
|
|
13
|
+
infoSoft: string;
|
|
14
|
+
infoText: string;
|
|
11
15
|
isDark: boolean;
|
|
12
16
|
isReduceMotion: boolean;
|
|
13
17
|
ink: string;
|
|
@@ -15,17 +19,45 @@ export interface PsMobileTheme {
|
|
|
15
19
|
muted: string;
|
|
16
20
|
overlay: string;
|
|
17
21
|
primary: string;
|
|
22
|
+
primary100: string;
|
|
23
|
+
primary200: string;
|
|
24
|
+
primary300: string;
|
|
25
|
+
primary400: string;
|
|
26
|
+
primary50: string;
|
|
27
|
+
primary500: string;
|
|
28
|
+
primary600: string;
|
|
29
|
+
primary700: string;
|
|
30
|
+
primary800: string;
|
|
31
|
+
primary900: string;
|
|
18
32
|
primaryContrast: string;
|
|
33
|
+
primaryPressed: string;
|
|
19
34
|
primarySoft: string;
|
|
35
|
+
primarySoftStrong: string;
|
|
36
|
+
primaryText: string;
|
|
20
37
|
secondary: string;
|
|
38
|
+
secondary100: string;
|
|
39
|
+
secondary200: string;
|
|
40
|
+
secondary300: string;
|
|
41
|
+
secondary400: string;
|
|
42
|
+
secondary50: string;
|
|
43
|
+
secondary500: string;
|
|
44
|
+
secondary600: string;
|
|
45
|
+
secondary700: string;
|
|
46
|
+
secondary800: string;
|
|
47
|
+
secondary900: string;
|
|
21
48
|
secondaryContrast: string;
|
|
49
|
+
secondaryPressed: string;
|
|
22
50
|
secondarySoft: string;
|
|
51
|
+
secondarySoftStrong: string;
|
|
52
|
+
secondaryText: string;
|
|
23
53
|
skeletonBase: string;
|
|
24
54
|
skeletonSweep: string;
|
|
25
55
|
success: string;
|
|
26
56
|
successSoft: string;
|
|
57
|
+
successText: string;
|
|
27
58
|
surface: string;
|
|
28
59
|
warning: string;
|
|
29
60
|
warningSoft: string;
|
|
61
|
+
warningText: string;
|
|
30
62
|
white: string;
|
|
31
63
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PsSheetLeadingKind = 'back' | 'close';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
2
|
+
import type { PsActionMenuHeader } from '../interfaces/ps-action-menu-header';
|
|
2
3
|
import type { PsActionMenuSection } from '../interfaces/ps-action-menu-section';
|
|
3
4
|
import type { PsMenuItem } from '../interfaces/ps-menu-item';
|
|
4
5
|
export declare class PsActionMenuService {
|
|
@@ -6,5 +7,8 @@ export declare class PsActionMenuService {
|
|
|
6
7
|
static consistent(sections: PsActionMenuSection[]): PsActionMenuSection[];
|
|
7
8
|
static flatten(sections: PsActionMenuSection[]): PsMenuItem[];
|
|
8
9
|
static expand(item: PsMenuItem): PsMenuItem[];
|
|
10
|
+
static hasAvatar(item: PsMenuItem): boolean;
|
|
11
|
+
static monogram(item: PsMenuItem): SFSymbol | undefined;
|
|
12
|
+
static headerSymbol(header: PsActionMenuHeader): SFSymbol;
|
|
9
13
|
static symbol(item: PsMenuItem): SFSymbol | undefined;
|
|
10
14
|
}
|
|
@@ -7,7 +7,7 @@ export class PsActionMenuService {
|
|
|
7
7
|
}
|
|
8
8
|
static consistent(sections) {
|
|
9
9
|
const items = sections.flatMap((section) => section.items);
|
|
10
|
-
const hasAll = items.every((item) => item.iconKey !== undefined || item.isChecked === true);
|
|
10
|
+
const hasAll = items.every((item) => item.iconKey !== undefined || item.isChecked === true || PsActionMenuService.hasAvatar(item));
|
|
11
11
|
if (hasAll)
|
|
12
12
|
return sections;
|
|
13
13
|
return sections.map((section) => ({
|
|
@@ -26,9 +26,32 @@ export class PsActionMenuService {
|
|
|
26
26
|
...item.children.flatMap((child) => this.expand(child)),
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
|
+
static hasAvatar(item) {
|
|
30
|
+
return item.imageUri !== undefined || item.monogram !== undefined;
|
|
31
|
+
}
|
|
32
|
+
static monogram(item) {
|
|
33
|
+
if (item.monogram === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
const monograms = PsSfSymbolConfig.monograms;
|
|
36
|
+
return monograms[item.monogram.trim().normalize('NFD').charAt(0).toLowerCase()];
|
|
37
|
+
}
|
|
38
|
+
static headerSymbol(header) {
|
|
39
|
+
const monogram = header.initials === undefined
|
|
40
|
+
? undefined
|
|
41
|
+
: PsActionMenuService.monogram({
|
|
42
|
+
id: 'header',
|
|
43
|
+
label: header.title,
|
|
44
|
+
monogram: header.initials,
|
|
45
|
+
onSelect: () => undefined,
|
|
46
|
+
});
|
|
47
|
+
return monogram === undefined ? PsSfSymbolConfig.headerSymbol : monogram;
|
|
48
|
+
}
|
|
29
49
|
static symbol(item) {
|
|
30
|
-
if (item.isChecked)
|
|
50
|
+
if (item.isChecked && !PsActionMenuService.hasAvatar(item))
|
|
31
51
|
return PsSfSymbolConfig.checkedSymbol;
|
|
52
|
+
const monogram = PsActionMenuService.monogram(item);
|
|
53
|
+
if (monogram !== undefined)
|
|
54
|
+
return monogram;
|
|
32
55
|
if (item.iconKey === undefined)
|
|
33
56
|
return undefined;
|
|
34
57
|
const symbols = PsSfSymbolConfig.symbols;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class PsAppLockGraceService {
|
|
2
|
+
static isExpired(backgroundedAt: number | null, now: number, graceSeconds: number): boolean;
|
|
3
|
+
static isActive(state: string): boolean;
|
|
4
|
+
static isHidden(state: string): boolean;
|
|
5
|
+
static isBackground(state: string): boolean;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PsAppLockConfig } from '../constants/ps-app-lock-config';
|
|
2
|
+
export class PsAppLockGraceService {
|
|
3
|
+
static isExpired(backgroundedAt, now, graceSeconds) {
|
|
4
|
+
if (backgroundedAt === null)
|
|
5
|
+
return false;
|
|
6
|
+
return now - backgroundedAt >= graceSeconds;
|
|
7
|
+
}
|
|
8
|
+
static isActive(state) {
|
|
9
|
+
return state === PsAppLockConfig.activeState;
|
|
10
|
+
}
|
|
11
|
+
static isHidden(state) {
|
|
12
|
+
return state === PsAppLockConfig.inactiveState || state === PsAppLockConfig.backgroundState;
|
|
13
|
+
}
|
|
14
|
+
static isBackground(state) {
|
|
15
|
+
return state === PsAppLockConfig.backgroundState;
|
|
16
|
+
}
|
|
17
|
+
}
|