framework7-react 6.3.15 → 7.0.0-beta.11
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/components/{accordion-content/accordion-content.d.ts → accordion-content.d.ts} +0 -0
- package/{esm/components → components}/accordion-content.js +15 -15
- package/components/{accordion-item/accordion-item.d.ts → accordion-item.d.ts} +0 -0
- package/{esm/components → components}/accordion-item.js +28 -28
- package/components/{accordion-toggle/accordion-toggle.d.ts → accordion-toggle.d.ts} +0 -0
- package/{esm/components → components}/accordion-toggle.js +15 -15
- package/components/{accordion/accordion.d.ts → accordion.d.ts} +0 -0
- package/components/accordion.js +29 -0
- package/components/{actions-button/actions-button.d.ts → actions-button.d.ts} +0 -0
- package/{esm/components → components}/actions-button.js +20 -21
- package/components/{actions-group/actions-group.d.ts → actions-group.d.ts} +0 -0
- package/{esm/components → components}/actions-group.js +15 -15
- package/components/{actions-label/actions-label.d.ts → actions-label.d.ts} +0 -0
- package/{esm/components → components}/actions-label.js +17 -17
- package/components/{actions/actions.d.ts → actions.d.ts} +0 -0
- package/components/actions.js +138 -0
- package/components/{app/app.d.ts → app.d.ts} +0 -0
- package/{esm/components → components}/app.js +24 -27
- package/components/{appbar/appbar.d.ts → appbar.d.ts} +0 -0
- package/{esm/components → components}/appbar.js +22 -23
- package/components/{area-chart/area-chart.d.ts → area-chart.d.ts} +0 -0
- package/components/area-chart.js +354 -0
- package/components/{badge/badge.d.ts → badge.d.ts} +0 -0
- package/{esm/components → components}/badge.js +16 -16
- package/components/{block-footer/block-footer.d.ts → block-footer.d.ts} +0 -0
- package/{esm/components → components}/block-footer.js +15 -15
- package/components/{block-header/block-header.d.ts → block-header.d.ts} +0 -0
- package/{esm/components → components}/block-header.js +15 -15
- package/components/{block-title/block-title.d.ts → block-title.d.ts} +0 -0
- package/{esm/components → components}/block-title.js +17 -17
- package/components/{block/block.d.ts → block.d.ts} +0 -0
- package/components/block.js +63 -0
- package/components/breadcrumbs-collapsed.d.ts +16 -0
- package/components/breadcrumbs-collapsed.js +32 -0
- package/components/breadcrumbs-item.d.ts +17 -0
- package/components/breadcrumbs-item.js +33 -0
- package/components/breadcrumbs-separator.d.ts +15 -0
- package/components/breadcrumbs-separator.js +25 -0
- package/components/breadcrumbs.d.ts +15 -0
- package/components/breadcrumbs.js +26 -0
- package/components/{button/button.d.ts → button.d.ts} +0 -0
- package/{esm/components → components}/button.js +64 -65
- package/components/{card-content/card-content.d.ts → card-content.d.ts} +0 -0
- package/{esm/components → components}/card-content.js +16 -17
- package/components/{card-footer/card-footer.d.ts → card-footer.d.ts} +0 -0
- package/{esm/components → components}/card-footer.js +15 -15
- package/components/{card-header/card-header.d.ts → card-header.d.ts} +0 -0
- package/{esm/components → components}/card-header.js +15 -15
- package/components/{card/card.d.ts → card.d.ts} +0 -0
- package/{esm/components → components}/card.js +62 -62
- package/components/{checkbox/checkbox.d.ts → checkbox.d.ts} +0 -0
- package/{esm/components → components}/checkbox.js +29 -29
- package/components/{chip/chip.d.ts → chip.d.ts} +0 -0
- package/{esm/components → components}/chip.js +30 -30
- package/components/{col/col.d.ts → col.d.ts} +0 -0
- package/components/col.js +75 -0
- package/components/{fab-backdrop/fab-backdrop.d.ts → fab-backdrop.d.ts} +0 -0
- package/{esm/components → components}/fab-backdrop.js +14 -14
- package/components/{fab-button/fab-button.d.ts → fab-button.d.ts} +0 -0
- package/{esm/components → components}/fab-button.js +21 -21
- package/components/{fab-buttons/fab-buttons.d.ts → fab-buttons.d.ts} +0 -0
- package/components/fab-buttons.js +29 -0
- package/components/{fab/fab.d.ts → fab.d.ts} +0 -0
- package/{esm/components → components}/fab.js +36 -37
- package/components/{gauge/gauge.d.ts → gauge.d.ts} +0 -0
- package/components/gauge.js +104 -0
- package/components/{icon/icon.d.ts → icon.d.ts} +0 -0
- package/{esm/components → components}/icon.js +34 -34
- package/components/{input/input.d.ts → input.d.ts} +0 -0
- package/{esm/components → components}/input.js +132 -146
- package/components/{link/link.d.ts → link.d.ts} +0 -0
- package/components/link.js +102 -0
- package/components/{list-button/list-button.d.ts → list-button.d.ts} +0 -0
- package/{esm/components → components}/list-button.js +37 -34
- package/components/{list-group/list-group.d.ts → list-group.d.ts} +0 -0
- package/{esm/components → components}/list-group.js +24 -24
- package/components/{list-index/list-index.d.ts → list-index.d.ts} +0 -0
- package/components/list-index.js +94 -0
- package/components/{list-input/list-input.d.ts → list-input.d.ts} +0 -0
- package/{esm/components → components}/list-input.js +146 -163
- package/components/{list-item-cell/list-item-cell.d.ts → list-item-cell.d.ts} +0 -0
- package/{esm/components → components}/list-item-cell.js +15 -15
- package/components/{list-item-content/list-item-content.d.ts → list-item-content.d.ts} +0 -0
- package/{esm/components → components}/list-item-content.js +55 -53
- package/components/{list-item-row/list-item-row.d.ts → list-item-row.d.ts} +0 -0
- package/{esm/components → components}/list-item-row.js +15 -15
- package/components/{list-item/list-item.d.ts → list-item.d.ts} +0 -0
- package/{esm/components → components}/list-item.js +99 -108
- package/components/{list/list.d.ts → list.d.ts} +0 -0
- package/{esm/components → components}/list.js +104 -101
- package/components/{login-screen-title/login-screen-title.d.ts → login-screen-title.d.ts} +0 -0
- package/{esm/components → components}/login-screen-title.js +15 -15
- package/components/{login-screen/login-screen.d.ts → login-screen.d.ts} +0 -0
- package/components/login-screen.js +119 -0
- package/components/{menu-dropdown-item/menu-dropdown-item.d.ts → menu-dropdown-item.d.ts} +0 -0
- package/{esm/components → components}/menu-dropdown-item.js +31 -31
- package/components/{menu-dropdown/menu-dropdown.d.ts → menu-dropdown.d.ts} +0 -0
- package/{esm/components → components}/menu-dropdown.js +21 -21
- package/components/{menu-item/menu-item.d.ts → menu-item.d.ts} +0 -0
- package/{esm/components → components}/menu-item.js +44 -44
- package/components/{menu/menu.d.ts → menu.d.ts} +0 -0
- package/{esm/components → components}/menu.js +15 -15
- package/components/{message/message.d.ts → message.d.ts} +0 -0
- package/{esm/components → components}/message.js +40 -41
- package/components/{messagebar-attachment/messagebar-attachment.d.ts → messagebar-attachment.d.ts} +0 -0
- package/{esm/components → components}/messagebar-attachment.js +19 -20
- package/components/{messagebar-attachments/messagebar-attachments.d.ts → messagebar-attachments.d.ts} +0 -0
- package/{esm/components → components}/messagebar-attachments.js +15 -15
- package/components/{messagebar-sheet-image/messagebar-sheet-image.d.ts → messagebar-sheet-image.d.ts} +0 -0
- package/{esm/components → components}/messagebar-sheet-image.js +22 -23
- package/components/{messagebar-sheet-item/messagebar-sheet-item.d.ts → messagebar-sheet-item.d.ts} +0 -0
- package/{esm/components → components}/messagebar-sheet-item.js +15 -15
- package/components/{messagebar-sheet/messagebar-sheet.d.ts → messagebar-sheet.d.ts} +0 -0
- package/{esm/components → components}/messagebar-sheet.js +15 -15
- package/components/{messagebar/messagebar.d.ts → messagebar.d.ts} +0 -0
- package/components/messagebar.js +202 -0
- package/components/{messages-title/messages-title.d.ts → messages-title.d.ts} +0 -0
- package/{esm/components → components}/messages-title.js +15 -15
- package/components/{messages/messages.d.ts → messages.d.ts} +0 -0
- package/components/messages.js +139 -0
- package/components/{nav-left/nav-left.d.ts → nav-left.d.ts} +0 -0
- package/{esm/components → components}/nav-left.js +28 -28
- package/components/{nav-right/nav-right.d.ts → nav-right.d.ts} +0 -0
- package/{esm/components → components}/nav-right.js +17 -17
- package/components/{nav-title-large/nav-title-large.d.ts → nav-title-large.d.ts} +0 -0
- package/{esm/components → components}/nav-title-large.js +15 -15
- package/components/{nav-title/nav-title.d.ts → nav-title.d.ts} +0 -0
- package/{esm/components → components}/nav-title.js +20 -20
- package/components/{navbar/navbar.d.ts → navbar.d.ts} +0 -0
- package/{esm/components → components}/navbar.js +80 -81
- package/components/{page-content/page-content.d.ts → page-content.d.ts} +0 -0
- package/{esm/components → components}/page-content.js +50 -52
- package/components/{page/page.d.ts → page.d.ts} +0 -0
- package/{esm/components → components}/page.js +104 -107
- package/components/{panel/panel.d.ts → panel.d.ts} +0 -0
- package/components/panel.js +198 -0
- package/components/{photo-browser/photo-browser.d.ts → photo-browser.d.ts} +0 -0
- package/components/photo-browser.js +164 -0
- package/components/{pie-chart/pie-chart.d.ts → pie-chart.d.ts} +0 -0
- package/components/pie-chart.js +171 -0
- package/components/{popover/popover.d.ts → popover.d.ts} +0 -0
- package/components/popover.js +134 -0
- package/components/{popup/popup.d.ts → popup.d.ts} +0 -0
- package/components/popup.js +155 -0
- package/components/{preloader/preloader.d.ts → preloader.d.ts} +0 -0
- package/{esm/components → components}/preloader.js +23 -23
- package/components/{progressbar/progressbar.d.ts → progressbar.d.ts} +0 -0
- package/components/progressbar.js +46 -0
- package/components/{radio/radio.d.ts → radio.d.ts} +0 -0
- package/{esm/components → components}/radio.js +24 -24
- package/components/{range/range.d.ts → range.d.ts} +0 -0
- package/components/range.js +130 -0
- package/components/{routable-modals/routable-modals.d.ts → routable-modals.d.ts} +0 -0
- package/{esm/components → components}/routable-modals.js +23 -25
- package/components/{row/row.d.ts → row.d.ts} +0 -0
- package/{esm/components → components}/row.js +29 -31
- package/components/{searchbar/searchbar.d.ts → searchbar.d.ts} +0 -0
- package/components/searchbar.js +226 -0
- package/components/{segmented/segmented.d.ts → segmented.d.ts} +0 -0
- package/{esm/components → components}/segmented.js +29 -30
- package/components/{sheet/sheet.d.ts → sheet.d.ts} +0 -0
- package/components/sheet.js +184 -0
- package/components/{skeleton-avatar/skeleton-avatar.d.ts → skeleton-avatar.d.ts} +1 -0
- package/{esm/components → components}/skeleton-avatar.js +1 -0
- package/components/{skeleton-block/skeleton-block.d.ts → skeleton-block.d.ts} +1 -0
- package/{esm/components → components}/skeleton-block.js +1 -0
- package/components/{skeleton-image/skeleton-image.d.ts → skeleton-image.d.ts} +1 -0
- package/{esm/components → components}/skeleton-image.js +1 -0
- package/components/{skeleton-text/skeleton-text.d.ts → skeleton-text.d.ts} +1 -0
- package/{esm/components → components}/skeleton-text.js +1 -0
- package/components/{stepper/stepper.d.ts → stepper.d.ts} +0 -0
- package/components/stepper.js +223 -0
- package/components/{subnavbar/subnavbar.d.ts → subnavbar.d.ts} +0 -0
- package/{esm/components → components}/subnavbar.js +19 -20
- package/components/{swipeout-actions/swipeout-actions.d.ts → swipeout-actions.d.ts} +0 -0
- package/{esm/components → components}/swipeout-actions.js +19 -19
- package/components/{swipeout-button/swipeout-button.d.ts → swipeout-button.d.ts} +0 -0
- package/{esm/components → components}/swipeout-button.js +23 -23
- package/components/{swiper-slide/swiper-slide.d.ts → swiper-slide.d.ts} +0 -0
- package/{esm/components → components}/swiper-slide.js +0 -0
- package/components/{swiper/swiper.d.ts → swiper.d.ts} +0 -0
- package/{esm/components → components}/swiper.js +0 -0
- package/components/{tab/tab.d.ts → tab.d.ts} +0 -0
- package/{esm/components → components}/tab.js +45 -45
- package/components/{tabs/tabs.d.ts → tabs.d.ts} +0 -0
- package/{esm/components → components}/tabs.js +23 -23
- package/components/{text-editor/text-editor.d.ts → text-editor.d.ts} +0 -0
- package/components/text-editor.js +141 -0
- package/components/{toggle/toggle.d.ts → toggle.d.ts} +0 -0
- package/components/toggle.js +114 -0
- package/components/{toolbar/toolbar.d.ts → toolbar.d.ts} +0 -0
- package/{esm/components → components}/toolbar.js +47 -48
- package/components/{treeview-item/treeview-item.d.ts → treeview-item.d.ts} +0 -0
- package/{esm/components → components}/treeview-item.js +45 -44
- package/components/{treeview/treeview.d.ts → treeview.d.ts} +0 -0
- package/{esm/components → components}/treeview.js +15 -15
- package/components/{view/view.d.ts → view.d.ts} +0 -0
- package/components/view.js +238 -0
- package/components/{views/views.d.ts → views.d.ts} +0 -0
- package/{esm/components → components}/views.js +17 -17
- package/framework7-react.d.ts +5 -1
- package/framework7-react.js +119 -0
- package/package.json +6 -4
- package/{esm/shared → shared}/components-router.js +78 -68
- package/{esm/shared → shared}/f7.js +15 -23
- package/shared/get-router-initial-component.js +39 -0
- package/{esm/shared → shared}/list-context.js +1 -1
- package/{esm/shared → shared}/mixins.js +91 -77
- package/shared/modal-state-classes.js +9 -0
- package/{esm/shared → shared}/plugin.js +13 -14
- package/shared/router-context.js +6 -0
- package/shared/router-open-in.js +106 -0
- package/shared/tabbar-context.js +5 -0
- package/{esm/shared → shared}/use-async-component.js +2 -2
- package/shared/use-icon.js +35 -0
- package/{esm/shared → shared}/use-isomorphic-layout-effect.js +0 -0
- package/{esm/shared → shared}/use-route-props.js +5 -6
- package/{esm/shared → shared}/use-smart-select.js +8 -8
- package/shared/use-store.js +35 -0
- package/{esm/shared → shared}/use-tab.js +10 -10
- package/shared/use-theme.js +13 -0
- package/{esm/shared → shared}/use-tooltip.js +13 -11
- package/{esm/shared → shared}/utils.js +42 -69
- package/{esm/shared → shared}/watch-prop.js +4 -4
- package/cjs/components/accordion-content.js +0 -40
- package/cjs/components/accordion-item.js +0 -112
- package/cjs/components/accordion-toggle.js +0 -41
- package/cjs/components/accordion.js +0 -41
- package/cjs/components/actions-button.js +0 -68
- package/cjs/components/actions-group.js +0 -40
- package/cjs/components/actions-label.js +0 -50
- package/cjs/components/actions.js +0 -160
- package/cjs/components/app.js +0 -77
- package/cjs/components/appbar.js +0 -58
- package/cjs/components/area-chart.js +0 -397
- package/cjs/components/badge.js +0 -48
- package/cjs/components/block-footer.js +0 -40
- package/cjs/components/block-header.js +0 -40
- package/cjs/components/block-title.js +0 -45
- package/cjs/components/block.js +0 -76
- package/cjs/components/button.js +0 -167
- package/cjs/components/card-content.js +0 -44
- package/cjs/components/card-footer.js +0 -40
- package/cjs/components/card-header.js +0 -40
- package/cjs/components/card.js +0 -196
- package/cjs/components/checkbox.js +0 -79
- package/cjs/components/chip.js +0 -89
- package/cjs/components/col.js +0 -84
- package/cjs/components/fab-backdrop.js +0 -38
- package/cjs/components/fab-button.js +0 -65
- package/cjs/components/fab-buttons.js +0 -41
- package/cjs/components/fab.js +0 -98
- package/cjs/components/gauge.js +0 -127
- package/cjs/components/icon.js +0 -109
- package/cjs/components/input.js +0 -469
- package/cjs/components/link.js +0 -124
- package/cjs/components/list-button.js +0 -75
- package/cjs/components/list-group.js +0 -62
- package/cjs/components/list-index.js +0 -120
- package/cjs/components/list-input.js +0 -472
- package/cjs/components/list-item-cell.js +0 -40
- package/cjs/components/list-item-content.js +0 -180
- package/cjs/components/list-item-row.js +0 -40
- package/cjs/components/list-item.js +0 -406
- package/cjs/components/list.js +0 -250
- package/cjs/components/login-screen-title.js +0 -40
- package/cjs/components/login-screen.js +0 -142
- package/cjs/components/menu-dropdown-item.js +0 -72
- package/cjs/components/menu-dropdown.js +0 -54
- package/cjs/components/menu-item.js +0 -120
- package/cjs/components/menu.js +0 -42
- package/cjs/components/message.js +0 -133
- package/cjs/components/messagebar-attachment.js +0 -59
- package/cjs/components/messagebar-attachments.js +0 -40
- package/cjs/components/messagebar-sheet-image.js +0 -59
- package/cjs/components/messagebar-sheet-item.js +0 -40
- package/cjs/components/messagebar-sheet.js +0 -40
- package/cjs/components/messagebar.js +0 -230
- package/cjs/components/messages-title.js +0 -40
- package/cjs/components/messages.js +0 -164
- package/cjs/components/nav-left.js +0 -76
- package/cjs/components/nav-right.js +0 -43
- package/cjs/components/nav-title-large.js +0 -42
- package/cjs/components/nav-title.js +0 -53
- package/cjs/components/navbar.js +0 -279
- package/cjs/components/page-content.js +0 -173
- package/cjs/components/page.js +0 -423
- package/cjs/components/panel.js +0 -231
- package/cjs/components/photo-browser.js +0 -180
- package/cjs/components/pie-chart.js +0 -202
- package/cjs/components/popover.js +0 -157
- package/cjs/components/popup.js +0 -183
- package/cjs/components/preloader.js +0 -101
- package/cjs/components/progressbar.js +0 -60
- package/cjs/components/radio.js +0 -68
- package/cjs/components/range.js +0 -164
- package/cjs/components/routable-modals.js +0 -71
- package/cjs/components/row.js +0 -79
- package/cjs/components/searchbar.js +0 -257
- package/cjs/components/segmented.js +0 -71
- package/cjs/components/sheet.js +0 -213
- package/cjs/components/skeleton-avatar.js +0 -9
- package/cjs/components/skeleton-block.js +0 -9
- package/cjs/components/skeleton-image.js +0 -9
- package/cjs/components/skeleton-text.js +0 -9
- package/cjs/components/stepper.js +0 -260
- package/cjs/components/subnavbar.js +0 -50
- package/cjs/components/swipeout-actions.js +0 -50
- package/cjs/components/swipeout-button.js +0 -61
- package/cjs/components/swiper-slide.js +0 -9
- package/cjs/components/swiper.js +0 -9
- package/cjs/components/tab.js +0 -141
- package/cjs/components/tabs.js +0 -72
- package/cjs/components/text-editor.js +0 -160
- package/cjs/components/toggle.js +0 -137
- package/cjs/components/toolbar.js +0 -125
- package/cjs/components/treeview-item.js +0 -131
- package/cjs/components/treeview.js +0 -40
- package/cjs/components/view.js +0 -284
- package/cjs/components/views.js +0 -43
- package/cjs/framework7-react.js +0 -416
- package/cjs/shared/components-router.js +0 -243
- package/cjs/shared/f7.js +0 -105
- package/cjs/shared/get-router-initial-component.js +0 -48
- package/cjs/shared/list-context.js +0 -17
- package/cjs/shared/mixins.js +0 -165
- package/cjs/shared/modal-state-classes.js +0 -17
- package/cjs/shared/plugin.js +0 -56
- package/cjs/shared/router-context.js +0 -15
- package/cjs/shared/tabbar-context.js +0 -14
- package/cjs/shared/use-async-component.js +0 -20
- package/cjs/shared/use-icon.js +0 -50
- package/cjs/shared/use-isomorphic-layout-effect.js +0 -12
- package/cjs/shared/use-route-props.js +0 -25
- package/cjs/shared/use-smart-select.js +0 -38
- package/cjs/shared/use-store.js +0 -47
- package/cjs/shared/use-tab.js +0 -46
- package/cjs/shared/use-theme.js +0 -24
- package/cjs/shared/use-tooltip.js +0 -61
- package/cjs/shared/utils.js +0 -199
- package/cjs/shared/watch-prop.js +0 -21
- package/components/accordion/package.json +0 -9
- package/components/accordion-content/package.json +0 -9
- package/components/accordion-item/package.json +0 -9
- package/components/accordion-toggle/package.json +0 -9
- package/components/actions/package.json +0 -9
- package/components/actions-button/package.json +0 -9
- package/components/actions-group/package.json +0 -9
- package/components/actions-label/package.json +0 -9
- package/components/app/package.json +0 -9
- package/components/appbar/package.json +0 -9
- package/components/area-chart/package.json +0 -9
- package/components/badge/package.json +0 -9
- package/components/block/package.json +0 -9
- package/components/block-footer/package.json +0 -9
- package/components/block-header/package.json +0 -9
- package/components/block-title/package.json +0 -9
- package/components/button/package.json +0 -9
- package/components/card/package.json +0 -9
- package/components/card-content/package.json +0 -9
- package/components/card-footer/package.json +0 -9
- package/components/card-header/package.json +0 -9
- package/components/checkbox/package.json +0 -9
- package/components/chip/package.json +0 -9
- package/components/col/package.json +0 -9
- package/components/fab/package.json +0 -9
- package/components/fab-backdrop/package.json +0 -9
- package/components/fab-button/package.json +0 -9
- package/components/fab-buttons/package.json +0 -9
- package/components/gauge/package.json +0 -9
- package/components/icon/package.json +0 -9
- package/components/input/package.json +0 -9
- package/components/link/package.json +0 -9
- package/components/list/package.json +0 -9
- package/components/list-button/package.json +0 -9
- package/components/list-group/package.json +0 -9
- package/components/list-index/package.json +0 -9
- package/components/list-input/package.json +0 -9
- package/components/list-item/package.json +0 -9
- package/components/list-item-cell/package.json +0 -9
- package/components/list-item-content/package.json +0 -9
- package/components/list-item-row/package.json +0 -9
- package/components/login-screen/package.json +0 -9
- package/components/login-screen-title/package.json +0 -9
- package/components/menu/package.json +0 -9
- package/components/menu-dropdown/package.json +0 -9
- package/components/menu-dropdown-item/package.json +0 -9
- package/components/menu-item/package.json +0 -9
- package/components/message/package.json +0 -9
- package/components/messagebar/package.json +0 -9
- package/components/messagebar-attachment/package.json +0 -9
- package/components/messagebar-attachments/package.json +0 -9
- package/components/messagebar-sheet/package.json +0 -9
- package/components/messagebar-sheet-image/package.json +0 -9
- package/components/messagebar-sheet-item/package.json +0 -9
- package/components/messages/package.json +0 -9
- package/components/messages-title/package.json +0 -9
- package/components/nav-left/package.json +0 -9
- package/components/nav-right/package.json +0 -9
- package/components/nav-title/package.json +0 -9
- package/components/nav-title-large/package.json +0 -9
- package/components/navbar/package.json +0 -9
- package/components/page/package.json +0 -9
- package/components/page-content/package.json +0 -9
- package/components/panel/package.json +0 -9
- package/components/photo-browser/package.json +0 -9
- package/components/pie-chart/package.json +0 -9
- package/components/popover/package.json +0 -9
- package/components/popup/package.json +0 -9
- package/components/preloader/package.json +0 -9
- package/components/progressbar/package.json +0 -9
- package/components/radio/package.json +0 -9
- package/components/range/package.json +0 -9
- package/components/routable-modals/package.json +0 -9
- package/components/row/package.json +0 -9
- package/components/searchbar/package.json +0 -9
- package/components/segmented/package.json +0 -9
- package/components/sheet/package.json +0 -9
- package/components/skeleton-avatar/package.json +0 -9
- package/components/skeleton-block/package.json +0 -9
- package/components/skeleton-image/package.json +0 -9
- package/components/skeleton-text/package.json +0 -9
- package/components/stepper/package.json +0 -9
- package/components/subnavbar/package.json +0 -9
- package/components/swipeout-actions/package.json +0 -9
- package/components/swipeout-button/package.json +0 -9
- package/components/swiper/package.json +0 -9
- package/components/swiper-slide/package.json +0 -9
- package/components/tab/package.json +0 -9
- package/components/tabs/package.json +0 -9
- package/components/text-editor/package.json +0 -9
- package/components/toggle/package.json +0 -9
- package/components/toolbar/package.json +0 -9
- package/components/treeview/package.json +0 -9
- package/components/treeview-item/package.json +0 -9
- package/components/view/package.json +0 -9
- package/components/views/package.json +0 -9
- package/esm/components/accordion.js +0 -29
- package/esm/components/actions.js +0 -144
- package/esm/components/area-chart.js +0 -385
- package/esm/components/block.js +0 -63
- package/esm/components/col.js +0 -71
- package/esm/components/fab-buttons.js +0 -29
- package/esm/components/gauge.js +0 -117
- package/esm/components/link.js +0 -104
- package/esm/components/list-index.js +0 -105
- package/esm/components/login-screen.js +0 -126
- package/esm/components/messagebar.js +0 -211
- package/esm/components/messages.js +0 -149
- package/esm/components/panel.js +0 -216
- package/esm/components/photo-browser.js +0 -170
- package/esm/components/pie-chart.js +0 -190
- package/esm/components/popover.js +0 -141
- package/esm/components/popup.js +0 -167
- package/esm/components/progressbar.js +0 -46
- package/esm/components/range.js +0 -149
- package/esm/components/searchbar.js +0 -243
- package/esm/components/sheet.js +0 -196
- package/esm/components/stepper.js +0 -244
- package/esm/components/text-editor.js +0 -145
- package/esm/components/toggle.js +0 -119
- package/esm/components/view.js +0 -261
- package/esm/framework7-react.js +0 -115
- package/esm/shared/get-router-initial-component.js +0 -40
- package/esm/shared/modal-state-classes.js +0 -10
- package/esm/shared/router-context.js +0 -6
- package/esm/shared/tabbar-context.js +0 -5
- package/esm/shared/use-icon.js +0 -38
- package/esm/shared/use-store.js +0 -38
- package/esm/shared/use-theme.js +0 -15
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
|
-
import { classNames, getExtraAttrs, extend } from '../shared/utils';
|
|
5
|
-
import { colorClasses } from '../shared/mixins';
|
|
6
|
-
import { useTooltip } from '../shared/use-tooltip';
|
|
7
|
-
import { useTheme } from '../shared/use-theme';
|
|
4
|
+
import { classNames, getExtraAttrs, extend } from '../shared/utils.js';
|
|
5
|
+
import { colorClasses } from '../shared/mixins.js';
|
|
6
|
+
import { useTooltip } from '../shared/use-tooltip.js';
|
|
7
|
+
import { useTheme } from '../shared/use-theme.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
9
|
+
const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const {
|
|
12
|
+
className,
|
|
13
|
+
id,
|
|
14
|
+
style,
|
|
15
|
+
children,
|
|
16
|
+
material,
|
|
17
|
+
f7,
|
|
18
|
+
icon,
|
|
19
|
+
md,
|
|
20
|
+
ios,
|
|
21
|
+
aurora,
|
|
22
|
+
size
|
|
23
|
+
} = props;
|
|
24
|
+
const extraAttrs = getExtraAttrs(props);
|
|
25
|
+
const elRef = useRef(null);
|
|
26
|
+
useImperativeHandle(ref, () => ({
|
|
27
|
+
el: elRef.current
|
|
28
|
+
}));
|
|
29
29
|
useTooltip(elRef, props);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const getClasses = () => {
|
|
32
|
+
let classes = {
|
|
33
33
|
icon: true
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
let themeIcon;
|
|
36
36
|
if (theme && theme.ios) themeIcon = ios;else if (theme && theme.md) themeIcon = md;else if (theme && theme.aurora) themeIcon = aurora;
|
|
37
37
|
|
|
38
38
|
if (themeIcon) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const parts = themeIcon.split(':');
|
|
40
|
+
const prop = parts[0];
|
|
41
|
+
const value = parts[1];
|
|
42
42
|
|
|
43
43
|
if (prop === 'material' || prop === 'f7') {
|
|
44
44
|
classes['material-icons'] = prop === 'material';
|
|
@@ -60,8 +60,8 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
60
60
|
return classNames(className, classes, colorClasses(props));
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const getIconText = () => {
|
|
64
|
+
let text = material || f7;
|
|
65
65
|
|
|
66
66
|
if (md && theme && theme.md && (md.indexOf('material:') >= 0 || md.indexOf('f7:') >= 0)) {
|
|
67
67
|
text = md.split(':')[1];
|
|
@@ -74,10 +74,10 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
74
74
|
return text;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
let sizeComputed = size;
|
|
78
78
|
|
|
79
79
|
if (typeof size === 'number' || parseFloat(size) === size * 1) {
|
|
80
|
-
sizeComputed = size
|
|
80
|
+
sizeComputed = `${size}px`;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
return /*#__PURE__*/React.createElement("i", _extends({
|
|
File without changes
|
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { forwardRef, useRef, useImperativeHandle, useState } from 'react';
|
|
4
|
-
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect';
|
|
5
|
-
import { classNames, getExtraAttrs, getSlots, emit, extend } from '../shared/utils';
|
|
6
|
-
import { colorClasses } from '../shared/mixins';
|
|
7
|
-
import { f7ready, f7 } from '../shared/f7';
|
|
8
|
-
import { watchProp } from '../shared/watch-prop';
|
|
9
|
-
import Toggle from './toggle';
|
|
10
|
-
import Range from './range';
|
|
11
|
-
import TextEditor from './text-editor';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
4
|
+
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
|
+
import { classNames, getExtraAttrs, getSlots, emit, extend } from '../shared/utils.js';
|
|
6
|
+
import { colorClasses } from '../shared/mixins.js';
|
|
7
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
8
|
+
import { watchProp } from '../shared/watch-prop.js';
|
|
9
|
+
import Toggle from './toggle.js';
|
|
10
|
+
import Range from './range.js';
|
|
11
|
+
import TextEditor from './text-editor.js';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
id,
|
|
18
|
+
style,
|
|
19
|
+
type,
|
|
20
|
+
name,
|
|
21
|
+
value,
|
|
22
|
+
defaultValue,
|
|
23
|
+
inputmode,
|
|
24
|
+
placeholder,
|
|
25
|
+
inputId,
|
|
26
|
+
size,
|
|
27
|
+
accept,
|
|
28
|
+
autocomplete,
|
|
29
|
+
autocorrect,
|
|
30
|
+
autocapitalize,
|
|
31
|
+
spellcheck,
|
|
32
|
+
autofocus,
|
|
33
|
+
autosave,
|
|
34
|
+
checked,
|
|
35
|
+
disabled,
|
|
36
|
+
max,
|
|
37
|
+
min,
|
|
38
|
+
step,
|
|
39
|
+
maxlength,
|
|
40
|
+
minlength,
|
|
41
|
+
multiple,
|
|
42
|
+
readonly,
|
|
43
|
+
required,
|
|
44
|
+
inputStyle,
|
|
45
|
+
pattern,
|
|
46
|
+
validate,
|
|
47
|
+
validateOnBlur,
|
|
48
|
+
onValidate,
|
|
49
|
+
tabindex,
|
|
50
|
+
resizable,
|
|
51
|
+
clearButton,
|
|
52
|
+
// Form
|
|
53
|
+
noFormStoreData,
|
|
54
|
+
noStoreData,
|
|
55
|
+
ignoreStoreData,
|
|
56
|
+
// Error, Info
|
|
57
|
+
errorMessage,
|
|
58
|
+
errorMessageForce,
|
|
59
|
+
info,
|
|
60
|
+
// Outline
|
|
61
|
+
outline,
|
|
62
|
+
// Components
|
|
63
|
+
wrap = true,
|
|
64
|
+
dropdown = 'auto',
|
|
65
|
+
// Datepicker
|
|
66
|
+
calendarParams,
|
|
67
|
+
// Colorpciker
|
|
68
|
+
colorPickerParams,
|
|
69
|
+
// Text editor
|
|
70
|
+
textEditorParams
|
|
71
|
+
} = props;
|
|
72
|
+
const [inputInvalid, setInputInvalid] = useState(false);
|
|
73
|
+
const [inputFocused, setInputFocused] = useState(false);
|
|
74
|
+
const extraAttrs = getExtraAttrs(props);
|
|
75
|
+
const f7Calendar = useRef(null);
|
|
76
|
+
const f7ColorPicker = useRef(null);
|
|
77
|
+
const elRef = useRef(null);
|
|
78
|
+
const inputElRef = useRef(null);
|
|
79
|
+
const updateInputOnDidUpdate = useRef(false);
|
|
80
|
+
|
|
81
|
+
const getDomValue = () => {
|
|
82
82
|
if (!inputElRef.current) return undefined;
|
|
83
83
|
return inputElRef.current.value;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
const isInputHasValue = () => {
|
|
87
87
|
if (type === 'datepicker' && Array.isArray(value) && value.length === 0) {
|
|
88
88
|
return false;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
const domValue = getDomValue();
|
|
92
92
|
return typeof value === 'undefined' ? domValue || domValue === 0 : value || value === 0;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const validateInput = () => {
|
|
96
96
|
if (!f7 || !inputElRef.current) return;
|
|
97
|
-
|
|
97
|
+
const validity = inputElRef.current.validity;
|
|
98
98
|
if (!validity) return;
|
|
99
99
|
|
|
100
100
|
if (!validity.valid) {
|
|
@@ -112,49 +112,37 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
const onTextareaResize = event => {
|
|
116
116
|
emit(props, 'textareaResize', event);
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
const onInputNotEmpty = event => {
|
|
120
120
|
emit(props, 'inputNotEmpty', event);
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
const onInputEmpty = event => {
|
|
124
124
|
emit(props, 'inputEmpty', event);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
const onInputClear = event => {
|
|
128
128
|
emit(props, 'inputClear', event);
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
args[_key] = arguments[_key];
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
emit.apply(void 0, [props, 'input'].concat(args));
|
|
131
|
+
const onInput = (...args) => {
|
|
132
|
+
emit(props, 'input', ...args);
|
|
137
133
|
|
|
138
134
|
if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && inputElRef.current) {
|
|
139
135
|
validateInput();
|
|
140
136
|
}
|
|
141
137
|
};
|
|
142
138
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
args[_key2] = arguments[_key2];
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
emit.apply(void 0, [props, 'focus'].concat(args));
|
|
139
|
+
const onFocus = (...args) => {
|
|
140
|
+
emit(props, 'focus', ...args);
|
|
149
141
|
setInputFocused(true);
|
|
150
142
|
};
|
|
151
143
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
args[_key3] = arguments[_key3];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
emit.apply(void 0, [props, 'blur'].concat(args));
|
|
144
|
+
const onBlur = (...args) => {
|
|
145
|
+
emit(props, 'blur', ...args);
|
|
158
146
|
|
|
159
147
|
if ((validate || validate === '' || validateOnBlur || validateOnBlur === '') && inputElRef.current) {
|
|
160
148
|
validateInput();
|
|
@@ -163,26 +151,20 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
163
151
|
setInputFocused(false);
|
|
164
152
|
};
|
|
165
153
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
args[_key4] = arguments[_key4];
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
emit.apply(void 0, [props, 'change'].concat(args));
|
|
154
|
+
const onChange = (...args) => {
|
|
155
|
+
emit(props, 'change', ...args);
|
|
172
156
|
|
|
173
157
|
if (type === 'texteditor') {
|
|
174
158
|
emit(props, 'textEditorChange', args[1]);
|
|
175
159
|
}
|
|
176
160
|
};
|
|
177
161
|
|
|
178
|
-
useImperativeHandle(ref,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
};
|
|
182
|
-
});
|
|
162
|
+
useImperativeHandle(ref, () => ({
|
|
163
|
+
el: elRef.current
|
|
164
|
+
}));
|
|
183
165
|
|
|
184
|
-
|
|
185
|
-
f7ready(
|
|
166
|
+
const onMount = () => {
|
|
167
|
+
f7ready(() => {
|
|
186
168
|
if (type === 'range' || type === 'toggle') return;
|
|
187
169
|
if (!inputElRef.current) return;
|
|
188
170
|
inputElRef.current.addEventListener('input:notempty', onInputNotEmpty, false);
|
|
@@ -197,33 +179,37 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
197
179
|
}
|
|
198
180
|
|
|
199
181
|
if (type === 'datepicker') {
|
|
200
|
-
f7Calendar.current = f7.calendar.create(
|
|
182
|
+
f7Calendar.current = f7.calendar.create({
|
|
201
183
|
inputEl: inputElRef.current,
|
|
202
|
-
value
|
|
184
|
+
value,
|
|
203
185
|
on: {
|
|
204
|
-
change
|
|
186
|
+
change(calendar, calendarValue) {
|
|
205
187
|
emit(props, 'calendarChange', calendarValue);
|
|
206
188
|
}
|
|
207
|
-
|
|
208
|
-
|
|
189
|
+
|
|
190
|
+
},
|
|
191
|
+
...(calendarParams || {})
|
|
192
|
+
});
|
|
209
193
|
}
|
|
210
194
|
|
|
211
195
|
if (type === 'colorpicker') {
|
|
212
|
-
f7ColorPicker.current = f7.colorPicker.create(
|
|
196
|
+
f7ColorPicker.current = f7.colorPicker.create({
|
|
213
197
|
inputEl: inputElRef.current,
|
|
214
|
-
value
|
|
198
|
+
value,
|
|
215
199
|
on: {
|
|
216
|
-
change
|
|
200
|
+
change(colorPicker, colorPickerValue) {
|
|
217
201
|
emit(props, 'colorPickerChange', colorPickerValue);
|
|
218
202
|
}
|
|
219
|
-
|
|
220
|
-
|
|
203
|
+
|
|
204
|
+
},
|
|
205
|
+
...(colorPickerParams || {})
|
|
206
|
+
});
|
|
221
207
|
}
|
|
222
208
|
|
|
223
209
|
f7.input.checkEmptyState(inputElRef.current);
|
|
224
210
|
|
|
225
211
|
if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && (typeof value !== 'undefined' && value !== null && value !== '' || typeof defaultValue !== 'undefined' && defaultValue !== null && defaultValue !== '')) {
|
|
226
|
-
setTimeout(
|
|
212
|
+
setTimeout(() => {
|
|
227
213
|
validateInput();
|
|
228
214
|
}, 0);
|
|
229
215
|
}
|
|
@@ -234,7 +220,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
234
220
|
});
|
|
235
221
|
};
|
|
236
222
|
|
|
237
|
-
|
|
223
|
+
const onDestroy = () => {
|
|
238
224
|
if (type === 'range' || type === 'toggle') return;
|
|
239
225
|
if (!inputElRef.current) return;
|
|
240
226
|
inputElRef.current.removeEventListener('input:notempty', onInputNotEmpty, false);
|
|
@@ -259,11 +245,11 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
259
245
|
}
|
|
260
246
|
};
|
|
261
247
|
|
|
262
|
-
useIsomorphicLayoutEffect(
|
|
248
|
+
useIsomorphicLayoutEffect(() => {
|
|
263
249
|
onMount();
|
|
264
250
|
return onDestroy;
|
|
265
251
|
}, []);
|
|
266
|
-
useIsomorphicLayoutEffect(
|
|
252
|
+
useIsomorphicLayoutEffect(() => {
|
|
267
253
|
if (!f7) return;
|
|
268
254
|
|
|
269
255
|
if (updateInputOnDidUpdate.current) {
|
|
@@ -280,15 +266,15 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
280
266
|
}
|
|
281
267
|
}
|
|
282
268
|
});
|
|
283
|
-
watchProp(colorPickerParams,
|
|
269
|
+
watchProp(colorPickerParams, newValue => {
|
|
284
270
|
if (!f7 || !f7ColorPicker.current) return;
|
|
285
271
|
extend(f7ColorPicker.current.params, newValue || {});
|
|
286
272
|
});
|
|
287
|
-
watchProp(calendarParams,
|
|
273
|
+
watchProp(calendarParams, newValue => {
|
|
288
274
|
if (!f7 || !f7Calendar.current) return;
|
|
289
275
|
extend(f7Calendar.current.params, newValue || {});
|
|
290
276
|
});
|
|
291
|
-
watchProp(value,
|
|
277
|
+
watchProp(value, newValue => {
|
|
292
278
|
if (type === 'range' || type === 'toggle') return;
|
|
293
279
|
if (!f7) return;
|
|
294
280
|
updateInputOnDidUpdate.current = true;
|
|
@@ -301,34 +287,34 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
301
287
|
f7ColorPicker.current.setValue(newValue);
|
|
302
288
|
}
|
|
303
289
|
});
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
290
|
+
const domValue = getDomValue();
|
|
291
|
+
const inputHasValue = isInputHasValue();
|
|
292
|
+
const slots = getSlots(props);
|
|
293
|
+
let inputEl;
|
|
308
294
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
295
|
+
const createInput = (InputTag, children) => {
|
|
296
|
+
const needsValue = type !== 'file' && type !== 'datepicker' && type !== 'colorpicker';
|
|
297
|
+
const needsType = InputTag === 'input';
|
|
298
|
+
let inputType = type;
|
|
313
299
|
|
|
314
300
|
if (inputType === 'datepicker' || inputType === 'colorpicker') {
|
|
315
301
|
inputType = 'text';
|
|
316
302
|
}
|
|
317
303
|
|
|
318
|
-
|
|
304
|
+
const inputClassName = classNames(!wrap && className, {
|
|
319
305
|
resizable: inputType === 'textarea' && resizable,
|
|
320
306
|
'no-store-data': noFormStoreData || noStoreData || ignoreStoreData,
|
|
321
307
|
'input-invalid': errorMessage && errorMessageForce || inputInvalid,
|
|
322
308
|
'input-with-value': inputHasValue,
|
|
323
309
|
'input-focused': inputFocused
|
|
324
310
|
});
|
|
325
|
-
|
|
311
|
+
let inputValue;
|
|
326
312
|
|
|
327
313
|
if (needsValue) {
|
|
328
314
|
if (typeof value !== 'undefined') inputValue = value;else inputValue = domValue;
|
|
329
315
|
}
|
|
330
316
|
|
|
331
|
-
|
|
317
|
+
const valueProps = {};
|
|
332
318
|
|
|
333
319
|
if (type !== 'datepicker' && type !== 'colorpicker') {
|
|
334
320
|
if ('value' in props) valueProps.value = inputValue;
|
|
@@ -422,7 +408,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
422
408
|
}
|
|
423
409
|
|
|
424
410
|
if (wrap) {
|
|
425
|
-
|
|
411
|
+
const wrapClasses = classNames(className, 'input', {
|
|
426
412
|
'input-outline': outline,
|
|
427
413
|
'input-dropdown': dropdown === 'auto' ? type === 'select' : dropdown,
|
|
428
414
|
'input-invalid': errorMessage && errorMessageForce || inputInvalid
|
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle, useContext } from 'react';
|
|
4
|
+
import { classNames, getExtraAttrs, isStringProp, emit } from '../shared/utils.js';
|
|
5
|
+
import { colorClasses, routerAttrs, routerClasses, actionsAttrs, actionsClasses } from '../shared/mixins.js';
|
|
6
|
+
import { useIcon } from '../shared/use-icon.js';
|
|
7
|
+
import { useRouteProps } from '../shared/use-route-props.js';
|
|
8
|
+
import { useTooltip } from '../shared/use-tooltip.js';
|
|
9
|
+
import { TabbarContext } from '../shared/tabbar-context.js';
|
|
10
|
+
import Badge from './badge.js';
|
|
11
|
+
import { useSmartSelect } from '../shared/use-smart-select.js';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const Link = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
|
+
const f7SmartSelect = useRef(null);
|
|
16
|
+
const {
|
|
17
|
+
className,
|
|
18
|
+
id,
|
|
19
|
+
style,
|
|
20
|
+
children,
|
|
21
|
+
noLinkClass,
|
|
22
|
+
text,
|
|
23
|
+
tabLink,
|
|
24
|
+
tabLinkActive,
|
|
25
|
+
tabbarLabel,
|
|
26
|
+
iconOnly,
|
|
27
|
+
badge,
|
|
28
|
+
badgeColor,
|
|
29
|
+
href = '#',
|
|
30
|
+
target,
|
|
31
|
+
// Smart Select
|
|
32
|
+
smartSelect,
|
|
33
|
+
smartSelectParams
|
|
34
|
+
} = props;
|
|
35
|
+
const tabbarContext = useContext(TabbarContext);
|
|
36
|
+
const isTabbarLabel = tabbarLabel || tabbarContext.tabbarHasLabels;
|
|
37
|
+
const extraAttrs = getExtraAttrs(props);
|
|
38
|
+
const elRef = useRef(null);
|
|
39
|
+
|
|
40
|
+
const onClick = e => {
|
|
41
|
+
emit(props, 'click', e);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
useImperativeHandle(ref, () => ({
|
|
45
|
+
el: elRef.current,
|
|
46
|
+
f7SmartSelect: () => f7SmartSelect.current
|
|
47
|
+
}));
|
|
48
|
+
useTooltip(elRef, props);
|
|
49
|
+
useRouteProps(elRef, props);
|
|
50
|
+
useSmartSelect(smartSelect, smartSelectParams, f7SmartSelect, () => {
|
|
51
|
+
return elRef.current;
|
|
52
|
+
});
|
|
53
|
+
let textEl;
|
|
54
|
+
let badgeEl;
|
|
55
|
+
|
|
56
|
+
if (text) {
|
|
57
|
+
if (badge) badgeEl = /*#__PURE__*/React.createElement(Badge, {
|
|
58
|
+
color: badgeColor
|
|
59
|
+
}, badge);
|
|
60
|
+
textEl = /*#__PURE__*/React.createElement("span", {
|
|
61
|
+
className: isTabbarLabel ? 'tabbar-label' : ''
|
|
62
|
+
}, text, badgeEl);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const iconEl = useIcon(props);
|
|
66
|
+
let iconOnlyComputed;
|
|
67
|
+
|
|
68
|
+
if (iconOnly || !text && children && children.length === 0 || !text && !children) {
|
|
69
|
+
iconOnlyComputed = true;
|
|
70
|
+
} else {
|
|
71
|
+
iconOnlyComputed = false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const classes = classNames(className, {
|
|
75
|
+
link: !(noLinkClass || isTabbarLabel),
|
|
76
|
+
'icon-only': iconOnlyComputed,
|
|
77
|
+
'tab-link': tabLink || tabLink === '',
|
|
78
|
+
'tab-link-active': tabLinkActive,
|
|
79
|
+
'smart-select': smartSelect
|
|
80
|
+
}, colorClasses(props), routerClasses(props), actionsClasses(props));
|
|
81
|
+
let hrefComputed = href;
|
|
82
|
+
if (href === true) hrefComputed = '#';
|
|
83
|
+
if (href === false) hrefComputed = undefined; // no href attribute
|
|
84
|
+
|
|
85
|
+
const attrs = {
|
|
86
|
+
href: hrefComputed,
|
|
87
|
+
target,
|
|
88
|
+
'data-tab': isStringProp(tabLink) && tabLink || undefined,
|
|
89
|
+
...routerAttrs(props),
|
|
90
|
+
...actionsAttrs(props)
|
|
91
|
+
};
|
|
92
|
+
return /*#__PURE__*/React.createElement("a", _extends({
|
|
93
|
+
ref: elRef,
|
|
94
|
+
id: id,
|
|
95
|
+
style: style,
|
|
96
|
+
className: classes
|
|
97
|
+
}, attrs, extraAttrs, {
|
|
98
|
+
onClick: onClick
|
|
99
|
+
}), iconEl, textEl, children);
|
|
100
|
+
});
|
|
101
|
+
Link.displayName = 'f7-link';
|
|
102
|
+
export default Link;
|
|
File without changes
|