@imposium-hub/components 1.43.5 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -13
- package/dist/cjs/Util.d.ts +19 -0
- package/dist/cjs/Util.js +271 -0
- package/dist/cjs/Util.js.map +1 -0
- package/dist/cjs/components/Tooltip.d.ts +7 -0
- package/dist/cjs/components/Tooltip.js +63 -0
- package/dist/cjs/components/Tooltip.js.map +1 -0
- package/dist/cjs/components/app-wrapper/AppWrapper.d.ts +27 -0
- package/dist/cjs/components/app-wrapper/AppWrapper.js +235 -0
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -0
- package/dist/cjs/components/asset-details/AssetDetails.d.ts +2 -0
- package/dist/cjs/components/asset-details/AssetDetails.js +124 -0
- package/dist/cjs/components/asset-details/AssetDetails.js.map +1 -0
- package/dist/cjs/components/assets/AssetField.d.ts +2 -0
- package/dist/cjs/components/assets/AssetField.js +171 -0
- package/dist/cjs/components/assets/AssetField.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableComplexTagCell.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableComplexTagCell.js +118 -0
- package/dist/cjs/components/assets/AssetsTableComplexTagCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableDateCell.d.ts +6 -0
- package/dist/cjs/components/assets/AssetsTableDateCell.js +31 -0
- package/dist/cjs/components/assets/AssetsTableDateCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableDropzone.d.ts +10 -0
- package/dist/cjs/components/assets/AssetsTableDropzone.js +61 -0
- package/dist/cjs/components/assets/AssetsTableDropzone.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableDurationCell.d.ts +3 -0
- package/dist/cjs/components/assets/AssetsTableDurationCell.js +56 -0
- package/dist/cjs/components/assets/AssetsTableDurationCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableNameCell.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableNameCell.js +78 -0
- package/dist/cjs/components/assets/AssetsTableNameCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableNameFilter.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableNameFilter.js +69 -0
- package/dist/cjs/components/assets/AssetsTableNameFilter.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTablePreviewCell.d.ts +20 -0
- package/dist/cjs/components/assets/AssetsTablePreviewCell.js +131 -0
- package/dist/cjs/components/assets/AssetsTablePreviewCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableSelectCell.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableSelectCell.js +84 -0
- package/dist/cjs/components/assets/AssetsTableSelectCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableSelectFilter.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableSelectFilter.js +73 -0
- package/dist/cjs/components/assets/AssetsTableSelectFilter.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableStatusCell.d.ts +6 -0
- package/dist/cjs/components/assets/AssetsTableStatusCell.js +34 -0
- package/dist/cjs/components/assets/AssetsTableStatusCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableTagsCell.d.ts +7 -0
- package/dist/cjs/components/assets/AssetsTableTagsCell.js +34 -0
- package/dist/cjs/components/assets/AssetsTableTagsCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableTagsFilter.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableTagsFilter.js +69 -0
- package/dist/cjs/components/assets/AssetsTableTagsFilter.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableTagsPivot.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableTagsPivot.js +123 -0
- package/dist/cjs/components/assets/AssetsTableTagsPivot.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableTypeCell.d.ts +6 -0
- package/dist/cjs/components/assets/AssetsTableTypeCell.js +35 -0
- package/dist/cjs/components/assets/AssetsTableTypeCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableTypeFilter.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableTypeFilter.js +95 -0
- package/dist/cjs/components/assets/AssetsTableTypeFilter.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.d.ts +6 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.js +63 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -0
- package/dist/cjs/components/assets/AssetsUploadMenu.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsUploadMenu.js +98 -0
- package/dist/cjs/components/assets/AssetsUploadMenu.js.map +1 -0
- package/dist/cjs/components/assets/DataTableDnDWrapper.d.ts +11 -0
- package/dist/cjs/components/assets/DataTableDnDWrapper.js +72 -0
- package/dist/cjs/components/assets/DataTableDnDWrapper.js.map +1 -0
- package/dist/cjs/components/assets/DroppableAssetRenderer.d.ts +7 -0
- package/dist/cjs/components/assets/DroppableAssetRenderer.js +58 -0
- package/dist/cjs/components/assets/DroppableAssetRenderer.js.map +1 -0
- package/dist/cjs/components/assets/FontAssetPreview.d.ts +15 -0
- package/dist/cjs/components/assets/FontAssetPreview.js +99 -0
- package/dist/cjs/components/assets/FontAssetPreview.js.map +1 -0
- package/dist/cjs/components/assets/PreviewNotAvailable.d.ts +6 -0
- package/dist/cjs/components/assets/PreviewNotAvailable.js +42 -0
- package/dist/cjs/components/assets/PreviewNotAvailable.js.map +1 -0
- package/dist/cjs/components/auth-gate/AuthGate.d.ts +2 -0
- package/dist/cjs/components/auth-gate/AuthGate.js +97 -0
- package/dist/cjs/components/auth-gate/AuthGate.js.map +1 -0
- package/dist/cjs/components/button/Button.d.ts +23 -0
- package/dist/cjs/components/button/Button.js +105 -0
- package/dist/cjs/components/button/Button.js.map +1 -0
- package/dist/cjs/components/button/Button.stories.d.ts +10 -0
- package/dist/cjs/components/button/Button.stories.js +127 -0
- package/dist/cjs/components/button/Button.stories.js.map +1 -0
- package/dist/cjs/components/button-group-field/ButtonGroupField.d.ts +28 -0
- package/dist/cjs/components/button-group-field/ButtonGroupField.js +101 -0
- package/dist/cjs/components/button-group-field/ButtonGroupField.js.map +1 -0
- package/dist/cjs/components/button-group-field/ButtonGroupField.stories.d.ts +8 -0
- package/dist/cjs/components/button-group-field/ButtonGroupField.stories.js +53 -0
- package/dist/cjs/components/button-group-field/ButtonGroupField.stories.js.map +1 -0
- package/dist/cjs/components/button-menu/ButtonMenu.d.ts +24 -0
- package/dist/cjs/components/button-menu/ButtonMenu.js +164 -0
- package/dist/cjs/components/button-menu/ButtonMenu.js.map +1 -0
- package/dist/cjs/components/button-menu/ButtonMenu.stories.d.ts +8 -0
- package/dist/cjs/components/button-menu/ButtonMenu.stories.js +50 -0
- package/dist/cjs/components/button-menu/ButtonMenu.stories.js.map +1 -0
- package/dist/cjs/components/button-menu/ButtonMenuItem.d.ts +11 -0
- package/dist/cjs/components/button-menu/ButtonMenuItem.js +55 -0
- package/dist/cjs/components/button-menu/ButtonMenuItem.js.map +1 -0
- package/dist/cjs/components/card/Card.d.ts +24 -0
- package/dist/cjs/components/card/Card.js +132 -0
- package/dist/cjs/components/card/Card.js.map +1 -0
- package/dist/cjs/components/card/Card.stories.d.ts +8 -0
- package/dist/cjs/components/card/Card.stories.js +43 -0
- package/dist/cjs/components/card/Card.stories.js.map +1 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.d.ts +18 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.js +68 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.js.map +1 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.stories.d.ts +8 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.stories.js +58 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.stories.js.map +1 -0
- package/dist/cjs/components/color-field/ColorField.d.ts +31 -0
- package/dist/cjs/components/color-field/ColorField.js +119 -0
- package/dist/cjs/components/color-field/ColorField.js.map +1 -0
- package/dist/cjs/components/color-field/ColorFiled.stories.d.ts +8 -0
- package/dist/cjs/components/color-field/ColorFiled.stories.js +59 -0
- package/dist/cjs/components/color-field/ColorFiled.stories.js.map +1 -0
- package/dist/cjs/components/compositions/TextLayer.d.ts +26 -0
- package/dist/cjs/components/compositions/TextLayer.js +222 -0
- package/dist/cjs/components/compositions/TextLayer.js.map +1 -0
- package/dist/cjs/components/controlled-list/ControlledList.d.ts +13 -0
- package/dist/cjs/components/controlled-list/ControlledList.js +76 -0
- package/dist/cjs/components/controlled-list/ControlledList.js.map +1 -0
- package/dist/cjs/components/controlled-list/ControlledList.stories.d.ts +8 -0
- package/dist/cjs/components/controlled-list/ControlledList.stories.js +41 -0
- package/dist/cjs/components/controlled-list/ControlledList.stories.js.map +1 -0
- package/dist/cjs/components/data-table/DataTable.d.ts +37 -0
- package/dist/cjs/components/data-table/DataTable.js +238 -0
- package/dist/cjs/components/data-table/DataTable.js.map +1 -0
- package/dist/cjs/components/data-table/DataTablePaginator.d.ts +14 -0
- package/dist/cjs/components/data-table/DataTablePaginator.js +85 -0
- package/dist/cjs/components/data-table/DataTablePaginator.js.map +1 -0
- package/dist/cjs/components/data-table/Paginator.d.ts +3 -0
- package/dist/cjs/components/data-table/Paginator.js +72 -0
- package/dist/cjs/components/data-table/Paginator.js.map +1 -0
- package/dist/cjs/components/determinate-loader/DeterminateLoader.d.ts +5 -0
- package/dist/cjs/components/determinate-loader/DeterminateLoader.js +35 -0
- package/dist/cjs/components/determinate-loader/DeterminateLoader.js.map +1 -0
- package/dist/cjs/components/determinate-loader/DeterminateLoader.stories.d.ts +9 -0
- package/dist/cjs/components/determinate-loader/DeterminateLoader.stories.js +66 -0
- package/dist/cjs/components/determinate-loader/DeterminateLoader.stories.js.map +1 -0
- package/dist/cjs/components/dropdown/Dropdown.d.ts +27 -0
- package/dist/cjs/components/dropdown/Dropdown.js +140 -0
- package/dist/cjs/components/dropdown/Dropdown.js.map +1 -0
- package/dist/cjs/components/dropdown/Dropdown.stories.d.ts +20 -0
- package/dist/cjs/components/dropdown/Dropdown.stories.js +61 -0
- package/dist/cjs/components/dropdown/Dropdown.stories.js.map +1 -0
- package/dist/cjs/components/field-wrapper/FieldWrapper.d.ts +26 -0
- package/dist/cjs/components/field-wrapper/FieldWrapper.js +136 -0
- package/dist/cjs/components/field-wrapper/FieldWrapper.js.map +1 -0
- package/dist/cjs/components/field-wrapper/FieldWrapper.stories.d.ts +8 -0
- package/dist/cjs/components/field-wrapper/FieldWrapper.stories.js +42 -0
- package/dist/cjs/components/field-wrapper/FieldWrapper.stories.js.map +1 -0
- package/dist/cjs/components/h-rule/HRule.d.ts +3 -0
- package/dist/cjs/components/h-rule/HRule.js +35 -0
- package/dist/cjs/components/h-rule/HRule.js.map +1 -0
- package/dist/cjs/components/h-rule/HRule.stories.d.ts +7 -0
- package/dist/cjs/components/h-rule/HRule.stories.js +43 -0
- package/dist/cjs/components/h-rule/HRule.stories.js.map +1 -0
- package/dist/cjs/components/header/Header.d.ts +55 -0
- package/dist/cjs/components/header/Header.js +289 -0
- package/dist/cjs/components/header/Header.js.map +1 -0
- package/dist/cjs/components/list-field/ListField.d.ts +35 -0
- package/dist/cjs/components/list-field/ListField.js +166 -0
- package/dist/cjs/components/list-field/ListField.js.map +1 -0
- package/dist/cjs/components/list-field/ListField.stories.d.ts +8 -0
- package/dist/cjs/components/list-field/ListField.stories.js +40 -0
- package/dist/cjs/components/list-field/ListField.stories.js.map +1 -0
- package/dist/cjs/components/log-viewer/LogViewer.d.ts +21 -0
- package/dist/cjs/components/log-viewer/LogViewer.js +106 -0
- package/dist/cjs/components/log-viewer/LogViewer.js.map +1 -0
- package/dist/cjs/components/media-variable-field/MediaVariableField.d.ts +27 -0
- package/dist/cjs/components/media-variable-field/MediaVariableField.js +180 -0
- package/dist/cjs/components/media-variable-field/MediaVariableField.js.map +1 -0
- package/dist/cjs/components/modal/Modal.d.ts +16 -0
- package/dist/cjs/components/modal/Modal.js +81 -0
- package/dist/cjs/components/modal/Modal.js.map +1 -0
- package/dist/cjs/components/modal/Modal.stories.d.ts +8 -0
- package/dist/cjs/components/modal/Modal.stories.js +74 -0
- package/dist/cjs/components/modal/Modal.stories.js.map +1 -0
- package/dist/cjs/components/no-access/NoAccess.d.ts +6 -0
- package/dist/cjs/components/no-access/NoAccess.js +48 -0
- package/dist/cjs/components/no-access/NoAccess.js.map +1 -0
- package/dist/cjs/components/number-field/NumberField.d.ts +26 -0
- package/dist/cjs/components/number-field/NumberField.js +94 -0
- package/dist/cjs/components/number-field/NumberField.js.map +1 -0
- package/dist/cjs/components/number-field/NumberField.stories.d.ts +8 -0
- package/dist/cjs/components/number-field/NumberField.stories.js +62 -0
- package/dist/cjs/components/number-field/NumberField.stories.js.map +1 -0
- package/dist/cjs/components/players/AudioPlayer.d.ts +17 -0
- package/dist/cjs/components/players/AudioPlayer.js +72 -0
- package/dist/cjs/components/players/AudioPlayer.js.map +1 -0
- package/dist/cjs/components/players/ImagePlayer.d.ts +20 -0
- package/dist/cjs/components/players/ImagePlayer.js +85 -0
- package/dist/cjs/components/players/ImagePlayer.js.map +1 -0
- package/dist/cjs/components/players/ImagePreview.d.ts +19 -0
- package/dist/cjs/components/players/ImagePreview.js +95 -0
- package/dist/cjs/components/players/ImagePreview.js.map +1 -0
- package/dist/cjs/components/players/ImageSequencePlayer.d.ts +20 -0
- package/dist/cjs/components/players/ImageSequencePlayer.js +83 -0
- package/dist/cjs/components/players/ImageSequencePlayer.js.map +1 -0
- package/dist/cjs/components/players/TemplatePlayer.d.ts +17 -0
- package/dist/cjs/components/players/TemplatePlayer.js +73 -0
- package/dist/cjs/components/players/TemplatePlayer.js.map +1 -0
- package/dist/cjs/components/players/VideoPlayer.d.ts +40 -0
- package/dist/cjs/components/players/VideoPlayer.js +126 -0
- package/dist/cjs/components/players/VideoPlayer.js.map +1 -0
- package/dist/cjs/components/players/VideoPreview.d.ts +16 -0
- package/dist/cjs/components/players/VideoPreview.js +90 -0
- package/dist/cjs/components/players/VideoPreview.js.map +1 -0
- package/dist/cjs/components/portal/Portal.d.ts +7 -0
- package/dist/cjs/components/portal/Portal.js +18 -0
- package/dist/cjs/components/portal/Portal.js.map +1 -0
- package/dist/cjs/components/publish-wizard/PublishWizard.d.ts +35 -0
- package/dist/cjs/components/publish-wizard/PublishWizard.js +425 -0
- package/dist/cjs/components/publish-wizard/PublishWizard.js.map +1 -0
- package/dist/cjs/components/publish-wizard/publish/APIIntegration.d.ts +5 -0
- package/dist/cjs/components/publish-wizard/publish/APIIntegration.js +66 -0
- package/dist/cjs/components/publish-wizard/publish/APIIntegration.js.map +1 -0
- package/dist/cjs/components/publish-wizard/publish/EmailWorkflow.d.ts +2 -0
- package/dist/cjs/components/publish-wizard/publish/EmailWorkflow.js +440 -0
- package/dist/cjs/components/publish-wizard/publish/EmailWorkflow.js.map +1 -0
- package/dist/cjs/components/publish-wizard/publish/HubSpotFlow.d.ts +16 -0
- package/dist/cjs/components/publish-wizard/publish/HubSpotFlow.js +95 -0
- package/dist/cjs/components/publish-wizard/publish/HubSpotFlow.js.map +1 -0
- package/dist/cjs/components/publish-wizard/publish/PublishStatusIndicator.d.ts +2 -0
- package/dist/cjs/components/publish-wizard/publish/PublishStatusIndicator.js +107 -0
- package/dist/cjs/components/publish-wizard/publish/PublishStatusIndicator.js.map +1 -0
- package/dist/cjs/components/publish-wizard/publish/WebpageHosted.d.ts +19 -0
- package/dist/cjs/components/publish-wizard/publish/WebpageHosted.js +148 -0
- package/dist/cjs/components/publish-wizard/publish/WebpageHosted.js.map +1 -0
- package/dist/cjs/components/section/Section.d.ts +3 -0
- package/dist/cjs/components/section/Section.js +42 -0
- package/dist/cjs/components/section/Section.js.map +1 -0
- package/dist/cjs/components/section/Section.stories.d.ts +7 -0
- package/dist/cjs/components/section/Section.stories.js +63 -0
- package/dist/cjs/components/section/Section.stories.js.map +1 -0
- package/dist/cjs/components/select-field/SelectField.d.ts +28 -0
- package/dist/cjs/components/select-field/SelectField.js +140 -0
- package/dist/cjs/components/select-field/SelectField.js.map +1 -0
- package/dist/cjs/components/select-field/SelectField.stories.d.ts +8 -0
- package/dist/cjs/components/select-field/SelectField.stories.js +39 -0
- package/dist/cjs/components/select-field/SelectField.stories.js.map +1 -0
- package/dist/cjs/components/service-icon/ServiceIcon.d.ts +7 -0
- package/dist/cjs/components/service-icon/ServiceIcon.js +77 -0
- package/dist/cjs/components/service-icon/ServiceIcon.js.map +1 -0
- package/dist/cjs/components/service-icon/ServiceIcon.test.js +1 -0
- package/dist/cjs/components/service-icon/ServiceIcon.test.js.map +1 -0
- package/dist/cjs/components/shortcut-menu/ShortcutMenu.d.ts +6 -0
- package/dist/cjs/components/shortcut-menu/ShortcutMenu.js +45 -0
- package/dist/cjs/components/shortcut-menu/ShortcutMenu.js.map +1 -0
- package/dist/cjs/components/shortcut-menu/ShortcutMenu.stories.d.ts +7 -0
- package/dist/cjs/components/shortcut-menu/ShortcutMenu.stories.js +42 -0
- package/dist/cjs/components/shortcut-menu/ShortcutMenu.stories.js.map +1 -0
- package/dist/cjs/components/slider-field/SliderField.d.ts +28 -0
- package/dist/cjs/components/slider-field/SliderField.js +95 -0
- package/dist/cjs/components/slider-field/SliderField.js.map +1 -0
- package/dist/cjs/components/slider-field/SliderField.stories.d.ts +8 -0
- package/dist/cjs/components/slider-field/SliderField.stories.js +61 -0
- package/dist/cjs/components/slider-field/SliderField.stories.js.map +1 -0
- package/dist/cjs/components/spinner/Spinner.d.ts +3 -0
- package/dist/cjs/components/spinner/Spinner.js +33 -0
- package/dist/cjs/components/spinner/Spinner.js.map +1 -0
- package/dist/cjs/components/story-previewer/StoryPreviewer.d.ts +2 -0
- package/dist/cjs/components/story-previewer/StoryPreviewer.js +552 -0
- package/dist/cjs/components/story-previewer/StoryPreviewer.js.map +1 -0
- package/dist/cjs/components/tabs/Tabs.d.ts +5 -0
- package/dist/cjs/components/tabs/Tabs.js +213 -0
- package/dist/cjs/components/tabs/Tabs.js.map +1 -0
- package/dist/cjs/components/tabs/Tabs.stories.d.ts +9 -0
- package/dist/cjs/components/tabs/Tabs.stories.js +82 -0
- package/dist/cjs/components/tabs/Tabs.stories.js.map +1 -0
- package/dist/cjs/components/tag/Tag.d.ts +8 -0
- package/dist/cjs/components/tag/Tag.js +42 -0
- package/dist/cjs/components/tag/Tag.js.map +1 -0
- package/dist/cjs/components/tag/Tag.test.js +1 -0
- package/dist/cjs/components/tag/Tag.test.js.map +1 -0
- package/dist/cjs/components/text-area-field/TextAreaField.d.ts +41 -0
- package/dist/cjs/components/text-area-field/TextAreaField.js +188 -0
- package/dist/cjs/components/text-area-field/TextAreaField.js.map +1 -0
- package/dist/cjs/components/text-area-field/TextAreaField.stories.d.ts +8 -0
- package/dist/cjs/components/text-area-field/TextAreaField.stories.js +39 -0
- package/dist/cjs/components/text-area-field/TextAreaField.stories.js.map +1 -0
- package/dist/cjs/components/text-field/TextField.d.ts +63 -0
- package/dist/cjs/components/text-field/TextField.js +394 -0
- package/dist/cjs/components/text-field/TextField.js.map +1 -0
- package/dist/cjs/components/text-field/TextField.stories.d.ts +8 -0
- package/dist/cjs/components/text-field/TextField.stories.js +39 -0
- package/dist/cjs/components/text-field/TextField.stories.js.map +1 -0
- package/dist/cjs/components/toast-service/ToastService.d.ts +6 -0
- package/dist/cjs/components/toast-service/ToastService.js +87 -0
- package/dist/cjs/components/toast-service/ToastService.js.map +1 -0
- package/dist/cjs/constants/api.d.ts +5 -0
- package/dist/cjs/constants/api.js +9 -0
- package/dist/cjs/constants/api.js.map +1 -0
- package/dist/cjs/constants/assets.d.ts +17 -0
- package/dist/cjs/constants/assets.js +27 -0
- package/dist/cjs/constants/assets.js.map +1 -0
- package/dist/cjs/constants/compositions.d.ts +60 -0
- package/dist/cjs/constants/compositions.js +147 -0
- package/dist/cjs/constants/compositions.js.map +1 -0
- package/dist/cjs/constants/copy.d.ts +181 -0
- package/dist/cjs/constants/copy.js +194 -0
- package/dist/cjs/constants/copy.js.map +1 -0
- package/dist/cjs/constants/dnd.d.ts +1 -0
- package/dist/cjs/constants/dnd.js +7 -0
- package/dist/cjs/constants/dnd.js.map +1 -0
- package/dist/cjs/constants/icons.d.ts +59 -0
- package/dist/cjs/constants/icons.js +146 -0
- package/dist/cjs/constants/icons.js.map +1 -0
- package/dist/cjs/constants/player.d.ts +1 -0
- package/dist/cjs/constants/player.js +5 -0
- package/dist/cjs/constants/player.js.map +1 -0
- package/dist/cjs/constants/previewer.d.ts +1 -0
- package/dist/cjs/constants/previewer.js +9 -0
- package/dist/cjs/constants/previewer.js.map +1 -0
- package/dist/cjs/constants/variables.d.ts +13 -0
- package/dist/cjs/constants/variables.js +22 -0
- package/dist/cjs/constants/variables.js.map +1 -0
- package/dist/cjs/index.d.ts +94 -0
- package/dist/cjs/index.js +235 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/experience.d.ts +30 -0
- package/dist/cjs/interfaces/experience.js +3 -0
- package/dist/cjs/interfaces/experience.js.map +1 -0
- package/dist/cjs/redux/actions/access.d.ts +16 -0
- package/dist/cjs/redux/actions/access.js +151 -0
- package/dist/cjs/redux/actions/access.js.map +1 -0
- package/dist/cjs/redux/actions/active-batch.d.ts +12 -0
- package/dist/cjs/redux/actions/active-batch.js +189 -0
- package/dist/cjs/redux/actions/active-batch.js.map +1 -0
- package/dist/cjs/redux/actions/asset-filters.d.ts +3 -0
- package/dist/cjs/redux/actions/asset-filters.js +11 -0
- package/dist/cjs/redux/actions/asset-filters.js.map +1 -0
- package/dist/cjs/redux/actions/asset-list.d.ts +11 -0
- package/dist/cjs/redux/actions/asset-list.js +156 -0
- package/dist/cjs/redux/actions/asset-list.js.map +1 -0
- package/dist/cjs/redux/actions/asset-tags.d.ts +5 -0
- package/dist/cjs/redux/actions/asset-tags.js +27 -0
- package/dist/cjs/redux/actions/asset-tags.js.map +1 -0
- package/dist/cjs/redux/actions/asset-uploads.d.ts +7 -0
- package/dist/cjs/redux/actions/asset-uploads.js +144 -0
- package/dist/cjs/redux/actions/asset-uploads.js.map +1 -0
- package/dist/cjs/redux/actions/auth.d.ts +9 -0
- package/dist/cjs/redux/actions/auth.js +30 -0
- package/dist/cjs/redux/actions/auth.js.map +1 -0
- package/dist/cjs/redux/actions/publish.d.ts +7 -0
- package/dist/cjs/redux/actions/publish.js +99 -0
- package/dist/cjs/redux/actions/publish.js.map +1 -0
- package/dist/cjs/redux/actions/selected-assets.d.ts +7 -0
- package/dist/cjs/redux/actions/selected-assets.js +52 -0
- package/dist/cjs/redux/actions/selected-assets.js.map +1 -0
- package/dist/cjs/redux/reducers/access.d.ts +2 -0
- package/dist/cjs/redux/reducers/access.js +61 -0
- package/dist/cjs/redux/reducers/access.js.map +1 -0
- package/dist/cjs/redux/reducers/active-batch.d.ts +2 -0
- package/dist/cjs/redux/reducers/active-batch.js +105 -0
- package/dist/cjs/redux/reducers/active-batch.js.map +1 -0
- package/dist/cjs/redux/reducers/asset-filters.d.ts +2 -0
- package/dist/cjs/redux/reducers/asset-filters.js +38 -0
- package/dist/cjs/redux/reducers/asset-filters.js.map +1 -0
- package/dist/cjs/redux/reducers/asset-list.d.ts +2 -0
- package/dist/cjs/redux/reducers/asset-list.js +93 -0
- package/dist/cjs/redux/reducers/asset-list.js.map +1 -0
- package/dist/cjs/redux/reducers/asset-tags.d.ts +2 -0
- package/dist/cjs/redux/reducers/asset-tags.js +18 -0
- package/dist/cjs/redux/reducers/asset-tags.js.map +1 -0
- package/dist/cjs/redux/reducers/asset-uploads.d.ts +2 -0
- package/dist/cjs/redux/reducers/asset-uploads.js +72 -0
- package/dist/cjs/redux/reducers/asset-uploads.js.map +1 -0
- package/dist/cjs/redux/reducers/auth.d.ts +3 -0
- package/dist/cjs/redux/reducers/auth.js +67 -0
- package/dist/cjs/redux/reducers/auth.js.map +1 -0
- package/dist/cjs/redux/reducers/publish.d.ts +11 -0
- package/dist/cjs/redux/reducers/publish.js +35 -0
- package/dist/cjs/redux/reducers/publish.js.map +1 -0
- package/dist/cjs/redux/reducers/selected-assets.d.ts +2 -0
- package/dist/cjs/redux/reducers/selected-assets.js +51 -0
- package/dist/cjs/redux/reducers/selected-assets.js.map +1 -0
- package/dist/cjs/services/API-Legacy.d.ts +7 -0
- package/dist/cjs/services/API-Legacy.js +51 -0
- package/dist/cjs/services/API-Legacy.js.map +1 -0
- package/dist/cjs/services/API.d.ts +178 -0
- package/dist/cjs/services/API.js +997 -0
- package/dist/cjs/services/API.js.map +1 -0
- package/dist/cjs/services/Auth0.d.ts +18 -0
- package/dist/cjs/services/Auth0.js +102 -0
- package/dist/cjs/services/Auth0.js.map +1 -0
- package/dist/cjs/services/Session.d.ts +25 -0
- package/dist/cjs/services/Session.js +233 -0
- package/dist/cjs/services/Session.js.map +1 -0
- package/dist/cjs/services/Storage.d.ts +4 -0
- package/dist/cjs/services/Storage.js +55 -0
- package/dist/cjs/services/Storage.js.map +1 -0
- package/dist/cjs/services/Timer.d.ts +15 -0
- package/dist/cjs/services/Timer.js +26 -0
- package/dist/cjs/services/Timer.js.map +1 -0
- package/dist/cjs/utils/routing.d.ts +1 -0
- package/dist/cjs/utils/routing.js +17 -0
- package/dist/cjs/utils/routing.js.map +1 -0
- package/dist/cjs/utils/template-generator.d.ts +8 -0
- package/dist/cjs/utils/template-generator.js +36 -0
- package/dist/cjs/utils/template-generator.js.map +1 -0
- package/dist/styles.less +1586 -1586
- package/less/entry.less +36 -6
- package/package.json +50 -83
- package/{Util.ts → src/Util.ts} +3 -3
- package/{components → src/components}/Tooltip.tsx +1 -1
- package/{components → src/components}/asset-details/AssetDetails.tsx +2 -2
- package/{components → src/components}/assets/AssetsTableComplexTagCell.tsx +2 -2
- package/{components → src/components}/assets/AssetsTableDropzone.tsx +1 -1
- package/{components → src/components}/assets/AssetsTableNameFilter.tsx +1 -1
- package/{components → src/components}/assets/AssetsTablePreviewCell.tsx +4 -4
- package/{components → src/components}/assets/AssetsTableSelectCell.tsx +1 -1
- package/{components → src/components}/assets/AssetsTableSelectFilter.tsx +1 -1
- package/{components → src/components}/assets/AssetsTableTagsFilter.tsx +1 -1
- package/{components → src/components}/assets/AssetsTableTagsPivot.tsx +16 -6
- package/{components → src/components}/assets/AssetsUploadMenu.tsx +2 -2
- package/{components → src/components}/auth-gate/AuthGate.tsx +1 -1
- package/{components → src/components}/button/Button.tsx +1 -1
- package/{components → src/components}/button-group-field/ButtonGroupField.tsx +1 -1
- package/{components → src/components}/button-menu/ButtonMenuItem.tsx +1 -1
- package/{components → src/components}/checkbox-field/CheckboxField.tsx +1 -1
- package/{components → src/components}/compositions/TextLayer.tsx +2 -1
- package/{components → src/components}/controlled-list/ControlledList.tsx +1 -1
- package/{components → src/components}/data-table/DataTablePaginator.tsx +1 -1
- package/{components → src/components}/determinate-loader/DeterminateLoader.stories.tsx +1 -1
- package/{components → src/components}/determinate-loader/DeterminateLoader.tsx +2 -4
- package/{components → src/components}/modal/Modal.tsx +1 -1
- package/{components → src/components}/number-field/NumberField.tsx +2 -2
- package/{components → src/components}/players/TemplatePlayer.tsx +2 -2
- package/{components → src/components}/players/VideoPreview.tsx +1 -1
- package/{components → src/components}/publish-wizard/PublishWizard.tsx +2 -2
- package/{components → src/components}/publish-wizard/publish/EmailWorkflow.tsx +1 -1
- package/{components → src/components}/select-field/SelectField.tsx +1 -1
- package/{components → src/components}/service-icon/ServiceIcon.tsx +1 -1
- package/{components → src/components}/shortcut-menu/ShortcutMenu.stories.tsx +1 -6
- package/{components → src/components}/shortcut-menu/ShortcutMenu.tsx +2 -4
- package/{components → src/components}/text-field/TextField.tsx +1 -1
- package/{components → src/components}/toast-service/ToastService.tsx +6 -2
- package/{Entry.ts → src/index.ts} +3 -12
- package/{redux → src/redux}/actions/access.ts +0 -1
- package/{redux → src/redux}/actions/active-batch.ts +2 -5
- package/{redux → src/redux}/actions/asset-list.ts +4 -2
- package/{redux → src/redux}/actions/asset-uploads.ts +1 -1
- package/{redux → src/redux}/reducers/access.ts +1 -1
- package/{redux → src/redux}/reducers/auth.ts +1 -1
- package/{services → src/services}/Session.ts +1 -2
- package/tsconfig.json +19 -0
- package/components/button/Button.test.tsx +0 -0
- package/components/button-group-field/ButtonGroupField.test.tsx +0 -0
- package/components/button-menu/ButtonMenu.test.tsx +0 -0
- package/components/button-menu/ButtonMenuItem.test.tsx +0 -0
- package/components/card/Card.test.tsx +0 -0
- package/components/checkbox-field/CheckboxField.test.tsx +0 -0
- package/components/color-field/ColorField.test.tsx +0 -0
- package/components/compositions/CompositionRendererLayer.tsx +0 -197
- package/components/compositions/StaticCompositionConfig.tsx +0 -143
- package/components/compositions/StaticCompositionEditor.tsx +0 -96
- package/components/compositions/StaticCompositionRenderer.tsx +0 -121
- package/components/compositions/TextLayerOptions.tsx +0 -317
- package/components/controlled-list/ControlledList.test.tsx +0 -0
- package/components/data-table/DataTable.test.tsx +0 -0
- package/components/data-table/DataTablePaginator.test.tsx +0 -0
- package/components/determinate-loader/DeterminateLoader.test.tsx +0 -0
- package/components/dropdown/dropdown.test.tsx +0 -0
- package/components/field-wrapper/FieldWrapper.test.tsx +0 -0
- package/components/h-rule/HRule.test.tsx +0 -0
- package/components/header/Header.test.tsx +0 -119
- package/components/list-field/ListField.test.tsx +0 -0
- package/components/log-viewer/LogViewer.tsx +0 -97
- package/components/modal/Modal.test.tsx +0 -0
- package/components/no-access/NoAccess.test.tsx +0 -0
- package/components/number-field/NumberField.test.tsx +0 -0
- package/components/section/Section.test.tsx +0 -0
- package/components/select-field/SelectField.test.tsx +0 -0
- package/components/tabs/Tabs.test.tsx +0 -0
- package/components/text-area-field/TextAreaField.test.tsx +0 -0
- package/components/text-field/TextField.test.tsx +0 -0
- package/components/toast-service/ToastService.test.tsx +0 -0
- package/dist/components.js +0 -281
- package/dist/components.js.map +0 -1
- package/dist/styles.css +0 -2
- package/dist/styles.css.map +0 -1
- package/dist/styles.less.map +0 -1
- package/less/styles.less +0 -36
- /package/{components/Tag/Tag.test.tsx → dist/cjs/components/service-icon/ServiceIcon.test.d.ts} +0 -0
- /package/{components/app-wrapper/AppWrapper.test.tsx → dist/cjs/components/tag/Tag.test.d.ts} +0 -0
- /package/{components/auth-gate/AuthGate.test.tsx → src/components/Tag/Tag.test.tsx} +0 -0
- /package/{components → src/components}/Tag/Tag.tsx +0 -0
- /package/{components → src/components}/app-wrapper/AppWrapper.tsx +0 -0
- /package/{components → src/components}/assets/AssetField.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableDateCell.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableDurationCell.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableNameCell.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableStatusCell.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableTagsCell.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableTypeCell.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTableTypeFilter.tsx +0 -0
- /package/{components → src/components}/assets/AssetsTypeIcon.tsx +0 -0
- /package/{components → src/components}/assets/DataTableDnDWrapper.tsx +0 -0
- /package/{components → src/components}/assets/DroppableAssetRenderer.tsx +0 -0
- /package/{components → src/components}/assets/FontAssetPreview.tsx +0 -0
- /package/{components → src/components}/assets/PreviewNotAvailable.tsx +0 -0
- /package/{components → src/components}/button/Button.stories.tsx +0 -0
- /package/{components → src/components}/button-group-field/ButtonGroupField.stories.tsx +0 -0
- /package/{components → src/components}/button-menu/ButtonMenu.stories.tsx +0 -0
- /package/{components → src/components}/button-menu/ButtonMenu.tsx +0 -0
- /package/{components → src/components}/card/Card.stories.tsx +0 -0
- /package/{components → src/components}/card/Card.tsx +0 -0
- /package/{components → src/components}/checkbox-field/CheckboxField.stories.tsx +0 -0
- /package/{components → src/components}/color-field/ColorField.tsx +0 -0
- /package/{components → src/components}/color-field/ColorFiled.stories.tsx +0 -0
- /package/{components → src/components}/controlled-list/ControlledList.stories.tsx +0 -0
- /package/{components → src/components}/data-table/DataTable.tsx +0 -0
- /package/{components → src/components}/data-table/Paginator.tsx +0 -0
- /package/{components → src/components}/dropdown/dropdown.stories.tsx +0 -0
- /package/{components → src/components}/dropdown/dropdown.tsx +0 -0
- /package/{components → src/components}/field-wrapper/FieldWrapper.stories.tsx +0 -0
- /package/{components → src/components}/field-wrapper/FieldWrapper.tsx +0 -0
- /package/{components → src/components}/h-rule/HRule.stories.tsx +0 -0
- /package/{components → src/components}/h-rule/HRule.tsx +0 -0
- /package/{components → src/components}/header/Header.tsx +0 -0
- /package/{components → src/components}/list-field/ListField.stories.tsx +0 -0
- /package/{components → src/components}/list-field/ListField.tsx +0 -0
- /package/{components/dropdown → src/components}/log-viewer/LogViewer.tsx +0 -0
- /package/{components → src/components}/media-variable-field/MediaVariableField.tsx +0 -0
- /package/{components → src/components}/modal/Modal.stories.tsx +0 -0
- /package/{components → src/components}/no-access/NoAccess.tsx +0 -0
- /package/{components → src/components}/number-field/NumberField.stories.tsx +0 -0
- /package/{components → src/components}/players/AudioPlayer.tsx +0 -0
- /package/{components → src/components}/players/ImagePlayer.tsx +0 -0
- /package/{components → src/components}/players/ImagePreview.tsx +0 -0
- /package/{components → src/components}/players/ImageSequencePlayer.tsx +0 -0
- /package/{components → src/components}/players/VideoPlayer.tsx +0 -0
- /package/{components → src/components}/portal/Portal.tsx +0 -0
- /package/{components → src/components}/publish-wizard/publish/APIIntegration.tsx +0 -0
- /package/{components → src/components}/publish-wizard/publish/HubSpotFlow.tsx +0 -0
- /package/{components → src/components}/publish-wizard/publish/PublishStatusIndicator.tsx +0 -0
- /package/{components → src/components}/publish-wizard/publish/WebpageHosted.tsx +0 -0
- /package/{components → src/components}/section/Section.stories.tsx +0 -0
- /package/{components → src/components}/section/Section.tsx +0 -0
- /package/{components → src/components}/select-field/SelectField.stories.tsx +0 -0
- /package/{components → src/components}/service-icon/ServiceIcon.test.tsx +0 -0
- /package/{components → src/components}/slider-field/SliderField.stories.tsx +0 -0
- /package/{components → src/components}/slider-field/SliderField.tsx +0 -0
- /package/{components → src/components}/spinner/Spinner.tsx +0 -0
- /package/{components → src/components}/story-previewer/StoryPreviewer.tsx +0 -0
- /package/{components → src/components}/tabs/Tabs.stories.tsx +0 -0
- /package/{components → src/components}/tabs/Tabs.tsx +0 -0
- /package/{components → src/components}/text-area-field/TextAreaField.stories.tsx +0 -0
- /package/{components → src/components}/text-area-field/TextAreaField.tsx +0 -0
- /package/{components → src/components}/text-field/TextField.stories.tsx +0 -0
- /package/{constants → src/constants}/api.ts +0 -0
- /package/{constants → src/constants}/assets.ts +0 -0
- /package/{constants → src/constants}/compositions.ts +0 -0
- /package/{constants → src/constants}/copy.ts +0 -0
- /package/{constants → src/constants}/dnd.ts +0 -0
- /package/{constants → src/constants}/icons.tsx +0 -0
- /package/{constants → src/constants}/player.ts +0 -0
- /package/{constants → src/constants}/previewer.ts +0 -0
- /package/{constants → src/constants}/variables.ts +0 -0
- /package/{interfaces → src/interfaces}/experience.ts +0 -0
- /package/{redux → src/redux}/actions/asset-filters.ts +0 -0
- /package/{redux → src/redux}/actions/asset-tags.ts +0 -0
- /package/{redux → src/redux}/actions/auth.ts +0 -0
- /package/{redux → src/redux}/actions/publish.ts +0 -0
- /package/{redux → src/redux}/actions/selected-assets.ts +0 -0
- /package/{redux → src/redux}/reducers/active-batch.ts +0 -0
- /package/{redux → src/redux}/reducers/asset-filters.ts +0 -0
- /package/{redux → src/redux}/reducers/asset-list.ts +0 -0
- /package/{redux → src/redux}/reducers/asset-tags.ts +0 -0
- /package/{redux → src/redux}/reducers/asset-uploads.ts +0 -0
- /package/{redux → src/redux}/reducers/publish.ts +0 -0
- /package/{redux → src/redux}/reducers/selected-assets.ts +0 -0
- /package/{services → src/services}/API-Legacy.ts +0 -0
- /package/{services → src/services}/API.ts +0 -0
- /package/{services → src/services}/Auth0.ts +0 -0
- /package/{services → src/services}/Storage.ts +0 -0
- /package/{services → src/services}/Timer.ts +0 -0
- /package/{utils → src/utils}/routing.ts +0 -0
- /package/{utils → src/utils}/template-generator.ts +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
var React = __importStar(require("react"));
|
|
53
|
+
var Util_1 = require("../../Util");
|
|
54
|
+
var Tooltip_1 = require("../Tooltip");
|
|
55
|
+
var icons_1 = require("../../constants/icons");
|
|
56
|
+
var Button = /** @class */ (function (_super) {
|
|
57
|
+
__extends(Button, _super);
|
|
58
|
+
function Button(props) {
|
|
59
|
+
var _this = _super.call(this, props) || this;
|
|
60
|
+
_this.tooltipId = "imposium-button-".concat((0, Util_1.generateUUID)());
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
Button.prototype.onClick = function (e) {
|
|
64
|
+
if (this.props.onClick && !this.props.loading) {
|
|
65
|
+
this.props.onClick(e);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
Button.prototype.render = function () {
|
|
69
|
+
var _this = this;
|
|
70
|
+
var _a = this.props, style = _a.style, color = _a.color, size = _a.size, customStyles = _a.customStyles;
|
|
71
|
+
var _b = this.props, width = _b.width, loading = _b.loading, tooltip = _b.tooltip;
|
|
72
|
+
var _c = this.props, active = _c.active, disabled = _c.disabled, buttonRef = _c.buttonRef;
|
|
73
|
+
var activeClass = (active) ? 'active' : '';
|
|
74
|
+
var disabledClass = (disabled) ? 'disabled' : '';
|
|
75
|
+
if (!size) {
|
|
76
|
+
size = '';
|
|
77
|
+
}
|
|
78
|
+
if (!style) {
|
|
79
|
+
style = 'default';
|
|
80
|
+
}
|
|
81
|
+
if (!color) {
|
|
82
|
+
color = '';
|
|
83
|
+
}
|
|
84
|
+
if (width) {
|
|
85
|
+
if (customStyles) {
|
|
86
|
+
customStyles['width'] = width;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
customStyles = {
|
|
90
|
+
width: width
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
var kids = (!loading)
|
|
95
|
+
? this.props.children
|
|
96
|
+
: React.createElement("span", { className: 'loading-icon' }, icons_1.ICON_CIRCLE_NOTCH);
|
|
97
|
+
var content = React.createElement("div", __assign({}, (0, Tooltip_1.renderTooltipProps)(this.tooltipId, this.props.tooltip), { ref: buttonRef, className: "imposium-btn btn-".concat(style, " ").concat(size, " ").concat(color, " ").concat(activeClass, " ").concat(disabledClass), onClick: function (e) { return _this.onClick(e); }, style: customStyles }),
|
|
98
|
+
kids,
|
|
99
|
+
(0, Tooltip_1.renderTooltip)(this.tooltipId, this.props.tooltip));
|
|
100
|
+
return content;
|
|
101
|
+
};
|
|
102
|
+
return Button;
|
|
103
|
+
}(React.PureComponent));
|
|
104
|
+
exports.default = Button;
|
|
105
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,mCAA0C;AAC1C,sCAA+E;AAC/E,+CAA0D;AAiB1D;IAAqB,0BAAiC;IAIlD,gBAAY,KAAK;QAAjB,YAEI,kBAAM,KAAK,CAAC,SAGf;QADG,KAAI,CAAC,SAAS,GAAG,0BAAmB,IAAA,mBAAY,GAAE,CAAE,CAAC;;IACzD,CAAC;IAEO,wBAAO,GAAf,UAAgB,CAAC;QAEb,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YAC3C,IAA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AAC,KAAK,CAAC,OAAO,CAAC,IAC1D,GAAG,EAAI,SAAS,EAChB,SAAS,EAAI,2BAAoB,KAAK,cAAI,IAAI,cAAI,KAAK,cAAI,WAAW,cAAI,aAAa,CAAE,EACzF,OAAO,EAAI,UAAC,CAAC,IAAK,OAAA,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAf,CAAe,EACjC,KAAK,EAAI,YAAY;YACpB,IAAI;YACJ,IAAA,uBAAa,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAChD,CAAC;QAEP,OAAO,OAAO,CAAC;IACnB,CAAC;IACL,aAAC;AAAD,CAAC,AAvDD,CAAqB,KAAK,CAAC,aAAa,GAuDvC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const sizes: () => JSX.Element;
|
|
7
|
+
export declare const styles: () => JSX.Element;
|
|
8
|
+
export declare const colors: () => JSX.Element;
|
|
9
|
+
export declare const loading: () => JSX.Element;
|
|
10
|
+
export declare const tooltips: () => JSX.Element;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.tooltips = exports.loading = exports.colors = exports.styles = exports.sizes = void 0;
|
|
30
|
+
var React = __importStar(require("react"));
|
|
31
|
+
var Button_1 = __importDefault(require("./Button"));
|
|
32
|
+
var addon_actions_1 = require("@storybook/addon-actions");
|
|
33
|
+
var icons_1 = require("../../constants/icons");
|
|
34
|
+
exports.default = { title: 'Button' };
|
|
35
|
+
var handleClick = (0, addon_actions_1.action)('button-click');
|
|
36
|
+
var sizes = function () {
|
|
37
|
+
return React.createElement(React.Fragment, null,
|
|
38
|
+
React.createElement(Button_1.default, { onClick: handleClick }, "Default"),
|
|
39
|
+
"\u00A0",
|
|
40
|
+
React.createElement(Button_1.default, { onClick: handleClick }, icons_1.ICON_PLUS),
|
|
41
|
+
React.createElement("br", null),
|
|
42
|
+
React.createElement("br", null),
|
|
43
|
+
React.createElement(Button_1.default, { onClick: handleClick, size: 'large' }, "Large"),
|
|
44
|
+
"\u00A0",
|
|
45
|
+
React.createElement(Button_1.default, { onClick: handleClick, size: 'large' }, icons_1.ICON_PLUS));
|
|
46
|
+
};
|
|
47
|
+
exports.sizes = sizes;
|
|
48
|
+
var styles = function () {
|
|
49
|
+
return React.createElement(React.Fragment, null,
|
|
50
|
+
React.createElement(Button_1.default, { onClick: handleClick }, "Default"),
|
|
51
|
+
"\u00A0",
|
|
52
|
+
React.createElement(Button_1.default, { onClick: handleClick }, icons_1.ICON_PLUS),
|
|
53
|
+
React.createElement("br", null),
|
|
54
|
+
React.createElement("br", null),
|
|
55
|
+
React.createElement(Button_1.default, { onClick: handleClick, style: 'subtle' }, "Subtle"),
|
|
56
|
+
"\u00A0",
|
|
57
|
+
React.createElement(Button_1.default, { onClick: handleClick, style: 'subtle' }, icons_1.ICON_PLUS),
|
|
58
|
+
React.createElement("br", null),
|
|
59
|
+
React.createElement("br", null),
|
|
60
|
+
React.createElement(Button_1.default, { onClick: handleClick, style: 'bold' }, "Bold"),
|
|
61
|
+
"\u00A0",
|
|
62
|
+
React.createElement(Button_1.default, { onClick: handleClick, style: 'bold' }, icons_1.ICON_PLUS));
|
|
63
|
+
};
|
|
64
|
+
exports.styles = styles;
|
|
65
|
+
var colors = function () {
|
|
66
|
+
return React.createElement(React.Fragment, null,
|
|
67
|
+
React.createElement("p", null, "Default"),
|
|
68
|
+
React.createElement(Button_1.default, { onClick: handleClick }, icons_1.ICON_PLUS),
|
|
69
|
+
"\u00A0",
|
|
70
|
+
React.createElement(Button_1.default, { onClick: handleClick, style: 'subtle' }, icons_1.ICON_PLUS),
|
|
71
|
+
"\u00A0",
|
|
72
|
+
React.createElement(Button_1.default, { onClick: handleClick, style: 'bold' }, icons_1.ICON_PLUS),
|
|
73
|
+
React.createElement("br", null),
|
|
74
|
+
React.createElement("br", null),
|
|
75
|
+
React.createElement("p", null, "Primary"),
|
|
76
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'primary' }, icons_1.ICON_PLUS),
|
|
77
|
+
"\u00A0",
|
|
78
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'primary', style: 'subtle' }, icons_1.ICON_PLUS),
|
|
79
|
+
"\u00A0",
|
|
80
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'primary', style: 'bold' }, icons_1.ICON_PLUS),
|
|
81
|
+
React.createElement("br", null),
|
|
82
|
+
React.createElement("br", null),
|
|
83
|
+
React.createElement("p", null, "Secondary"),
|
|
84
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'secondary' }, icons_1.ICON_PLUS),
|
|
85
|
+
"\u00A0",
|
|
86
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'secondary', style: 'subtle' }, icons_1.ICON_PLUS),
|
|
87
|
+
"\u00A0",
|
|
88
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'secondary', style: 'bold' }, icons_1.ICON_PLUS),
|
|
89
|
+
React.createElement("br", null),
|
|
90
|
+
React.createElement("br", null),
|
|
91
|
+
React.createElement("p", null, "Danger"),
|
|
92
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'danger' }, icons_1.ICON_PLUS),
|
|
93
|
+
"\u00A0",
|
|
94
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'danger', style: 'subtle' }, icons_1.ICON_PLUS),
|
|
95
|
+
"\u00A0",
|
|
96
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'danger', style: 'bold' }, icons_1.ICON_PLUS),
|
|
97
|
+
React.createElement("br", null),
|
|
98
|
+
React.createElement("br", null));
|
|
99
|
+
};
|
|
100
|
+
exports.colors = colors;
|
|
101
|
+
var loading = function () {
|
|
102
|
+
return React.createElement(React.Fragment, null,
|
|
103
|
+
React.createElement(Button_1.default, { onClick: handleClick, color: 'primary', size: 'large', loading: true }, "Loading"));
|
|
104
|
+
};
|
|
105
|
+
exports.loading = loading;
|
|
106
|
+
var tooltips = function () {
|
|
107
|
+
return React.createElement(React.Fragment, null,
|
|
108
|
+
React.createElement(Button_1.default, { onClick: handleClick, tooltip: 'This is a default tooltip, automatically positioned', color: 'primary', size: 'large' }, "Default"),
|
|
109
|
+
React.createElement("br", null),
|
|
110
|
+
React.createElement(Button_1.default, { onClick: handleClick, customStyles: {
|
|
111
|
+
marginLeft: '300px'
|
|
112
|
+
}, tooltip: {
|
|
113
|
+
content: 'This is a custom tooltip, dark theme, left',
|
|
114
|
+
position: 'left',
|
|
115
|
+
theme: 'dark'
|
|
116
|
+
}, color: 'primary', size: 'large' }, "Custom 1"),
|
|
117
|
+
React.createElement("br", null),
|
|
118
|
+
React.createElement(Button_1.default, { onClick: handleClick, customStyles: {
|
|
119
|
+
marginLeft: '200px'
|
|
120
|
+
}, tooltip: {
|
|
121
|
+
content: 'This is another custom tooltip, bottom',
|
|
122
|
+
position: 'bottom'
|
|
123
|
+
}, color: 'primary', size: 'large' }, "Custom 2"),
|
|
124
|
+
React.createElement("br", null));
|
|
125
|
+
};
|
|
126
|
+
exports.tooltips = tooltips;
|
|
127
|
+
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../../src/components/button/Button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,oDAA8B;AAC9B,0DAAkD;AAClD,+CAAkD;AAElD,kBAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEnC,IAAM,WAAW,GAAG,IAAA,sBAAM,EAAC,cAAc,CAAC,CAAC;AAEpC,IAAM,KAAK,GAAG;IACrB,OAAA;QACI,oBAAC,gBAAM,IACH,OAAO,EAAI,WAAW,cAEjB;;QAET,oBAAC,gBAAM,IACH,OAAO,EAAI,WAAW,IACrB,iBAAS,CACL;QACT,+BAAK;QAAA,+BAAK;QACV,oBAAC,gBAAM,IACH,OAAO,EAAI,WAAW,EACtB,IAAI,EAAI,OAAO,YAEV;;QAET,oBAAC,gBAAM,IACH,OAAO,EAAI,WAAW,EACtB,IAAI,EAAI,OAAO,IACd,iBAAS,CACL,CACV;AAtBH,CAsBG,CAAC;AAvBS,QAAA,KAAK,SAuBd;AAEG,IAAM,MA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,MAAM;gBACjB,KAAK,EAAE,MAAM;aAChB,EACD,KAAK,EAAG,SAAS,EACjB,IAAI,EAAG,OAAO,eAET;QACT,+BAAK;QACL,oBAAC,gBAAM,IACH,OAAO,EAAI,WAAW,EACtB,YAAY,EAAI;gBACZ,UAAU,EAAE,OAAO;aACtB,EACD,OAAO,EAAK;gBACR,OAAO,EAAG,wCAAwC;gBAClD,QAAQ,EAAG,QAAQ;aACtB,EACD,KAAK,EAAG,SAAS,EACjB,IAAI,EAAG,OAAO,eAET;QACT,+BAAK,CACN;AAtCH,CAsCG,CAAC;AAvCS,QAAA,QAAQ,YAuCjB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IToolTipConfig } from '../Tooltip';
|
|
3
|
+
interface IButtonGroupOption {
|
|
4
|
+
value: string | boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
bgColor?: string;
|
|
7
|
+
icon?: any;
|
|
8
|
+
onDoubleClick?: (...args: any[]) => any;
|
|
9
|
+
tooltip?: IToolTipConfig | string;
|
|
10
|
+
}
|
|
11
|
+
interface IButtonGroupFieldProps {
|
|
12
|
+
label?: string;
|
|
13
|
+
width?: string | number;
|
|
14
|
+
value: string;
|
|
15
|
+
options: IButtonGroupOption[];
|
|
16
|
+
tooltip?: IToolTipConfig | string;
|
|
17
|
+
onChange(e: any): void;
|
|
18
|
+
info?: string;
|
|
19
|
+
labelPosition?: string;
|
|
20
|
+
}
|
|
21
|
+
declare class ButtonGroupField extends React.PureComponent<IButtonGroupFieldProps> {
|
|
22
|
+
private clickTimeout;
|
|
23
|
+
private clickCounter;
|
|
24
|
+
constructor(p: IButtonGroupFieldProps);
|
|
25
|
+
private handleMultipleClicks;
|
|
26
|
+
render: () => JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export default ButtonGroupField;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
var React = __importStar(require("react"));
|
|
56
|
+
var FieldWrapper_1 = __importDefault(require("../field-wrapper/FieldWrapper"));
|
|
57
|
+
var Tooltip_1 = require("../Tooltip");
|
|
58
|
+
var ButtonGroupField = /** @class */ (function (_super) {
|
|
59
|
+
__extends(ButtonGroupField, _super);
|
|
60
|
+
function ButtonGroupField(p) {
|
|
61
|
+
var _this = _super.call(this, p) || this;
|
|
62
|
+
_this.clickCounter = 0;
|
|
63
|
+
_this.handleMultipleClicks = function (singleClick, doubleClick) {
|
|
64
|
+
_this.clickCounter++;
|
|
65
|
+
if (_this.clickCounter === 1) {
|
|
66
|
+
_this.clickTimeout = window.setTimeout(function () {
|
|
67
|
+
_this.clickCounter = 0;
|
|
68
|
+
singleClick();
|
|
69
|
+
}, 300);
|
|
70
|
+
}
|
|
71
|
+
if (_this.clickCounter === 2) {
|
|
72
|
+
clearTimeout(_this.clickTimeout);
|
|
73
|
+
_this.clickCounter = 0;
|
|
74
|
+
doubleClick();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
_this.render = function () {
|
|
78
|
+
var _a = _this.props, value = _a.value, label = _a.label, options = _a.options, width = _a.width, tooltip = _a.tooltip, info = _a.info, labelPosition = _a.labelPosition;
|
|
79
|
+
var optionStyle = { width: "".concat(100 / options.length, "%") };
|
|
80
|
+
return (React.createElement(FieldWrapper_1.default, { customClass: 'button-group-field', label: label, tooltip: tooltip, info: info, labelPosition: labelPosition, width: width },
|
|
81
|
+
React.createElement("div", { className: 'button-group' }, options.map(function (option, i) {
|
|
82
|
+
var optionKey = option.value;
|
|
83
|
+
var optionLabel = option.label;
|
|
84
|
+
var icon = (option.icon) ? option.icon : null;
|
|
85
|
+
var tooltipId = "".concat(optionKey, "-").concat(i);
|
|
86
|
+
var activeOption = (optionKey === value);
|
|
87
|
+
var activeClass = (activeOption) ? 'active' : '';
|
|
88
|
+
var onClick = (!activeOption) ? function () { _this.props.onChange(optionKey); } : null;
|
|
89
|
+
return (React.createElement("div", __assign({ key: "option-".concat(optionKey), style: optionStyle, className: "button-group-option ".concat(activeClass) }, (0, Tooltip_1.renderTooltipProps)(tooltipId, option.tooltip), { onClick: (typeof option.onDoubleClick === 'function')
|
|
90
|
+
? function () { return _this.handleMultipleClicks(onClick, option.onDoubleClick); }
|
|
91
|
+
: onClick }),
|
|
92
|
+
(!icon) ? optionLabel : icon,
|
|
93
|
+
(0, Tooltip_1.renderTooltip)(tooltipId, option.tooltip)));
|
|
94
|
+
}))));
|
|
95
|
+
};
|
|
96
|
+
return _this;
|
|
97
|
+
}
|
|
98
|
+
return ButtonGroupField;
|
|
99
|
+
}(React.PureComponent));
|
|
100
|
+
exports.default = ButtonGroupField;
|
|
101
|
+
//# sourceMappingURL=ButtonGroupField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroupField.js","sourceRoot":"","sources":["../../../../src/components/button-group-field/ButtonGroupField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,+EAAyD;AACzD,sCAA+E;AAsB/E;IAA+B,oCAA2C;IAItE,0BAAY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|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.defaultField = void 0;
|
|
30
|
+
var React = __importStar(require("react"));
|
|
31
|
+
var addon_actions_1 = require("@storybook/addon-actions");
|
|
32
|
+
var ButtonGroupField_1 = __importDefault(require("./ButtonGroupField"));
|
|
33
|
+
exports.default = {
|
|
34
|
+
title: 'ButtonGroupField',
|
|
35
|
+
component: ButtonGroupField_1.default,
|
|
36
|
+
};
|
|
37
|
+
var OVERLAY_ENGINE_TYPES = {
|
|
38
|
+
CHROMIUM: 'chromium',
|
|
39
|
+
PHANTOM: ''
|
|
40
|
+
};
|
|
41
|
+
var SAMPLE_OPTIONS = [
|
|
42
|
+
{
|
|
43
|
+
value: OVERLAY_ENGINE_TYPES.CHROMIUM,
|
|
44
|
+
label: 'Chromium'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: OVERLAY_ENGINE_TYPES.PHANTOM,
|
|
48
|
+
label: 'Phantom'
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
var defaultField = function () { return (React.createElement(ButtonGroupField_1.default, { label: 'Button Group', width: '300px', value: 'Default Value', options: SAMPLE_OPTIONS, tooltip: 'ButtonGroupField Tooltip', onChange: (0, addon_actions_1.action)('Field onChange'), info: 'This is some additional information about the field', labelPosition: 'center' })); };
|
|
52
|
+
exports.defaultField = defaultField;
|
|
53
|
+
//# sourceMappingURL=ButtonGroupField.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroupField.stories.js","sourceRoot":"","sources":["../../../../src/components/button-group-field/ButtonGroupField.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,0DAAkD;AAClD,wEAAkD;AAGlD,kBAAe;IACX,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,0BAAgB;CAC9B,CAAC;AAuBF,IAAM,oBAAoB,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,EAAE;CACd,CAAC;AAEF,IAAM,cAAc,GAAG;IACnB;QACI,KAAK,EAAE,oBAAoB,CAAC,QAAQ;QACpC,KAAK,EAAE,UAAU;KACpB;IACD;QACI,KAAK,EAAE,oBAAoB,CAAC,OAAO;QACnC,KAAK,EAAE,SAAS;KACnB;CACJ,CAAC;AAEK,IAAM,YAAY,GAAG,cAAM,OAAA,CAC9B,oBAAC,0BAAgB,IACb,KAAK,EAAG,cAAc,EACtB,KAAK,EAAI,OAAO,EAChB,KAAK,EAAG,eAAe,EACvB,OAAO,EAAI,cAAc,EACzB,OAAO,EAAG,0BAA0B,EACpC,QAAQ,EAAI,IAAA,sBAAM,EAAC,gBAAgB,CAAC,EACpC,IAAI,EAAG,qDAAqD,EAC5D,aAAa,EAAG,QAAQ,GACtB,CACT,EAXiC,CAWjC,CAAC;AAXW,QAAA,YAAY,gBAWvB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IButtonMenuProps {
|
|
3
|
+
button: any;
|
|
4
|
+
items: any;
|
|
5
|
+
position: string;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
onClick?: (e: any) => string | void;
|
|
8
|
+
}
|
|
9
|
+
interface IButtonMenuState {
|
|
10
|
+
open: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare class ButtonMenu extends React.PureComponent<IButtonMenuProps, IButtonMenuState> {
|
|
13
|
+
private evtHandlers;
|
|
14
|
+
private toggleRef;
|
|
15
|
+
private menuRef;
|
|
16
|
+
constructor(props: any);
|
|
17
|
+
private handleClickOutside;
|
|
18
|
+
componentWillUnmount(): void;
|
|
19
|
+
toggleMenu(e: any): void;
|
|
20
|
+
renderItems(): any[];
|
|
21
|
+
renderMenu(): JSX.Element;
|
|
22
|
+
render(): JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export default ButtonMenu;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __values = (this && this.__values) || function(o) {
|
|
41
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
42
|
+
if (m) return m.call(o);
|
|
43
|
+
if (o && typeof o.length === "number") return {
|
|
44
|
+
next: function () {
|
|
45
|
+
if (o && i >= o.length) o = void 0;
|
|
46
|
+
return { value: o && o[i++], done: !o };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
var React = __importStar(require("react"));
|
|
53
|
+
var ButtonMenu = /** @class */ (function (_super) {
|
|
54
|
+
__extends(ButtonMenu, _super);
|
|
55
|
+
function ButtonMenu(props) {
|
|
56
|
+
var _this = _super.call(this, props) || this;
|
|
57
|
+
_this.state = {
|
|
58
|
+
open: false
|
|
59
|
+
};
|
|
60
|
+
_this.evtHandlers = {
|
|
61
|
+
toggleMenu: function (e) { return _this.toggleMenu(e); },
|
|
62
|
+
clickOutside: function (e, isSelect) { return _this.handleClickOutside(e, isSelect); }
|
|
63
|
+
};
|
|
64
|
+
_this.toggleRef = React.createRef();
|
|
65
|
+
_this.menuRef = React.createRef();
|
|
66
|
+
return _this;
|
|
67
|
+
}
|
|
68
|
+
ButtonMenu.prototype.handleClickOutside = function (e, isSelect) {
|
|
69
|
+
var clickOnToggle = (this.toggleRef && this.toggleRef.current && this.toggleRef.current.contains(e.target)) ? true : false;
|
|
70
|
+
var menus = (this.menuRef && this.menuRef.current && this.menuRef.current.contains(e.target)) ? true : false;
|
|
71
|
+
if (!clickOnToggle && !isSelect) {
|
|
72
|
+
document.removeEventListener('click', this.evtHandlers.clickOutside);
|
|
73
|
+
this.setState({
|
|
74
|
+
open: false
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (isSelect && !menus) {
|
|
78
|
+
document.removeEventListener('click', this.evtHandlers.clickOutside);
|
|
79
|
+
this.setState({
|
|
80
|
+
open: false
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
ButtonMenu.prototype.componentWillUnmount = function () {
|
|
85
|
+
document.removeEventListener('click', this.evtHandlers.clickOutside);
|
|
86
|
+
};
|
|
87
|
+
ButtonMenu.prototype.toggleMenu = function (e) {
|
|
88
|
+
var _this = this;
|
|
89
|
+
var onClick = this.props.onClick;
|
|
90
|
+
var newState = !this.state.open;
|
|
91
|
+
if (onClick) {
|
|
92
|
+
onClick(newState);
|
|
93
|
+
}
|
|
94
|
+
this.setState({
|
|
95
|
+
open: newState
|
|
96
|
+
}, function () {
|
|
97
|
+
if (_this.state.open) {
|
|
98
|
+
document.addEventListener('click', function (evt) { return _this.evtHandlers.clickOutside(evt, onClick ? true : undefined); });
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
document.removeEventListener('click', _this.evtHandlers.clickOutside);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
ButtonMenu.prototype.renderItems = function () {
|
|
106
|
+
var e_1, _a;
|
|
107
|
+
var _this = this;
|
|
108
|
+
var _b = this.props, items = _b.items, isOpen = _b.isOpen;
|
|
109
|
+
var newItems = [];
|
|
110
|
+
var _loop_1 = function (item) {
|
|
111
|
+
// clone the menu items passed in, close the modal before calling onClick on each item
|
|
112
|
+
var newItem = React.cloneElement(item, {
|
|
113
|
+
onClick: function (e) {
|
|
114
|
+
if (!_this.props.isOpen) {
|
|
115
|
+
document.removeEventListener('click', _this.evtHandlers.clickOutside);
|
|
116
|
+
}
|
|
117
|
+
_this.setState({
|
|
118
|
+
open: isOpen ? isOpen : false
|
|
119
|
+
}, function () {
|
|
120
|
+
item.props.onClick(e);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
newItems.push(newItem);
|
|
125
|
+
};
|
|
126
|
+
try {
|
|
127
|
+
for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
|
|
128
|
+
var item = items_1_1.value;
|
|
129
|
+
_loop_1(item);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
133
|
+
finally {
|
|
134
|
+
try {
|
|
135
|
+
if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
|
|
136
|
+
}
|
|
137
|
+
finally { if (e_1) throw e_1.error; }
|
|
138
|
+
}
|
|
139
|
+
return newItems;
|
|
140
|
+
};
|
|
141
|
+
ButtonMenu.prototype.renderMenu = function () {
|
|
142
|
+
var position = this.props.position;
|
|
143
|
+
var open = this.state.open;
|
|
144
|
+
if (open) {
|
|
145
|
+
return React.createElement("div", { className: "menu ".concat(position) }, this.renderItems());
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
ButtonMenu.prototype.render = function () {
|
|
149
|
+
var button = this.props.button;
|
|
150
|
+
var open = this.state.open;
|
|
151
|
+
// Clone the trigger button passed in and add an onClick listener
|
|
152
|
+
var trigger = React.cloneElement(button, {
|
|
153
|
+
buttonRef: this.toggleRef,
|
|
154
|
+
onClick: this.evtHandlers.toggleMenu,
|
|
155
|
+
active: open
|
|
156
|
+
});
|
|
157
|
+
return React.createElement("div", { ref: this.menuRef, className: 'button-menu' },
|
|
158
|
+
trigger,
|
|
159
|
+
this.renderMenu());
|
|
160
|
+
};
|
|
161
|
+
return ButtonMenu;
|
|
162
|
+
}(React.PureComponent));
|
|
163
|
+
exports.default = ButtonMenu;
|
|
164
|
+
//# sourceMappingURL=ButtonMenu.js.map
|