mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
* N8N-3029 Add Node Type for Wokrflow Stickies/Notes * N8N-3029 Update Content, Update Aliasses * N8N-3030 Created N8N Sticky Component in Design System * N8N-3030 Fixed Code spaccing Sticky Component * N8N-3030 Fixed Code spaccing StickyStories Component * N8N-3030 Fixed Code spaccing Markdown Component * N8N-3030 Added Sticky Colors Pallete into Storybook, Update Color Variables for Sticky Component * N8N-3030 Added Unfocus Event * N8N-3030 Update Default Placeholder, Markdown Styles, Fixed Edit State, Added Text to EditState, Fixed Height of Area, Turned off Resize of textarea * N8N-3030 Update Sticky Overflow, Update Hover States, Updated Markdown Overflow * N8N-3030, N8N-3031 - Add Resize to Sticky, Created N8n-Resize component * N8N-3031 Fixed Importing Components in Editor-ui * N8N-3031 Fixed Resize Component, Fixed Gradient * N8N-3030, N8N-3031 Update Note Description * N8N-3032 Hotfix Building Storybook * N8N-3032 - Select Behaviour, Changes in Resize Component, Emit on Width/Height/Top/Left Change * N8N-3032 Update Resize Component to emmit left/top, Update Dynamic Resize on Selected Background * N8N-3032 Updated / Dragging vs Resizing, prevent open Modal for stickies * N8N-3032 Added ID props to n8n-sticky // dynamic id for multi resizing in NodeView * N8N-3033 Add dynamic size Tooltip on Sticky * N8N-3033 Updated Z-index for Sticky Component * N8N-3033 Updated N8N-Resize Component, Fixed SelectedBackround for Sticky Component * N8N-3033 Refactor * N8N-3033 Focus/Defocus on TextArea * N8N-3033 Fixed Resizing on NW Point * N8N-3030 Save content in vuex on input change * N8N-3033 Fixed Resizer, Save Width and Height in Vue * N8N-3033 Hide Sticky Footer on small height/width * N8N-3033 Fixed Resizer * N8N-3033 Dynamic Z-index for Stickies * N8N-3033 Dynamic Z-index for Stickies * N8N-3033 Removed static z-index for select sticky class * N8N-3034 Added Telemetry * N8N-3030 Formatter * N8N-3030 Format code * N8N-3030 Fixed Selecting Stickies * N8N-3033 Fixed Notifications * N8N-3030 Added new paddings for Default Stickies * N8N-3033 Prevent Scrolling NodeView when Sticky is in Edit mode and Mouse is Over the TextArea * N8N-3030 Prevent double clicking to switch state of Sticky component in Edit Mode * N8N-3033 Fixed Z-index of Stickies * N8N-3033 Prevent delete node when in EditMode * N8N-3030 Prevent Delete Button to delete the Sticky while in Edit Mode * N8N-3030 Change EditMode (emit) on keyboard shortucts, update Markdown Links & Images, Added new props * N8N-3030 Sticky Component - No padding when hiding footer text * N8N-3033 Fix Resizing enter into Edit Mode * N8N-3033 Selecting different nodes - exit the edit mode * N8N-3033 Auto Select Text in text-area by default - Sticky Component * N8N-3033 Prevent Default behaviour for CTRL + X, CTRL + A when Sticky is Active && inEditMode * N8N-3033 Refactor Resizer, Refactor Sticky, Update zIndex inEditMode * N8N-3033 Updated Default Text // Node-base, Storybook * N8N-3033 Add Resizing in EditMode - Components update * N8N-3033 Fixed Footer - Show/Hide on Resize in EditMode * N8N-3033 Fix ActiveSticky on Init * N8N-3033 Refactor Sticky in Vuex, Fixed Init Sticky Tweaks, Prevent Modal Openning, Save on Keyboard shortcuts * Stickies - Update Note node with new props * N8N-3030 Updated Default Note text, Update the Markdown Link * N8N-3030 CMD-C does not copy the text fix * N8N-3030 Fix Max Zoom / Zoom out shortcuts disabled in editState * N8N-3030 Z-index fixed during Edit Mode typing * N8N-3030 Prevent Autoselect Text in Stickies if the text is not default * N8N-3030 Fixed ReadOnly Bugs / Prevent showing Tooltip, Resizing * N8N-3030 Added Sticky Creator Button * N8N-3030 Update Icon / Sticky Creator Button * N8N-3033 Update Sticky Icon / StickyCreator Button * update package lock * 🔩 update note props * 🚿 clean props * 🔧 linting * 🔧 fix spacing * remove resize component * remove resize component * ✂ clean up sticky * revert back to height width * revert back to height/width * replace zindex property * replace default text property * use i18n to translate * update package lock * move resize * clean up how height/width are set * fix resize for sticky to support left/top * clean up resize * fix lasso/highlight bug * remove unused props * fix zoom to fit * fix padding for demo view * fix readonly * remove iseditable, use active state * clean up keyboard events * chang button size, no edit on insert * scale resizing correctly * make active on resize * fix select on resize/move * use outline icon * allow for multiple line breaks * fix multi line bug * fix edit mode outline * keep edit open as one resizes * respect multiple spaces * fix scrolling bug * clean up hover impl * clean up references to note * disable for rename * fix drifting while drag * fix mouse cursor on resize * fix sticky min height * refactor resize into component * fix pulling too far bug * fix delete/cut all bug * fix padding bottom * fix active change on resize * add transition to button * Fix sticky markdown click * add solid fa icon * update node graph, telemetry event * add snapping * change alt text * update package lock * fix bug in button hover * add back transition * clean up resize * add grid size as param * remove breaks * clean up markdown * lint fixes * fix spacing * clean up markdown colors * clean up classes in resize * clean up resize * update sticky story * fix spacing * clean up classes * revert change * revert change * revert change * clean up sticky component * remove unused component * remove unnessary data * remove unnessary data * clean up actions * clean up sticky size * clean up unnessary border style * fix bug * replace sticky note name * update description * remove support for multi spaces * update tracking name * update telemetry reqs * fix enter bug * update alt text * update sticky notes doc url * fix readonly bug * update class name * update quote marks Co-authored-by: SchnapsterDog <olivertrajceski@yahoo.com>
309 lines
7.3 KiB
Vue
309 lines
7.3 KiB
Vue
<template functional>
|
|
<component
|
|
:is="$options.components.ElButton"
|
|
:plain="props.type === 'outline'"
|
|
:disabled="props.disabled"
|
|
:size="props.size"
|
|
:loading="props.loading"
|
|
:title="props.title || props.label"
|
|
:class="$options.getClass(props, $style)"
|
|
:round="!props.circle && props.round"
|
|
:circle="props.circle"
|
|
:style="$options.styles(props)"
|
|
@click="(e) => listeners.click && listeners.click(e)"
|
|
>
|
|
<span :class="$style.icon" v-if="props.loading || props.icon">
|
|
<component
|
|
:is="$options.components.N8nSpinner"
|
|
v-if="props.loading"
|
|
:size="props.size"
|
|
/>
|
|
<component
|
|
:is="$options.components.N8nIcon"
|
|
v-else-if="props.icon"
|
|
:icon="props.icon"
|
|
:size="props.size"
|
|
/>
|
|
</span>
|
|
<span v-if="props.label">{{ props.label }}</span>
|
|
</component>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import N8nIcon from '../N8nIcon';
|
|
import N8nSpinner from '../N8nSpinner';
|
|
import ElButton from 'element-ui/lib/button';
|
|
|
|
export default {
|
|
name: 'n8n-button',
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
},
|
|
title: {
|
|
type: String,
|
|
},
|
|
type: {
|
|
type: String,
|
|
default: 'primary',
|
|
validator: (value: string): boolean =>
|
|
['primary', 'outline', 'light', 'text'].includes(value),
|
|
},
|
|
theme: {
|
|
type: String,
|
|
validator: (value: string): boolean =>
|
|
['success', 'warning', 'danger'].includes(value),
|
|
},
|
|
size: {
|
|
type: String,
|
|
default: 'medium',
|
|
validator: (value: string): boolean =>
|
|
['mini', 'small', 'medium', 'large', 'xlarge'].includes(value),
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
icon: {
|
|
},
|
|
round: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
circle: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
float: {
|
|
type: String,
|
|
validator: (value: string): boolean =>
|
|
['left', 'right'].includes(value),
|
|
},
|
|
fullWidth: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
transparentBackground: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
components: {
|
|
ElButton,
|
|
N8nSpinner,
|
|
N8nIcon,
|
|
},
|
|
styles: (props: {
|
|
fullWidth?: boolean;
|
|
float?: string;
|
|
}): { float?: string; width?: string } => {
|
|
return {
|
|
...(props.float ? { float: props.float } : {}),
|
|
...(props.fullWidth ? { width: '100%' } : {}),
|
|
};
|
|
},
|
|
getClass(props: { type: string; theme?: string, transparentBackground: boolean }, $style: any): string {
|
|
const theme = props.type === 'text'
|
|
? 'text'
|
|
: `${props.type}-${props.theme || 'primary'}`;
|
|
|
|
if (props.transparentBackground) {
|
|
return `${$style[theme]} ${$style['transparent']}`;
|
|
}
|
|
|
|
return $style[theme];
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
@import "../../utils";
|
|
|
|
.button {
|
|
> i {
|
|
display: none;
|
|
}
|
|
|
|
> span {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
span + span {
|
|
margin-left: var(--spacing-3xs);
|
|
}
|
|
}
|
|
|
|
$active-shade-percent: 10%;
|
|
$color-primary-shade: lightness(
|
|
--color-primary-h,
|
|
--color-primary-s,
|
|
--color-primary-l,
|
|
-($active-shade-percent)
|
|
);
|
|
|
|
$color-success-shade: lightness(
|
|
--color-success-h,
|
|
--color-success-s,
|
|
--color-success-l,
|
|
-($active-shade-percent)
|
|
);
|
|
|
|
$color-warning-shade: lightness(
|
|
--color-warning-h,
|
|
--color-warning-s,
|
|
--color-warning-l,
|
|
-($active-shade-percent)
|
|
);
|
|
|
|
$color-danger-shade: lightness(
|
|
--color-danger-h,
|
|
--color-danger-s,
|
|
--color-danger-l,
|
|
-($active-shade-percent)
|
|
);
|
|
|
|
.primary-primary {
|
|
composes: button;
|
|
}
|
|
|
|
.primary-success {
|
|
composes: button;
|
|
--button-background-color: var(--color-success);
|
|
--button-color: var(--color-text-xlight);
|
|
--button-border-color: var(--color-success);
|
|
--button-active-color: var(--color-text-xlight);
|
|
--button-active-border-color: #{$color-success-shade};
|
|
--button-active-background-color: #{$color-success-shade};
|
|
}
|
|
|
|
.primary-warning {
|
|
composes: button;
|
|
--button-background-color: var(--color-warning);
|
|
--button-color: var(--color-text-xlight);
|
|
--button-border-color: var(--color-warning);
|
|
--button-active-color: var(--color-text-xlight);
|
|
--button-active-border-color: #{$color-warning-shade};
|
|
--button-active-background-color: #{$color-warning-shade};
|
|
}
|
|
|
|
.primary-danger {
|
|
composes: button;
|
|
--button-background-color: var(--color-danger);
|
|
--button-color: var(--color-text-xlight);
|
|
--button-border-color: var(--color-danger);
|
|
--button-active-color: var(--color-text-xlight);
|
|
--button-active-border-color: #{$color-danger-shade};
|
|
--button-active-background-color: #{$color-danger-shade};
|
|
}
|
|
|
|
.outline {
|
|
--button-background-color: var(--color-foreground-xlight);
|
|
--button-disabled-background-color: var(--color-foreground-xlight);
|
|
--button-active-background-color: var(--color-foreground-xlight);
|
|
}
|
|
|
|
.outline-primary {
|
|
composes: button;
|
|
composes: outline;
|
|
--button-color: var(--color-primary);
|
|
--button-active-border-color: #{$color-primary-shade};
|
|
--button-active-color: #{$color-primary-shade};
|
|
}
|
|
|
|
.outline-success {
|
|
composes: button;
|
|
composes: outline;
|
|
--button-color: var(--color-success);
|
|
--button-border-color: var(--color-success);
|
|
--button-active-color: #{$color-success-shade};
|
|
--button-active-border-color: #{$color-success-shade};
|
|
}
|
|
|
|
.outline-warning {
|
|
composes: button;
|
|
composes: outline;
|
|
--button-color: var(--color-warning);
|
|
--button-border-color: var(--color-warning);
|
|
--button-active-color: #{$color-warning-shade};
|
|
--button-active-border-color: #{$color-warning-shade};
|
|
}
|
|
|
|
.outline-danger {
|
|
composes: button;
|
|
composes: outline;
|
|
--button-color: var(--color-danger);
|
|
--button-border-color: var(--color-danger);
|
|
--button-active-color: #{$color-danger-shade};
|
|
--button-active-border-color: #{$color-danger-shade};
|
|
}
|
|
|
|
.light-primary {
|
|
composes: button;
|
|
--button-color: var(--color-primary);
|
|
--button-border-color: var(--color-primary-tint-2);
|
|
--button-background-color: var(--color-primary-tint-2);
|
|
--button-active-background-color: var(--color-primary-tint-2);
|
|
--button-active-color: #{$color-primary-shade};
|
|
--button-active-border-color: #{$color-primary-shade};
|
|
}
|
|
|
|
.light-success {
|
|
composes: button;
|
|
--button-color: var(--color-success);
|
|
--button-border-color: var(--color-success-tint-1);
|
|
--button-background-color: var(--color-success-tint-1);
|
|
--button-active-background-color: var(--color-success-tint-1);
|
|
--button-active-color: #{$color-success-shade};
|
|
--button-active-border-color: #{$color-success-shade};
|
|
}
|
|
|
|
.light-warning {
|
|
composes: button;
|
|
--button-color: var(--color-warning);
|
|
--button-border-color: var(--color-warning-tint-2);
|
|
--button-background-color: var(--color-warning-tint-2);
|
|
--button-active-background-color: var(--color-warning-tint-2);
|
|
--button-active-color: #{$color-warning-shade};
|
|
--button-active-border-color: #{$color-warning-shade};
|
|
}
|
|
|
|
.light-danger {
|
|
composes: button;
|
|
--button-color: var(--color-danger);
|
|
--button-border-color: var(--color-danger-tint-1);
|
|
--button-background-color: var(--color-danger-tint-1);
|
|
--button-active-background-color: var(--color-danger-tint-1);
|
|
--button-active-color: #{$color-danger-shade};
|
|
--button-active-border-color: #{$color-danger-shade};
|
|
}
|
|
|
|
.text {
|
|
composes: button;
|
|
--button-color: var(--color-text-light);
|
|
--button-border-color: transparent;
|
|
--button-background-color: transparent;
|
|
--button-active-background-color: transparent;
|
|
--button-active-color: var(--color-primary);
|
|
--button-active-border-color: transparent;
|
|
}
|
|
|
|
.transparent {
|
|
--button-background-color: transparent;
|
|
--button-active-background-color: transparent;
|
|
}
|
|
|
|
.icon {
|
|
display: inline-flex;
|
|
|
|
svg {
|
|
display: block;
|
|
}
|
|
}
|
|
</style>
|