@visns-studio/visns-components 5.11.7 → 5.11.9
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/package.json +1 -1
- package/src/components/crm/Field.jsx +209 -82
- package/src/components/crm/generic/GenericQuote.jsx +504 -126
- package/src/components/crm/generic/styles/GenericQuote.module.scss +382 -78
- package/src/components/crm/styles/Field.module.scss +301 -0
- package/src/components/proposal/ProposalTemplatePreview.css +26 -8
- package/src/components/proposal/ProposalTemplateSectionManager.css +47 -5
- package/src/components/proposal/ProposalTemplateSectionManager.jsx +33 -7
- package/src/components/proposal/SectionEditor.jsx +48 -14
- package/src/components/proposal/SectionTypeSelector.css +54 -0
- package/src/components/proposal/SectionTypeSelector.jsx +15 -3
|
@@ -76,7 +76,10 @@ const categoryColors = {
|
|
|
76
76
|
footer: 'footer-category'
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const SectionTypeSelector = ({ onSelect, onCancel }) => {
|
|
79
|
+
const SectionTypeSelector = ({ onSelect, onCancel, existingSections = [] }) => {
|
|
80
|
+
// Get list of existing section types
|
|
81
|
+
const existingSectionTypes = existingSections.map(section => section.section_type);
|
|
82
|
+
|
|
80
83
|
const groupedSections = sectionTypes.reduce((acc, section) => {
|
|
81
84
|
if (!acc[section.category]) {
|
|
82
85
|
acc[section.category] = [];
|
|
@@ -110,11 +113,15 @@ const SectionTypeSelector = ({ onSelect, onCancel }) => {
|
|
|
110
113
|
<div className="section-types-grid">
|
|
111
114
|
{sections.map((section) => {
|
|
112
115
|
const IconComponent = section.icon;
|
|
116
|
+
const isAlreadyUsed = existingSectionTypes.includes(section.id);
|
|
117
|
+
|
|
113
118
|
return (
|
|
114
119
|
<button
|
|
115
120
|
key={section.id}
|
|
116
|
-
onClick={() => onSelect(section.id)}
|
|
117
|
-
className={`section-type-card ${categoryColors[category]}`}
|
|
121
|
+
onClick={() => !isAlreadyUsed && onSelect(section.id)}
|
|
122
|
+
className={`section-type-card ${categoryColors[category]} ${isAlreadyUsed ? 'disabled' : ''}`}
|
|
123
|
+
disabled={isAlreadyUsed}
|
|
124
|
+
title={isAlreadyUsed ? `${section.name} section already exists in this template` : `Add ${section.name} section`}
|
|
118
125
|
>
|
|
119
126
|
<div className="section-type-card-header">
|
|
120
127
|
<div className="section-type-icon">
|
|
@@ -128,6 +135,11 @@ const SectionTypeSelector = ({ onSelect, onCancel }) => {
|
|
|
128
135
|
Dynamic
|
|
129
136
|
</span>
|
|
130
137
|
)}
|
|
138
|
+
{isAlreadyUsed && (
|
|
139
|
+
<span className="used-badge">
|
|
140
|
+
Already Added
|
|
141
|
+
</span>
|
|
142
|
+
)}
|
|
131
143
|
</h4>
|
|
132
144
|
<p className="section-type-description">
|
|
133
145
|
{section.description}
|