@weavix/tracker-components 0.0.3 → 0.1.1
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 +191 -19
- package/build/cjs/assets/icons/keyResult.d.ts +4 -0
- package/build/cjs/assets/icons/keyResult.js +21 -0
- package/build/cjs/assets/icons/keyResult.js.map +1 -0
- package/build/cjs/components/FieldsSelect/FieldsSelect.classname.js +1 -1
- package/build/cjs/components/FieldsSelect/FieldsSelect.classname.js.map +1 -1
- package/build/cjs/components/Icon/EntityIcon/EntityIcon.classname.js +1 -1
- package/build/cjs/components/Icon/EntityIcon/EntityIcon.classname.js.map +1 -1
- package/build/cjs/components/Icon/GoalIcon/GoalIcon.d.ts +6 -0
- package/build/cjs/components/Icon/GoalIcon/GoalIcon.js +24 -0
- package/build/cjs/components/Icon/GoalIcon/GoalIcon.js.map +1 -0
- package/build/cjs/components/Icon/GoalIcon/README.md +123 -0
- package/build/cjs/components/Icon/GoalIcon/index.d.ts +1 -0
- package/build/cjs/components/Icon/GoalIcon/index.js +13 -0
- package/build/cjs/components/Icon/GoalIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/Icon.classname.js +1 -1
- package/build/cjs/components/Icon/Icon.classname.js.map +1 -1
- package/build/cjs/components/Icon/IconRefuge/IconRefuge.classname.js +1 -1
- package/build/cjs/components/Icon/IconRefuge/IconRefuge.classname.js.map +1 -1
- package/build/cjs/components/Icon/IssueTypeIcon/IssueTypeIcon.classname.js +1 -1
- package/build/cjs/components/Icon/IssueTypeIcon/IssueTypeIcon.classname.js.map +1 -1
- package/build/cjs/components/Icon/IssueTypeIcon/README.md +105 -23
- package/build/cjs/components/Icon/KeyResultIcon/KeyResultIcon.d.ts +4 -0
- package/build/cjs/components/Icon/KeyResultIcon/KeyResultIcon.js +35 -0
- package/build/cjs/components/Icon/KeyResultIcon/KeyResultIcon.js.map +1 -0
- package/build/cjs/components/Icon/KeyResultIcon/README.md +73 -0
- package/build/cjs/components/Icon/KeyResultIcon/i18n.d.ts +6 -0
- package/build/cjs/components/Icon/KeyResultIcon/i18n.js +13 -0
- package/build/cjs/components/Icon/KeyResultIcon/i18n.js.map +1 -0
- package/build/cjs/components/Icon/KeyResultIcon/index.d.ts +2 -0
- package/build/cjs/components/Icon/KeyResultIcon/index.js +13 -0
- package/build/cjs/components/Icon/KeyResultIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/MetaEntityIcon/MetaEntityIcon.d.ts +7 -0
- package/build/cjs/components/Icon/MetaEntityIcon/MetaEntityIcon.js +46 -0
- package/build/cjs/components/Icon/MetaEntityIcon/MetaEntityIcon.js.map +1 -0
- package/build/cjs/components/Icon/MetaEntityIcon/README.md +126 -0
- package/build/cjs/components/Icon/MetaEntityIcon/index.d.ts +2 -0
- package/build/cjs/components/Icon/MetaEntityIcon/index.js +13 -0
- package/build/cjs/components/Icon/MetaEntityIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/PortfolioIcon/README.md +87 -9
- package/build/cjs/components/Icon/PortfolioIcon/index.d.ts +2 -0
- package/build/cjs/components/Icon/PortfolioIcon/index.js +13 -0
- package/build/cjs/components/Icon/PortfolioIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/ProjectIcon/README.md +133 -9
- package/build/cjs/components/Icon/ProjectIcon/index.d.ts +2 -0
- package/build/cjs/components/Icon/ProjectIcon/index.js +13 -0
- package/build/cjs/components/Icon/ProjectIcon/index.js.map +1 -0
- package/build/cjs/components/Icon/index.d.ts +7 -2
- package/build/cjs/components/Icon/index.js +57 -2
- package/build/cjs/components/Icon/index.js.map +1 -1
- package/build/cjs/components/MetaEntitiesSelect/MetaEntitiesSelect.classname.d.ts +1 -0
- package/build/cjs/components/MetaEntitiesSelect/MetaEntitiesSelect.classname.js +9 -0
- package/build/cjs/components/MetaEntitiesSelect/MetaEntitiesSelect.classname.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/MetaEntitiesSelect.d.ts +10 -0
- package/build/cjs/components/MetaEntitiesSelect/MetaEntitiesSelect.js +65 -0
- package/build/cjs/components/MetaEntitiesSelect/MetaEntitiesSelect.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/README.md +183 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggest/EntitiesSuggest.d.ts +15 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggest/EntitiesSuggest.js +69 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggest/EntitiesSuggest.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.classname.d.ts +1 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.classname.js +9 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.classname.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.css +18 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.css.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.d.ts +10 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.js +33 -0
- package/build/cjs/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/i18n.d.ts +6 -0
- package/build/cjs/components/MetaEntitiesSelect/i18n.js +13 -0
- package/build/cjs/components/MetaEntitiesSelect/i18n.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/index.d.ts +2 -0
- package/build/cjs/components/MetaEntitiesSelect/index.js +13 -0
- package/build/cjs/components/MetaEntitiesSelect/index.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/utils/getMetaEntityDisplay.d.ts +2 -0
- package/build/cjs/components/MetaEntitiesSelect/utils/getMetaEntityDisplay.js +11 -0
- package/build/cjs/components/MetaEntitiesSelect/utils/getMetaEntityDisplay.js.map +1 -0
- package/build/cjs/components/MetaEntitiesSelect/utils/getMetaEntityId.d.ts +2 -0
- package/build/cjs/components/MetaEntitiesSelect/utils/getMetaEntityId.js +10 -0
- package/build/cjs/components/MetaEntitiesSelect/utils/getMetaEntityId.js.map +1 -0
- package/build/cjs/components/PluginFieldsSelect/PluginFieldsSelect.d.ts +1 -1
- package/build/cjs/components/PluginFieldsSelect/PluginFieldsSelect.js.map +1 -1
- package/build/cjs/components/QueueIcon/QueueIcon.classname.js +1 -1
- package/build/cjs/components/QueueIcon/QueueIcon.classname.js.map +1 -1
- package/build/cjs/components/QueueSelect/QueueSelect.classname.js +1 -1
- package/build/cjs/components/QueueSelect/QueueSelect.classname.js.map +1 -1
- package/build/cjs/components/QueueSelect/QueueSelect.css.map +1 -1
- package/build/cjs/components/Select/Autocomplete.d.ts +1 -1
- package/build/cjs/components/Select/MultiAutocomplete.d.ts +1 -1
- package/build/cjs/components/Select/Select.classname.js +1 -1
- package/build/cjs/components/Select/Select.classname.js.map +1 -1
- package/build/cjs/components/Select/Select.css.map +1 -1
- package/build/cjs/components/Select/Select.d.ts +1 -1
- package/build/cjs/components/Select/SelectSearch/SelectSearch.classname.js +1 -1
- package/build/cjs/components/Select/SelectSearch/SelectSearch.classname.js.map +1 -1
- package/build/cjs/components/Select/SelectSearch/SelectSearch.d.ts +1 -1
- package/build/cjs/components/Select/SelectSearch/SelectSearch.js +2 -2
- package/build/cjs/components/Select/SelectSearch/SelectSearch.js.map +1 -1
- package/build/cjs/components/Select/SelectSearch/hooks/useSelectSearch.d.ts +2 -2
- package/build/cjs/components/Select/SelectSearch/hooks/useSelectSearch.js.map +1 -1
- package/build/cjs/components/Select/TagsSelect/TagsSelect.classname.js +1 -1
- package/build/cjs/components/Select/TagsSelect/TagsSelect.classname.js.map +1 -1
- package/build/cjs/components/Suggest/Suggest.classname.d.ts +1 -0
- package/build/cjs/components/Suggest/Suggest.classname.js +9 -0
- package/build/cjs/components/Suggest/Suggest.classname.js.map +1 -0
- package/build/cjs/components/Suggest/Suggest.css +24 -0
- package/build/cjs/components/Suggest/Suggest.css.map +1 -0
- package/build/cjs/components/Suggest/Suggest.d.ts +147 -0
- package/build/cjs/components/Suggest/Suggest.js +621 -0
- package/build/cjs/components/Suggest/Suggest.js.map +1 -0
- package/build/cjs/components/Suggest/i18n.d.ts +22 -0
- package/build/cjs/components/Suggest/i18n.js +29 -0
- package/build/cjs/components/Suggest/i18n.js.map +1 -0
- package/build/cjs/components/Suggest/index.d.ts +1 -0
- package/build/cjs/components/Suggest/index.js +17 -0
- package/build/cjs/components/Suggest/index.js.map +1 -0
- package/build/cjs/components/TrackerDisclosure/README.md +205 -0
- package/build/cjs/components/TrackerDisclosure/TrackerDisclosure.classname.js +1 -1
- package/build/cjs/components/TrackerDisclosure/TrackerDisclosure.classname.js.map +1 -1
- package/build/cjs/components/TrackerSelect/TrackerSelect.classname.js +1 -1
- package/build/cjs/components/TrackerSelect/TrackerSelect.classname.js.map +1 -1
- package/build/cjs/components/TrackerSelect/TrackerSelect.css.map +1 -1
- package/build/cjs/components/useOnFocusOutside/OutsideFocusHandlerContainer.d.ts +9 -0
- package/build/cjs/components/useOnFocusOutside/OutsideFocusHandlerContainer.js +31 -0
- package/build/cjs/components/useOnFocusOutside/OutsideFocusHandlerContainer.js.map +1 -0
- package/build/cjs/components/useOnFocusOutside/useOnFocusOutside.d.ts +1 -0
- package/build/cjs/components/useOnFocusOutside/useOnFocusOutside.js +38 -0
- package/build/cjs/components/useOnFocusOutside/useOnFocusOutside.js.map +1 -0
- package/build/cjs/hooks/useConditionallyControlledState.d.ts +1 -0
- package/build/cjs/hooks/useConditionallyControlledState.js +15 -0
- package/build/cjs/hooks/useConditionallyControlledState.js.map +1 -0
- package/build/cjs/hooks/useLocalizedString.d.ts +1 -1
- package/build/cjs/hooks/useLocalizedString.js.map +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +12 -0
- package/build/cjs/index.js.map +1 -1
- package/build/esm/assets/icons/keyResult.d.ts +4 -0
- package/build/esm/assets/icons/keyResult.js +13 -0
- package/build/esm/components/FieldsSelect/FieldsSelect.classname.js +1 -1
- package/build/esm/components/FieldsSelect/FieldsSelect.classname.js.map +1 -1
- package/build/esm/components/Icon/EntityIcon/EntityIcon.classname.js +1 -1
- package/build/esm/components/Icon/EntityIcon/EntityIcon.classname.js.map +1 -1
- package/build/esm/components/Icon/GoalIcon/GoalIcon.d.ts +6 -0
- package/build/esm/components/Icon/GoalIcon/GoalIcon.js +17 -0
- package/build/esm/components/Icon/GoalIcon/GoalIcon.js.map +1 -0
- package/build/esm/components/Icon/GoalIcon/README.md +123 -0
- package/build/esm/components/Icon/GoalIcon/index.d.ts +1 -0
- package/build/esm/components/Icon/GoalIcon/index.js +2 -0
- package/build/esm/components/Icon/GoalIcon/index.js.map +1 -0
- package/build/esm/components/Icon/Icon.classname.js +1 -1
- package/build/esm/components/Icon/Icon.classname.js.map +1 -1
- package/build/esm/components/Icon/IconRefuge/IconRefuge.classname.js +1 -1
- package/build/esm/components/Icon/IconRefuge/IconRefuge.classname.js.map +1 -1
- package/build/esm/components/Icon/IssueTypeIcon/IssueTypeIcon.classname.js +1 -1
- package/build/esm/components/Icon/IssueTypeIcon/IssueTypeIcon.classname.js.map +1 -1
- package/build/esm/components/Icon/IssueTypeIcon/README.md +105 -23
- package/build/esm/components/Icon/KeyResultIcon/KeyResultIcon.d.ts +4 -0
- package/build/esm/components/Icon/KeyResultIcon/KeyResultIcon.js +28 -0
- package/build/esm/components/Icon/KeyResultIcon/KeyResultIcon.js.map +1 -0
- package/build/esm/components/Icon/KeyResultIcon/README.md +73 -0
- package/build/esm/components/Icon/KeyResultIcon/i18n.d.ts +6 -0
- package/build/esm/components/Icon/KeyResultIcon/i18n.js +7 -0
- package/build/esm/components/Icon/KeyResultIcon/i18n.js.map +1 -0
- package/build/esm/components/Icon/KeyResultIcon/index.d.ts +2 -0
- package/build/esm/components/Icon/KeyResultIcon/index.js +2 -0
- package/build/esm/components/Icon/KeyResultIcon/index.js.map +1 -0
- package/build/esm/components/Icon/MetaEntityIcon/MetaEntityIcon.d.ts +7 -0
- package/build/esm/components/Icon/MetaEntityIcon/MetaEntityIcon.js +39 -0
- package/build/esm/components/Icon/MetaEntityIcon/MetaEntityIcon.js.map +1 -0
- package/build/esm/components/Icon/MetaEntityIcon/README.md +126 -0
- package/build/esm/components/Icon/MetaEntityIcon/index.d.ts +2 -0
- package/build/esm/components/Icon/MetaEntityIcon/index.js +2 -0
- package/build/esm/components/Icon/MetaEntityIcon/index.js.map +1 -0
- package/build/esm/components/Icon/PortfolioIcon/README.md +87 -9
- package/build/esm/components/Icon/PortfolioIcon/index.d.ts +2 -0
- package/build/esm/components/Icon/PortfolioIcon/index.js +2 -0
- package/build/esm/components/Icon/PortfolioIcon/index.js.map +1 -0
- package/build/esm/components/Icon/ProjectIcon/README.md +133 -9
- package/build/esm/components/Icon/ProjectIcon/index.d.ts +2 -0
- package/build/esm/components/Icon/ProjectIcon/index.js +2 -0
- package/build/esm/components/Icon/ProjectIcon/index.js.map +1 -0
- package/build/esm/components/Icon/index.d.ts +7 -2
- package/build/esm/components/Icon/index.js +7 -2
- package/build/esm/components/Icon/index.js.map +1 -1
- package/build/esm/components/MetaEntitiesSelect/MetaEntitiesSelect.classname.d.ts +1 -0
- package/build/esm/components/MetaEntitiesSelect/MetaEntitiesSelect.classname.js +3 -0
- package/build/esm/components/MetaEntitiesSelect/MetaEntitiesSelect.classname.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/MetaEntitiesSelect.d.ts +10 -0
- package/build/esm/components/MetaEntitiesSelect/MetaEntitiesSelect.js +57 -0
- package/build/esm/components/MetaEntitiesSelect/MetaEntitiesSelect.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/README.md +183 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggest/EntitiesSuggest.d.ts +15 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggest/EntitiesSuggest.js +61 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggest/EntitiesSuggest.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.classname.d.ts +1 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.classname.js +3 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.classname.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.css +18 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.css.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.d.ts +10 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.js +26 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/components/EntitiesSuggestItem/EntitiesSuggestItem.scss +24 -0
- package/build/esm/components/MetaEntitiesSelect/i18n.d.ts +6 -0
- package/build/esm/components/MetaEntitiesSelect/i18n.js +7 -0
- package/build/esm/components/MetaEntitiesSelect/i18n.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/index.d.ts +2 -0
- package/build/esm/components/MetaEntitiesSelect/index.js +2 -0
- package/build/esm/components/MetaEntitiesSelect/index.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/utils/getMetaEntityDisplay.d.ts +2 -0
- package/build/esm/components/MetaEntitiesSelect/utils/getMetaEntityDisplay.js +5 -0
- package/build/esm/components/MetaEntitiesSelect/utils/getMetaEntityDisplay.js.map +1 -0
- package/build/esm/components/MetaEntitiesSelect/utils/getMetaEntityId.d.ts +2 -0
- package/build/esm/components/MetaEntitiesSelect/utils/getMetaEntityId.js +4 -0
- package/build/esm/components/MetaEntitiesSelect/utils/getMetaEntityId.js.map +1 -0
- package/build/esm/components/PluginFieldsSelect/PluginFieldsSelect.d.ts +1 -1
- package/build/esm/components/PluginFieldsSelect/PluginFieldsSelect.js.map +1 -1
- package/build/esm/components/QueueIcon/QueueIcon.classname.js +1 -1
- package/build/esm/components/QueueIcon/QueueIcon.classname.js.map +1 -1
- package/build/esm/components/QueueSelect/QueueSelect.classname.js +1 -1
- package/build/esm/components/QueueSelect/QueueSelect.classname.js.map +1 -1
- package/build/esm/components/QueueSelect/QueueSelect.css.map +1 -1
- package/build/esm/components/QueueSelect/QueueSelect.scss +4 -8
- package/build/esm/components/Select/Autocomplete.d.ts +1 -1
- package/build/esm/components/Select/MultiAutocomplete.d.ts +1 -1
- package/build/esm/components/Select/Select.classname.js +1 -1
- package/build/esm/components/Select/Select.classname.js.map +1 -1
- package/build/esm/components/Select/Select.css.map +1 -1
- package/build/esm/components/Select/Select.d.ts +1 -1
- package/build/esm/components/Select/Select.scss +3 -4
- package/build/esm/components/Select/SelectSearch/SelectSearch.classname.js +1 -1
- package/build/esm/components/Select/SelectSearch/SelectSearch.classname.js.map +1 -1
- package/build/esm/components/Select/SelectSearch/SelectSearch.d.ts +1 -1
- package/build/esm/components/Select/SelectSearch/SelectSearch.js +1 -1
- package/build/esm/components/Select/SelectSearch/SelectSearch.js.map +1 -1
- package/build/esm/components/Select/SelectSearch/hooks/useSelectSearch.d.ts +2 -2
- package/build/esm/components/Select/SelectSearch/hooks/useSelectSearch.js.map +1 -1
- package/build/esm/components/Select/TagsSelect/TagsSelect.classname.js +1 -1
- package/build/esm/components/Select/TagsSelect/TagsSelect.classname.js.map +1 -1
- package/build/esm/components/Suggest/Suggest.classname.d.ts +1 -0
- package/build/esm/components/Suggest/Suggest.classname.js +3 -0
- package/build/esm/components/Suggest/Suggest.classname.js.map +1 -0
- package/build/esm/components/Suggest/Suggest.css +24 -0
- package/build/esm/components/Suggest/Suggest.css.map +1 -0
- package/build/esm/components/Suggest/Suggest.d.ts +147 -0
- package/build/esm/components/Suggest/Suggest.js +613 -0
- package/build/esm/components/Suggest/Suggest.js.map +1 -0
- package/build/esm/components/Suggest/Suggest.scss +30 -0
- package/build/esm/components/Suggest/i18n.d.ts +22 -0
- package/build/esm/components/Suggest/i18n.js +23 -0
- package/build/esm/components/Suggest/i18n.js.map +1 -0
- package/build/esm/components/Suggest/index.d.ts +1 -0
- package/build/esm/components/Suggest/index.js +2 -0
- package/build/esm/components/Suggest/index.js.map +1 -0
- package/build/esm/components/TrackerDisclosure/README.md +205 -0
- package/build/esm/components/TrackerDisclosure/TrackerDisclosure.classname.js +1 -1
- package/build/esm/components/TrackerDisclosure/TrackerDisclosure.classname.js.map +1 -1
- package/build/esm/components/TrackerSelect/TrackerSelect.classname.js +1 -1
- package/build/esm/components/TrackerSelect/TrackerSelect.classname.js.map +1 -1
- package/build/esm/components/TrackerSelect/TrackerSelect.css.map +1 -1
- package/build/esm/components/TrackerSelect/TrackerSelect.scss +3 -5
- package/build/esm/components/useOnFocusOutside/OutsideFocusHandlerContainer.d.ts +9 -0
- package/build/esm/components/useOnFocusOutside/OutsideFocusHandlerContainer.js +24 -0
- package/build/esm/components/useOnFocusOutside/OutsideFocusHandlerContainer.js.map +1 -0
- package/build/esm/components/useOnFocusOutside/useOnFocusOutside.d.ts +1 -0
- package/build/esm/components/useOnFocusOutside/useOnFocusOutside.js +31 -0
- package/build/esm/components/useOnFocusOutside/useOnFocusOutside.js.map +1 -0
- package/build/esm/hooks/useConditionallyControlledState.d.ts +1 -0
- package/build/esm/hooks/useConditionallyControlledState.js +9 -0
- package/build/esm/hooks/useConditionallyControlledState.js.map +1 -0
- package/build/esm/hooks/useLocalizedString.d.ts +1 -1
- package/build/esm/hooks/useLocalizedString.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/styles/mixins.scss +8 -0
- package/package.json +3 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","GoalIcon","KeyResultIcon","PortfolioIcon","ProjectIcon","jsx","_jsx","MetaEntityIcon","_ref","entity","_ref$size","size","entityType","id","shortId","portfolioId","projectId","Number","goalId"],"sources":["MetaEntityIcon.tsx"],"sourcesContent":["import React from 'react';\nimport type {FC} from 'react';\n\nimport type {MetaEntityV2} from '@weavix/tracker-api-types';\n\nimport {GoalIcon} from '../GoalIcon';\nimport {KeyResultIcon} from '../KeyResultIcon';\nimport {PortfolioIcon} from '../PortfolioIcon';\nimport {ProjectIcon} from '../ProjectIcon';\n\nexport type MetaEntityIconProps = {\n entity: Pick<MetaEntityV2, 'entityType' | 'id' | 'shortId'>;\n size?: number;\n};\n\nexport const MetaEntityIcon: FC<MetaEntityIconProps> = ({entity, size = 20}) => {\n const {entityType, id, shortId} = entity;\n\n switch (entityType) {\n case 'portfolio':\n return <PortfolioIcon portfolioId={id} size={size} />;\n case 'project':\n return <ProjectIcon projectId={Number(shortId)} size={size} />;\n case 'goal':\n return <GoalIcon goalId={Number(shortId)} size={size} />;\n case 'keyResult' as unknown as MetaEntityV2['entityType']:\n return <KeyResultIcon size={size} />;\n default:\n return null;\n }\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAKzB,SAAQC,QAAQ;AAChB,SAAQC,aAAa;AACrB,SAAQC,aAAa;AACrB,SAAQC,WAAW;AAAwB,SAAAC,GAAA,IAAAC,IAAA;AAO3C,OAAO,IAAMC,cAAuC,GAAG,SAA1CA,cAAuCA,CAAAC,IAAA,EAA4B;EAAA,IAAvBC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAAC,SAAA,GAAAF,IAAA,CAAEG,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,EAAE,GAAAA,SAAA;EACtE,IAAOE,UAAU,GAAiBH,MAAM,CAAjCG,UAAU;IAAEC,EAAE,GAAaJ,MAAM,CAArBI,EAAE;IAAEC,OAAO,GAAIL,MAAM,CAAjBK,OAAO;EAE9B,QAAQF,UAAU;IACd,KAAK,WAAW;MACZ,oBAAON,IAAA,CAACH,aAAa;QAACY,WAAW,EAAEF,EAAG;QAACF,IAAI,EAAEA;MAAK,CAAE,CAAC;IACzD,KAAK,SAAS;MACV,oBAAOL,IAAA,CAACF,WAAW;QAACY,SAAS,EAAEC,MAAM,CAACH,OAAO,CAAE;QAACH,IAAI,EAAEA;MAAK,CAAE,CAAC;IAClE,KAAK,MAAM;MACP,oBAAOL,IAAA,CAACL,QAAQ;QAACiB,MAAM,EAAED,MAAM,CAACH,OAAO,CAAE;QAACH,IAAI,EAAEA;MAAK,CAAE,CAAC;IAC5D,KAAK,WAAW;MACZ,oBAAOL,IAAA,CAACJ,aAAa;QAACS,IAAI,EAAEA;MAAK,CAAE,CAAC;IACxC;MACI,OAAO,IAAI;EACnB;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# MetaEntityIcon
|
|
2
|
+
|
|
3
|
+
<!-- description:start -->
|
|
4
|
+
A dispatcher component that renders the correct icon for any Tracker meta entity type — project, portfolio, goal, or key result. Pass the entity object and the component automatically selects and renders the appropriate icon with a deterministic color derived from the entity ID.
|
|
5
|
+
<!-- description:end -->
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {MetaEntityIcon} from '@weavix/tracker-components';
|
|
11
|
+
|
|
12
|
+
<MetaEntityIcon entity={{entityType: 'project', id: 'proj-1', shortId: 42}} />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Component props
|
|
16
|
+
|
|
17
|
+
<!-- props:start -->
|
|
18
|
+
```ts
|
|
19
|
+
{
|
|
20
|
+
/**
|
|
21
|
+
* The meta entity to display an icon for.
|
|
22
|
+
* Only `entityType`, `id`, and `shortId` are required.
|
|
23
|
+
*/
|
|
24
|
+
entity: {
|
|
25
|
+
entityType: 'project' | 'portfolio' | 'goal' | 'keyResult';
|
|
26
|
+
/** String entity ID (used for portfolio color generation). */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Numeric short ID (used for project and goal color generation). */
|
|
29
|
+
shortId: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Size of the SVG icon inside the container in pixels.
|
|
34
|
+
* @default 20
|
|
35
|
+
*/
|
|
36
|
+
size?: number;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
<!-- props:end -->
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Supported entity types
|
|
44
|
+
|
|
45
|
+
| `entityType` | Rendered component | Color source |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `'project'` | [`ProjectIcon`](../ProjectIcon/README.md) | `shortId` |
|
|
48
|
+
| `'portfolio'` | [`PortfolioIcon`](../PortfolioIcon/README.md) | `id` |
|
|
49
|
+
| `'goal'` | [`GoalIcon`](../GoalIcon/README.md) | `shortId` |
|
|
50
|
+
| `'keyResult'` | [`KeyResultIcon`](../KeyResultIcon/README.md) | fixed asset, no color |
|
|
51
|
+
| anything else | `null` (renders nothing) | — |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
### All entity types
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import {MetaEntityIcon} from '@weavix/tracker-components';
|
|
61
|
+
|
|
62
|
+
<MetaEntityIcon entity={{entityType: 'project', id: 'proj-1', shortId: 42}} />
|
|
63
|
+
<MetaEntityIcon entity={{entityType: 'portfolio', id: 'port-1', shortId: 7}} />
|
|
64
|
+
<MetaEntityIcon entity={{entityType: 'goal', id: 'goal-1', shortId: 99}} />
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Custom size
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
// 32 px icon for a page header
|
|
71
|
+
<MetaEntityIcon
|
|
72
|
+
entity={{entityType: 'project', id: 'proj-1', shortId: 42}}
|
|
73
|
+
size={32}
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Rendering from a Tracker API response
|
|
78
|
+
|
|
79
|
+
`MetaEntityIcon` accepts the shape returned directly by the Tracker entities search endpoint, so you can pass `result.data[i]` without any mapping:
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import React, {useEffect, useState} from 'react';
|
|
83
|
+
import {MetaEntityIcon} from '@weavix/tracker-components';
|
|
84
|
+
import type {MetaEntityV2} from '@weavix/tracker-api-types';
|
|
85
|
+
|
|
86
|
+
interface Props {
|
|
87
|
+
trackerApi: TrackerApi;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const EntityList: React.FC<Props> = ({trackerApi}) => {
|
|
91
|
+
const [entities, setEntities] = useState<MetaEntityV2[]>([]);
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
trackerApi.v3
|
|
95
|
+
.post['/entities/{entityType}/_search']({
|
|
96
|
+
pathParams: {entityType: 'project'},
|
|
97
|
+
queryParams: {fields: ['summary'], page: 1, perPage: 20},
|
|
98
|
+
bodyParams: {filter: {}, filterTypes: ['ALL'], input: ''},
|
|
99
|
+
})
|
|
100
|
+
.then((result) => setEntities(result.data));
|
|
101
|
+
}, [trackerApi]);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<ul>
|
|
105
|
+
{entities.map((entity) => (
|
|
106
|
+
<li key={entity.id} style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
107
|
+
<MetaEntityIcon entity={entity} size={20} />
|
|
108
|
+
<span>{entity.fields?.summary?.value ?? entity.id}</span>
|
|
109
|
+
</li>
|
|
110
|
+
))}
|
|
111
|
+
</ul>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Used inside MetaEntitiesSelect
|
|
117
|
+
|
|
118
|
+
`MetaEntityIcon` is used internally by [`MetaEntitiesSelect`](../../MetaEntitiesSelect/README.md) to render each item in the suggest list. You do not need to use it directly when using that component.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Notes
|
|
123
|
+
|
|
124
|
+
- The `entity` prop only requires `entityType`, `id`, and `shortId` — it is compatible with the full `MetaEntityV2` type from `@weavix/tracker-api-types`.
|
|
125
|
+
- For unknown `entityType` values the component renders `null` silently.
|
|
126
|
+
- To render individual entity icons directly, use [`ProjectIcon`](../ProjectIcon/README.md), [`PortfolioIcon`](../PortfolioIcon/README.md), [`GoalIcon`](../GoalIcon/README.md), or [`KeyResultIcon`](../KeyResultIcon/README.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MetaEntityIcon"],"sources":["index.ts"],"sourcesContent":["export {MetaEntityIcon} from './MetaEntityIcon';\nexport type {MetaEntityIconProps} from './MetaEntityIcon';\n"],"mappings":"AAAA,SAAQA,cAAc","ignoreList":[]}
|
|
@@ -1,51 +1,129 @@
|
|
|
1
1
|
# PortfolioIcon
|
|
2
2
|
|
|
3
3
|
<!-- description:start -->
|
|
4
|
-
|
|
4
|
+
Displays a colored icon for a Tracker portfolio entity. The icon color is deterministically derived from the `portfolioId`, so the same portfolio always renders the same color across sessions and environments.
|
|
5
5
|
<!-- description:end -->
|
|
6
6
|
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {PortfolioIcon} from '@weavix/tracker-components';
|
|
11
|
+
|
|
12
|
+
<PortfolioIcon portfolioId="portfolio-abc" />
|
|
13
|
+
```
|
|
14
|
+
|
|
7
15
|
## Component props
|
|
8
16
|
|
|
9
17
|
<!-- props:start -->
|
|
10
18
|
```ts
|
|
11
19
|
{
|
|
12
20
|
/**
|
|
13
|
-
* Portfolio ID used to generate a deterministic color
|
|
21
|
+
* Portfolio ID used to generate a deterministic color.
|
|
22
|
+
* Typically the string entity ID returned by the Tracker API.
|
|
14
23
|
*/
|
|
15
24
|
portfolioId: string;
|
|
25
|
+
|
|
16
26
|
/**
|
|
17
|
-
* Additional class
|
|
27
|
+
* Additional CSS class applied to the root element.
|
|
18
28
|
*/
|
|
19
29
|
className?: string;
|
|
30
|
+
|
|
20
31
|
/**
|
|
21
|
-
* Entity type label
|
|
32
|
+
* Entity type label. Defaults to "portfolio".
|
|
22
33
|
*/
|
|
23
34
|
type?: string;
|
|
35
|
+
|
|
24
36
|
/**
|
|
25
|
-
* Size of the SVG icon inside the container in pixels
|
|
37
|
+
* Size of the SVG icon inside the container in pixels.
|
|
26
38
|
* @default 16
|
|
27
39
|
*/
|
|
28
40
|
size?: number;
|
|
41
|
+
|
|
29
42
|
/**
|
|
30
|
-
* Size of the icon container in pixels
|
|
43
|
+
* Size of the icon container (the colored square) in pixels.
|
|
31
44
|
* @default 24
|
|
32
45
|
*/
|
|
33
46
|
refugeSize?: number;
|
|
47
|
+
|
|
34
48
|
/**
|
|
35
|
-
* Whether to render a colored background behind the icon
|
|
49
|
+
* Whether to render a colored background behind the icon.
|
|
36
50
|
* @default false
|
|
37
51
|
*/
|
|
38
52
|
withBackground?: boolean;
|
|
53
|
+
|
|
39
54
|
/**
|
|
40
|
-
* Border radius variant of the icon container
|
|
55
|
+
* Border radius variant of the icon container.
|
|
41
56
|
* @default 'm'
|
|
42
57
|
*/
|
|
43
58
|
radius?: 'm' | 'l';
|
|
59
|
+
|
|
44
60
|
/**
|
|
45
|
-
* Alpha (opacity) of the icon color
|
|
61
|
+
* Alpha (opacity) of the icon foreground color.
|
|
46
62
|
* @default 1
|
|
47
63
|
*/
|
|
48
64
|
colorAlpha?: number;
|
|
49
65
|
}
|
|
50
66
|
```
|
|
51
67
|
<!-- props:end -->
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Examples
|
|
72
|
+
|
|
73
|
+
### Default
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import {PortfolioIcon} from '@weavix/tracker-components';
|
|
77
|
+
|
|
78
|
+
<PortfolioIcon portfolioId="portfolio-abc" />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### With background
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
<PortfolioIcon portfolioId="portfolio-abc" withBackground />
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Custom size
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<PortfolioIcon portfolioId="portfolio-abc" size={20} refugeSize={32} />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Alongside portfolio name
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import {PortfolioIcon} from '@weavix/tracker-components';
|
|
97
|
+
|
|
98
|
+
export const PortfolioLabel = ({portfolio}: {portfolio: {id: string; name: string}}) => (
|
|
99
|
+
<div style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
100
|
+
<PortfolioIcon portfolioId={portfolio.id} />
|
|
101
|
+
<span>{portfolio.name}</span>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Multiple portfolios (each gets a unique color)
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
const portfolios = [
|
|
110
|
+
{id: 'port-1', name: 'Platform'},
|
|
111
|
+
{id: 'port-2', name: 'Growth'},
|
|
112
|
+
{id: 'port-3', name: 'Infrastructure'},
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
portfolios.map((p) => (
|
|
116
|
+
<div key={p.id} style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
117
|
+
<PortfolioIcon portfolioId={p.id} />
|
|
118
|
+
<span>{p.name}</span>
|
|
119
|
+
</div>
|
|
120
|
+
));
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Notes
|
|
126
|
+
|
|
127
|
+
- Unlike [`ProjectIcon`](../ProjectIcon/README.md) and [`GoalIcon`](../GoalIcon/README.md), `PortfolioIcon` uses the **string `id`** (not `shortId`) for color generation.
|
|
128
|
+
- `withBackground` defaults to `false` for portfolios (vs `true` for projects). Pass `withBackground` explicitly if you want the colored square background.
|
|
129
|
+
- To render the correct icon for an arbitrary meta entity type, use [`MetaEntityIcon`](../MetaEntityIcon/README.md) instead.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PortfolioIcon"],"sources":["index.ts"],"sourcesContent":["export {PortfolioIcon} from './PortfolioIcon';\nexport type {PortfolioIconProps} from './PortfolioIcon';\n"],"mappings":"AAAA,SAAQA,aAAa","ignoreList":[]}
|
|
@@ -1,51 +1,175 @@
|
|
|
1
1
|
# ProjectIcon
|
|
2
2
|
|
|
3
3
|
<!-- description:start -->
|
|
4
|
-
|
|
4
|
+
Displays a colored icon for a Tracker project entity. The icon color is deterministically derived from the `projectId`, so the same project always renders the same color across sessions and environments.
|
|
5
5
|
<!-- description:end -->
|
|
6
6
|
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {ProjectIcon} from '@weavix/tracker-components';
|
|
11
|
+
|
|
12
|
+
<ProjectIcon projectId={123} />
|
|
13
|
+
```
|
|
14
|
+
|
|
7
15
|
## Component props
|
|
8
16
|
|
|
9
17
|
<!-- props:start -->
|
|
10
18
|
```ts
|
|
11
19
|
{
|
|
12
20
|
/**
|
|
13
|
-
* Project ID used to generate a deterministic color
|
|
21
|
+
* Project ID used to generate a deterministic color.
|
|
22
|
+
* Accepts either the numeric shortId or a string entity ID.
|
|
14
23
|
*/
|
|
15
24
|
projectId?: number | string;
|
|
25
|
+
|
|
16
26
|
/**
|
|
17
|
-
* Additional class
|
|
27
|
+
* Additional CSS class applied to the root element.
|
|
18
28
|
*/
|
|
19
29
|
className?: string;
|
|
30
|
+
|
|
20
31
|
/**
|
|
21
|
-
* Entity type label
|
|
32
|
+
* Entity type label. Defaults to "project".
|
|
22
33
|
*/
|
|
23
34
|
type?: string;
|
|
35
|
+
|
|
24
36
|
/**
|
|
25
|
-
* Size of the SVG icon inside the container in pixels
|
|
37
|
+
* Size of the SVG icon inside the container in pixels.
|
|
26
38
|
* @default 16
|
|
27
39
|
*/
|
|
28
40
|
size?: number;
|
|
41
|
+
|
|
29
42
|
/**
|
|
30
|
-
* Size of the icon container in pixels
|
|
43
|
+
* Size of the icon container (the colored square) in pixels.
|
|
31
44
|
* @default 24
|
|
32
45
|
*/
|
|
33
46
|
refugeSize?: number;
|
|
47
|
+
|
|
34
48
|
/**
|
|
35
|
-
* Whether to render a colored background behind the icon
|
|
49
|
+
* Whether to render a colored background behind the icon.
|
|
36
50
|
* @default true
|
|
37
51
|
*/
|
|
38
52
|
withBackground?: boolean;
|
|
53
|
+
|
|
39
54
|
/**
|
|
40
|
-
* Border radius variant of the icon container
|
|
55
|
+
* Border radius variant of the icon container.
|
|
41
56
|
* @default 'm'
|
|
42
57
|
*/
|
|
43
58
|
radius?: 'm' | 'l';
|
|
59
|
+
|
|
44
60
|
/**
|
|
45
|
-
* Alpha (opacity) of the icon color
|
|
61
|
+
* Alpha (opacity) of the icon foreground color.
|
|
46
62
|
* @default 1
|
|
47
63
|
*/
|
|
48
64
|
colorAlpha?: number;
|
|
49
65
|
}
|
|
50
66
|
```
|
|
51
67
|
<!-- props:end -->
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Examples
|
|
72
|
+
|
|
73
|
+
### Default
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import {ProjectIcon} from '@weavix/tracker-components';
|
|
77
|
+
|
|
78
|
+
<ProjectIcon projectId={123} />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Without background
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// Renders only the colored SVG, no background square
|
|
85
|
+
<ProjectIcon projectId={123} withBackground={false} />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Custom size
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<ProjectIcon projectId={123} size={20} refugeSize={32} />
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Large radius
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<ProjectIcon projectId={123} radius="l" />
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Alongside project name
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import {ProjectIcon} from '@weavix/tracker-components';
|
|
104
|
+
|
|
105
|
+
export const ProjectLabel = ({project}: {project: {shortId: number; name: string}}) => (
|
|
106
|
+
<div style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
107
|
+
<ProjectIcon projectId={project.shortId} />
|
|
108
|
+
<span>{project.name}</span>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Multiple projects (each gets a unique color)
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
const projects = [
|
|
117
|
+
{shortId: 1, name: 'Backend API'},
|
|
118
|
+
{shortId: 2, name: 'Mobile App'},
|
|
119
|
+
{shortId: 3, name: 'Design System'},
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
projects.map((p) => (
|
|
123
|
+
<div key={p.shortId} style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
124
|
+
<ProjectIcon projectId={p.shortId} />
|
|
125
|
+
<span>{p.name}</span>
|
|
126
|
+
</div>
|
|
127
|
+
));
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Rendering from a Tracker API response
|
|
131
|
+
|
|
132
|
+
The Tracker entities search endpoint returns `shortId` as a number — pass it directly:
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import React, {useEffect, useState} from 'react';
|
|
136
|
+
import {ProjectIcon} from '@weavix/tracker-components';
|
|
137
|
+
import type {MetaEntityV2} from '@weavix/tracker-api-types';
|
|
138
|
+
|
|
139
|
+
interface Props {
|
|
140
|
+
trackerApi: TrackerApi;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const ProjectList: React.FC<Props> = ({trackerApi}) => {
|
|
144
|
+
const [projects, setProjects] = useState<MetaEntityV2[]>([]);
|
|
145
|
+
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
trackerApi.v3
|
|
148
|
+
.post['/entities/{entityType}/_search']({
|
|
149
|
+
pathParams: {entityType: 'project'},
|
|
150
|
+
queryParams: {fields: ['summary'], page: 1, perPage: 20},
|
|
151
|
+
bodyParams: {filter: {}, filterTypes: ['ALL'], input: ''},
|
|
152
|
+
})
|
|
153
|
+
.then((result) => setProjects(result.data));
|
|
154
|
+
}, [trackerApi]);
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<ul>
|
|
158
|
+
{projects.map((project) => (
|
|
159
|
+
<li key={project.id} style={{display: 'flex', alignItems: 'center', gap: 8}}>
|
|
160
|
+
<ProjectIcon projectId={project.shortId} />
|
|
161
|
+
<span>{project.fields?.summary?.value ?? project.id}</span>
|
|
162
|
+
</li>
|
|
163
|
+
))}
|
|
164
|
+
</ul>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Notes
|
|
172
|
+
|
|
173
|
+
- `withBackground` defaults to `true` for projects (vs `false` for [`PortfolioIcon`](../PortfolioIcon/README.md)).
|
|
174
|
+
- Pass `projectId` as the **numeric `shortId`** from the Tracker API for consistent color generation. String IDs are also accepted.
|
|
175
|
+
- To render the correct icon for an arbitrary meta entity type, use [`MetaEntityIcon`](../MetaEntityIcon/README.md) instead.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ProjectIcon"],"sources":["index.ts"],"sourcesContent":["export {ProjectIcon} from './ProjectIcon';\nexport type {ProjectIconProps} from './ProjectIcon';\n"],"mappings":"AAAA,SAAQA,WAAW","ignoreList":[]}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export * from './EntityIcon';
|
|
2
|
+
export * from './GoalIcon';
|
|
3
|
+
export * from './IconRefuge';
|
|
1
4
|
export * from './IssueTypeIcon';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
5
|
+
export * from './KeyResultIcon';
|
|
6
|
+
export * from './MetaEntityIcon';
|
|
7
|
+
export * from './PortfolioIcon';
|
|
8
|
+
export * from './ProjectIcon';
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
export * from "./EntityIcon";
|
|
2
|
+
export * from "./GoalIcon";
|
|
3
|
+
export * from "./IconRefuge";
|
|
1
4
|
export * from "./IssueTypeIcon";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
5
|
+
export * from "./KeyResultIcon";
|
|
6
|
+
export * from "./MetaEntityIcon";
|
|
7
|
+
export * from "./PortfolioIcon";
|
|
8
|
+
export * from "./ProjectIcon";
|
|
4
9
|
// #sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './IssueTypeIcon';\nexport * from './PortfolioIcon
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './EntityIcon';\nexport * from './GoalIcon';\nexport * from './IconRefuge';\nexport * from './IssueTypeIcon';\nexport * from './KeyResultIcon';\nexport * from './MetaEntityIcon';\nexport * from './PortfolioIcon';\nexport * from './ProjectIcon';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cnMetaEntitiesSelect: import("@bem-react/classname").ClassNameFormatter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["block","cnMetaEntitiesSelect"],"sources":["MetaEntitiesSelect.classname.ts"],"sourcesContent":["import {block} from '~/src/components/cn';\n\nexport const cnMetaEntitiesSelect = block('meta-entities-select');\n"],"mappings":"AAAA,SAAQA,KAAK;AAEb,OAAO,IAAMC,oBAAoB,GAAGD,KAAK,CAAC,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { MetaEntityV2 } from '@weavix/tracker-api-types';
|
|
3
|
+
import type { EntitiesSuggestProps } from './components/EntitiesSuggest/EntitiesSuggest';
|
|
4
|
+
type EntitiesSuggestPropsToOmit = 'getItemId' | 'getSuggestTextFromClickedItem' | 'renderItem';
|
|
5
|
+
export type MetaEntitiesSelectProps = Omit<EntitiesSuggestProps<MetaEntityV2>, EntitiesSuggestPropsToOmit> & {
|
|
6
|
+
className?: string;
|
|
7
|
+
itemClassName?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const MetaEntitiesSelect: FC<MetaEntitiesSelectProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["className", "itemClassName", "placeholder", "text", "onTextChange"];
|
|
5
|
+
import React, { useCallback, useState } from 'react';
|
|
6
|
+
import { getConfig } from '@gravity-ui/uikit';
|
|
7
|
+
import { MetaEntityIcon } from "./../Icon";
|
|
8
|
+
import { useLocalizedString } from "./../../hooks/useLocalizedString";
|
|
9
|
+
import { cnMetaEntitiesSelect } from "./MetaEntitiesSelect.classname";
|
|
10
|
+
import { EntitiesSuggest } from "./components/EntitiesSuggest/EntitiesSuggest";
|
|
11
|
+
import { EntitiesSuggestItem } from "./components/EntitiesSuggestItem/EntitiesSuggestItem";
|
|
12
|
+
import { defaultMessages } from "./i18n";
|
|
13
|
+
import { getMetaEntityDisplay } from "./utils/getMetaEntityDisplay";
|
|
14
|
+
import { getMetaEntityId } from "./utils/getMetaEntityId";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
export var MetaEntitiesSelect = function MetaEntitiesSelect(_ref) {
|
|
17
|
+
var className = _ref.className,
|
|
18
|
+
itemClassName = _ref.itemClassName,
|
|
19
|
+
placeholder = _ref.placeholder,
|
|
20
|
+
initialText = _ref.text,
|
|
21
|
+
onTextChange = _ref.onTextChange,
|
|
22
|
+
suggestProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var config = getConfig();
|
|
24
|
+
var _useLocalizedString = useLocalizedString(defaultMessages, config.lang),
|
|
25
|
+
t = _useLocalizedString.t;
|
|
26
|
+
var _useState = useState(initialText !== null && initialText !== void 0 ? initialText : ''),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
text = _useState2[0],
|
|
29
|
+
setText = _useState2[1];
|
|
30
|
+
var handleTextChange = useCallback(function (value) {
|
|
31
|
+
setText(value);
|
|
32
|
+
onTextChange === null || onTextChange === void 0 || onTextChange(value);
|
|
33
|
+
}, [setText, onTextChange]);
|
|
34
|
+
var renderItem = useCallback(function (entity) {
|
|
35
|
+
var entityName = getMetaEntityDisplay(entity);
|
|
36
|
+
return /*#__PURE__*/_jsx(EntitiesSuggestItem, {
|
|
37
|
+
id: entity.id,
|
|
38
|
+
name: entityName,
|
|
39
|
+
className: cnMetaEntitiesSelect('item', itemClassName),
|
|
40
|
+
icon: /*#__PURE__*/_jsx(MetaEntityIcon, {
|
|
41
|
+
entity: entity
|
|
42
|
+
})
|
|
43
|
+
}, entity.id);
|
|
44
|
+
}, [itemClassName]);
|
|
45
|
+
return /*#__PURE__*/_jsx(EntitiesSuggest, _objectSpread(_objectSpread({}, suggestProps), {}, {
|
|
46
|
+
className: cnMetaEntitiesSelect(null, className),
|
|
47
|
+
renderItem: renderItem,
|
|
48
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t('placeholder'),
|
|
49
|
+
getItemsOnMount: true,
|
|
50
|
+
showItemsOnNoText: true,
|
|
51
|
+
getItemId: getMetaEntityId,
|
|
52
|
+
getSuggestTextFromClickedItem: getMetaEntityDisplay,
|
|
53
|
+
text: text,
|
|
54
|
+
onTextChange: handleTextChange
|
|
55
|
+
}));
|
|
56
|
+
};
|
|
57
|
+
// #sourceMappingURL=MetaEntitiesSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","getConfig","MetaEntityIcon","useLocalizedString","cnMetaEntitiesSelect","EntitiesSuggest","EntitiesSuggestItem","defaultMessages","getMetaEntityDisplay","getMetaEntityId","jsx","_jsx","MetaEntitiesSelect","_ref","className","itemClassName","placeholder","initialText","text","onTextChange","suggestProps","_objectWithoutProperties","_excluded","config","_useLocalizedString","lang","t","_useState","_useState2","_slicedToArray","setText","handleTextChange","value","renderItem","entity","entityName","id","name","icon","_objectSpread","getItemsOnMount","showItemsOnNoText","getItemId","getSuggestTextFromClickedItem"],"sources":["MetaEntitiesSelect.tsx"],"sourcesContent":["import type {FC} from 'react';\nimport React, {useCallback, useState} from 'react';\n\nimport {getConfig} from '@gravity-ui/uikit';\nimport type {MetaEntityV2} from '@weavix/tracker-api-types';\n\nimport {MetaEntityIcon} from '~/src/components/Icon/';\nimport {useLocalizedString} from '~/src/hooks/useLocalizedString';\n\nimport {cnMetaEntitiesSelect} from './MetaEntitiesSelect.classname';\nimport {EntitiesSuggest} from './components/EntitiesSuggest/EntitiesSuggest';\nimport type {EntitiesSuggestProps} from './components/EntitiesSuggest/EntitiesSuggest';\nimport {EntitiesSuggestItem} from './components/EntitiesSuggestItem/EntitiesSuggestItem';\nimport {defaultMessages} from './i18n';\nimport {getMetaEntityDisplay} from './utils/getMetaEntityDisplay';\nimport {getMetaEntityId} from './utils/getMetaEntityId';\n\ntype EntitiesSuggestPropsToOmit = 'getItemId' | 'getSuggestTextFromClickedItem' | 'renderItem';\n\nexport type MetaEntitiesSelectProps = Omit<\n EntitiesSuggestProps<MetaEntityV2>,\n EntitiesSuggestPropsToOmit\n> & {\n className?: string;\n itemClassName?: string;\n};\n\nexport const MetaEntitiesSelect: FC<MetaEntitiesSelectProps> = ({\n className,\n itemClassName,\n placeholder,\n text: initialText,\n onTextChange,\n ...suggestProps\n}) => {\n const config = getConfig();\n const {t} = useLocalizedString(defaultMessages, config.lang);\n const [text, setText] = useState(initialText ?? '');\n const handleTextChange = useCallback(\n (value: string) => {\n setText(value);\n onTextChange?.(value);\n },\n [setText, onTextChange],\n );\n\n const renderItem = useCallback(\n (entity: MetaEntityV2) => {\n const entityName = getMetaEntityDisplay(entity);\n return (\n <EntitiesSuggestItem\n key={entity.id}\n id={entity.id}\n name={entityName}\n className={cnMetaEntitiesSelect('item', itemClassName)}\n icon={<MetaEntityIcon entity={entity} />}\n />\n );\n },\n [itemClassName],\n );\n\n return (\n <EntitiesSuggest<MetaEntityV2>\n {...suggestProps}\n className={cnMetaEntitiesSelect(null, className)}\n renderItem={renderItem}\n placeholder={placeholder ?? t('placeholder')}\n getItemsOnMount\n showItemsOnNoText\n getItemId={getMetaEntityId}\n getSuggestTextFromClickedItem={getMetaEntityDisplay}\n text={text}\n onTextChange={handleTextChange}\n />\n );\n};\n"],"mappings":";;;;AACA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,QAAO,OAAO;AAElD,SAAQC,SAAS,QAAO,mBAAmB;AAG3C,SAAQC,cAAc;AACtB,SAAQC,kBAAkB;AAE1B,SAAQC,oBAAoB;AAC5B,SAAQC,eAAe;AAEvB,SAAQC,mBAAmB;AAC3B,SAAQC,eAAe;AACvB,SAAQC,oBAAoB;AAC5B,SAAQC,eAAe;AAAiC,SAAAC,GAAA,IAAAC,IAAA;AAYxD,OAAO,IAAMC,kBAA+C,GAAG,SAAlDA,kBAA+CA,CAAAC,IAAA,EAOtD;EAAA,IANFC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACLC,WAAW,GAAAJ,IAAA,CAAjBK,IAAI;IACJC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACTC,YAAY,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EAEf,IAAMC,MAAM,GAAGtB,SAAS,CAAC,CAAC;EAC1B,IAAAuB,mBAAA,GAAYrB,kBAAkB,CAACI,eAAe,EAAEgB,MAAM,CAACE,IAAI,CAAC;IAArDC,CAAC,GAAAF,mBAAA,CAADE,CAAC;EACR,IAAAC,SAAA,GAAwB3B,QAAQ,CAACiB,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI,EAAE,CAAC;IAAAW,UAAA,GAAAC,cAAA,CAAAF,SAAA;IAA5CT,IAAI,GAAAU,UAAA;IAAEE,OAAO,GAAAF,UAAA;EACpB,IAAMG,gBAAgB,GAAGhC,WAAW,CAChC,UAACiC,KAAa,EAAK;IACfF,OAAO,CAACE,KAAK,CAAC;IACdb,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAGa,KAAK,CAAC;EACzB,CAAC,EACD,CAACF,OAAO,EAAEX,YAAY,CAC1B,CAAC;EAED,IAAMc,UAAU,GAAGlC,WAAW,CAC1B,UAACmC,MAAoB,EAAK;IACtB,IAAMC,UAAU,GAAG3B,oBAAoB,CAAC0B,MAAM,CAAC;IAC/C,oBACIvB,IAAA,CAACL,mBAAmB;MAEhB8B,EAAE,EAAEF,MAAM,CAACE,EAAG;MACdC,IAAI,EAAEF,UAAW;MACjBrB,SAAS,EAAEV,oBAAoB,CAAC,MAAM,EAAEW,aAAa,CAAE;MACvDuB,IAAI,eAAE3B,IAAA,CAACT,cAAc;QAACgC,MAAM,EAAEA;MAAO,CAAE;IAAE,GAJpCA,MAAM,CAACE,EAKf,CAAC;EAEV,CAAC,EACD,CAACrB,aAAa,CAClB,CAAC;EAED,oBACIJ,IAAA,CAACN,eAAe,EAAAkC,aAAA,CAAAA,aAAA,KACRnB,YAAY;IAChBN,SAAS,EAAEV,oBAAoB,CAAC,IAAI,EAAEU,SAAS,CAAE;IACjDmB,UAAU,EAAEA,UAAW;IACvBjB,WAAW,EAAEA,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAIU,CAAC,CAAC,aAAa,CAAE;IAC7Cc,eAAe;IACfC,iBAAiB;IACjBC,SAAS,EAAEjC,eAAgB;IAC3BkC,6BAA6B,EAAEnC,oBAAqB;IACpDU,IAAI,EAAEA,IAAK;IACXC,YAAY,EAAEY;EAAiB,EAClC,CAAC;AAEV,CAAC","ignoreList":[]}
|