@pallasoft/ps-mobile-components 1.3.0 → 1.4.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-entries.js +1 -0
- package/dist/components/ps-action-menu/ps-action-menu.android.js +19 -30
- package/dist/components/ps-action-sheet/ps-action-sheet.js +6 -4
- package/dist/components/ps-barcode-scanner-sheet/index.d.ts +2 -0
- package/dist/components/ps-barcode-scanner-sheet/index.js +2 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.d.ts +11 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.js +1 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.d.ts +2 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.js +82 -0
- package/dist/components/ps-button/ps-button.js +4 -2
- package/dist/components/ps-cartesian-chart/ps-cartesian-chart.js +25 -19
- package/dist/components/ps-checkbox/ps-checkbox.js +5 -2
- package/dist/components/ps-chip/ps-chip.js +3 -1
- package/dist/components/ps-date-field/ps-date-field.android.js +1 -1
- package/dist/components/ps-date-field/ps-date-field.ios.js +1 -1
- package/dist/components/ps-document-page/ps-document-page-props.d.ts +3 -0
- package/dist/components/ps-document-page/ps-document-page.d.ts +1 -1
- package/dist/components/ps-document-page/ps-document-page.js +16 -7
- package/dist/components/ps-document-page-strip/index.d.ts +2 -0
- package/dist/components/ps-document-page-strip/index.js +2 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip-props.d.ts +6 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip-props.js +1 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip.d.ts +2 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip.js +43 -0
- package/dist/components/ps-document-pdf-cover/index.d.ts +2 -0
- package/dist/components/ps-document-pdf-cover/index.js +2 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.d.ts +6 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.js +1 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.d.ts +2 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.js +18 -0
- package/dist/components/ps-document-preview/ps-document-preview.js +3 -4
- package/dist/components/ps-document-preview-face/index.d.ts +2 -0
- package/dist/components/ps-document-preview-face/index.js +2 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face-props.d.ts +6 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face-props.js +1 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face.d.ts +2 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face.js +18 -0
- package/dist/components/ps-document-text-page/index.d.ts +2 -0
- package/dist/components/ps-document-text-page/index.js +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.d.ts +6 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.js +1 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.d.ts +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.js +18 -0
- package/dist/components/ps-document-unsupported/index.d.ts +2 -0
- package/dist/components/ps-document-unsupported/index.js +2 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported-props.d.ts +7 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported-props.js +1 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported.d.ts +2 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported.js +10 -0
- package/dist/components/ps-document-viewer/ps-document-viewer.js +27 -7
- package/dist/components/ps-header-action/index.d.ts +2 -0
- package/dist/components/ps-header-action/index.js +2 -0
- package/dist/components/ps-header-action/ps-header-action-props.d.ts +6 -0
- package/dist/components/ps-header-action/ps-header-action-props.js +1 -0
- package/dist/components/ps-header-action/ps-header-action.android.d.ts +2 -0
- package/dist/components/ps-header-action/ps-header-action.android.js +9 -0
- package/dist/components/ps-header-action/ps-header-action.d.ts +2 -0
- package/dist/components/ps-header-action/ps-header-action.js +11 -0
- package/dist/components/ps-header-menu/index.d.ts +2 -0
- package/dist/components/ps-header-menu/index.js +2 -0
- package/dist/components/ps-header-menu/ps-header-menu-props.d.ts +7 -0
- package/dist/components/ps-header-menu/ps-header-menu-props.js +1 -0
- package/dist/components/ps-header-menu/ps-header-menu.android.d.ts +2 -0
- package/dist/components/ps-header-menu/ps-header-menu.android.js +11 -0
- package/dist/components/ps-header-menu/ps-header-menu.d.ts +2 -0
- package/dist/components/ps-header-menu/ps-header-menu.js +20 -0
- package/dist/components/ps-icon-button/ps-icon-button.js +7 -7
- package/dist/components/ps-kpi-card/ps-kpi-card.js +1 -2
- package/dist/components/ps-list/ps-list-action-row.js +6 -6
- package/dist/components/ps-list/ps-list-context-menu.android.d.ts +2 -0
- package/dist/components/ps-list/ps-list-context-menu.android.js +3 -0
- package/dist/components/ps-list/ps-list-link-menu.android.d.ts +2 -0
- package/dist/components/ps-list/ps-list-link-menu.android.js +7 -0
- package/dist/components/ps-list/ps-list-link-row.js +5 -5
- package/dist/components/ps-list/ps-list-props.d.ts +1 -0
- package/dist/components/ps-list/ps-list-row-body.d.ts +2 -2
- package/dist/components/ps-list/ps-list-row-body.js +7 -4
- package/dist/components/ps-list/ps-list-row-menu.d.ts +10 -0
- package/dist/components/ps-list/ps-list-row-menu.js +27 -0
- package/dist/components/ps-list/ps-list-row.d.ts +1 -1
- package/dist/components/ps-list/ps-list-row.js +2 -2
- package/dist/components/ps-list/ps-list-select-row.js +2 -1
- package/dist/components/ps-menu-popup/index.d.ts +4 -0
- package/dist/components/ps-menu-popup/index.js +4 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.d.ts +1 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.js +7 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-header.d.ts +5 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-header.js +8 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-row.d.ts +12 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-row.js +22 -0
- package/dist/components/ps-menu-popup/ps-menu-popup.d.ts +9 -0
- package/dist/components/ps-menu-popup/ps-menu-popup.js +35 -0
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider-props.d.ts +1 -0
- 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 +8 -2
- package/dist/components/ps-native-menu/ps-native-menu-row.js +5 -5
- package/dist/components/ps-native-menu/ps-native-menu.android.js +16 -24
- package/dist/components/ps-option-picker/ps-option-picker.js +3 -1
- package/dist/components/ps-page-header/ps-page-header.js +3 -1
- package/dist/components/ps-pallasoft-sign-in-button/ps-pallasoft-sign-in-button.js +3 -1
- package/dist/components/ps-screen/ps-screen.js +9 -4
- package/dist/components/ps-search-field/ps-search-field.js +3 -1
- package/dist/components/ps-segmented-control/ps-segmented-control.android.js +4 -9
- package/dist/components/ps-selection-mode/ps-selection-bar.d.ts +9 -0
- package/dist/components/ps-selection-mode/ps-selection-bar.js +49 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.android.d.ts +2 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.android.js +23 -0
- package/dist/components/ps-sheet-content/ps-sheet-content.js +1 -1
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.android.js +4 -4
- package/dist/components/ps-sortable-grid/ps-sortable-item.js +2 -0
- package/dist/components/ps-spinner/ps-spinner.android.d.ts +2 -0
- package/dist/components/ps-spinner/ps-spinner.android.js +13 -0
- package/dist/components/ps-switch/ps-switch.android.d.ts +2 -0
- package/dist/components/ps-switch/ps-switch.android.js +25 -0
- package/dist/components/ps-switcher/index.d.ts +2 -0
- package/dist/components/ps-switcher/index.js +2 -0
- package/dist/components/ps-switcher/ps-switcher-panel.d.ts +10 -0
- package/dist/components/ps-switcher/ps-switcher-panel.js +17 -0
- package/dist/components/ps-switcher/ps-switcher-props.d.ts +12 -0
- package/dist/components/ps-switcher/ps-switcher-props.js +1 -0
- package/dist/components/ps-switcher/ps-switcher-row.d.ts +7 -0
- package/dist/components/ps-switcher/ps-switcher-row.js +33 -0
- package/dist/components/ps-switcher/ps-switcher-trigger.d.ts +11 -0
- package/dist/components/ps-switcher/ps-switcher-trigger.js +35 -0
- package/dist/components/ps-switcher/ps-switcher.d.ts +2 -0
- package/dist/components/ps-switcher/ps-switcher.js +21 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.js +1 -1
- package/dist/components/ps-tabs/ps-tabs.js +3 -1
- package/dist/components/ps-waterfall-chart/index.d.ts +2 -0
- package/dist/components/ps-waterfall-chart/index.js +2 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.d.ts +9 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.js +1 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.d.ts +2 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.js +37 -0
- package/dist/components/ps-widget-list/ps-widget-list.js +1 -1
- package/dist/constants/ps-android-state-config.d.ts +12 -0
- package/dist/constants/ps-android-state-config.js +12 -0
- package/dist/constants/ps-barcode-permission.d.ts +6 -0
- package/dist/constants/ps-barcode-permission.js +5 -0
- package/dist/constants/ps-barcode-scanner-config.d.ts +18 -0
- package/dist/constants/ps-barcode-scanner-config.js +31 -0
- package/dist/constants/ps-capture-config.d.ts +12 -0
- package/dist/constants/ps-capture-config.js +22 -0
- package/dist/constants/ps-capture-source.d.ts +7 -0
- package/dist/constants/ps-capture-source.js +6 -0
- package/dist/constants/ps-cartesian-series-shape.d.ts +5 -0
- package/dist/constants/ps-cartesian-series-shape.js +4 -0
- package/dist/constants/ps-chart-brand-config.d.ts +21 -0
- package/dist/constants/ps-chart-brand-config.js +10 -0
- package/dist/constants/ps-document-config.d.ts +3 -0
- package/dist/constants/ps-document-config.js +3 -0
- package/dist/constants/ps-document-file-config.d.ts +11 -0
- package/dist/constants/ps-document-file-config.js +11 -0
- package/dist/constants/ps-document-kind.d.ts +1 -0
- package/dist/constants/ps-document-kind.js +1 -0
- package/dist/constants/ps-document-load-status.d.ts +7 -0
- package/dist/constants/ps-document-load-status.js +6 -0
- package/dist/constants/ps-document-pdf-config.d.ts +14 -0
- package/dist/constants/ps-document-pdf-config.js +14 -0
- package/dist/constants/ps-header-config.d.ts +3 -0
- package/dist/constants/ps-header-config.js +3 -0
- package/dist/constants/ps-menu-popup-config.d.ts +10 -0
- package/dist/constants/ps-menu-popup-config.js +10 -0
- package/dist/constants/ps-quick-action-config.d.ts +4 -0
- package/dist/constants/ps-quick-action-config.js +4 -0
- package/dist/constants/ps-ripple-kind.d.ts +8 -0
- package/dist/constants/ps-ripple-kind.js +7 -0
- package/dist/constants/ps-selection-bar-config.d.ts +4 -0
- package/dist/constants/ps-selection-bar-config.js +4 -0
- package/dist/constants/ps-sortable-grid-config.d.ts +2 -1
- package/dist/constants/ps-sortable-grid-config.js +2 -1
- package/dist/constants/ps-switcher-config.d.ts +12 -0
- package/dist/constants/ps-switcher-config.js +12 -0
- package/dist/contexts/ps-tab-bar-context.js +1 -0
- package/dist/hooks/use-ps-barcode-scanner.d.ts +2 -0
- package/dist/hooks/use-ps-barcode-scanner.js +9 -0
- package/dist/hooks/use-ps-document-open.d.ts +3 -0
- package/dist/hooks/use-ps-document-open.js +14 -0
- package/dist/hooks/use-ps-document-pdf-cover.d.ts +3 -0
- package/dist/hooks/use-ps-document-pdf-cover.js +33 -0
- package/dist/hooks/use-ps-document-pdf-pages.d.ts +3 -0
- package/dist/hooks/use-ps-document-pdf-pages.js +31 -0
- package/dist/hooks/use-ps-document-text.d.ts +3 -0
- package/dist/hooks/use-ps-document-text.js +29 -0
- package/dist/hooks/use-ps-file-upload.d.ts +3 -0
- package/dist/hooks/use-ps-file-upload.js +32 -0
- package/dist/hooks/use-ps-header-right.d.ts +2 -0
- package/dist/hooks/use-ps-header-right.js +9 -0
- package/dist/hooks/use-ps-material-scheme.d.ts +2 -0
- package/dist/hooks/use-ps-material-scheme.js +3 -0
- package/dist/hooks/use-ps-menu-anchor.d.ts +10 -0
- package/dist/hooks/use-ps-menu-anchor.js +13 -0
- package/dist/hooks/use-ps-quick-actions.d.ts +2 -0
- package/dist/hooks/use-ps-quick-actions.js +30 -0
- package/dist/hooks/use-ps-stack-screen-options.d.ts +2 -0
- package/dist/hooks/use-ps-stack-screen-options.js +7 -0
- package/dist/hooks/use-ps-top-inset.d.ts +1 -0
- package/dist/hooks/use-ps-top-inset.js +10 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +43 -0
- package/dist/interfaces/ps-barcode-frame-size.d.ts +4 -0
- package/dist/interfaces/ps-barcode-frame-size.js +1 -0
- package/dist/interfaces/ps-barcode-last-read.d.ts +4 -0
- package/dist/interfaces/ps-barcode-last-read.js +1 -0
- package/dist/interfaces/ps-barcode-scan.d.ts +4 -0
- package/dist/interfaces/ps-barcode-scan.js +1 -0
- package/dist/interfaces/ps-barcode-scanner-labels.d.ts +8 -0
- package/dist/interfaces/ps-barcode-scanner-labels.js +1 -0
- package/dist/interfaces/ps-barcode-scanner-native.d.ts +23 -0
- package/dist/interfaces/ps-barcode-scanner-native.js +1 -0
- package/dist/interfaces/ps-capture-labels.d.ts +6 -0
- package/dist/interfaces/ps-capture-labels.js +1 -0
- package/dist/interfaces/ps-capture-menu-options.d.ts +6 -0
- package/dist/interfaces/ps-capture-menu-options.js +1 -0
- package/dist/interfaces/ps-capture-modules.d.ts +6 -0
- package/dist/interfaces/ps-capture-modules.js +1 -0
- package/dist/interfaces/ps-capture-options.d.ts +6 -0
- package/dist/interfaces/ps-capture-options.js +1 -0
- package/dist/interfaces/ps-cartesian-chart-series.d.ts +2 -0
- package/dist/interfaces/ps-date-dialog-colors.d.ts +19 -0
- package/dist/interfaces/ps-date-dialog-colors.js +1 -0
- package/dist/interfaces/ps-device-file.d.ts +5 -0
- package/dist/interfaces/ps-device-file.js +1 -0
- package/dist/interfaces/ps-document-file-system.d.ts +2 -0
- package/dist/interfaces/ps-document-file-system.js +1 -0
- package/dist/interfaces/ps-document-labels.d.ts +1 -0
- package/dist/interfaces/ps-document-page-image.d.ts +5 -0
- package/dist/interfaces/ps-document-page-image.js +1 -0
- package/dist/interfaces/ps-document-pdf-native.d.ts +9 -0
- package/dist/interfaces/ps-document-pdf-native.js +1 -0
- package/dist/interfaces/ps-document-pdf-options.d.ts +4 -0
- package/dist/interfaces/ps-document-pdf-options.js +1 -0
- package/dist/interfaces/ps-document-pdf-state.d.ts +6 -0
- package/dist/interfaces/ps-document-pdf-state.js +1 -0
- package/dist/interfaces/ps-document-viewer-entry.d.ts +8 -0
- package/dist/interfaces/ps-document-viewer-entry.js +1 -0
- package/dist/interfaces/ps-file-upload-options.d.ts +8 -0
- package/dist/interfaces/ps-file-upload-options.js +1 -0
- package/dist/interfaces/ps-material-scheme.d.ts +38 -0
- package/dist/interfaces/ps-material-scheme.js +1 -0
- package/dist/interfaces/ps-material-segmented-colors.d.ts +14 -0
- package/dist/interfaces/ps-material-segmented-colors.js +1 -0
- package/dist/interfaces/ps-material-switch-colors.d.ts +14 -0
- package/dist/interfaces/ps-material-switch-colors.js +1 -0
- package/dist/interfaces/ps-menu-anchor.d.ts +6 -0
- package/dist/interfaces/ps-menu-anchor.js +1 -0
- package/dist/interfaces/ps-menu-item.d.ts +1 -0
- package/dist/interfaces/ps-menu-popup-layout.d.ts +6 -0
- package/dist/interfaces/ps-menu-popup-layout.js +1 -0
- package/dist/interfaces/ps-menu-popup-window.d.ts +4 -0
- package/dist/interfaces/ps-menu-popup-window.js +1 -0
- package/dist/interfaces/ps-mobile-theme-input.d.ts +2 -0
- package/dist/interfaces/ps-quick-action-native.d.ts +14 -0
- package/dist/interfaces/ps-quick-action-native.js +1 -0
- package/dist/interfaces/ps-quick-action.d.ts +7 -0
- package/dist/interfaces/ps-quick-action.js +1 -0
- package/dist/interfaces/ps-scanned-file.d.ts +2 -5
- package/dist/interfaces/ps-stack-screen-options.d.ts +2 -0
- package/dist/interfaces/ps-stack-screen-options.js +1 -0
- package/dist/interfaces/ps-switcher-item.d.ts +11 -0
- package/dist/interfaces/ps-switcher-item.js +1 -0
- package/dist/interfaces/ps-tab-bar-context-data.d.ts +1 -0
- package/dist/interfaces/ps-tab-bar-icon-colors.d.ts +4 -0
- package/dist/interfaces/ps-tab-bar-icon-colors.js +1 -0
- package/dist/interfaces/ps-tab-bar-label-style.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-label-style.js +1 -0
- package/dist/interfaces/ps-tab-bar-label-styles.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-label-styles.js +1 -0
- package/dist/interfaces/ps-tab-bar-style.d.ts +12 -0
- package/dist/interfaces/ps-tab-bar-style.js +1 -0
- package/dist/interfaces/ps-waterfall-datum.d.ts +6 -0
- package/dist/interfaces/ps-waterfall-datum.js +1 -0
- package/dist/interfaces/ps-waterfall-step.d.ts +7 -0
- package/dist/interfaces/ps-waterfall-step.js +1 -0
- package/dist/interfaces/use-ps-barcode-scanner-result.d.ts +6 -0
- package/dist/interfaces/use-ps-barcode-scanner-result.js +1 -0
- package/dist/interfaces/use-ps-document-open-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-open-result.js +1 -0
- package/dist/interfaces/use-ps-document-pdf-cover-result.d.ts +7 -0
- package/dist/interfaces/use-ps-document-pdf-cover-result.js +1 -0
- package/dist/interfaces/use-ps-document-pdf-pages-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-pdf-pages-result.js +1 -0
- package/dist/interfaces/use-ps-document-text-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-text-result.js +1 -0
- package/dist/interfaces/use-ps-file-upload-result.d.ts +8 -0
- package/dist/interfaces/use-ps-file-upload-result.js +1 -0
- package/dist/interfaces/use-ps-quick-actions-options.d.ts +5 -0
- package/dist/interfaces/use-ps-quick-actions-options.js +1 -0
- package/dist/services/ps-barcode-scanner-service.d.ts +14 -0
- package/dist/services/ps-barcode-scanner-service.js +53 -0
- package/dist/services/ps-button-style-service.d.ts +2 -0
- package/dist/services/ps-button-style-service.js +13 -1
- package/dist/services/ps-capture-picker-service.d.ts +11 -0
- package/dist/services/ps-capture-picker-service.js +67 -0
- package/dist/services/ps-capture-source-service.d.ts +10 -0
- package/dist/services/ps-capture-source-service.js +31 -0
- package/dist/services/ps-chart-brand-service.d.ts +4 -0
- package/dist/services/ps-chart-brand-service.js +20 -0
- package/dist/services/ps-chart-shape-service.d.ts +7 -0
- package/dist/services/ps-chart-shape-service.js +17 -0
- package/dist/services/ps-control-style-service.js +3 -2
- package/dist/services/ps-date-picker-service.d.ts +3 -0
- package/dist/services/ps-date-picker-service.js +21 -0
- package/dist/services/ps-device-file-service.d.ts +14 -0
- package/dist/services/ps-device-file-service.js +27 -0
- package/dist/services/ps-document-file-service.d.ts +10 -0
- package/dist/services/ps-document-file-service.js +75 -0
- package/dist/services/ps-document-open-service.d.ts +5 -0
- package/dist/services/ps-document-open-service.js +16 -0
- package/dist/services/ps-document-pdf-service.d.ts +10 -0
- package/dist/services/ps-document-pdf-service.js +40 -0
- package/dist/services/ps-document-text-service.d.ts +5 -0
- package/dist/services/ps-document-text-service.js +14 -0
- package/dist/services/ps-document-viewer-entry-service.d.ts +11 -0
- package/dist/services/ps-document-viewer-entry-service.js +72 -0
- package/dist/services/ps-list-row-style-service.js +2 -5
- package/dist/services/ps-material-control-service.d.ts +9 -0
- package/dist/services/ps-material-control-service.js +46 -0
- package/dist/services/ps-material-scheme-service.d.ts +5 -0
- package/dist/services/ps-material-scheme-service.js +42 -0
- package/dist/services/ps-menu-popup-service.d.ts +6 -0
- package/dist/services/ps-menu-popup-service.js +23 -0
- package/dist/services/ps-mobile-theme-service.d.ts +1 -1
- package/dist/services/ps-mobile-theme-service.js +7 -2
- package/dist/services/ps-navigation-theme-service.d.ts +5 -0
- package/dist/services/ps-navigation-theme-service.js +21 -0
- package/dist/services/ps-pdf-native-service.d.ts +8 -0
- package/dist/services/ps-pdf-native-service.js +33 -0
- package/dist/services/ps-quick-action-service.d.ts +9 -0
- package/dist/services/ps-quick-action-service.js +31 -0
- package/dist/services/ps-ripple-service.d.ts +7 -0
- package/dist/services/ps-ripple-service.js +26 -0
- package/dist/services/ps-screen-service.d.ts +3 -1
- package/dist/services/ps-screen-service.js +8 -2
- package/dist/services/ps-sheet-service.d.ts +1 -0
- package/dist/services/ps-sheet-service.js +3 -0
- package/dist/services/ps-stack-options-service.d.ts +5 -0
- package/dist/services/ps-stack-options-service.js +18 -0
- package/dist/services/ps-state-service.d.ts +7 -0
- package/dist/services/ps-state-service.js +26 -0
- package/dist/services/ps-switcher-service.d.ts +6 -0
- package/dist/services/ps-switcher-service.js +15 -0
- package/dist/services/ps-tab-bar-style-service.d.ts +5 -0
- package/dist/services/ps-tab-bar-style-service.js +30 -0
- package/dist/services/ps-waterfall-service.d.ts +10 -0
- package/dist/services/ps-waterfall-service.js +38 -0
- package/jest-setup.js +86 -3
- package/package.json +36 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Image, View } from 'react-native';
|
|
3
|
+
import { PsDocumentConfig } from '../../constants/ps-document-config';
|
|
4
|
+
import { PsDocumentKind } from '../../constants/ps-document-kind';
|
|
5
|
+
import { usePsDocumentText } from '../../hooks/use-ps-document-text';
|
|
6
|
+
import { PsDocumentPdfCover } from '../ps-document-pdf-cover/ps-document-pdf-cover';
|
|
7
|
+
import { PsDocumentUnsupported } from '../ps-document-unsupported/ps-document-unsupported';
|
|
8
|
+
import { PsText } from '../ps-text/ps-text';
|
|
9
|
+
export const PsDocumentPreviewFace = ({ item, labels }) => {
|
|
10
|
+
const loaded = usePsDocumentText(item);
|
|
11
|
+
if (item.kind === PsDocumentKind.Image && item.source !== null)
|
|
12
|
+
return (_jsx(Image, { accessibilityLabel: item.name, resizeMode: 'contain', source: { headers: item.source.headers, uri: item.source.uri }, style: { flex: 1 } }));
|
|
13
|
+
if (item.kind === PsDocumentKind.Pdf && item.source !== null)
|
|
14
|
+
return _jsx(PsDocumentPdfCover, { item: item, labels: labels });
|
|
15
|
+
if (item.kind === PsDocumentKind.Text && loaded.text !== null)
|
|
16
|
+
return (_jsx(View, { style: { flex: 1, padding: PsDocumentConfig.previewPadding }, children: _jsx(PsText, { numberOfLines: PsDocumentConfig.previewTextLines, children: loaded.text }) }));
|
|
17
|
+
return _jsx(PsDocumentUnsupported, { item: item, labels: labels });
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PsIconKey } from '@pallasoft/ps-icons';
|
|
3
|
+
import { ScrollView, View } from 'react-native';
|
|
4
|
+
import { PsDocumentConfig } from '../../constants/ps-document-config';
|
|
5
|
+
import { PsDocumentLoadStatus } from '../../constants/ps-document-load-status';
|
|
6
|
+
import { usePsDocumentText } from '../../hooks/use-ps-document-text';
|
|
7
|
+
import { PsDocumentMessage } from '../ps-document-message/ps-document-message';
|
|
8
|
+
import { PsDocumentUnsupported } from '../ps-document-unsupported/ps-document-unsupported';
|
|
9
|
+
import { PsSpinner } from '../ps-spinner/ps-spinner';
|
|
10
|
+
import { PsText } from '../ps-text/ps-text';
|
|
11
|
+
export const PsDocumentTextPage = ({ item, labels }) => {
|
|
12
|
+
const loaded = usePsDocumentText(item);
|
|
13
|
+
if (loaded.status === PsDocumentLoadStatus.Loading)
|
|
14
|
+
return (_jsx(View, { style: { alignItems: 'center', flex: 1, justifyContent: 'center' }, children: _jsx(PsSpinner, {}) }));
|
|
15
|
+
if (loaded.text === null)
|
|
16
|
+
return item.source === null ? (_jsx(PsDocumentUnsupported, { isOnDark: true, item: item, labels: labels })) : (_jsx(PsDocumentMessage, { description: item.name, iconKey: PsIconKey.Warning, isOnDark: true, title: labels.loadFailed }));
|
|
17
|
+
return (_jsx(View, { style: { flex: 1 }, testID: 'ps-document-text-page', children: _jsx(ScrollView, { contentContainerStyle: { padding: PsDocumentConfig.pageGutter }, showsVerticalScrollIndicator: true, children: _jsx(PsText, { isSelectable: true, tone: 'white', children: loaded.text }) }) }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PsDocumentItem } from '../../interfaces/ps-document-item';
|
|
2
|
+
import type { PsDocumentLabels } from '../../interfaces/ps-document-labels';
|
|
3
|
+
export interface PsDocumentUnsupportedProps {
|
|
4
|
+
isOnDark?: boolean;
|
|
5
|
+
item: PsDocumentItem;
|
|
6
|
+
labels: PsDocumentLabels;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PsIconKey } from '@pallasoft/ps-icons';
|
|
3
|
+
import { usePsDocumentOpen } from '../../hooks/use-ps-document-open';
|
|
4
|
+
import { PsDocumentOpenService } from '../../services/ps-document-open-service';
|
|
5
|
+
import { PsDocumentMessage } from '../ps-document-message/ps-document-message';
|
|
6
|
+
export const PsDocumentUnsupported = ({ isOnDark = false, item, labels, }) => {
|
|
7
|
+
const opener = usePsDocumentOpen(item);
|
|
8
|
+
const canOpen = labels.open !== undefined && PsDocumentOpenService.canOpen(item);
|
|
9
|
+
return (_jsx(PsDocumentMessage, { actionLabel: canOpen && !opener.isOpening ? labels.open : undefined, description: item.name, iconKey: opener.hasFailed ? PsIconKey.Warning : PsIconKey.Doc, isOnDark: isOnDark, onAction: canOpen ? () => void opener.open() : undefined, title: opener.hasFailed ? labels.loadFailed : labels.unsupported }));
|
|
10
|
+
};
|
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { PsIconKey } from '@pallasoft/ps-icons';
|
|
4
4
|
import { FlatList, Modal, StatusBar, View } from 'react-native';
|
|
5
5
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
7
|
import { PsDocumentConfig } from '../../constants/ps-document-config';
|
|
8
8
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
9
|
+
import { usePsDocumentPdfPages } from '../../hooks/use-ps-document-pdf-pages';
|
|
9
10
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
10
11
|
import { PsDocumentPagerService } from '../../services/ps-document-pager-service';
|
|
12
|
+
import { PsDocumentViewerEntryService } from '../../services/ps-document-viewer-entry-service';
|
|
13
|
+
import { PsDocumentPageStrip } from '../ps-document-page-strip/ps-document-page-strip';
|
|
11
14
|
import { PsDocumentPage } from '../ps-document-page/ps-document-page';
|
|
12
15
|
import { PsIconButton } from '../ps-icon-button/ps-icon-button';
|
|
13
16
|
import { PsText } from '../ps-text/ps-text';
|
|
14
17
|
export const PsDocumentViewer = ({ initialIndex = 0, isOpen, items, labels, onClose, }) => {
|
|
15
18
|
const theme = usePsMobileTheme();
|
|
16
19
|
const insets = useSafeAreaInsets();
|
|
20
|
+
const list = useRef(null);
|
|
17
21
|
const [width, setWidth] = useState(0);
|
|
18
22
|
const [isZoomed, setIsZoomed] = useState(false);
|
|
19
|
-
const [
|
|
20
|
-
const
|
|
23
|
+
const [currentEntry, setCurrentEntry] = useState(null);
|
|
24
|
+
const pdf = usePsDocumentPdfPages(items, isOpen);
|
|
25
|
+
const entries = PsDocumentViewerEntryService.entries(items, pdf.states);
|
|
26
|
+
const index = currentEntry === null
|
|
27
|
+
? PsDocumentViewerEntryService.startIndex(items, entries, initialIndex)
|
|
28
|
+
: PsDocumentViewerEntryService.resolveIndex(currentEntry, entries, 0);
|
|
29
|
+
const current = entries[index];
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (width > 0 && entries.length > 0)
|
|
32
|
+
list.current?.scrollToIndex({ animated: false, index });
|
|
33
|
+
}, [entries.length, index, width]);
|
|
21
34
|
return (_jsxs(Modal, { animationType: 'fade', onRequestClose: onClose, presentationStyle: 'fullScreen', visible: isOpen, children: [_jsx(StatusBar, { barStyle: 'light-content' }), _jsxs(GestureHandlerRootView, { style: {
|
|
22
35
|
backgroundColor: PsDocumentConfig.backdropColor,
|
|
23
36
|
flex: 1,
|
|
@@ -28,12 +41,19 @@ export const PsDocumentViewer = ({ initialIndex = 0, isOpen, items, labels, onCl
|
|
|
28
41
|
flexDirection: 'row',
|
|
29
42
|
paddingHorizontal: PsDocumentConfig.barPaddingHorizontal,
|
|
30
43
|
paddingVertical: PsDocumentConfig.barPaddingVertical,
|
|
31
|
-
}, children: [_jsx(PsIconButton, { color: theme.white, iconKey: PsIconKey.Close, label: labels.close, onPress: onClose }), _jsxs(View, { style: { alignItems: 'center', flex: 1 }, children: [PsDocumentPagerService.hasMany(
|
|
44
|
+
}, children: [_jsx(PsIconButton, { color: theme.white, iconKey: PsIconKey.Close, label: labels.close, onPress: onClose }), _jsxs(View, { style: { alignItems: 'center', flex: 1 }, children: [PsDocumentPagerService.hasMany(entries.length) ? (_jsx(PsText, { tone: 'white', weight: 'semibold', children: PsDocumentPagerService.counter(index, entries.length) })) : null, current === undefined ? null : (_jsx(PsText, { numberOfLines: 1, tone: 'white', variant: 'caption', children: current.item.name }))] }), _jsx(View, { style: { width: PsMobileControlConfig.controlHeights.default } })] }), _jsx(View, { onLayout: (event) => setWidth(event.nativeEvent.layout.width), style: { flex: 1 }, testID: 'ps-document-viewer-pager', children: width === 0 ? null : (_jsx(FlatList, { data: entries, getItemLayout: (_data, position) => ({
|
|
32
45
|
index: position,
|
|
33
46
|
length: width,
|
|
34
47
|
offset: PsDocumentPagerService.offset(position, width),
|
|
35
|
-
}), horizontal: true, initialScrollIndex: index, keyExtractor: (
|
|
36
|
-
|
|
48
|
+
}), horizontal: true, initialScrollIndex: index, keyExtractor: (entry) => entry.id, onMomentumScrollEnd: (event) => {
|
|
49
|
+
const next = entries[PsDocumentPagerService.pageIndex(event.nativeEvent.contentOffset.x, width, entries.length)];
|
|
50
|
+
if (next !== undefined)
|
|
51
|
+
setCurrentEntry(next);
|
|
37
52
|
setIsZoomed(false);
|
|
38
|
-
}, pagingEnabled: true, renderItem: ({ item }) => (_jsx(View, { style: { width }, children: _jsx(PsDocumentPage, { item: item, labels: labels, onDismiss: onClose, onZoomChange: setIsZoomed }) })), scrollEnabled: !isZoomed, showsHorizontalScrollIndicator: false, testID: 'ps-document-viewer-list' })) })
|
|
53
|
+
}, pagingEnabled: true, ref: list, renderItem: ({ item: entry }) => (_jsx(View, { style: { width }, children: _jsx(PsDocumentPage, { item: entry.item, labels: labels, onDismiss: onClose, onRetry: pdf.retry, onZoomChange: setIsZoomed, status: entry.status }) })), scrollEnabled: !isZoomed, showsHorizontalScrollIndicator: false, testID: 'ps-document-viewer-list' })) }), PsDocumentViewerEntryService.hasStrip(items, entries) ? (_jsx(PsDocumentPageStrip, { entries: entries, index: index, onSelect: (position) => {
|
|
54
|
+
const entry = entries[position];
|
|
55
|
+
if (entry !== undefined)
|
|
56
|
+
setCurrentEntry(entry);
|
|
57
|
+
setIsZoomed(false);
|
|
58
|
+
} })) : null] })] }));
|
|
39
59
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { usePsHeaderRight } from '../../hooks/use-ps-header-right';
|
|
3
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
4
|
+
import { PsIconButton } from '../ps-icon-button/ps-icon-button';
|
|
5
|
+
export const PsHeaderAction = ({ iconKey, label, onPress }) => {
|
|
6
|
+
const theme = usePsMobileTheme();
|
|
7
|
+
usePsHeaderRight(_jsx(PsIconButton, { backgroundColor: 'transparent', color: theme.ink, iconKey: iconKey, label: label, onPress: onPress, variant: 'header' }));
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from 'expo-router';
|
|
3
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
4
|
+
import { PsActionMenuService } from '../../services/ps-action-menu-service';
|
|
5
|
+
export const PsHeaderAction = ({ iconKey, label, onPress }) => {
|
|
6
|
+
const haptic = usePsHaptics();
|
|
7
|
+
return (_jsx(Stack.Toolbar, { placement: 'right', children: _jsx(Stack.Toolbar.Button, { accessibilityLabel: label, icon: PsActionMenuService.symbol({ iconKey, id: label, label, onSelect: onPress }), onPress: () => {
|
|
8
|
+
haptic('light');
|
|
9
|
+
onPress();
|
|
10
|
+
} }) }));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PsMobileIconKey } from '../../constants/ps-mobile-icon-key';
|
|
3
|
+
import { usePsHeaderRight } from '../../hooks/use-ps-header-right';
|
|
4
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
5
|
+
import { PsActionMenu } from '../ps-action-menu/ps-action-menu';
|
|
6
|
+
import { PsIconButton } from '../ps-icon-button/ps-icon-button';
|
|
7
|
+
export const PsHeaderMenu = ({ iconKey = PsMobileIconKey.More, items, label, }) => {
|
|
8
|
+
const theme = usePsMobileTheme();
|
|
9
|
+
usePsHeaderRight(items.length === 0 ? null : (_jsx(PsActionMenu, { items: items, label: label, children: ({ open }) => (_jsx(PsIconButton, { backgroundColor: 'transparent', color: theme.ink, iconKey: iconKey, label: label, onPress: open, variant: 'header' })) })));
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from 'expo-router';
|
|
3
|
+
import { PsMobileIconKey } from '../../constants/ps-mobile-icon-key';
|
|
4
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
5
|
+
import { PsActionMenuService } from '../../services/ps-action-menu-service';
|
|
6
|
+
export const PsHeaderMenu = ({ iconKey = PsMobileIconKey.More, items, label, }) => {
|
|
7
|
+
const haptic = usePsHaptics();
|
|
8
|
+
const entries = PsActionMenuService.consistent([{ id: 'items', items }])[0];
|
|
9
|
+
if (entries === undefined)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsx(Stack.Toolbar, { placement: 'right', children: _jsx(Stack.Toolbar.Menu, { accessibilityLabel: label, icon: PsActionMenuService.symbol({
|
|
12
|
+
iconKey,
|
|
13
|
+
id: 'more',
|
|
14
|
+
label,
|
|
15
|
+
onSelect: () => undefined,
|
|
16
|
+
}), children: entries.items.map((item) => (_jsx(Stack.Toolbar.MenuAction, { destructive: item.isDanger === true, disabled: item.isDisabled === true, icon: PsActionMenuService.symbol(item), onPress: () => {
|
|
17
|
+
haptic('selection');
|
|
18
|
+
item.onSelect();
|
|
19
|
+
}, children: item.label }, item.id))) }) }));
|
|
20
|
+
};
|
|
@@ -4,10 +4,12 @@ import { Pressable } from 'react-native';
|
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
5
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
6
6
|
import { PsPageHeaderConfig } from '../../constants/ps-page-header-config';
|
|
7
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
7
8
|
import { PsPageHeaderContext } from '../../contexts/ps-page-header-context';
|
|
8
9
|
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
9
10
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
10
|
-
import {
|
|
11
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
12
|
+
import { PsStateService } from '../../services/ps-state-service';
|
|
11
13
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
12
14
|
export const PsIconButton = ({ backgroundColor, color, iconKey, isDisabled = false, label, onPress, size = 'default', testID, variant, }) => {
|
|
13
15
|
const haptic = usePsHaptics();
|
|
@@ -17,7 +19,7 @@ export const PsIconButton = ({ backgroundColor, color, iconKey, isDisabled = fal
|
|
|
17
19
|
const dimension = isHeader
|
|
18
20
|
? PsPageHeaderConfig.buttonSize
|
|
19
21
|
: PsMobileControlConfig.controlHeights[size];
|
|
20
|
-
return (_jsx(Pressable, { accessibilityLabel: label, accessibilityRole: 'button', accessibilityState: { disabled: isDisabled }, disabled: isDisabled, hitSlop: PsLayoutConfig.hitSlop, onPress: onPress === undefined
|
|
22
|
+
return (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Borderless), accessibilityLabel: label, accessibilityRole: 'button', accessibilityState: { disabled: isDisabled }, disabled: isDisabled, hitSlop: PsLayoutConfig.hitSlop, onPress: onPress === undefined
|
|
21
23
|
? undefined
|
|
22
24
|
: () => {
|
|
23
25
|
haptic('light');
|
|
@@ -27,16 +29,14 @@ export const PsIconButton = ({ backgroundColor, color, iconKey, isDisabled = fal
|
|
|
27
29
|
backgroundColor: backgroundColor !== undefined
|
|
28
30
|
? backgroundColor
|
|
29
31
|
: isHeader
|
|
30
|
-
?
|
|
31
|
-
? PsMobileControlConfig.neutralAlpha + PsMobileControlConfig.pressedAlpha
|
|
32
|
-
: PsMobileControlConfig.neutralAlpha)
|
|
32
|
+
? PsStateService.headerFill(theme, pressed)
|
|
33
33
|
: pressed
|
|
34
|
-
?
|
|
34
|
+
? PsStateService.pressedFill(theme, 'transparent')
|
|
35
35
|
: 'transparent',
|
|
36
36
|
borderRadius: isHeader ? dimension / 2 : PsMobileControlConfig.controlRadius,
|
|
37
37
|
height: dimension,
|
|
38
38
|
justifyContent: 'center',
|
|
39
|
-
opacity: isDisabled ?
|
|
39
|
+
opacity: isDisabled ? PsStateService.disabledOpacity() : 1,
|
|
40
40
|
width: dimension,
|
|
41
41
|
}), children: _jsx(PsIcon, { color: color === undefined ? theme.ink : color, iconKey: iconKey, size: isHeader ? PsPageHeaderConfig.iconSize : undefined }) }));
|
|
42
42
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { View } from 'react-native';
|
|
3
2
|
import { PsChartConfig } from '../../constants/ps-chart-config';
|
|
4
3
|
import { PsChartSkeletonVariant } from '../../constants/ps-chart-skeleton-variant';
|
|
5
4
|
import { PsChartFrame } from '../ps-chart-frame/ps-chart-frame';
|
|
@@ -8,5 +7,5 @@ import { PsSparkline } from '../ps-sparkline/ps-sparkline';
|
|
|
8
7
|
export const PsKpiCard = ({ delta, isLoading = false, period, title, value, values, }) => {
|
|
9
8
|
if (isLoading)
|
|
10
9
|
return (_jsx(PsChartFrame, { children: _jsx(PsChartSkeleton, { height: PsChartConfig.sparklineHeight * 2, variant: PsChartSkeletonVariant.Line }) }));
|
|
11
|
-
return (_jsx(PsChartFrame, { delta: delta, period: period, title: title, value: value, children: values === undefined ?
|
|
10
|
+
return (_jsx(PsChartFrame, { delta: delta, period: period, title: title, value: value, children: values === undefined ? null : _jsx(PsSparkline, { values: values }) }));
|
|
12
11
|
};
|
|
@@ -2,23 +2,23 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Pressable } from 'react-native';
|
|
3
3
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
4
4
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
5
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
5
6
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
6
|
-
import {
|
|
7
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
8
|
+
import { PsStateService } from '../../services/ps-state-service';
|
|
7
9
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
8
10
|
import { PsText } from '../ps-text/ps-text';
|
|
9
11
|
export const PsListActionRow = ({ children, iconKey, isDisabled = false, onPress, tone = 'primary', }) => {
|
|
10
12
|
const theme = usePsMobileTheme();
|
|
11
13
|
const isDestructive = tone === 'destructive';
|
|
12
14
|
const color = isDestructive ? theme.danger : theme.ink;
|
|
13
|
-
return (_jsxs(Pressable, { accessibilityRole: 'button', accessibilityState: { disabled: isDisabled }, disabled: isDisabled, onPress: onPress, style: ({ pressed }) => ({
|
|
15
|
+
return (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, isDestructive ? PsRippleKind.Danger : PsRippleKind.Surface), accessibilityRole: 'button', accessibilityState: { disabled: isDisabled }, disabled: isDisabled, onPress: onPress, style: ({ pressed }) => ({
|
|
14
16
|
alignItems: 'center',
|
|
15
|
-
backgroundColor: pressed
|
|
16
|
-
? PsMobileColorService.withAlpha(theme.ink, PsMobileControlConfig.pressedAlpha)
|
|
17
|
-
: theme.surface,
|
|
17
|
+
backgroundColor: pressed ? PsStateService.pressedFill(theme, theme.surface) : theme.surface,
|
|
18
18
|
flexDirection: 'row',
|
|
19
19
|
gap: PsMobileControlConfig.rowSpacing,
|
|
20
20
|
minHeight: PsLayoutConfig.rowMinHeight,
|
|
21
|
-
opacity: isDisabled ?
|
|
21
|
+
opacity: isDisabled ? PsStateService.disabledOpacity() : 1,
|
|
22
22
|
paddingHorizontal: PsLayoutConfig.gutter,
|
|
23
23
|
}), testID: 'ps-list-action-row', children: [iconKey === undefined ? null : _jsx(PsIcon, { color: color, iconKey: iconKey }), _jsx(PsText, { style: { color }, weight: 'semibold', children: children })] }));
|
|
24
24
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRouter } from 'expo-router';
|
|
3
|
+
import { PsListRowMenu } from './ps-list-row-menu';
|
|
4
|
+
export const PsListLinkMenu = ({ children, href, items, title }) => {
|
|
5
|
+
const router = useRouter();
|
|
6
|
+
return (_jsx(PsListRowMenu, { items: items, onPress: () => router.push(href), title: title, children: children }));
|
|
7
|
+
};
|
|
@@ -3,9 +3,11 @@ import { PsIconKey } from '@pallasoft/ps-icons';
|
|
|
3
3
|
import { Pressable, View } from 'react-native';
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
5
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
6
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
6
7
|
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
7
8
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
8
|
-
import {
|
|
9
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
10
|
+
import { PsStateService } from '../../services/ps-state-service';
|
|
9
11
|
import { PsCountBadge } from '../ps-count-badge/ps-count-badge';
|
|
10
12
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
11
13
|
import { PsText } from '../ps-text/ps-text';
|
|
@@ -16,14 +18,12 @@ export const PsListLinkRow = ({ count, countLabel, iconKey, isAlert = false, isL
|
|
|
16
18
|
if (isLoading)
|
|
17
19
|
return _jsx(PsListLinkRowSkeleton, {});
|
|
18
20
|
const hasCount = count !== undefined && count > 0;
|
|
19
|
-
return (_jsxs(Pressable, { accessibilityHint: countLabel, accessibilityRole: 'button', onPress: () => {
|
|
21
|
+
return (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityHint: countLabel, accessibilityRole: 'button', onPress: () => {
|
|
20
22
|
haptic('light');
|
|
21
23
|
onPress();
|
|
22
24
|
}, style: ({ pressed }) => ({
|
|
23
25
|
alignItems: 'center',
|
|
24
|
-
backgroundColor: pressed
|
|
25
|
-
? PsMobileColorService.withAlpha(theme.ink, PsMobileControlConfig.pressedAlpha)
|
|
26
|
-
: theme.surface,
|
|
26
|
+
backgroundColor: pressed ? PsStateService.pressedFill(theme, theme.surface) : theme.surface,
|
|
27
27
|
flexDirection: 'row',
|
|
28
28
|
gap: PsLayoutConfig.headerSlotGap,
|
|
29
29
|
minHeight: PsLayoutConfig.linkRowMinHeight,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PsListRowProps } from './ps-list-props';
|
|
2
|
-
export interface PsListRowBodyProps extends Pick<PsListRowProps, 'badge' | 'hasChevron' | 'isSelectable' | 'isSelected' | 'leadingIcon' | 'onPress' | 'subtitle' | 'title' | 'value'> {
|
|
2
|
+
export interface PsListRowBodyProps extends Pick<PsListRowProps, 'badge' | 'hasChevron' | 'isSelectable' | 'isSelected' | 'isValueStacked' | 'leadingIcon' | 'onPress' | 'subtitle' | 'title' | 'value'> {
|
|
3
3
|
hasMenu: boolean;
|
|
4
4
|
onLongPress: () => void;
|
|
5
5
|
}
|
|
6
|
-
export declare const PsListRowBody: ({ badge, hasChevron, hasMenu, isSelectable, isSelected, leadingIcon, onLongPress, onPress, subtitle, title, value, }: PsListRowBodyProps) => import("react").JSX.Element;
|
|
6
|
+
export declare const PsListRowBody: ({ badge, hasChevron, hasMenu, isSelectable, isSelected, isValueStacked, leadingIcon, onLongPress, onPress, subtitle, title, value, }: PsListRowBodyProps) => import("react").JSX.Element;
|
|
@@ -3,17 +3,20 @@ import { PsIconKey } from '@pallasoft/ps-icons';
|
|
|
3
3
|
import { Pressable, View } from 'react-native';
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
5
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
6
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
6
7
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
7
8
|
import { PsListRowStyleService } from '../../services/ps-list-row-style-service';
|
|
9
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
8
10
|
import { PsBadge } from '../ps-badge/ps-badge';
|
|
9
11
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
10
12
|
import { PsText } from '../ps-text/ps-text';
|
|
11
13
|
import { PsListRowSelectMark } from './ps-list-row-select-mark';
|
|
12
|
-
export const PsListRowBody = ({ badge, hasChevron = false, hasMenu, isSelectable = false, isSelected = false, leadingIcon, onLongPress, onPress, subtitle, title, value, }) => {
|
|
14
|
+
export const PsListRowBody = ({ badge, hasChevron = false, hasMenu, isSelectable = false, isSelected = false, isValueStacked = false, leadingIcon, onLongPress, onPress, subtitle, title, value, }) => {
|
|
13
15
|
const theme = usePsMobileTheme();
|
|
14
16
|
const isInteractive = onPress !== undefined || hasMenu;
|
|
15
17
|
const hasSecondLine = subtitle !== undefined || badge !== undefined;
|
|
16
|
-
|
|
18
|
+
const isStacked = isValueStacked && value !== undefined;
|
|
19
|
+
return (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: onPress === undefined ? undefined : 'button', accessibilityState: isSelectable ? { selected: isSelected } : undefined, delayLongPress: PsLayoutConfig.longPressDelayMs, disabled: !isInteractive, onLongPress: hasMenu ? onLongPress : undefined, onPress: onPress, style: ({ pressed }) => ({
|
|
17
20
|
alignItems: 'center',
|
|
18
21
|
backgroundColor: PsListRowStyleService.background(isSelectable && isSelected, pressed, theme),
|
|
19
22
|
flexDirection: 'row',
|
|
@@ -34,11 +37,11 @@ export const PsListRowBody = ({ badge, hasChevron = false, hasMenu, isSelectable
|
|
|
34
37
|
alignItems: 'center',
|
|
35
38
|
flexDirection: 'row',
|
|
36
39
|
gap: PsLayoutConfig.headerSlotGap,
|
|
37
|
-
}, children: [_jsx(PsText, { numberOfLines: 1, style: { flex: 1, flexShrink: 1 }, weight: 'semibold', children: title }), value === undefined ? null : (_jsx(PsText, { ellipsizeMode: 'middle', numberOfLines: 1, style: {
|
|
40
|
+
}, children: [_jsx(PsText, { numberOfLines: 1, style: { flex: 1, flexShrink: 1 }, tone: isStacked ? 'muted' : 'ink', variant: isStacked ? 'small' : undefined, weight: 'semibold', children: title }), value === undefined || isStacked ? null : (_jsx(PsText, { ellipsizeMode: 'middle', numberOfLines: 1, style: {
|
|
38
41
|
flexShrink: 1,
|
|
39
42
|
maxWidth: PsLayoutConfig.rowValueMaxWidth,
|
|
40
43
|
textAlign: 'right',
|
|
41
|
-
}, variant: 'numeric', children: value }))] }), hasSecondLine ? (_jsxs(View, { style: {
|
|
44
|
+
}, variant: 'numeric', children: value }))] }), isStacked ? _jsx(PsText, { children: value }) : null, hasSecondLine ? (_jsxs(View, { style: {
|
|
42
45
|
alignItems: 'center',
|
|
43
46
|
flexDirection: 'row',
|
|
44
47
|
gap: PsLayoutConfig.headerSlotGap,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { PsMenuItem } from '../../interfaces/ps-menu-item';
|
|
3
|
+
import type { PsListRowBodyProps } from './ps-list-row-body';
|
|
4
|
+
export interface PsListRowMenuProps {
|
|
5
|
+
children: ReactElement<PsListRowBodyProps>;
|
|
6
|
+
items: PsMenuItem[];
|
|
7
|
+
onPress?: () => void;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const PsListRowMenu: ({ children, items, onPress, title }: PsListRowMenuProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cloneElement } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
5
|
+
import { usePsMenuAnchor } from '../../hooks/use-ps-menu-anchor';
|
|
6
|
+
import { PsActionMenuService } from '../../services/ps-action-menu-service';
|
|
7
|
+
import { PsMenuPopup } from '../ps-menu-popup/ps-menu-popup';
|
|
8
|
+
import { PsMenuPopupHeader } from '../ps-menu-popup/ps-menu-popup-header';
|
|
9
|
+
import { PsMenuPopupRow } from '../ps-menu-popup/ps-menu-popup-row';
|
|
10
|
+
export const PsListRowMenu = ({ children, items, onPress, title }) => {
|
|
11
|
+
const haptic = usePsHaptics();
|
|
12
|
+
const menu = usePsMenuAnchor();
|
|
13
|
+
const entries = PsActionMenuService.flatten(PsActionMenuService.sections(items, undefined));
|
|
14
|
+
const hasMenu = entries.length > 0;
|
|
15
|
+
return (_jsxs(View, { collapsable: false, ref: menu.ref, children: [cloneElement(children, {
|
|
16
|
+
hasMenu,
|
|
17
|
+
onLongPress: () => {
|
|
18
|
+
haptic('medium');
|
|
19
|
+
menu.open();
|
|
20
|
+
},
|
|
21
|
+
onPress: onPress === undefined ? children.props.onPress : onPress,
|
|
22
|
+
}), menu.anchor === undefined ? null : (_jsxs(PsMenuPopup, { anchor: menu.anchor, onClose: menu.close, children: [_jsx(PsMenuPopupHeader, { title: title }), entries.map((item) => (_jsx(PsMenuPopupRow, { iconKey: item.iconKey, isChecked: item.isChecked, isDanger: item.isDanger, isDisabled: item.isDisabled, label: item.label, onPress: () => {
|
|
23
|
+
menu.close();
|
|
24
|
+
haptic('selection');
|
|
25
|
+
item.onSelect();
|
|
26
|
+
} }, item.id)))] }))] }));
|
|
27
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PsListRowProps } from './ps-list-props';
|
|
2
|
-
export declare const PsListRow: ({ actions, badge, hasChevron, href, isLoading, isSection, isSelectable, isSelected, leadingIcon, leadingSwipe, onPress, preview, skeleton, subtitle, trailingSwipe, title, value, }: PsListRowProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const PsListRow: ({ actions, badge, hasChevron, href, isLoading, isSection, isSelectable, isSelected, isValueStacked, leadingIcon, leadingSwipe, onPress, preview, skeleton, subtitle, trailingSwipe, title, value, }: PsListRowProps) => import("react").JSX.Element;
|
|
@@ -6,11 +6,11 @@ import { PsListLinkMenu } from './ps-list-link-menu';
|
|
|
6
6
|
import { PsListRowBody } from './ps-list-row-body';
|
|
7
7
|
import { PsListRowSkeleton } from './ps-list-row-skeleton';
|
|
8
8
|
import { PsListSwipeRow } from './ps-list-swipe-row';
|
|
9
|
-
export const PsListRow = ({ actions, badge, hasChevron, href, isLoading = false, isSection, isSelectable, isSelected, leadingIcon, leadingSwipe, onPress, preview, skeleton, subtitle, trailingSwipe, title, value, }) => {
|
|
9
|
+
export const PsListRow = ({ actions, badge, hasChevron, href, isLoading = false, isSection, isSelectable, isSelected, isValueStacked, leadingIcon, leadingSwipe, onPress, preview, skeleton, subtitle, trailingSwipe, title, value, }) => {
|
|
10
10
|
const menuItems = PsListService.menuItems(actions, PsListService.swipes(leadingSwipe, trailingSwipe));
|
|
11
11
|
if (isLoading)
|
|
12
12
|
return (_jsx(PsListRowSkeleton, { badge: badge, isSection: isSection, leadingIcon: leadingIcon, skeleton: skeleton, subtitle: subtitle, value: value }));
|
|
13
|
-
const row = (_jsx(PsListRowBody, { badge: badge, hasChevron: hasChevron, hasMenu: false, isSelectable: isSelectable, isSelected: isSelected, leadingIcon: leadingIcon, onLongPress: () => undefined, onPress: onPress, subtitle: subtitle, title: title, value: value }));
|
|
13
|
+
const row = (_jsx(PsListRowBody, { badge: badge, hasChevron: hasChevron, hasMenu: false, isSelectable: isSelectable, isSelected: isSelected, isValueStacked: isValueStacked, leadingIcon: leadingIcon, onLongPress: () => undefined, onPress: onPress, subtitle: subtitle, title: title, value: value }));
|
|
14
14
|
const body = href !== undefined ? (_jsx(PsListLinkMenu, { href: href, items: menuItems, preview: preview, title: title, children: row })) : menuItems.length === 0 ? (row) : (_jsx(PsListContextMenu, { items: menuItems, title: title, children: row }));
|
|
15
15
|
return (_jsx(View, { accessibilityActions: menuItems.map((item) => ({ label: item.label, name: item.id })), onAccessibilityAction: (event) => menuItems.find((item) => item.id === event.nativeEvent.actionName)?.onSelect(), children: leadingSwipe === undefined && trailingSwipe === undefined ? (body) : (_jsx(PsListSwipeRow, { leading: leadingSwipe, trailing: trailingSwipe, children: body })) }));
|
|
16
16
|
};
|
|
@@ -6,6 +6,7 @@ import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config'
|
|
|
6
6
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
7
7
|
import { PsNativeMenuService } from '../../services/ps-native-menu-service';
|
|
8
8
|
import { PsSelectService } from '../../services/ps-select-service';
|
|
9
|
+
import { PsStateService } from '../../services/ps-state-service';
|
|
9
10
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
10
11
|
import { PsNativeMenu } from '../ps-native-menu/ps-native-menu';
|
|
11
12
|
import { PsText } from '../ps-text/ps-text';
|
|
@@ -20,7 +21,7 @@ export const PsListSelectRow = ({ isDisabled = false, isLoading = false, onChang
|
|
|
20
21
|
flexDirection: 'row',
|
|
21
22
|
gap: PsLayoutConfig.headerSlotGap,
|
|
22
23
|
minHeight: PsLayoutConfig.rowMinHeight,
|
|
23
|
-
opacity: isDisabled ?
|
|
24
|
+
opacity: isDisabled ? PsStateService.disabledOpacity() : 1,
|
|
24
25
|
paddingHorizontal: PsLayoutConfig.gutter,
|
|
25
26
|
paddingVertical: PsLayoutConfig.rowPaddingVertical,
|
|
26
27
|
}, testID: 'ps-list-select-row', children: [_jsxs(View, { style: { flex: 1, gap: PsLayoutConfig.rowLineGap }, children: [_jsx(PsText, { numberOfLines: 1, weight: 'semibold', children: title }), subtitle === undefined ? null : (_jsx(PsText, { tone: 'muted', variant: 'small', children: subtitle }))] }), valueAccessory, _jsx(PsText, { numberOfLines: 1, style: { maxWidth: PsLayoutConfig.rowValueMaxWidth }, tone: 'muted', children: PsSelectService.selectedLabel(options, value) }), _jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Sort, size: PsMobileControlConfig.iconSizeInline })] })) }));
|