PromucFlow_constructor/app/client/src/icons/ControlIcons.tsx

592 lines
18 KiB
TypeScript
Raw Normal View History

feat: [epic] appsmith design system version 2 deduplication (#22030) ## Description ### Fixes - [x] https://github.com/appsmithorg/appsmith/issues/19383 - [x] https://github.com/appsmithorg/appsmith/issues/19384 - [x] https://github.com/appsmithorg/appsmith/issues/19385 - [x] https://github.com/appsmithorg/appsmith/issues/19386 - [x] https://github.com/appsmithorg/appsmith/issues/19387 - [x] https://github.com/appsmithorg/appsmith/issues/19388 - [x] https://github.com/appsmithorg/appsmith/issues/19389 - [x] https://github.com/appsmithorg/appsmith/issues/19390 - [x] https://github.com/appsmithorg/appsmith/issues/19391 - [x] https://github.com/appsmithorg/appsmith/issues/19392 - [x] https://github.com/appsmithorg/appsmith/issues/19393 - [x] https://github.com/appsmithorg/appsmith/issues/19394 - [x] https://github.com/appsmithorg/appsmith/issues/19395 - [x] https://github.com/appsmithorg/appsmith/issues/19396 - [x] https://github.com/appsmithorg/appsmith/issues/19397 - [x] https://github.com/appsmithorg/appsmith/issues/19398 - [x] https://github.com/appsmithorg/appsmith/issues/19399 - [x] https://github.com/appsmithorg/appsmith/issues/19400 - [x] https://github.com/appsmithorg/appsmith/issues/19401 - [x] https://github.com/appsmithorg/appsmith/issues/19402 - [x] https://github.com/appsmithorg/appsmith/issues/19403 - [x] https://github.com/appsmithorg/appsmith/issues/19404 - [x] https://github.com/appsmithorg/appsmith/issues/19405 - [x] https://github.com/appsmithorg/appsmith/issues/19406 - [x] https://github.com/appsmithorg/appsmith/issues/19407 - [x] https://github.com/appsmithorg/appsmith/issues/19408 - [x] https://github.com/appsmithorg/appsmith/issues/19409 Fixes # (issue) > if no issue exists, please create an issue and ask the maintainers about this first Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update ## How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Provide instructions, so we can reproduce. > Please also list any relevant details for your test configuration. > Delete anything that is not important - Manual - Jest - Cypress ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Ankita Kinger <ankita@appsmith.com> Co-authored-by: akash-codemonk <67054171+akash-codemonk@users.noreply.github.com> Co-authored-by: Tanvi Bhakta <tanvi@appsmith.com> Co-authored-by: Arsalan <arsalanyaldram0211@outlook.com> Co-authored-by: Aman Agarwal <aman@appsmith.com> Co-authored-by: Rohit Agarwal <rohit_agarwal@live.in> Co-authored-by: Nilesh Sarupriya <nilesh@appsmith.com> Co-authored-by: Nilesh Sarupriya <20905988+nsarupr@users.noreply.github.com> Co-authored-by: Tanvi Bhakta <tanvibhakta@gmail.com> Co-authored-by: Aishwarya UR <aishwarya@appsmith.com> Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local> Co-authored-by: Vijetha-Kaja <vijetha@appsmith.com> Co-authored-by: Parthvi <80334441+Parthvi12@users.noreply.github.com> Co-authored-by: Apple <nandan@thinkify.io> Co-authored-by: Saroj <43822041+sarojsarab@users.noreply.github.com> Co-authored-by: Sangeeth Sivan <74818788+berzerkeer@users.noreply.github.com> Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com> Co-authored-by: Aishwarya-U-R <91450662+Aishwarya-U-R@users.noreply.github.com> Co-authored-by: rahulramesha <rahul@appsmith.com> Co-authored-by: Aswath K <aswath.sana@gmail.com> Co-authored-by: Preet Sidhu <preetsidhu.bits@gmail.com> Co-authored-by: Vijetha-Kaja <119562824+Vijetha-Kaja@users.noreply.github.com> Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-05-19 18:37:06 +00:00
// TODO (tanvi): Figure out why this file is still here and if it's safe to delete it.
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { JSXElementConstructor } from "react";
import React from "react";
import { importRemixIcon, importSvg } from "design-system-old";
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { IconProps } from "constants/IconConstants";
import { IconWrapper } from "constants/IconConstants";
import PlayIcon from "assets/icons/control/play-icon.png";
const DeleteIcon = importSvg(
async () => import("assets/icons/control/delete.svg"),
);
const MoveIcon = importSvg(async () => import("assets/icons/control/move.svg"));
const EditIcon = importSvg(async () => import("assets/icons/control/edit.svg"));
const ViewIcon = importSvg(async () => import("assets/icons/control/view.svg"));
const MoreVerticalIcon = importSvg(
async () => import("assets/icons/control/more-vertical.svg"),
);
const OverflowMenuIcon = importSvg(
async () => import("assets/icons/menu/overflow-menu.svg"),
);
const JsToggleIcon = importSvg(
async () => import("assets/icons/control/js-toggle.svg"),
);
const IncreaseIcon = importSvg(
async () => import("assets/icons/control/increase.svg"),
);
const DecreaseIcon = importSvg(
async () => import("assets/icons/control/decrease.svg"),
);
const DraggableIcon = importSvg(
async () => import("assets/icons/control/draggable.svg"),
);
const CloseCircleIcon = importSvg(
async () => import("assets/icons/control/close-circle.svg"),
);
const AddCircleIcon = importSvg(
async () => import("assets/icons/control/add-circle.svg"),
);
const HelpIcon = importSvg(async () => import("assets/icons/control/help.svg"));
const CollapseIcon = importSvg(
async () => import("assets/icons/control/collapse.svg"),
);
const PickMyLocationSelectedIcon = importSvg(
async () => import("assets/icons/control/pick-location-selected.svg"),
);
const RemoveIcon = importSvg(
async () => import("assets/icons/control/remove.svg"),
);
const DragIcon = importSvg(async () => import("assets/icons/control/drag.svg"));
const SortIcon = importSvg(
async () => import("assets/icons/control/sort-icon.svg"),
);
const EditWhiteIcon = importSvg(
async () => import("assets/icons/control/edit-white.svg"),
);
const LaunchIcon = importSvg(
async () => import("assets/icons/control/launch.svg"),
);
const BackIcon = importSvg(async () => import("assets/icons/control/back.svg"));
const DeleteColumnIcon = importSvg(
async () => import("assets/icons/control/delete-column.svg"),
);
const BoldFontIcon = importSvg(
async () => import("assets/icons/control/bold.svg"),
);
const UnderlineIcon = importSvg(
async () => import("assets/icons/control/underline.svg"),
);
const ItalicsFontIcon = importSvg(
async () => import("assets/icons/control/italics.svg"),
);
const LeftAlignIcon = importSvg(
async () => import("assets/icons/control/left-align.svg"),
);
const CenterAlignIcon = importSvg(
async () => import("assets/icons/control/center-align.svg"),
);
const RightAlignIcon = importSvg(
async () => import("assets/icons/control/right-align.svg"),
);
const VerticalAlignRight = importSvg(
async () => import("assets/icons/control/align_right.svg"),
);
const VerticalAlignLeft = importSvg(
async () => import("assets/icons/control/align_left.svg"),
);
const VerticalAlignBottom = importSvg(
async () => import("assets/icons/control/vertical_align_bottom.svg"),
);
const VerticalAlignCenter = importSvg(
async () => import("assets/icons/control/vertical_align_center.svg"),
);
const VerticalAlignTop = importSvg(
async () => import("assets/icons/control/vertical_align_top.svg"),
);
const Copy2Icon = importSvg(
async () => import("assets/icons/control/copy2.svg"),
);
const CutIcon = importSvg(async () => import("assets/icons/control/cut.svg"));
const GroupIcon = importSvg(
async () => import("assets/icons/control/group.svg"),
);
const HeadingOneIcon = importSvg(
async () => import("assets/icons/control/heading_1.svg"),
);
const HeadingTwoIcon = importSvg(
async () => import("assets/icons/control/heading_2.svg"),
);
const HeadingThreeIcon = importSvg(
async () => import("assets/icons/control/heading_3.svg"),
);
const ParagraphIcon = importSvg(
async () => import("assets/icons/control/paragraph.svg"),
);
const ParagraphTwoIcon = importSvg(
async () => import("assets/icons/control/paragraph_2.svg"),
);
const BulletsIcon = importSvg(
async () => import("assets/icons/control/bullets.svg"),
);
const DividerCapRightIcon = importSvg(
async () => import("assets/icons/control/divider_cap_right.svg"),
);
const DividerCapLeftIcon = importSvg(
async () => import("assets/icons/control/divider_cap_left.svg"),
);
const DividerCapAllIcon = importSvg(
async () => import("assets/icons/control/divider_cap_all.svg"),
);
const TrendingFlat = importSvg(
async () => import("assets/icons/ads/trending-flat.svg"),
);
const AlignLeftIcon = importSvg(
async () => import("assets/icons/control/align_left.svg"),
);
const AlignRightIcon = importSvg(
async () => import("assets/icons/control/align_right.svg"),
);
const BorderRadiusSharpIcon = importSvg(
async () => import("assets/icons/control/border-radius-sharp.svg"),
);
const BorderRadiusRoundedIcon = importSvg(
async () => import("assets/icons/control/border-radius-rounded.svg"),
);
const BorderRadiusCircleIcon = importSvg(
async () => import("assets/icons/control/border-radius-circle.svg"),
);
const BoxShadowNoneIcon = importSvg(
async () => import("assets/icons/control/box-shadow-none.svg"),
);
const BoxShadowVariant1Icon = importSvg(
async () => import("assets/icons/control/box-shadow-variant1.svg"),
);
const BoxShadowVariant2Icon = importSvg(
async () => import("assets/icons/control/box-shadow-variant2.svg"),
);
const BoxShadowVariant3Icon = importSvg(
async () => import("assets/icons/control/box-shadow-variant3.svg"),
);
const BoxShadowVariant4Icon = importSvg(
async () => import("assets/icons/control/box-shadow-variant4.svg"),
);
const BoxShadowVariant5Icon = importSvg(
async () => import("assets/icons/control/box-shadow-variant5.svg"),
);
const IncreaseV2Icon = importRemixIcon(
async () => import("remixicon-react/AddLineIcon"),
);
const PinIcon = importRemixIcon(
async () => import("remixicon-react/Pushpin2LineIcon"),
);
const CopyIcon = importRemixIcon(
async () => import("remixicon-react/FileCopyLineIcon"),
);
const QuestionIcon = importRemixIcon(
async () => import("remixicon-react/QuestionLineIcon"),
);
const SettingsIcon = importRemixIcon(
async () => import("remixicon-react/Settings5LineIcon"),
);
const EyeIcon = importRemixIcon(
async () => import("remixicon-react/EyeLineIcon"),
);
const EyeOffIcon = importRemixIcon(
async () => import("remixicon-react/EyeOffLineIcon"),
);
const CloseIcon = importRemixIcon(
async () => import("remixicon-react/CloseLineIcon"),
);
2020-06-10 17:31:20 +00:00
/* eslint-disable react/display-name */
export const ControlIcons: {
[id: string]: JSXElementConstructor<
IconProps & React.HTMLAttributes<HTMLDivElement>
>;
} = {
DELETE_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<DeleteIcon />
</IconWrapper>
),
MOVE_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<MoveIcon />
</IconWrapper>
),
EDIT_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<EditIcon />
</IconWrapper>
),
VIEW_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<ViewIcon />
</IconWrapper>
),
MORE_VERTICAL_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2019-11-21 10:52:49 +00:00
<IconWrapper {...props}>
<MoreVerticalIcon />
</IconWrapper>
),
MORE_HORIZONTAL_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2020-01-24 09:54:40 +00:00
<IconWrapper {...props}>
<OverflowMenuIcon />
</IconWrapper>
),
JS_TOGGLE: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<JsToggleIcon />
</IconWrapper>
),
INCREASE_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2020-04-15 11:42:11 +00:00
<IconWrapper {...props}>
<IncreaseIcon />
</IconWrapper>
),
DECREASE_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2020-04-15 11:42:11 +00:00
<IconWrapper {...props}>
<DecreaseIcon />
</IconWrapper>
),
DRAGGABLE_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2020-04-15 11:42:11 +00:00
<IconWrapper {...props}>
<DraggableIcon />
</IconWrapper>
),
CLOSE_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<CloseIcon />
</IconWrapper>
),
CLOSE_CIRCLE_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<CloseCircleIcon />
</IconWrapper>
),
ADD_CIRCLE_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<AddCircleIcon />
</IconWrapper>
),
PICK_MY_LOCATION_SELECTED_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2020-04-15 11:42:11 +00:00
<IconWrapper {...props}>
<PickMyLocationSelectedIcon />
2020-04-15 11:42:11 +00:00
</IconWrapper>
),
SETTINGS_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
2020-05-22 11:03:35 +00:00
<IconWrapper {...props}>
2020-06-10 17:31:20 +00:00
<SettingsIcon />
2020-05-22 11:03:35 +00:00
</IconWrapper>
),
HELP_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
2020-05-28 18:10:26 +00:00
<IconWrapper {...props}>
<HelpIcon />
</IconWrapper>
),
PLAY_VIDEO: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
2020-06-22 13:46:19 +00:00
<IconWrapper {...props}>
<img
alt="Datasource"
src={PlayIcon}
style={{ height: "30px", width: "30px" }}
/>
2020-06-22 13:46:19 +00:00
</IconWrapper>
),
REMOVE_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<RemoveIcon />
</IconWrapper>
),
DRAG_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<DragIcon />
</IconWrapper>
),
COLLAPSE_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<CollapseIcon />
</IconWrapper>
),
SORT_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<SortIcon />
</IconWrapper>
),
EDIT_WHITE: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
2020-08-18 06:40:11 +00:00
<IconWrapper {...props}>
<EditWhiteIcon />
</IconWrapper>
),
LAUNCH_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
2020-08-18 06:40:11 +00:00
<IconWrapper {...props}>
<LaunchIcon />
</IconWrapper>
),
BACK_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<BackIcon />
</IconWrapper>
),
SHOW_COLUMN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<EyeIcon />
</IconWrapper>
),
HIDE_COLUMN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<EyeOffIcon />
</IconWrapper>
),
DELETE_COLUMN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<DeleteColumnIcon />
</IconWrapper>
),
BOLD_FONT: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<BoldFontIcon />
</IconWrapper>
),
UNDERLINE: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<UnderlineIcon />
</IconWrapper>
),
ITALICS_FONT: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<ItalicsFontIcon />
</IconWrapper>
),
LEFT_ALIGN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<LeftAlignIcon />
</IconWrapper>
),
CENTER_ALIGN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<CenterAlignIcon />
</IconWrapper>
),
RIGHT_ALIGN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<RightAlignIcon />
</IconWrapper>
),
VERTICAL_RIGHT: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<VerticalAlignRight />
</IconWrapper>
),
VERTICAL_LEFT: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<VerticalAlignLeft />
</IconWrapper>
),
VERTICAL_TOP: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<VerticalAlignTop />
</IconWrapper>
),
VERTICAL_CENTER: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<VerticalAlignCenter />
</IconWrapper>
),
VERTICAL_BOTTOM: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<VerticalAlignBottom />
</IconWrapper>
),
COPY_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<CopyIcon />
</IconWrapper>
),
COPY2_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<Copy2Icon />
</IconWrapper>
),
CUT_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<CutIcon />
</IconWrapper>
),
GROUP_CONTROL: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<GroupIcon />
</IconWrapper>
),
HEADING_ONE: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<HeadingOneIcon />
</IconWrapper>
),
HEADING_TWO: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<HeadingTwoIcon />
</IconWrapper>
),
HEADING_THREE: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<HeadingThreeIcon />
</IconWrapper>
),
PARAGRAPH: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<ParagraphIcon />
</IconWrapper>
),
PARAGRAPH_TWO: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<ParagraphTwoIcon />
</IconWrapper>
),
BULLETS: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<BulletsIcon />
</IconWrapper>
),
DIVIDER_CAP_RIGHT: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<DividerCapRightIcon />
</IconWrapper>
),
DIVIDER_CAP_LEFT: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<DividerCapLeftIcon />
</IconWrapper>
),
DIVIDER_CAP_ALL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<DividerCapAllIcon />
</IconWrapper>
),
BIND_DATA_CONTROL: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
[Feature] new nav sniping mode (#5746) * added sniping mode toggle option to header * added cover to components on hover in sniping mode * fixed the transition time * using filled icon * Show dependencies in action pane * Added a wrapper to make a widget snipeable * removed older parts of sniping from Positioned Container * removed onclick action from snipeable wrapper * Showing widget name in different color * Added a mechanism to send user to sniping mode from successful API screen * created new property pane saga to bind the data * Fix datasource list width issue * Fix sidebar going out of view when the response is a table * Minor refactor * Show add widgets section on the sidebar * Stop showing autocomplete option after adding a widget * fetching pageId, appId from store * Get suggested widget from response * Fix table data not getting evaluated after adding binding * Fix property pane going below the entity explorer while navigating from query/api pane * Fix width of sidepane shifting for apis * Fix vertical margins of connections * Fix api pane suggested widget showing up for errors * Fix margins * can show select in canvas btn in sidebar * can get the action object at the end to bind the data * updated saga and action names * can bind data to table * Use themes * Use new image url for Table widget * Added conditional mapping for sniping mode binding. * updated the widget name tags and seq of calls to open property pane * pushed all sniping mode decoration to header * moved setting sniping mode logic to editor reducer * Added keyboard short cut to get out of sniping mode * updated reset sniping mechanism * removed a divider line * if there are no relationships, will not show the complete section * Connect Data will automatically show relevant tab in integrations * Update list and dropdown image urls * Remove create table button * no wrapping bind to text * minor review considerations * showing the widget name to left in sniping mode * can set data to datepicker * will not show snipe btn if there are no widgets in canvas * Changes for multiple suggested widgets * removed dependency of sniping from suggested widgets * Added analytics events for sniping mode * logic for binding data to a widget, moved to snipeable component * changed binding widget func from capture to onClick and took care of sniping from widget wrapper too. * added tests to check sniping mode for table * updated test spec * minor fix * Fix copy changes * Update test to use table widget from suggested widget list * if fails to bind will generate warning and keep user in sniping mode * in sniping mode will only show name plate if it is under focus * fixed the test case * added a comment * minor fix to capture on click event in sniping mode * updated text * Hide connections UI when there are no connections * Increase width to 90% * Show placeholder text and back button in sidepane * Show tooltip on hover * Add analyitcs events for suggested widgets and connections * Update label based on whether widgets are there or not * binding related changes * renamed the saga file containing sinping mode sagas * Changes for inspect entity * Revert "binding related changes" temporarily This reverts commit 54ae9667fecf24bc3cf9912a5356d06600b25c84. * Update suggested widgets url * Update table url * Fix chart data field not getting evaluated * a minor fix to show proper tool tip when user hovers on widget name * Show sidepane when there is output * Update locators * Use constants for messages * Update file name to ApiRightPane * Remove delay * Revert "Revert "binding related changes" temporarily" This reverts commit ee7f75e83218137250b4b9a28fcf63080c185150. * Fix width * Fix overlap Co-authored-by: Akash N <akash@codemonk.in>
2021-07-26 16:44:10 +00:00
<IconWrapper {...props}>
<TrendingFlat />
</IconWrapper>
),
ICON_ALIGN_LEFT: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<AlignLeftIcon />
</IconWrapper>
),
ICON_ALIGN_RIGHT: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<AlignRightIcon />
</IconWrapper>
),
BORDER_RADIUS_SHARP: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BorderRadiusSharpIcon />
</IconWrapper>
),
BORDER_RADIUS_ROUNDED: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BorderRadiusRoundedIcon />
</IconWrapper>
),
BORDER_RADIUS_CIRCLE: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BorderRadiusCircleIcon />
</IconWrapper>
),
BOX_SHADOW_NONE: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BoxShadowNoneIcon />
</IconWrapper>
),
BOX_SHADOW_VARIANT1: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BoxShadowVariant1Icon />
</IconWrapper>
),
BOX_SHADOW_VARIANT2: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BoxShadowVariant2Icon />
</IconWrapper>
),
BOX_SHADOW_VARIANT3: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BoxShadowVariant3Icon />
</IconWrapper>
),
BOX_SHADOW_VARIANT4: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BoxShadowVariant4Icon />
</IconWrapper>
),
BOX_SHADOW_VARIANT5: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<BoxShadowVariant5Icon />
</IconWrapper>
),
INCREASE_CONTROL_V2: (
props: IconProps & React.HTMLAttributes<HTMLDivElement>,
) => (
<IconWrapper {...props}>
<IncreaseV2Icon />
</IconWrapper>
),
QUESTION: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
<IconWrapper {...props}>
<QuestionIcon />
</IconWrapper>
),
PIN: (props: IconProps & React.HTMLAttributes<HTMLDivElement>) => (
feat: added column freeze and unfreeze functionality to table widget (#18757) **PRD**: https://www.notion.so/appsmith/Ability-to-freeze-columns-dd118f7ed2e14e008ee305056b79874a?d=300f4968889244da9f737e1bfd8c06dc#2ddaf28e10a0475cb69f1af77b938d0b This PR adds the following features to the table widget: - Freeze the columns to the left or right of the table.(Both canvas and page view mode). - Unfreeze the frozen columns. (Both canvas and page view mode). - Columns that are left frozen, will get unfrozen at a position after the last left frozen column. (Both canvas and page view mode). - Columns that are right frozen, will get unfrozen at a position before the first right frozen column. (Both canvas and page view mode). - Column order can be persisted in the Page view mode. - Users can also unfreeze the columns that are frozen by the developers. - Columns that are frozen cannot be reordered(Both canvas and page view mode) - **Property pane changes (Columns property)**: - If the column is frozen to the left then that column should appear at top of the list. - If the column is frozen to the right then that column should appear at the bottom of the list. - The columns that are frozen cannot be moved or re-ordered in the list. They remain fixed in their position. - In-Page mode, If there is a change in frozen or unfrozen columns in multiple tables then the order of columns and frozen and unfrozen columns should get persisted on refresh i.e. changes should get persisted across refreshes.
2023-02-15 11:42:46 +00:00
<IconWrapper {...props}>
<PinIcon />
</IconWrapper>
),
};
2019-11-21 10:52:49 +00:00
export type ControlIconName = keyof typeof ControlIcons;