sccoreui 4.3.4 → 4.3.5
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/dist/App.scss +87 -2
- package/dist/components/form/form-fields/form-fields.js +2 -2
- package/dist/components/froala-editor/FroalaEditor.js +3 -32
- package/dist/components/treeDropdownSelect/treeDropdownSelect.js +15 -0
- package/dist/index.js +3 -1
- package/dist/types/components/treeDropdownSelect/treeDropdownSelect.d.ts +3 -0
- package/dist/types/components/types/type.d.ts +5 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/App.scss
CHANGED
|
@@ -598,8 +598,93 @@ div:has(ul.date_filter) .p-datepicker-footer {
|
|
|
598
598
|
|
|
599
599
|
.text-editor {
|
|
600
600
|
button {
|
|
601
|
-
&::after{
|
|
601
|
+
&::after {
|
|
602
602
|
content: none !important;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
button#formatULOptions-1:hover::before,
|
|
609
|
+
button#formatULOptions-1.fr-btn-hover::before,
|
|
610
|
+
button#formatULOptions-1.fr-active::before,
|
|
611
|
+
button#formatOLOptions-1:hover::before,
|
|
612
|
+
button#formatOLOptions-1.fr-btn-hover::before,
|
|
613
|
+
button#formatOLOptions-1.fr-active::before {
|
|
614
|
+
content: '';
|
|
615
|
+
border: 2px solid gray;
|
|
616
|
+
border-left: 0;
|
|
617
|
+
border-top: 0;
|
|
618
|
+
width: 6px;
|
|
619
|
+
height: 6px;
|
|
620
|
+
position: absolute;
|
|
621
|
+
left: 2px;
|
|
622
|
+
top: 39%;
|
|
623
|
+
transform: rotate(45deg);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
#fontFamily-1:before {
|
|
627
|
+
content: '';
|
|
628
|
+
border: 2px solid gray;
|
|
629
|
+
border-left: 0;
|
|
630
|
+
border-top: 0;
|
|
631
|
+
width: 6px;
|
|
632
|
+
height: 6px;
|
|
633
|
+
position: absolute;
|
|
634
|
+
right: 8px;
|
|
635
|
+
top: 39%;
|
|
636
|
+
transform: rotate(45deg);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.fr-toolbar .fr-btn-grp {
|
|
640
|
+
display: inline-block;
|
|
641
|
+
margin: 0 0px 0 12px !important;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
/// Custon treeDropdownSelect style
|
|
647
|
+
.treeNoCollaps {
|
|
648
|
+
li {
|
|
649
|
+
padding-left: 0 !important;
|
|
650
|
+
padding-right: 0 !important;
|
|
651
|
+
}
|
|
652
|
+
.p-tree-toggler {
|
|
653
|
+
display: none;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.treeBadge {
|
|
657
|
+
background: var(--Gray-100, #F2F4F7) !important;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.p-treenode-content:hover{
|
|
661
|
+
background: var(--Primary-25, #F5F6FD) !important;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.p-treenode-content:hover .treeItem,
|
|
665
|
+
.p-treenode-content:focus .treeItem {
|
|
666
|
+
color: var(--primary-400);
|
|
667
|
+
|
|
668
|
+
.treeBadge {
|
|
669
|
+
color: var(--Primary-400, #243DC6) !important;
|
|
670
|
+
background: var(--Primary-50, #E2E5FA) !important;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.p-treenode-content:hover svg path,
|
|
675
|
+
.p-treenode-content:focus svg path {
|
|
676
|
+
stroke: var(--primary-400) !important;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.p-treenode-content:focus {
|
|
680
|
+
box-shadow: none !important;
|
|
681
|
+
outline: none !important;
|
|
682
|
+
background: var(--Primary-25, #F5F6FD) !important;
|
|
683
|
+
|
|
684
|
+
.treeBadge {
|
|
685
|
+
color: var(--Primary-400, #243DC6) !important;
|
|
686
|
+
background: var(--Primary-50, #E2E5FA) !important;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
/// Custon treeDropdownSelect style end /////////////////
|
|
@@ -32,8 +32,8 @@ const InputTextAreaField = (props) => {
|
|
|
32
32
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column relative" }, { children: [optional && (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] })), !optional && (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "font-medium text-base mb-1", htmlFor: name }, { children: label })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, type: "textarea", validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(inputtextarea_1.InputTextarea, Object.assign({ autoComplete: "off", placeholder: placeholder, style: { height: '154px', resize: 'none', overflowY: 'scroll' } }, field, { maxLength: maxLength, className: `pt-2 full_form_field ${className} ${errors[name] && touched[name] ? 'p-invalid' : ''} ${length === 'full' ? '' : 'form_field'}`, id: name })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "absolute text-base font-normal text-gray-600", style: { bottom: '20px', right: '12px' } }, { children: [charCount, "/", maxLength] }))] })) })), errors[name] && touched[name] ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'errorField flex align-items-center text-sm', style: { height: '16px' } }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors[name] }) }))) : (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'errorField flex align-items-center text-sm', style: { height: '16px' } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })));
|
|
33
33
|
};
|
|
34
34
|
const DropDownField = (props) => {
|
|
35
|
-
const { errors, touched, name, length, label, placeholder, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, filter, panelStyle
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column" }, { children: [optional && (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] })), !optional && (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "font-medium text-base mb-1", htmlFor: name }, { children: label })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ panelStyle: panelStyle || '',
|
|
35
|
+
const { errors, touched, name, length, label, placeholder, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, filter, panelStyle } = props;
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column" }, { children: [optional && (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] })), !optional && (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "font-medium text-base mb-1", htmlFor: name }, { children: label })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ panelStyle: panelStyle || '', filter: filter || false, disabled: disabled, placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, valueTemplate: customSelectedTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: `full_form_field ${className} ${errors[name] && touched[name] ? 'p-invalid' : ''} ${length === 'full' ? '' : 'form_field'}`, id: name }))) })), errors[name] && touched[name] ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'errorField flex align-items-center text-sm', style: { height: '16px' } }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors[name] }) }))) : (0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'errorField flex align-items-center text-sm', style: { height: '16px' } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })));
|
|
37
37
|
};
|
|
38
38
|
const MultiSelectField = (props) => {
|
|
39
39
|
const { errors, touched, name, length, label, placeholder, options, optional, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled } = props;
|
|
@@ -9,41 +9,17 @@ const react_froala_wysiwyg_1 = tslib_1.__importDefault(require("react-froala-wys
|
|
|
9
9
|
require("froala-editor/js/plugins.pkgd.min.js");
|
|
10
10
|
// import { SvgComponent } from 'sccoreui';
|
|
11
11
|
// import SvgComponent from '../../directives/svg-component';
|
|
12
|
-
|
|
12
|
+
// import { Bold, Italic } from '../../assets/svg/svg';
|
|
13
13
|
const MyEditor = () => {
|
|
14
14
|
const editorRef = (0, react_1.useRef)(null);
|
|
15
15
|
const html = ``;
|
|
16
16
|
const [editorContent, setEditorContent] = (0, react_1.useState)(html);
|
|
17
|
+
// const [editorConfig, setEditorConfig] = useState<any>()
|
|
17
18
|
// Callback function to handle content changes
|
|
18
19
|
const handleModelChange = (content) => {
|
|
19
20
|
setEditorContent(content);
|
|
20
21
|
};
|
|
21
22
|
(0, react_1.useEffect)(() => {
|
|
22
|
-
if (editorRef.current) {
|
|
23
|
-
editorRef.current.editor.doc.getElementById('bold-1').innerHTML = `${svg_1.Bold}`;
|
|
24
|
-
editorRef.current.editor.doc.getElementById('italic-1').innerHTML = `${svg_1.Italic}`;
|
|
25
|
-
// Listen for the 'contentChanged' event
|
|
26
|
-
editorRef.current.editor.events.on('contentChanged', () => {
|
|
27
|
-
const currentContent = editorRef.current.html.get();
|
|
28
|
-
// Define your special keywords
|
|
29
|
-
const specialKeywords = ['@product', '@category', '@item'];
|
|
30
|
-
// Iterate through each keyword and check for its presence in the content
|
|
31
|
-
specialKeywords.forEach(keyword => {
|
|
32
|
-
const keywordIndex = currentContent.lastIndexOf(keyword);
|
|
33
|
-
if (keywordIndex !== -1 && keywordIndex + keyword.length === currentContent.length) {
|
|
34
|
-
// Add a tag when the Enter key is pressed at the end of a special keyword
|
|
35
|
-
editorRef.current.events.on('keydown', (e) => {
|
|
36
|
-
if (e.which === editorRef.current.editor.KEYCODE.ENTER) {
|
|
37
|
-
// Do something special when Enter key is pressed
|
|
38
|
-
console.log(`Enter pressed after special keyword: ${keyword}`);
|
|
39
|
-
// For demonstration, let's insert a tag for demonstration
|
|
40
|
-
editorRef.current.html.insert(`<span class="special-tag">${keyword}</span>`);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
23
|
}, []);
|
|
48
24
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'text-editor' }, { children: (0, jsx_runtime_1.jsx)(react_froala_wysiwyg_1.default, { tag: "textarea", config: {
|
|
49
25
|
fontFamilySelection: true,
|
|
@@ -51,7 +27,6 @@ const MyEditor = () => {
|
|
|
51
27
|
'Arial,Helvetica,sans-serif': 'Font 1',
|
|
52
28
|
'Impact,Charcoal,sans-serif': 'Font 2',
|
|
53
29
|
'RobotoItalic,Charcoal,sans-serif': 'RobotoItalic',
|
|
54
|
-
'Tahoma,Geneva,sans-serif': 'Font 3'
|
|
55
30
|
},
|
|
56
31
|
fontFamilyDefaultSelection: 'Font 2',
|
|
57
32
|
placeholderText: 'placeholder',
|
|
@@ -66,7 +41,6 @@ const MyEditor = () => {
|
|
|
66
41
|
toolbarButtons: {
|
|
67
42
|
'fontFamily': {
|
|
68
43
|
'buttons': ['fontFamily'],
|
|
69
|
-
'class': 'customCard',
|
|
70
44
|
},
|
|
71
45
|
'moreText': {
|
|
72
46
|
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'fontSize', 'subscript', 'superscript', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
|
|
@@ -77,12 +51,9 @@ const MyEditor = () => {
|
|
|
77
51
|
'buttonsVisible': 2
|
|
78
52
|
},
|
|
79
53
|
'moreRich': {
|
|
80
|
-
'buttons': ['insertLink', 'insertImage', 'insertHR', 'undo', 'redo', 'html'],
|
|
54
|
+
'buttons': ['insertLink', 'insertImage', 'insertHR', 'undo', 'redo', 'html', "javascript"],
|
|
81
55
|
'buttonsVisible': 2
|
|
82
56
|
},
|
|
83
|
-
'fullscreen': {
|
|
84
|
-
'button': 'fullscreen'
|
|
85
|
-
},
|
|
86
57
|
},
|
|
87
58
|
}, model: editorContent, onModelChange: handleModelChange, ref: editorRef }) })));
|
|
88
59
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const tree_1 = require("primereact/tree");
|
|
6
|
+
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
7
|
+
const sccoreui_1 = require("sccoreui");
|
|
8
|
+
const TreeDropdownSelect = ({ treeData, expandedKeys, clickOnNode }) => {
|
|
9
|
+
const onClickNode = (e) => {
|
|
10
|
+
if (clickOnNode)
|
|
11
|
+
clickOnNode(e);
|
|
12
|
+
};
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(tree_1.Tree, { value: treeData, expandedKeys: expandedKeys, selectionMode: "single", className: 'treeNoCollaps', nodeTemplate: (node) => (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'flex gap-2 align-items-center justify-content-between w-full' }, { children: [" ", (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'treeItem flex gap-2 h-2rem align-items-center w-full h-full font-semibold' }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "chart-breakout-square" }), node.moduleName] })), " ", (node === null || node === void 0 ? void 0 : node.badgeValue) && (0, jsx_runtime_1.jsx)(sccoreui_1.Badge, { className: 'treeBadge w-auto text-gray-700', value: node === null || node === void 0 ? void 0 : node.badgeValue })] })), onNodeClick: (e) => onClickNode(e) }));
|
|
14
|
+
};
|
|
15
|
+
exports.default = TreeDropdownSelect;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Chart = exports.ProgressSpinner = exports.Skeleton = exports.Chip = exports.Chips = exports.Rating = exports.InputTextarea = exports.InputSwitch = exports.InputMask = exports.SpeedDial = exports.SplitButton = exports.DataViewLayoutOptions = exports.DataView = exports.Toast = exports.InputNumber = exports.OverlayPanel = exports.Tag = exports.Carousel = exports.ToggleButton = exports.CustomSlider = exports.Card = exports.Dialog = exports.Password = exports.confirmPopup = exports.ConfirmDialog = exports.RadioButton = exports.Badge = exports.Tooltip = exports.Calendar = exports.Image = exports.AvatarGroup = exports.Avatar = exports.classNames = exports.Paginator = exports.MultiSelect = exports.FileUpload = exports.TabMenu = exports.TabPanel = exports.TabView = exports.Sidebar = exports.Column = exports.DataTable = exports.Checkbox = exports.AutoComplete = exports.ColorPicker = exports.AccordionTab = exports.Accordion = exports.InputText = exports.Dropdown = exports.Button = void 0;
|
|
4
4
|
exports.StyleClass = exports.ScrollTop = exports.InplaceContent = exports.InplaceDisplay = exports.Inplace = exports.BlockUI = exports.Messages = exports.Message = exports.TieredMenu = exports.Stesp = exports.SlideMenu = exports.PanelMenu = exports.Menubar = exports.Menu = exports.Dock = exports.ContextMenu = exports.Toolbar = exports.SplitterPanel = exports.Splitter = exports.ScrollPanel = exports.Panel = exports.Fieldset = exports.DeferredContent = exports.Timeline = exports.TreeTable = exports.Tree = exports.PickList = exports.OrganizationChart = exports.OrderList = exports.DataScroller = exports.TriStateCheckbox = exports.TreeSelect = exports.SelectButton = exports.MultiStateCheckbox = exports.Mention = exports.ListBox = exports.Knob = exports.Editor = exports.CascadeSelect = exports.FilterOperator = exports.FilterMatchMode = exports.Slider = exports.Galleria = exports.SvgComponent = exports.CircleProgressComponent = exports.ProgressSteps = exports.ProgressBar = exports.Divider = exports.MegaMenu = exports.BreadCrumb = void 0;
|
|
5
|
-
exports.TextEditor = exports.FormFields = exports.FormComponent = exports.DatePicker = exports.MultiSelectDropDown = exports.Terminal = void 0;
|
|
5
|
+
exports.TextEditor = exports.FormFields = exports.FormComponent = exports.TreeDropdownSelect = exports.DatePicker = exports.MultiSelectDropDown = exports.Terminal = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const client_1 = tslib_1.__importDefault(require("react-dom/client"));
|
|
@@ -208,6 +208,8 @@ var multi_select_dropdown_1 = require("./components/multi-select-dropdown/multi-
|
|
|
208
208
|
Object.defineProperty(exports, "MultiSelectDropDown", { enumerable: true, get: function () { return tslib_1.__importDefault(multi_select_dropdown_1).default; } });
|
|
209
209
|
var date_picker_1 = require("./components/date-picker/date-picker");
|
|
210
210
|
Object.defineProperty(exports, "DatePicker", { enumerable: true, get: function () { return tslib_1.__importDefault(date_picker_1).default; } });
|
|
211
|
+
var treeDropdownSelect_1 = require("./components/treeDropdownSelect/treeDropdownSelect");
|
|
212
|
+
Object.defineProperty(exports, "TreeDropdownSelect", { enumerable: true, get: function () { return tslib_1.__importDefault(treeDropdownSelect_1).default; } });
|
|
211
213
|
var form_1 = require("./components/form/form");
|
|
212
214
|
Object.defineProperty(exports, "FormComponent", { enumerable: true, get: function () { return tslib_1.__importDefault(form_1).default; } });
|
|
213
215
|
var form_fields_1 = require("./components/form/form-fields/form-fields");
|
|
@@ -132,7 +132,6 @@ export interface DropDownFieldProps {
|
|
|
132
132
|
disabled?: boolean;
|
|
133
133
|
filter?: boolean;
|
|
134
134
|
panelStyle?: any;
|
|
135
|
-
panelClassName?: any;
|
|
136
135
|
}
|
|
137
136
|
export interface MultiSelectProps {
|
|
138
137
|
errors: any;
|
|
@@ -150,3 +149,8 @@ export interface MultiSelectProps {
|
|
|
150
149
|
validate?: any;
|
|
151
150
|
disabled?: boolean;
|
|
152
151
|
}
|
|
152
|
+
export interface TreeDropdownSelectTypes {
|
|
153
|
+
clickOnNode?: any;
|
|
154
|
+
treeData: any;
|
|
155
|
+
expandedKeys: any;
|
|
156
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export { default as StyleClass } from "./components/style-class/styleClass";
|
|
|
94
94
|
export { default as Terminal } from "./components/terminal/terminal";
|
|
95
95
|
export { default as MultiSelectDropDown } from './components/multi-select-dropdown/multi-select-dropdown';
|
|
96
96
|
export { default as DatePicker } from "./components/date-picker/date-picker";
|
|
97
|
+
export { default as TreeDropdownSelect } from './components/treeDropdownSelect/treeDropdownSelect';
|
|
97
98
|
export { default as FormComponent } from "./components/form/form";
|
|
98
99
|
export { default as FormFields } from "./components/form/form-fields/form-fields";
|
|
99
100
|
export { default as TextEditor } from "./components/froala-editor/FroalaEditor";
|