@neural-ui/native 0.0.0-stage → 0.1.0-beta.10
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/LICENSE +21 -0
- package/README.md +186 -2
- package/dist/accordion/accordion.d.ts +11 -0
- package/dist/accordion/accordion.js +75 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/accordion/index.d.ts +1 -0
- package/dist/accordion/index.js +2 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert/alert.d.ts +27 -0
- package/dist/alert/alert.js +69 -0
- package/dist/alert/alert.js.map +1 -0
- package/dist/alert/index.d.ts +1 -0
- package/dist/alert/index.js +2 -0
- package/dist/alert/index.js.map +1 -0
- package/dist/autocomplete/autocomplete.d.ts +15 -0
- package/dist/autocomplete/autocomplete.js +117 -0
- package/dist/autocomplete/autocomplete.js.map +1 -0
- package/dist/autocomplete/index.d.ts +1 -0
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.js.map +1 -0
- package/dist/avatar/avatar.d.ts +22 -0
- package/dist/avatar/avatar.js +89 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +1 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/avatar-group/avatar-group.d.ts +29 -0
- package/dist/avatar-group/avatar-group.js +83 -0
- package/dist/avatar-group/avatar-group.js.map +1 -0
- package/dist/avatar-group/index.d.ts +1 -0
- package/dist/avatar-group/index.js +2 -0
- package/dist/avatar-group/index.js.map +1 -0
- package/dist/badge/badge.d.ts +15 -0
- package/dist/badge/badge.js +27 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/bottom-sheet/bottom-sheet.d.ts +34 -0
- package/dist/bottom-sheet/bottom-sheet.js +160 -0
- package/dist/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/bottom-sheet/index.d.ts +1 -0
- package/dist/bottom-sheet/index.js +2 -0
- package/dist/bottom-sheet/index.js.map +1 -0
- package/dist/button/button.d.ts +32 -0
- package/dist/button/button.js +114 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button-group/button-group.d.ts +25 -0
- package/dist/button-group/button-group.js +121 -0
- package/dist/button-group/button-group.js.map +1 -0
- package/dist/button-group/index.d.ts +1 -0
- package/dist/button-group/index.js +2 -0
- package/dist/button-group/index.js.map +1 -0
- package/dist/calendar/calendar.d.ts +76 -0
- package/dist/calendar/calendar.js +612 -0
- package/dist/calendar/calendar.js.map +1 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/card/card-slots.d.ts +11 -0
- package/dist/card/card-slots.js +21 -0
- package/dist/card/card-slots.js.map +1 -0
- package/dist/card/card.d.ts +10 -0
- package/dist/card/card.js +47 -0
- package/dist/card/card.js.map +1 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +3 -0
- package/dist/card/index.js.map +1 -0
- package/dist/carousel/carousel.d.ts +54 -0
- package/dist/carousel/carousel.js +238 -0
- package/dist/carousel/carousel.js.map +1 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +2 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/cascade-select/cascade-select.d.ts +25 -0
- package/dist/cascade-select/cascade-select.js +151 -0
- package/dist/cascade-select/cascade-select.js.map +1 -0
- package/dist/cascade-select/index.d.ts +1 -0
- package/dist/cascade-select/index.js +2 -0
- package/dist/cascade-select/index.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +23 -0
- package/dist/checkbox/checkbox.js +107 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/chip/chip.d.ts +24 -0
- package/dist/chip/chip.js +86 -0
- package/dist/chip/chip.js.map +1 -0
- package/dist/chip/index.d.ts +1 -0
- package/dist/chip/index.js +2 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/confirm-dialog/confirm-dialog.d.ts +21 -0
- package/dist/confirm-dialog/confirm-dialog.js +93 -0
- package/dist/confirm-dialog/confirm-dialog.js.map +1 -0
- package/dist/confirm-dialog/index.d.ts +1 -0
- package/dist/confirm-dialog/index.js +2 -0
- package/dist/confirm-dialog/index.js.map +1 -0
- package/dist/context-menu/context-menu.d.ts +21 -0
- package/dist/context-menu/context-menu.js +105 -0
- package/dist/context-menu/context-menu.js.map +1 -0
- package/dist/context-menu/index.d.ts +1 -0
- package/dist/context-menu/index.js +2 -0
- package/dist/context-menu/index.js.map +1 -0
- package/dist/data-view/data-view-row.d.ts +31 -0
- package/dist/data-view/data-view-row.js +108 -0
- package/dist/data-view/data-view-row.js.map +1 -0
- package/dist/data-view/data-view-templates.d.ts +15 -0
- package/dist/data-view/data-view-templates.js +14 -0
- package/dist/data-view/data-view-templates.js.map +1 -0
- package/dist/data-view/data-view.d.ts +33 -0
- package/dist/data-view/data-view.js +178 -0
- package/dist/data-view/data-view.js.map +1 -0
- package/dist/data-view/index.d.ts +2 -0
- package/dist/data-view/index.js +3 -0
- package/dist/data-view/index.js.map +1 -0
- package/dist/date-input/date-input.d.ts +21 -0
- package/dist/date-input/date-input.js +150 -0
- package/dist/date-input/date-input.js.map +1 -0
- package/dist/date-input/index.d.ts +1 -0
- package/dist/date-input/index.js +2 -0
- package/dist/date-input/index.js.map +1 -0
- package/dist/divider/divider.d.ts +6 -0
- package/dist/divider/divider.js +14 -0
- package/dist/divider/divider.js.map +1 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +2 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/empty-state/empty-state.d.ts +9 -0
- package/dist/empty-state/empty-state.js +34 -0
- package/dist/empty-state/empty-state.js.map +1 -0
- package/dist/empty-state/index.d.ts +1 -0
- package/dist/empty-state/index.js +2 -0
- package/dist/empty-state/index.js.map +1 -0
- package/dist/filter-bar/filter-bar.d.ts +21 -0
- package/dist/filter-bar/filter-bar.js +121 -0
- package/dist/filter-bar/filter-bar.js.map +1 -0
- package/dist/filter-bar/index.d.ts +1 -0
- package/dist/filter-bar/index.js +2 -0
- package/dist/filter-bar/index.js.map +1 -0
- package/dist/form-field/form-field.d.ts +12 -0
- package/dist/form-field/form-field.js +39 -0
- package/dist/form-field/form-field.js.map +1 -0
- package/dist/form-field/index.d.ts +1 -0
- package/dist/form-field/index.js +2 -0
- package/dist/form-field/index.js.map +1 -0
- package/dist/foundation/accordion-indicator.d.ts +16 -0
- package/dist/foundation/accordion-indicator.js +36 -0
- package/dist/foundation/accordion-indicator.js.map +1 -0
- package/dist/foundation/anchored-layout.d.ts +23 -0
- package/dist/foundation/anchored-layout.js +23 -0
- package/dist/foundation/anchored-layout.js.map +1 -0
- package/dist/foundation/anchored-overlay.d.ts +41 -0
- package/dist/foundation/anchored-overlay.js +134 -0
- package/dist/foundation/anchored-overlay.js.map +1 -0
- package/dist/foundation/calendar.d.ts +8 -0
- package/dist/foundation/calendar.js +34 -0
- package/dist/foundation/calendar.js.map +1 -0
- package/dist/foundation/collapse.d.ts +22 -0
- package/dist/foundation/collapse.js +70 -0
- package/dist/foundation/collapse.js.map +1 -0
- package/dist/foundation/control-label.d.ts +2 -0
- package/dist/foundation/control-label.js +6 -0
- package/dist/foundation/control-label.js.map +1 -0
- package/dist/foundation/file-picker.d.ts +22 -0
- package/dist/foundation/file-picker.js +23 -0
- package/dist/foundation/file-picker.js.map +1 -0
- package/dist/foundation/haptics.d.ts +30 -0
- package/dist/foundation/haptics.js +53 -0
- package/dist/foundation/haptics.js.map +1 -0
- package/dist/foundation/icons.d.ts +14 -0
- package/dist/foundation/icons.js +16 -0
- package/dist/foundation/icons.js.map +1 -0
- package/dist/foundation/index.d.ts +44 -0
- package/dist/foundation/index.js +52 -0
- package/dist/foundation/index.js.map +1 -0
- package/dist/foundation/mobile.d.ts +37 -0
- package/dist/foundation/mobile.js +59 -0
- package/dist/foundation/mobile.js.map +1 -0
- package/dist/foundation/motion.d.ts +22 -0
- package/dist/foundation/motion.js +119 -0
- package/dist/foundation/motion.js.map +1 -0
- package/dist/foundation/native-pressable.d.ts +14 -0
- package/dist/foundation/native-pressable.js +44 -0
- package/dist/foundation/native-pressable.js.map +1 -0
- package/dist/foundation/native-text-input.d.ts +20 -0
- package/dist/foundation/native-text-input.js +96 -0
- package/dist/foundation/native-text-input.js.map +1 -0
- package/dist/foundation/native-text-snapshot.d.ts +3 -0
- package/dist/foundation/native-text-snapshot.js +19 -0
- package/dist/foundation/native-text-snapshot.js.map +1 -0
- package/dist/foundation/native-text-sync.d.ts +8 -0
- package/dist/foundation/native-text-sync.js +41 -0
- package/dist/foundation/native-text-sync.js.map +1 -0
- package/dist/foundation/text-control.d.ts +20 -0
- package/dist/foundation/text-control.js +41 -0
- package/dist/foundation/text-control.js.map +1 -0
- package/dist/foundation/tone.d.ts +10 -0
- package/dist/foundation/tone.js +52 -0
- package/dist/foundation/tone.js.map +1 -0
- package/dist/foundation/tree.d.ts +12 -0
- package/dist/foundation/tree.js +39 -0
- package/dist/foundation/tree.js.map +1 -0
- package/dist/gallery/gallery-templates.d.ts +24 -0
- package/dist/gallery/gallery-templates.js +25 -0
- package/dist/gallery/gallery-templates.js.map +1 -0
- package/dist/gallery/gallery.d.ts +74 -0
- package/dist/gallery/gallery.js +208 -0
- package/dist/gallery/gallery.js.map +1 -0
- package/dist/gallery/index.d.ts +2 -0
- package/dist/gallery/index.js +3 -0
- package/dist/gallery/index.js.map +1 -0
- package/dist/haptics/index.d.ts +12 -0
- package/dist/haptics/index.js +36 -0
- package/dist/haptics/index.js.map +1 -0
- package/dist/icon-button/icon-button.d.ts +27 -0
- package/dist/icon-button/icon-button.js +88 -0
- package/dist/icon-button/icon-button.js.map +1 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/icon-button/index.js +2 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/image-viewer/image-viewer.d.ts +134 -0
- package/dist/image-viewer/image-viewer.js +380 -0
- package/dist/image-viewer/image-viewer.js.map +1 -0
- package/dist/image-viewer/index.d.ts +1 -0
- package/dist/image-viewer/index.js +2 -0
- package/dist/image-viewer/index.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/inline-editor/index.d.ts +1 -0
- package/dist/inline-editor/index.js +2 -0
- package/dist/inline-editor/index.js.map +1 -0
- package/dist/inline-editor/inline-editor.d.ts +17 -0
- package/dist/inline-editor/inline-editor.js +144 -0
- package/dist/inline-editor/inline-editor.js.map +1 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +2 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/input.d.ts +9 -0
- package/dist/input/input.js +87 -0
- package/dist/input/input.js.map +1 -0
- package/dist/input-mask/index.d.ts +1 -0
- package/dist/input-mask/index.js +2 -0
- package/dist/input-mask/index.js.map +1 -0
- package/dist/input-mask/input-mask.d.ts +17 -0
- package/dist/input-mask/input-mask.js +112 -0
- package/dist/input-mask/input-mask.js.map +1 -0
- package/dist/input-otp/index.d.ts +1 -0
- package/dist/input-otp/index.js +2 -0
- package/dist/input-otp/index.js.map +1 -0
- package/dist/input-otp/input-otp.d.ts +18 -0
- package/dist/input-otp/input-otp.js +169 -0
- package/dist/input-otp/input-otp.js.map +1 -0
- package/dist/input-tags/index.d.ts +1 -0
- package/dist/input-tags/index.js +2 -0
- package/dist/input-tags/index.js.map +1 -0
- package/dist/input-tags/input-tags.d.ts +21 -0
- package/dist/input-tags/input-tags.js +150 -0
- package/dist/input-tags/input-tags.js.map +1 -0
- package/dist/listbox/index.d.ts +2 -0
- package/dist/listbox/index.js +3 -0
- package/dist/listbox/index.js.map +1 -0
- package/dist/listbox/listbox-templates.d.ts +17 -0
- package/dist/listbox/listbox-templates.js +14 -0
- package/dist/listbox/listbox-templates.js.map +1 -0
- package/dist/listbox/listbox.d.ts +24 -0
- package/dist/listbox/listbox.js +136 -0
- package/dist/listbox/listbox.js.map +1 -0
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/menu/menu.d.ts +19 -0
- package/dist/menu/menu.js +95 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/meter-group/index.d.ts +1 -0
- package/dist/meter-group/index.js +2 -0
- package/dist/meter-group/index.js.map +1 -0
- package/dist/meter-group/meter-group.d.ts +23 -0
- package/dist/meter-group/meter-group.js +68 -0
- package/dist/meter-group/meter-group.js.map +1 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +3 -0
- package/dist/modal/index.js.map +1 -0
- package/dist/modal/modal-templates.d.ts +14 -0
- package/dist/modal/modal-templates.js +23 -0
- package/dist/modal/modal-templates.js.map +1 -0
- package/dist/modal/modal.d.ts +38 -0
- package/dist/modal/modal.js +169 -0
- package/dist/modal/modal.js.map +1 -0
- package/dist/nav/index.d.ts +1 -0
- package/dist/nav/index.js +2 -0
- package/dist/nav/index.js.map +1 -0
- package/dist/nav/nav.d.ts +15 -0
- package/dist/nav/nav.js +84 -0
- package/dist/nav/nav.js.map +1 -0
- package/dist/notification-center/index.d.ts +1 -0
- package/dist/notification-center/index.js +2 -0
- package/dist/notification-center/index.js.map +1 -0
- package/dist/notification-center/notification-center.d.ts +18 -0
- package/dist/notification-center/notification-center.js +104 -0
- package/dist/notification-center/notification-center.js.map +1 -0
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +2 -0
- package/dist/number-input/index.js.map +1 -0
- package/dist/number-input/number-input.d.ts +23 -0
- package/dist/number-input/number-input.js +143 -0
- package/dist/number-input/number-input.js.map +1 -0
- package/dist/panel/index.d.ts +2 -0
- package/dist/panel/index.js +3 -0
- package/dist/panel/index.js.map +1 -0
- package/dist/panel/panel-slots.d.ts +11 -0
- package/dist/panel/panel-slots.js +21 -0
- package/dist/panel/panel-slots.js.map +1 -0
- package/dist/panel/panel.d.ts +11 -0
- package/dist/panel/panel.js +60 -0
- package/dist/panel/panel.js.map +1 -0
- package/dist/password/index.d.ts +1 -0
- package/dist/password/index.js +2 -0
- package/dist/password/index.js.map +1 -0
- package/dist/password/password.d.ts +12 -0
- package/dist/password/password.js +111 -0
- package/dist/password/password.js.map +1 -0
- package/dist/pick-list/index.d.ts +1 -0
- package/dist/pick-list/index.js +2 -0
- package/dist/pick-list/index.js.map +1 -0
- package/dist/pick-list/pick-list.d.ts +32 -0
- package/dist/pick-list/pick-list.js +215 -0
- package/dist/pick-list/pick-list.js.map +1 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/popover.d.ts +15 -0
- package/dist/popover/popover.js +55 -0
- package/dist/popover/popover.js.map +1 -0
- package/dist/progress-bar/index.d.ts +1 -0
- package/dist/progress-bar/index.js +2 -0
- package/dist/progress-bar/index.js.map +1 -0
- package/dist/progress-bar/progress-bar.d.ts +13 -0
- package/dist/progress-bar/progress-bar.js +50 -0
- package/dist/progress-bar/progress-bar.js.map +1 -0
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.js.map +1 -0
- package/dist/radio/radio.d.ts +19 -0
- package/dist/radio/radio.js +109 -0
- package/dist/radio/radio.js.map +1 -0
- package/dist/rating/index.d.ts +1 -0
- package/dist/rating/index.js +2 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/rating/rating.d.ts +17 -0
- package/dist/rating/rating.js +121 -0
- package/dist/rating/rating.js.map +1 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +3 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/select-templates.d.ts +24 -0
- package/dist/select/select-templates.js +23 -0
- package/dist/select/select-templates.js.map +1 -0
- package/dist/select/select.d.ts +33 -0
- package/dist/select/select.js +193 -0
- package/dist/select/select.js.map +1 -0
- package/dist/sidebar/index.d.ts +1 -0
- package/dist/sidebar/index.js +2 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/sidebar/sidebar.d.ts +34 -0
- package/dist/sidebar/sidebar.js +127 -0
- package/dist/sidebar/sidebar.js.map +1 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/skeleton.d.ts +32 -0
- package/dist/skeleton/skeleton.js +121 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.d.ts +37 -0
- package/dist/slider/slider.js +186 -0
- package/dist/slider/slider.js.map +1 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +2 -0
- package/dist/speed-dial/index.js.map +1 -0
- package/dist/speed-dial/speed-dial.d.ts +31 -0
- package/dist/speed-dial/speed-dial.js +138 -0
- package/dist/speed-dial/speed-dial.js.map +1 -0
- package/dist/spinner/index.d.ts +1 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/spinner.d.ts +13 -0
- package/dist/spinner/spinner.js +57 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/stats-card/index.d.ts +1 -0
- package/dist/stats-card/index.js +2 -0
- package/dist/stats-card/index.js.map +1 -0
- package/dist/stats-card/stats-card.d.ts +19 -0
- package/dist/stats-card/stats-card.js +70 -0
- package/dist/stats-card/stats-card.js.map +1 -0
- package/dist/stepper/index.d.ts +1 -0
- package/dist/stepper/index.js +2 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/stepper/stepper.d.ts +21 -0
- package/dist/stepper/stepper.js +134 -0
- package/dist/stepper/stepper.js.map +1 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/switch.d.ts +27 -0
- package/dist/switch/switch.js +106 -0
- package/dist/switch/switch.js.map +1 -0
- package/dist/tabs/index.d.ts +1 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/tabs.d.ts +25 -0
- package/dist/tabs/tabs.js +112 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +2 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/textarea/textarea.d.ts +8 -0
- package/dist/textarea/textarea.js +87 -0
- package/dist/textarea/textarea.js.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme.d.ts +16 -0
- package/dist/theme/theme.js +146 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/timeline.d.ts +16 -0
- package/dist/timeline/timeline.js +66 -0
- package/dist/timeline/timeline.js.map +1 -0
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/toast.d.ts +35 -0
- package/dist/toast/toast.js +146 -0
- package/dist/toast/toast.js.map +1 -0
- package/dist/toggle-button-group/index.d.ts +1 -0
- package/dist/toggle-button-group/index.js +2 -0
- package/dist/toggle-button-group/index.js.map +1 -0
- package/dist/toggle-button-group/toggle-button-group.d.ts +27 -0
- package/dist/toggle-button-group/toggle-button-group.js +145 -0
- package/dist/toggle-button-group/toggle-button-group.js.map +1 -0
- package/dist/toolbar/index.d.ts +1 -0
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.js.map +1 -0
- package/dist/toolbar/toolbar.d.ts +18 -0
- package/dist/toolbar/toolbar.js +84 -0
- package/dist/toolbar/toolbar.js.map +1 -0
- package/dist/tree/index.d.ts +1 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/tree.d.ts +26 -0
- package/dist/tree/tree.js +167 -0
- package/dist/tree/tree.js.map +1 -0
- package/dist/tree-select/index.d.ts +1 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/tree-select/index.js.map +1 -0
- package/dist/tree-select/tree-select.d.ts +20 -0
- package/dist/tree-select/tree-select.js +112 -0
- package/dist/tree-select/tree-select.js.map +1 -0
- package/dist/uploader/index.d.ts +2 -0
- package/dist/uploader/index.js +3 -0
- package/dist/uploader/index.js.map +1 -0
- package/dist/uploader/uploader.d.ts +37 -0
- package/dist/uploader/uploader.js +280 -0
- package/dist/uploader/uploader.js.map +1 -0
- package/dist/virtual-list/index.d.ts +2 -0
- package/dist/virtual-list/index.js +3 -0
- package/dist/virtual-list/index.js.map +1 -0
- package/dist/virtual-list/virtual-list-templates.d.ts +16 -0
- package/dist/virtual-list/virtual-list-templates.js +14 -0
- package/dist/virtual-list/virtual-list-templates.js.map +1 -0
- package/dist/virtual-list/virtual-list.d.ts +20 -0
- package/dist/virtual-list/virtual-list.js +110 -0
- package/dist/virtual-list/virtual-list.js.map +1 -0
- package/package.json +344 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchored-overlay.js","sourceRoot":"","sources":["../../src/foundation/anchored-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7H,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAoB,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAiB,MAAM,mBAAmB,CAA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O;YACtB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;YAC9D,IAAI,WAAW,CAAC,KAAK,GAAG,CAAC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;YACjI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;gBAClC,IAAI,MAAM,EAAE;oBAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;YACrG,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;uGAzDU,2BAA2B;2FAA3B,2BAA2B,2xBAcF,IAAI,2BAAU,UAAU,6CApClD;;;;;;;;;;;;;;;;;;;WAmBD,8iBApBC,KAAK,kRAAE,SAAS,mGAAE,UAAU,0TAAE,IAAI,iDAAE,aAAa;;2FAuBhD,2BAA2B;kBAzBvC,SAAS;+BACE,sBAAsB,WACvB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,CAAC,YAClD;;;;;;;;;;;;;;;;;;;WAmBD;mnBAiB2B,IAAI,QAAE,EAAE,IAAI,EAAE,CAAA,UAAoB,CAAA,EAAE","sourcesContent":["import { Component, DestroyRef, ElementRef, computed, effect, inject, input, model, signal, viewChild } from '@angular/core';\nimport { Modal, ScrollView, View, type LayoutEvent } from '@ng-native/components';\nimport { NeuNativePressable as Pressable } from './native-pressable.js';\nimport { HostEngine, type HostNode } from '@ng-native/fabric';\nimport { Keyboard, SafeArea } from '@ng-native/device';\nimport { anchoredLayout } from './anchored-layout.js';\nimport { AnimatedStyle } from '@ng-native/components/animations';\nimport { neuPresence } from './motion.js';\n\n/** Internal anchored surface shared by native popup controls. */\n@Component({\n selector: 'neu-anchored-overlay',\n imports: [Modal, Pressable, ScrollView, View, AnimatedStyle],\n template: `<modal [supportedOrientations]=\"['portrait', 'landscape']\" [visible]=\"motion.visible()\" [transparent]=\"true\" animationType=\"none\"\n presentationStyle=\"overFullScreen\" [statusBarTranslucent]=\"false\"\n (requestClose)=\"open.set(false)\" (show)=\"measure()\">\n <view class=\"overlay-root\" [collapsable]=\"false\" (layout)=\"layout($event)\"\n [pointerEvents]=\"open() ? 'auto' : 'none'\" [accessibilityElementsHidden]=\"!open()\"\n [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <pressable class=\"overlay-dismiss\" accessibilityRole=\"button\"\n [accessibilityLabel]=\"closeLabel()\" (press)=\"open.set(false)\" />\n <view class=\"overlay-popup\" [style.left]=\"position().left\" [style.width]=\"position().width\"\n [animatedStyle]=\"popupStyle\"\n [style.top]=\"position().top\" [style.bottom]=\"position().bottom\"\n [style.height]=\"popupHeight()\"\n [style.maxHeight]=\"position().height\" [accessibilityViewIsModal]=\"open()\">\n <scroll-view class=\"overlay-scroll\" keyboardShouldPersistTaps=\"handled\"\n (contentSizeChange)=\"contentHeight.set($event.height)\">\n <view class=\"overlay-content\"><ng-content /></view>\n </scroll-view>\n </view>\n </view>\n </modal>`,\n styleUrl: './anchored-overlay.css',\n})\nexport class NeuAnchoredOverlayComponent {\n readonly open = model(false);\n // The popup is remeasured after its Modal mounts. JS frames keep opacity in sync\n // with those layout commits instead of reconnecting a native animation tag.\n protected readonly motion = neuPresence(this.open, false);\n protected readonly popupStyle = { opacity: this.motion.progress };\n readonly anchor = input<HostNode>();\n readonly closeLabel = input('Dismiss options');\n readonly minimumWidth = input(160);\n readonly gap = input(8);\n private readonly engine = inject(HostEngine);\n private readonly keyboard = inject(Keyboard);\n private readonly safeArea = inject(SafeArea);\n private readonly destroy = inject(DestroyRef);\n private readonly origin = viewChild(View, { read: ElementRef<HostNode> });\n private measurement = 0;\n private readonly viewport = signal({ width: 360, height: 800 });\n private readonly frame = signal({ x: 16, y: 64, width: 328, height: 48 });\n private readonly windowOrigin = signal({ x: 0, y: 0 });\n protected readonly position = signal<{ left: number; width: number; top: number | null; bottom: number | null; height: number }>({ left: 16, width: 328, top: 120, bottom: null, height: 320 });\n protected readonly contentHeight = signal(0);\n // A native ScrollView needs a bounded viewport before it can measure its content.\n protected readonly popupHeight = computed(() => {\n const height = this.contentHeight(), available = this.position().height;\n return height > 0 ? Math.min(available, height + 2) : available;\n });\n constructor() {\n effect(() => {\n if (this.open() && this.anchor() && this.origin()) this.measure();\n else this.measurement++;\n });\n effect(() => {\n const view = this.viewport(), anchor = this.frame();\n const keyboard = this.keyboard.position();\n const keyboardTop = this.keyboard.visible()\n ? (keyboard.screenY ?? view.height - keyboard.height) - this.windowOrigin().y\n : undefined;\n this.position.set(anchoredLayout(view, anchor, this.minimumWidth(), this.gap(), keyboardTop, this.safeArea.insets()));\n });\n }\n protected layout(event: LayoutEvent): void {\n const { width, height } = event.nativeEvent.layout;\n if (width > 0 && height > 0) { this.viewport.set({ width, height }); this.measure(); }\n }\n protected measure(): void {\n const anchor = this.anchor(), origin = this.origin()?.nativeElement;\n if (!anchor || !origin || !this.open()) return;\n const measurement = ++this.measurement;\n const active = () => !this.destroy.destroyed && this.open() && this.anchor() === anchor && measurement === this.measurement;\n this.engine.measure(origin, originFrame => {\n if (!active()) return;\n this.windowOrigin.set({ x: originFrame.x, y: originFrame.y });\n if (originFrame.width > 0 && originFrame.height > 0) this.viewport.set({ width: originFrame.width, height: originFrame.height });\n this.engine.measure(anchor, frame => {\n if (active()) this.frame.set({ ...frame, x: frame.x - originFrame.x, y: frame.y - originFrame.y });\n });\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isoDate(value: string): Date | null;
|
|
2
|
+
export declare function todayISO(): string;
|
|
3
|
+
export declare function monthCells(month: string, firstDay?: number): readonly {
|
|
4
|
+
date: string;
|
|
5
|
+
day: number;
|
|
6
|
+
current: boolean;
|
|
7
|
+
}[];
|
|
8
|
+
export declare function shiftMonth(month: string, delta: number): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function isoDate(value) {
|
|
2
|
+
if (!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value))
|
|
3
|
+
return null;
|
|
4
|
+
const d = new Date(value + 'T12:00:00Z');
|
|
5
|
+
return Number.isNaN(d.getTime()) || d.toISOString().slice(0, 10) !== value
|
|
6
|
+
? null
|
|
7
|
+
: d;
|
|
8
|
+
}
|
|
9
|
+
export function todayISO() {
|
|
10
|
+
return new Date().toISOString().slice(0, 10);
|
|
11
|
+
}
|
|
12
|
+
export function monthCells(month, firstDay = 1) {
|
|
13
|
+
const start = isoDate(month + '-01');
|
|
14
|
+
if (!start)
|
|
15
|
+
return [];
|
|
16
|
+
const offset = (start.getUTCDay() - firstDay + 7) % 7;
|
|
17
|
+
return Array.from({ length: 42 }, (_, i) => {
|
|
18
|
+
const d = new Date(start);
|
|
19
|
+
d.setUTCDate(i - offset + 1);
|
|
20
|
+
return {
|
|
21
|
+
date: d.toISOString().slice(0, 10),
|
|
22
|
+
day: d.getUTCDate(),
|
|
23
|
+
current: d.getUTCMonth() === start.getUTCMonth(),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function shiftMonth(month, delta) {
|
|
28
|
+
const d = isoDate(month + '-01');
|
|
29
|
+
if (!d)
|
|
30
|
+
return todayISO().slice(0, 7);
|
|
31
|
+
d.setUTCMonth(d.getUTCMonth() + delta);
|
|
32
|
+
return d.toISOString().slice(0, 7);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=calendar.js.map
|
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AAC,EAAE,EAAE,CAAC;YAClC,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE;YACnB,OAAO,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE;SACjD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,KAAa;IACrD,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC;QAAE,OAAO,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC","sourcesContent":["export function isoDate(value: string): Date | null {\n if (!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value)) return null;\n const d = new Date(value + 'T12:00:00Z');\n return Number.isNaN(d.getTime()) || d.toISOString().slice(0, 10) !== value\n ? null\n : d;\n}\nexport function todayISO(): string {\n return new Date().toISOString().slice(0, 10);\n}\nexport function monthCells(\n month: string,\n firstDay = 1,\n): readonly { date: string; day: number; current: boolean }[] {\n const start = isoDate(month + '-01');\n if (!start) return [];\n const offset = (start.getUTCDay() - firstDay + 7) % 7;\n return Array.from({ length: 42 }, (_, i) => {\n const d = new Date(start);\n d.setUTCDate(i - offset + 1);\n return {\n date: d.toISOString().slice(0, 10),\n day: d.getUTCDate(),\n current: d.getUTCMonth() === start.getUTCMonth(),\n };\n });\n}\nexport function shiftMonth(month: string, delta: number): string {\n const d = isoDate(month + '-01');\n if (!d) return todayISO().slice(0, 7);\n d.setUTCMonth(d.getUTCMonth() + delta);\n return d.toISOString().slice(0, 7);\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type LayoutEvent } from '@ng-native/components';
|
|
2
|
+
import { Animated } from '@ng-native/components/animations';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NeuCollapseComponent {
|
|
5
|
+
readonly open: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
protected readonly motion: {
|
|
7
|
+
visible: import("@angular/core").WritableSignal<boolean>;
|
|
8
|
+
progress: Animated.Value;
|
|
9
|
+
};
|
|
10
|
+
private readonly height;
|
|
11
|
+
private readonly animatedHeight;
|
|
12
|
+
private readonly accessibility;
|
|
13
|
+
private readonly theme;
|
|
14
|
+
protected readonly animated: {
|
|
15
|
+
height: Animated.Value;
|
|
16
|
+
opacity: Animated.Value;
|
|
17
|
+
};
|
|
18
|
+
constructor();
|
|
19
|
+
protected measure(event: LayoutEvent): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NeuCollapseComponent, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NeuCollapseComponent, "neu-collapse", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Component, DestroyRef, effect, inject, input, signal } from '@angular/core';
|
|
2
|
+
import { View } from '@ng-native/components';
|
|
3
|
+
import { Animated, AnimatedStyle, Easing } from '@ng-native/components/animations';
|
|
4
|
+
import { Accessibility } from '@ng-native/device';
|
|
5
|
+
import { NEU_THEME, NEU_LIGHT_TOKENS } from './index.js';
|
|
6
|
+
import { neuMotionDuration, neuPresence } from './motion.js';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export class NeuCollapseComponent {
|
|
9
|
+
open = input(false, /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
11
|
+
// Already-open content must start fully visible before its first native
|
|
12
|
+
// measurement binds the animated height. User toggles still animate.
|
|
13
|
+
motion = neuPresence(this.open, false, false);
|
|
14
|
+
height = signal(0, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
16
|
+
animatedHeight = new Animated.Value(0);
|
|
17
|
+
accessibility = inject(Accessibility);
|
|
18
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
19
|
+
// Keep one animation graph attached while native layout measurements arrive.
|
|
20
|
+
// Replacing an interpolation during a running animation detaches its graph.
|
|
21
|
+
animated = {
|
|
22
|
+
height: this.animatedHeight,
|
|
23
|
+
opacity: this.motion.progress,
|
|
24
|
+
};
|
|
25
|
+
constructor() {
|
|
26
|
+
let initialOpen;
|
|
27
|
+
let measured = false;
|
|
28
|
+
effect(onCleanup => {
|
|
29
|
+
const open = this.open(), height = this.height();
|
|
30
|
+
initialOpen ??= open;
|
|
31
|
+
const firstMeasurement = height > 0 && !measured;
|
|
32
|
+
if (height > 0)
|
|
33
|
+
measured = true;
|
|
34
|
+
const duration = neuMotionDuration(this.theme?.().duration ?? NEU_LIGHT_TOKENS.duration, open);
|
|
35
|
+
const toValue = open ? height : 0;
|
|
36
|
+
if (height === 0 || this.accessibility.reduceMotion() || duration === 0 || (initialOpen && firstMeasurement)) {
|
|
37
|
+
this.animatedHeight.setValue(toValue);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const animation = Animated.timing(this.animatedHeight, {
|
|
41
|
+
toValue, duration, easing: Easing.out(Easing.cubic), useNativeDriver: false,
|
|
42
|
+
});
|
|
43
|
+
animation.start();
|
|
44
|
+
onCleanup(() => animation.stop());
|
|
45
|
+
});
|
|
46
|
+
inject(DestroyRef).onDestroy(() => this.animatedHeight.stopAnimation());
|
|
47
|
+
}
|
|
48
|
+
measure(event) {
|
|
49
|
+
const height = event.nativeEvent.layout.height;
|
|
50
|
+
if (Number.isFinite(height))
|
|
51
|
+
this.height.set(Math.max(0, height));
|
|
52
|
+
}
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuCollapseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.2", type: NeuCollapseComponent, isStandalone: true, selector: "neu-collapse", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `@if (motion.visible()) {
|
|
55
|
+
<view class="collapse" [animatedStyle]="animated" [pointerEvents]="open() ? 'auto' : 'none'"
|
|
56
|
+
[accessibilityElementsHidden]="!open()" [importantForAccessibility]="open() ? 'auto' : 'no-hide-descendants'">
|
|
57
|
+
<view class="collapse-content" (layout)="measure($event)"><ng-content /></view>
|
|
58
|
+
</view>
|
|
59
|
+
}`, isInline: true, styles: ["\n .collapse { position: relative; overflow: hidden; }\n .collapse-content { position: absolute; top: 0; left: 0; right: 0; gap: 12px; }\n "], dependencies: [{ kind: "directive", type: View, selector: "view" }, { kind: "directive", type: AnimatedStyle, selector: "[animatedStyle]" }] });
|
|
60
|
+
}
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuCollapseComponent, decorators: [{
|
|
62
|
+
type: Component,
|
|
63
|
+
args: [{ selector: 'neu-collapse', imports: [View, AnimatedStyle], template: `@if (motion.visible()) {
|
|
64
|
+
<view class="collapse" [animatedStyle]="animated" [pointerEvents]="open() ? 'auto' : 'none'"
|
|
65
|
+
[accessibilityElementsHidden]="!open()" [importantForAccessibility]="open() ? 'auto' : 'no-hide-descendants'">
|
|
66
|
+
<view class="collapse-content" (layout)="measure($event)"><ng-content /></view>
|
|
67
|
+
</view>
|
|
68
|
+
}`, styles: ["\n .collapse { position: relative; overflow: hidden; }\n .collapse-content { position: absolute; top: 0; left: 0; right: 0; gap: 12px; }\n "] }]
|
|
69
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }] } });
|
|
70
|
+
//# sourceMappingURL=collapse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse.js","sourceRoot":"","sources":["../../src/foundation/collapse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,IAAI,EAAoB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;;AAgB7D,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,KAAK,CAAC,KAAK;6EAAC,CAAC;IAC7B,wEAAwE;IACxE,qEAAqE;IAClD,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,MAAM,GAAG,MAAM,CAAC,CAAC;+EAAC,CAAC;IACnB,cAAc,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IACtC,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,6EAA6E;IAC7E,4EAA4E;IACzD,QAAQ,GAAG;QAC5B,MAAM,EAAE,IAAI,CAAC,cAAc;QAC3B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;KAC9B,CAAC;IACF;QACE,IAAI,WAAgC,CAAC;QACrC,IAAI,QAAQ,GAAG,KAAK,CAAC;Q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KAAkB;QAClC,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;QAC/C,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpE,CAAC;uGAxCU,oBAAoB;2FAApB,oBAAoB,yMAXrB;;;;;IAKR,4NANQ,IAAI,iDAAE,aAAa;;2FAYlB,oBAAoB;kBAdhC,SAAS;+BACE,cAAc,WACf,CAAC,IAAI,EAAE,aAAa,CAAC,YACpB;;;;;IAKR","sourcesContent":["import { Component, DestroyRef, effect, inject, input, signal } from '@angular/core';\nimport { View, type LayoutEvent } from '@ng-native/components';\nimport { Animated, AnimatedStyle, Easing } from '@ng-native/components/animations';\nimport { Accessibility } from '@ng-native/device';\nimport { NEU_THEME, NEU_LIGHT_TOKENS } from './index.js';\nimport { neuMotionDuration, neuPresence } from './motion.js';\n\n@Component({\n selector: 'neu-collapse',\n imports: [View, AnimatedStyle],\n template: `@if (motion.visible()) {\n <view class=\"collapse\" [animatedStyle]=\"animated\" [pointerEvents]=\"open() ? 'auto' : 'none'\"\n [accessibilityElementsHidden]=\"!open()\" [importantForAccessibility]=\"open() ? 'auto' : 'no-hide-descendants'\">\n <view class=\"collapse-content\" (layout)=\"measure($event)\"><ng-content /></view>\n </view>\n }`,\n styles: `\n .collapse { position: relative; overflow: hidden; }\n .collapse-content { position: absolute; top: 0; left: 0; right: 0; gap: 12px; }\n `,\n})\nexport class NeuCollapseComponent {\n readonly open = input(false);\n // Already-open content must start fully visible before its first native\n // measurement binds the animated height. User toggles still animate.\n protected readonly motion = neuPresence(this.open, false, false);\n private readonly height = signal(0);\n private readonly animatedHeight = new Animated.Value(0);\n private readonly accessibility = inject(Accessibility);\n private readonly theme = inject(NEU_THEME, { optional: true });\n // Keep one animation graph attached while native layout measurements arrive.\n // Replacing an interpolation during a running animation detaches its graph.\n protected readonly animated = {\n height: this.animatedHeight,\n opacity: this.motion.progress,\n };\n constructor() {\n let initialOpen: boolean | undefined;\n let measured = false;\n effect(onCleanup => {\n const open = this.open(), height = this.height();\n initialOpen ??= open;\n const firstMeasurement = height > 0 && !measured;\n if (height > 0) measured = true;\n const duration = neuMotionDuration(this.theme?.().duration ?? NEU_LIGHT_TOKENS.duration, open);\n const toValue = open ? height : 0;\n if (height === 0 || this.accessibility.reduceMotion() || duration === 0 || (initialOpen && firstMeasurement)) {\n this.animatedHeight.setValue(toValue);\n return;\n }\n const animation = Animated.timing(this.animatedHeight, {\n toValue, duration, easing: Easing.out(Easing.cubic), useNativeDriver: false,\n });\n animation.start();\n onCleanup(() => animation.stop());\n });\n inject(DestroyRef).onDestroy(() => this.animatedHeight.stopAnimation());\n }\n protected measure(event: LayoutEvent): void {\n const height = event.nativeEvent.layout.height;\n if (Number.isFinite(height)) this.height.set(Math.max(0, height));\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-label.js","sourceRoot":"","sources":["../../src/foundation/control-label.ts"],"names":[],"mappings":"AAAA,IAAI,WAAW,GAAG,CAAC,CAAC;AAEpB,qFAAqF;AACrF,MAAM,UAAU,cAAc;IAC5B,OAAO,qBAAqB,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["let nextLabelId = 0;\n\n/** Native label references must remain unique across control types and instances. */\nexport function controlLabelId(): string {\n return `neu-control-label-${++nextLabelId}`;\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export interface NeuFile {
|
|
3
|
+
readonly uri: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly size?: number;
|
|
6
|
+
readonly mimeType?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NeuFilePicker {
|
|
9
|
+
pick(options: {
|
|
10
|
+
type: readonly string[];
|
|
11
|
+
multiple: boolean;
|
|
12
|
+
}): Promise<readonly NeuFile[] | null>;
|
|
13
|
+
}
|
|
14
|
+
export declare const NEU_FILE_PICKER: InjectionToken<NeuFilePicker>;
|
|
15
|
+
export type NeuUpload = (file: NeuFile, progress: (percent: number) => void, signal: AbortSignal) => Promise<void>;
|
|
16
|
+
export interface NeuUploadItem {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly file: NeuFile;
|
|
19
|
+
readonly state: 'selected' | 'uploading' | 'complete' | 'error';
|
|
20
|
+
readonly progress: number;
|
|
21
|
+
readonly error?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export const NEU_FILE_PICKER = new InjectionToken('Neural file picker', {
|
|
3
|
+
providedIn: 'root',
|
|
4
|
+
factory: () => ({
|
|
5
|
+
async pick(options) {
|
|
6
|
+
const { getDocumentAsync } = await import('expo-document-picker');
|
|
7
|
+
const result = await getDocumentAsync({
|
|
8
|
+
type: [...options.type],
|
|
9
|
+
multiple: options.multiple,
|
|
10
|
+
copyToCacheDirectory: true,
|
|
11
|
+
});
|
|
12
|
+
return result.canceled
|
|
13
|
+
? null
|
|
14
|
+
: result.assets.map((x) => ({
|
|
15
|
+
uri: x.uri,
|
|
16
|
+
name: x.name,
|
|
17
|
+
size: x.size,
|
|
18
|
+
mimeType: x.mimeType,
|
|
19
|
+
}));
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=file-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-picker.js","sourceRoot":"","sources":["../../src/foundation/file-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAa/C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,cAAc,CAC/C,oBAAoB,EACpB;IACE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,OAAO;YAChB,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;YAClE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC;gBACpC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;gBACvB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,oBAAoB,EAAE,IAAI;aAC3B,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,QAAQ;gBACpB,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACxB,GAAG,EAAE,CAAC,CAAC,GAAG;oBACV,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;iBACrB,CAAC,CAAC,CAAC;QACV,CAAC;KACF,CAAC;CACH,CACF,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\nexport interface NeuFile {\n readonly uri: string;\n readonly name: string;\n readonly size?: number;\n readonly mimeType?: string;\n}\nexport interface NeuFilePicker {\n pick(options: {\n type: readonly string[];\n multiple: boolean;\n }): Promise<readonly NeuFile[] | null>;\n}\nexport const NEU_FILE_PICKER = new InjectionToken<NeuFilePicker>(\n 'Neural file picker',\n {\n providedIn: 'root',\n factory: () => ({\n async pick(options) {\n const { getDocumentAsync } = await import('expo-document-picker');\n const result = await getDocumentAsync({\n type: [...options.type],\n multiple: options.multiple,\n copyToCacheDirectory: true,\n });\n return result.canceled\n ? null\n : result.assets.map((x) => ({\n uri: x.uri,\n name: x.name,\n size: x.size,\n mimeType: x.mimeType,\n }));\n },\n }),\n },\n);\nexport type NeuUpload = (\n file: NeuFile,\n progress: (percent: number) => void,\n signal: AbortSignal,\n) => Promise<void>;\nexport interface NeuUploadItem {\n readonly id: string;\n readonly file: NeuFile;\n readonly state: 'selected' | 'uploading' | 'complete' | 'error';\n readonly progress: number;\n readonly error?: string;\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export type NeuHapticImpact = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';
|
|
4
|
+
export type NeuHapticFeedback = 'press' | 'selection' | NeuHapticImpact | 'success' | 'warning' | 'error';
|
|
5
|
+
export interface NeuHapticsOptions {
|
|
6
|
+
/** Explicitly enabling a provider opts the application into feedback. */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** Coalesce rapid feedback, including continuous sliders. Defaults to 80 ms. */
|
|
9
|
+
minimumIntervalMs?: number;
|
|
10
|
+
pressStyle?: NeuHapticImpact;
|
|
11
|
+
}
|
|
12
|
+
export interface NeuHapticsDriver {
|
|
13
|
+
available(): boolean;
|
|
14
|
+
play(feedback: Exclude<NeuHapticFeedback, 'press'>): void | Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare const NEU_HAPTICS_OPTIONS: InjectionToken<NeuHapticsOptions>;
|
|
17
|
+
/** Platform boundary, replaceable by consumers and contract tests. */
|
|
18
|
+
export declare const NEU_HAPTICS_DRIVER: InjectionToken<NeuHapticsDriver | null>;
|
|
19
|
+
/** Optional feedback: a missing motor or failed vibration must never block an action. */
|
|
20
|
+
export declare class NeuHaptics {
|
|
21
|
+
private readonly options;
|
|
22
|
+
private readonly driver;
|
|
23
|
+
readonly enabled: import("@angular/core").WritableSignal<boolean>;
|
|
24
|
+
private lastAt;
|
|
25
|
+
get available(): boolean;
|
|
26
|
+
/** True means a request was dispatched, not that hardware physically vibrated. */
|
|
27
|
+
play(feedback?: NeuHapticFeedback | false): boolean;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NeuHaptics, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Injectable, InjectionToken, inject, signal } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export const NEU_HAPTICS_OPTIONS = new InjectionToken('Neural haptics options', {
|
|
4
|
+
providedIn: 'root', factory: () => ({ enabled: false }),
|
|
5
|
+
});
|
|
6
|
+
/** Platform boundary, replaceable by consumers and contract tests. */
|
|
7
|
+
export const NEU_HAPTICS_DRIVER = new InjectionToken('Neural haptics driver', {
|
|
8
|
+
providedIn: 'root', factory: () => null,
|
|
9
|
+
});
|
|
10
|
+
/** Optional feedback: a missing motor or failed vibration must never block an action. */
|
|
11
|
+
export class NeuHaptics {
|
|
12
|
+
options = inject(NEU_HAPTICS_OPTIONS);
|
|
13
|
+
driver = inject(NEU_HAPTICS_DRIVER);
|
|
14
|
+
enabled = signal(this.options.enabled ?? false, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
16
|
+
lastAt = -Infinity;
|
|
17
|
+
get available() {
|
|
18
|
+
try {
|
|
19
|
+
return this.driver?.available() ?? false;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** True means a request was dispatched, not that hardware physically vibrated. */
|
|
26
|
+
play(feedback = 'press') {
|
|
27
|
+
if (!feedback || !this.enabled() || !this.available || !this.driver)
|
|
28
|
+
return false;
|
|
29
|
+
const configured = this.options.minimumIntervalMs ?? 80;
|
|
30
|
+
const interval = Number.isFinite(configured) ? Math.max(0, Math.min(1000, configured)) : 80;
|
|
31
|
+
const now = Date.now();
|
|
32
|
+
if (now >= this.lastAt && now - this.lastAt < interval)
|
|
33
|
+
return false;
|
|
34
|
+
try {
|
|
35
|
+
const result = this.driver.play(feedback === 'press' ? (this.options.pressStyle ?? 'light') : feedback);
|
|
36
|
+
this.lastAt = now;
|
|
37
|
+
// A consumer-supplied asynchronous driver must not leak rejected promises.
|
|
38
|
+
if (result)
|
|
39
|
+
void Promise.resolve(result).catch(() => undefined);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuHaptics, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
47
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuHaptics, providedIn: 'root' });
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuHaptics, decorators: [{
|
|
50
|
+
type: Injectable,
|
|
51
|
+
args: [{ providedIn: 'root' }]
|
|
52
|
+
}] });
|
|
53
|
+
//# sourceMappingURL=haptics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.js","sourceRoot":"","sources":["../../src/foundation/haptics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAe3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAoB,wBAAwB,EAAE;IACjG,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CACxD,CAAC,CAAC;AACH,sEAAsE;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAA0B,uBAAuB,EAAE;IACrG,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;CACxC,CAAC,CAAC;AAEH,yFAAyF;AAEzF,MAAM,OAAO,UAA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QAAQ,CAAC,CAAC;YACxG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;YAClB,2EAA2E;YAC3E,IAAI,MAAM;gBAAE,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO,KAAK,CAAC;QAAC,CAAC;IAC3B,CAAC;uGAxBU,UAAU;2GAAV,UAAU,cADG,MAAM;;2FACnB,UAAU;kBADtB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["import { Injectable, InjectionToken, inject, signal } from '@angular/core';\n\nexport type NeuHapticImpact = 'light' | 'medium' | 'heavy' | 'soft' | 'rigid';\nexport type NeuHapticFeedback = 'press' | 'selection' | NeuHapticImpact | 'success' | 'warning' | 'error';\nexport interface NeuHapticsOptions {\n /** Explicitly enabling a provider opts the application into feedback. */\n enabled?: boolean;\n /** Coalesce rapid feedback, including continuous sliders. Defaults to 80 ms. */\n minimumIntervalMs?: number;\n pressStyle?: NeuHapticImpact;\n}\nexport interface NeuHapticsDriver {\n available(): boolean;\n play(feedback: Exclude<NeuHapticFeedback, 'press'>): void | Promise<void>;\n}\nexport const NEU_HAPTICS_OPTIONS = new InjectionToken<NeuHapticsOptions>('Neural haptics options', {\n providedIn: 'root', factory: () => ({ enabled: false }),\n});\n/** Platform boundary, replaceable by consumers and contract tests. */\nexport const NEU_HAPTICS_DRIVER = new InjectionToken<NeuHapticsDriver | null>('Neural haptics driver', {\n providedIn: 'root', factory: () => null,\n});\n\n/** Optional feedback: a missing motor or failed vibration must never block an action. */\n@Injectable({ providedIn: 'root' })\nexport class NeuHaptics {\n private readonly options = inject(NEU_HAPTICS_OPTIONS);\n private readonly driver = inject(NEU_HAPTICS_DRIVER);\n readonly enabled = signal(this.options.enabled ?? false);\n private lastAt = -Infinity;\n\n get available(): boolean {\n try { return this.driver?.available() ?? false; } catch { return false; }\n }\n\n /** True means a request was dispatched, not that hardware physically vibrated. */\n play(feedback: NeuHapticFeedback | false = 'press'): boolean {\n if (!feedback || !this.enabled() || !this.available || !this.driver) return false;\n const configured = this.options.minimumIntervalMs ?? 80;\n const interval = Number.isFinite(configured) ? Math.max(0, Math.min(1000, configured)) : 80;\n const now = Date.now();\n if (now >= this.lastAt && now - this.lastAt < interval) return false;\n try {\n const result = this.driver.play(feedback === 'press' ? (this.options.pressStyle ?? 'light') : feedback);\n this.lastAt = now;\n // A consumer-supplied asynchronous driver must not leak rejected promises.\n if (result) void Promise.resolve(result).catch(() => undefined);\n return true;\n } catch { return false; }\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const NEU_CHEVRON_DOWN: string;
|
|
2
|
+
export declare const NEU_CHEVRON_RIGHT: string;
|
|
3
|
+
export declare const NEU_CHEVRON_LEFT: string;
|
|
4
|
+
export declare const NEU_ARROW_UP: string;
|
|
5
|
+
export declare const NEU_ARROW_DOWN: string;
|
|
6
|
+
export { NEU_PLUS_ICON as NEU_PLUS, NEU_CHECK_ICON as NEU_CHECK, } from './index.js';
|
|
7
|
+
export declare const NEU_EDIT: string;
|
|
8
|
+
export declare const NEU_CLOSE: string;
|
|
9
|
+
export declare const NEU_SEARCH: string;
|
|
10
|
+
export declare const NEU_FOLDER: string;
|
|
11
|
+
export declare const NEU_FILE: string;
|
|
12
|
+
export declare const NEU_MORE: string;
|
|
13
|
+
export declare const NEU_EYE: string;
|
|
14
|
+
export declare const NEU_EYE_OFF: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const svg = (path) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${path}</svg>`;
|
|
2
|
+
export const NEU_CHEVRON_DOWN = svg('<path d="m6 9 6 6 6-6"/>');
|
|
3
|
+
export const NEU_CHEVRON_RIGHT = svg('<path d="m9 6 6 6-6 6"/>');
|
|
4
|
+
export const NEU_CHEVRON_LEFT = svg('<path d="m15 6-6 6 6 6"/>');
|
|
5
|
+
export const NEU_ARROW_UP = svg('<path d="m6 12 6-6 6 6M12 6v12"/>');
|
|
6
|
+
export const NEU_ARROW_DOWN = svg('<path d="m6 12 6 6 6-6M12 6v12"/>');
|
|
7
|
+
export { NEU_PLUS_ICON as NEU_PLUS, NEU_CHECK_ICON as NEU_CHECK, } from './index.js';
|
|
8
|
+
export const NEU_EDIT = svg('<path d="m16 3 5 5-13 13H3v-5zM14 5l5 5"/>');
|
|
9
|
+
export const NEU_CLOSE = svg('<path d="m6 6 12 12M18 6 6 18"/>');
|
|
10
|
+
export const NEU_SEARCH = svg('<circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4 4"/>');
|
|
11
|
+
export const NEU_FOLDER = svg('<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10H3Z"/>');
|
|
12
|
+
export const NEU_FILE = svg('<path d="M14 3H5v18h14V8Z"/><path d="M14 3v5h5M8 13h8M8 17h5"/>');
|
|
13
|
+
export const NEU_MORE = svg('<circle cx="12" cy="5" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="12" cy="19" r="1"/>');
|
|
14
|
+
export const NEU_EYE = svg('<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/>');
|
|
15
|
+
export const NEU_EYE_OFF = svg('<path d="m3 3 18 18M10.6 5.1A11.7 11.7 0 0 1 12 5c6.5 0 10 7 10 7a19 19 0 0 1-3.3 4.3M6.2 6.2A20 20 0 0 0 2 12s3.5 7 10 7a12 12 0 0 0 5.8-1.8M10 10a3 3 0 0 0 4 4"/>');
|
|
16
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/foundation/icons.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAC3B,iKAAiK,IAAI,QAAQ,CAAC;AAChL,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC,0BAA0B,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACvE,OAAO,EACL,aAAa,IAAI,QAAQ,EACzB,cAAc,IAAI,SAAS,GAC5B,MAAM,YAAY,CAAC;AACpB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC,kCAAkC,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC,6DAA6D,CAAC,CAAC;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAC3B,4DAA4D,CAC7D,CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,iEAAiE,CAClE,CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,8FAA8F,CAC/F,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CACxB,6FAA6F,CAC9F,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,sKAAsK,CACvK,CAAC","sourcesContent":["const svg = (path: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${path}</svg>`;\nexport const NEU_CHEVRON_DOWN = svg('<path d=\"m6 9 6 6 6-6\"/>');\nexport const NEU_CHEVRON_RIGHT = svg('<path d=\"m9 6 6 6-6 6\"/>');\nexport const NEU_CHEVRON_LEFT = svg('<path d=\"m15 6-6 6 6 6\"/>');\nexport const NEU_ARROW_UP = svg('<path d=\"m6 12 6-6 6 6M12 6v12\"/>');\nexport const NEU_ARROW_DOWN = svg('<path d=\"m6 12 6 6 6-6M12 6v12\"/>');\nexport {\n NEU_PLUS_ICON as NEU_PLUS,\n NEU_CHECK_ICON as NEU_CHECK,\n} from './index.js';\nexport const NEU_EDIT = svg('<path d=\"m16 3 5 5-13 13H3v-5zM14 5l5 5\"/>');\nexport const NEU_CLOSE = svg('<path d=\"m6 6 12 12M18 6 6 18\"/>');\nexport const NEU_SEARCH = svg('<circle cx=\"10.5\" cy=\"10.5\" r=\"6.5\"/><path d=\"m16 16 4 4\"/>');\nexport const NEU_FOLDER = svg(\n '<path d=\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v10H3Z\"/>',\n);\nexport const NEU_FILE = svg(\n '<path d=\"M14 3H5v18h14V8Z\"/><path d=\"M14 3v5h5M8 13h8M8 17h5\"/>',\n);\nexport const NEU_MORE = svg(\n '<circle cx=\"12\" cy=\"5\" r=\"1\"/><circle cx=\"12\" cy=\"12\" r=\"1\"/><circle cx=\"12\" cy=\"19\" r=\"1\"/>',\n);\nexport const NEU_EYE = svg(\n '<path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>',\n);\nexport const NEU_EYE_OFF = svg(\n '<path d=\"m3 3 18 18M10.6 5.1A11.7 11.7 0 0 1 12 5c6.5 0 10 7 10 7a19 19 0 0 1-3.3 4.3M6.2 6.2A20 20 0 0 0 2 12s3.5 7 10 7a12 12 0 0 0 5.8-1.8M10 10a3 3 0 0 0 4 4\"/>',\n);\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InjectionToken, type Signal } from '@angular/core';
|
|
2
|
+
export * from './haptics.js';
|
|
3
|
+
export type NeuSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type NeuVariant = 'solid' | 'tonal' | 'outline' | 'text';
|
|
5
|
+
export type NeuTone = 'neutral' | 'brand' | 'accent' | 'success' | 'info' | 'warning' | 'danger';
|
|
6
|
+
export type NeuColorScheme = 'system' | 'light' | 'dark';
|
|
7
|
+
export interface NeuTokens {
|
|
8
|
+
accent: string;
|
|
9
|
+
onAccent: string;
|
|
10
|
+
surface: string;
|
|
11
|
+
canvas: string;
|
|
12
|
+
text: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
border: string;
|
|
15
|
+
tonal: string;
|
|
16
|
+
danger: string;
|
|
17
|
+
success: string;
|
|
18
|
+
warning: string;
|
|
19
|
+
warningText: string;
|
|
20
|
+
onWarning: string;
|
|
21
|
+
info: string;
|
|
22
|
+
/** Optional semantic text inks; defaults are resolved against the theme surfaces. */
|
|
23
|
+
accentText?: string;
|
|
24
|
+
dangerText?: string;
|
|
25
|
+
successText?: string;
|
|
26
|
+
infoText?: string;
|
|
27
|
+
radius: number;
|
|
28
|
+
spacing: number;
|
|
29
|
+
fontSize: number;
|
|
30
|
+
duration: number;
|
|
31
|
+
/** Decorative surfaces; independent of the functional control border. */
|
|
32
|
+
surfaceBorder?: string;
|
|
33
|
+
divider?: string;
|
|
34
|
+
surfaceSecondary?: string;
|
|
35
|
+
/** Dedicated image canvas and readable control ink, independent of app scheme. */
|
|
36
|
+
mediaCanvas?: string;
|
|
37
|
+
mediaText?: string;
|
|
38
|
+
mediaBarStyle?: 'light' | 'dark';
|
|
39
|
+
}
|
|
40
|
+
export declare const NEU_LIGHT_TOKENS: Readonly<NeuTokens>;
|
|
41
|
+
export declare const NEU_DARK_TOKENS: Readonly<NeuTokens>;
|
|
42
|
+
export declare const NEU_THEME: InjectionToken<Signal<Readonly<NeuTokens>>>;
|
|
43
|
+
export declare const NEU_CHECK_ICON = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m5 12 4 4 10-10\"/></svg>";
|
|
44
|
+
export declare const NEU_PLUS_ICON = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M12 5v14M5 12h14\"/></svg>";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export * from './haptics.js';
|
|
3
|
+
export const NEU_LIGHT_TOKENS = Object.freeze({
|
|
4
|
+
accent: '#006ee6',
|
|
5
|
+
onAccent: '#ffffff',
|
|
6
|
+
surface: '#ffffff',
|
|
7
|
+
canvas: '#f4f5f7',
|
|
8
|
+
text: '#172033',
|
|
9
|
+
muted: '#596477',
|
|
10
|
+
border: '#a5afbf',
|
|
11
|
+
tonal: '#eff6ff',
|
|
12
|
+
danger: '#dc2626',
|
|
13
|
+
success: '#15803d',
|
|
14
|
+
warning: '#f59e0b',
|
|
15
|
+
warningText: '#92400e',
|
|
16
|
+
onWarning: '#111827',
|
|
17
|
+
info: '#0064d1',
|
|
18
|
+
radius: 12,
|
|
19
|
+
spacing: 16,
|
|
20
|
+
fontSize: 16,
|
|
21
|
+
duration: 120,
|
|
22
|
+
surfaceBorder: '#e1e6ed',
|
|
23
|
+
divider: '#e7ebf0',
|
|
24
|
+
surfaceSecondary: '#eef1f5',
|
|
25
|
+
mediaCanvas: '#111722',
|
|
26
|
+
mediaText: '#edf1fa',
|
|
27
|
+
mediaBarStyle: 'light',
|
|
28
|
+
});
|
|
29
|
+
export const NEU_DARK_TOKENS = Object.freeze({
|
|
30
|
+
...NEU_LIGHT_TOKENS,
|
|
31
|
+
accent: '#b5c4ff',
|
|
32
|
+
onAccent: '#172955',
|
|
33
|
+
surface: '#1b2230',
|
|
34
|
+
canvas: '#111722',
|
|
35
|
+
text: '#edf1fa',
|
|
36
|
+
muted: '#b4bed0',
|
|
37
|
+
border: '#6c7a92',
|
|
38
|
+
tonal: '#293756',
|
|
39
|
+
danger: '#ffb4ab',
|
|
40
|
+
success: '#8fdeb1',
|
|
41
|
+
warning: '#efd48f',
|
|
42
|
+
warningText: '#efd48f',
|
|
43
|
+
onWarning: '#111722',
|
|
44
|
+
info: '#7dd3fc',
|
|
45
|
+
surfaceBorder: '#354052',
|
|
46
|
+
divider: '#303b4c',
|
|
47
|
+
surfaceSecondary: '#222d3f',
|
|
48
|
+
});
|
|
49
|
+
export const NEU_THEME = new InjectionToken('Neural Native theme');
|
|
50
|
+
export const NEU_CHECK_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 4 4 10-10"/></svg>';
|
|
51
|
+
export const NEU_PLUS_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>';
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/foundation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAC5D,cAAc,cAAc,CAAC;AAsC7B,MAAM,CAAC,MAAM,gBAAgB,GAAwB,MAAM,CAAC,MAAM,CAAC;IACjE,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,GAAG;IACb,aAAa,EAAE,SAAS;IACxB,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,SAAS;IAC3B,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,OAAO;CACvB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,eAAe,GAAwB,MAAM,CAAC,MAAM,CAAC;IAChE,GAAG,gBAAgB;IACnB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,SAAS;CAC5B,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,cAAc,CACzC,qBAAqB,CACtB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GACzB,8JAA8J,CAAC;AACjK,MAAM,CAAC,MAAM,aAAa,GACxB,uIAAuI,CAAC","sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nexport * from './haptics.js';\nexport type NeuSize = 'sm' | 'md' | 'lg';\nexport type NeuVariant = 'solid' | 'tonal' | 'outline' | 'text';\nexport type NeuTone = 'neutral' | 'brand' | 'accent' | 'success' | 'info' | 'warning' | 'danger';\nexport type NeuColorScheme = 'system' | 'light' | 'dark';\nexport interface NeuTokens {\n accent: string;\n onAccent: string;\n surface: string;\n canvas: string;\n text: string;\n muted: string;\n border: string;\n tonal: string;\n danger: string;\n success: string;\n warning: string;\n warningText: string;\n onWarning: string;\n info: string;\n /** Optional semantic text inks; defaults are resolved against the theme surfaces. */\n accentText?: string;\n dangerText?: string;\n successText?: string;\n infoText?: string;\n radius: number;\n spacing: number;\n fontSize: number;\n duration: number;\n /** Decorative surfaces; independent of the functional control border. */\n surfaceBorder?: string;\n divider?: string;\n surfaceSecondary?: string;\n /** Dedicated image canvas and readable control ink, independent of app scheme. */\n mediaCanvas?: string;\n mediaText?: string;\n mediaBarStyle?: 'light' | 'dark';\n}\nexport const NEU_LIGHT_TOKENS: Readonly<NeuTokens> = Object.freeze({\n accent: '#006ee6',\n onAccent: '#ffffff',\n surface: '#ffffff',\n canvas: '#f4f5f7',\n text: '#172033',\n muted: '#596477',\n border: '#a5afbf',\n tonal: '#eff6ff',\n danger: '#dc2626',\n success: '#15803d',\n warning: '#f59e0b',\n warningText: '#92400e',\n onWarning: '#111827',\n info: '#0064d1',\n radius: 12,\n spacing: 16,\n fontSize: 16,\n duration: 120,\n surfaceBorder: '#e1e6ed',\n divider: '#e7ebf0',\n surfaceSecondary: '#eef1f5',\n mediaCanvas: '#111722',\n mediaText: '#edf1fa',\n mediaBarStyle: 'light',\n});\nexport const NEU_DARK_TOKENS: Readonly<NeuTokens> = Object.freeze({\n ...NEU_LIGHT_TOKENS,\n accent: '#b5c4ff',\n onAccent: '#172955',\n surface: '#1b2230',\n canvas: '#111722',\n text: '#edf1fa',\n muted: '#b4bed0',\n border: '#6c7a92',\n tonal: '#293756',\n danger: '#ffb4ab',\n success: '#8fdeb1',\n warning: '#efd48f',\n warningText: '#efd48f',\n onWarning: '#111722',\n info: '#7dd3fc',\n surfaceBorder: '#354052',\n divider: '#303b4c',\n surfaceSecondary: '#222d3f',\n});\nexport const NEU_THEME = new InjectionToken<Signal<Readonly<NeuTokens>>>(\n 'Neural Native theme',\n);\nexport const NEU_CHECK_ICON =\n '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m5 12 4 4 10-10\"/></svg>';\nexport const NEU_PLUS_ICON =\n '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M12 5v14M5 12h14\"/></svg>';\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface NeuOption {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface NeuTreeNode extends NeuOption {
|
|
9
|
+
readonly children?: readonly NeuTreeNode[];
|
|
10
|
+
}
|
|
11
|
+
export interface NeuImageItem {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly uri: string;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function finite(value: number, fallback?: number): number;
|
|
17
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
18
|
+
export declare function bounded(value: number, min: number, max: number, step?: number): number;
|
|
19
|
+
export declare function uniqueOptions(options: readonly NeuOption[]): readonly NeuOption[];
|
|
20
|
+
export declare abstract class NeuTextControl {
|
|
21
|
+
protected readonly labelNativeId: string;
|
|
22
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
23
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
24
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
25
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
26
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
28
|
+
readonly hint: import("@angular/core").InputSignal<string>;
|
|
29
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
30
|
+
readonly requiredLabel: import("@angular/core").InputSignal<string>;
|
|
31
|
+
readonly error: import("@angular/core").InputSignal<string>;
|
|
32
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
33
|
+
protected readonly fieldHint: import("@angular/core").Signal<string | undefined>;
|
|
34
|
+
protected accept(value: string): void;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NeuTextControl, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NeuTextControl, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "requiredLabel": { "alias": "requiredLabel"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Directive, booleanAttribute, computed, input, model, output, } from '@angular/core';
|
|
2
|
+
import { controlLabelId } from './control-label.js';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export function finite(value, fallback = 0) {
|
|
5
|
+
return Number.isFinite(value) ? value : fallback;
|
|
6
|
+
}
|
|
7
|
+
export function clamp(value, min, max) {
|
|
8
|
+
return Math.min(Math.max(finite(value, min), min), max);
|
|
9
|
+
}
|
|
10
|
+
export function bounded(value, min, max, step = 1) {
|
|
11
|
+
const lo = finite(min), hi = Math.max(lo, finite(max, lo)), s = Math.max(Number.EPSILON, Math.abs(finite(step, 1)));
|
|
12
|
+
const n = lo + Math.round((finite(value, lo) - lo) / s) * s;
|
|
13
|
+
return clamp(Number(n.toFixed(10)), lo, hi);
|
|
14
|
+
}
|
|
15
|
+
export function uniqueOptions(options) {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
return options.filter((x) => {
|
|
18
|
+
if (seen.has(x.id))
|
|
19
|
+
return false;
|
|
20
|
+
seen.add(x.id);
|
|
21
|
+
return true;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export class NeuTextControl {
|
|
25
|
+
labelNativeId = controlLabelId();
|
|
26
|
+
value = model('', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
28
|
+
label = input.required(/* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
30
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
31
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
32
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
33
|
+
touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
34
|
+
hint = input('', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
36
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
37
|
+
requiredLabel = input('Required', /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "requiredLabel" }] : /* istanbul ignore next */ []));
|
|
39
|
+
error = input('', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
41
|
+
touch = output();
|
|
42
|
+
fieldHint = computed(() => [
|
|
43
|
+
this.required() ? this.requiredLabel() : '',
|
|
44
|
+
this.invalid() && this.error() ? this.error() : this.hint(),
|
|
45
|
+
].filter(Boolean).join('. ') || undefined, /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "fieldHint" }] : /* istanbul ignore next */ []));
|
|
47
|
+
accept(value) {
|
|
48
|
+
if (!this.disabled() && !this.readonly()) {
|
|
49
|
+
this.value.set(value);
|
|
50
|
+
this.touch.emit();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTextControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
54
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.2", type: NeuTextControl, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, requiredLabel: { classPropertyName: "requiredLabel", publicName: "requiredLabel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, ngImport: i0 });
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: NeuTextControl, decorators: [{
|
|
57
|
+
type: Directive
|
|
58
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], requiredLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredLabel", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] } });
|
|
59
|
+
//# sourceMappingURL=mobile.js.map
|