krl-alfred 2.24.0 → 2.24.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/dist/components/ColorPalette/ColorPalette.js +1 -1
- package/dist/components/ColorPalette/ColorPalette.styled.d.ts +7 -1
- package/dist/components/ColorPalette/ColorPalette.styled.js +5 -5
- package/dist/components/ColorPalette/ColorPalette.test.d.ts +1 -0
- package/dist/components/ColorPalette/ColorPalette.test.js +31 -0
- package/dist/components/DescriptionCard/DescriptionCard.d.ts +1 -1
- package/dist/components/DescriptionCard/DescriptionCard.js +9 -6
- package/dist/components/DescriptionCard/DescriptionCard.styled.d.ts +1 -1
- package/dist/components/DescriptionCard/DescriptionCard.styled.js +4 -4
- package/dist/components/DescriptionCard/DescriptionCard.test.js +36 -4
- package/dist/components/DescriptionCard/SortableDescriptionCard.js +1 -1
- package/dist/components/DescriptionCard/props.d.ts +3 -0
- package/dist/components/DescriptionCard/props.js +1 -0
- package/dist/components/DescriptionCard/stories/DescriptionCard.stories.d.ts +33 -1
- package/dist/components/DescriptionCard/stories/DescriptionCard.stories.js +6 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +10 -9
- package/dist/components/Input/Input.test.js +20 -0
- package/dist/components/Input/props.d.ts +3 -0
- package/dist/components/Input/props.js +2 -0
- package/dist/components/Input/stories/Input.stories.d.ts +17 -0
- package/dist/components/Input/stories/Input.stories.js +20 -1
- package/package.json +7 -7
|
@@ -9,7 +9,7 @@ var colors_json_1 = __importDefault(require("./../../jsons/colors.json"));
|
|
|
9
9
|
var ColorPalette = function (props) {
|
|
10
10
|
var Item = function (_a) {
|
|
11
11
|
var _b = _a.gradient, gradient = _b === void 0 ? props.gradient : _b, _c = _a.data, data = _c === void 0 ? props.data : _c;
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)(ColorPalette_styled_1.ColorItem, { children: [(0, jsx_runtime_1.jsx)(ColorPalette_styled_1.Bg, { gradient: gradient, data: data }), (0, jsx_runtime_1.jsx)(ColorPalette_styled_1.Text, { children: Object.entries(data).map(function (_a) {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(ColorPalette_styled_1.ColorItem, { children: [(0, jsx_runtime_1.jsx)(ColorPalette_styled_1.Bg, { "$gradient": gradient, "$data": data, "data-testid": "color-palette-bg" }), (0, jsx_runtime_1.jsx)(ColorPalette_styled_1.Text, { children: Object.entries(data).map(function (_a) {
|
|
13
13
|
var key4 = _a[0], value4 = _a[1];
|
|
14
14
|
return ((0, jsx_runtime_1.jsxs)(ColorPalette_styled_1.ValueListWrapper, { children: [(0, jsx_runtime_1.jsx)(ColorPalette_styled_1.Title, { children: key4 }), (0, jsx_runtime_1.jsx)(ColorPalette_styled_1.Value, { children: value4 })] }, key4));
|
|
15
15
|
}) })] }));
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ColorPalette } from "./props";
|
|
3
|
+
type BgProps = {
|
|
4
|
+
$gradient?: ColorPalette["gradient"];
|
|
5
|
+
$data?: ColorPalette["data"];
|
|
6
|
+
};
|
|
2
7
|
export declare const ColorPaletteStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
3
8
|
export declare const ColorItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
4
|
-
export declare const Bg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof
|
|
9
|
+
export declare const Bg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BgProps> & BgProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BgProps> & BgProps, never>>> & string;
|
|
5
10
|
export declare const Text: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
6
11
|
export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
|
|
7
12
|
export declare const TitleXl: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>>> & string;
|
|
8
13
|
export declare const TitleLg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>>> & string;
|
|
9
14
|
export declare const Value: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
|
|
10
15
|
export declare const ValueListWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
16
|
+
export {};
|
|
@@ -11,11 +11,11 @@ exports.ValueListWrapper = exports.Value = exports.TitleLg = exports.TitleXl = e
|
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
exports.ColorPaletteStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 15px;\n margin-bottom: 3rem;\n @media (max-width: 1200px) {\n grid-template-columns: repeat(3, 1fr);\n }\n @media (max-width: 768px) {\n grid-template-columns: repeat(2, 1fr);\n }\n @media (max-width: 576px) {\n grid-template-columns: repeat(1, 1fr);\n }\n"], ["\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 15px;\n margin-bottom: 3rem;\n @media (max-width: 1200px) {\n grid-template-columns: repeat(3, 1fr);\n }\n @media (max-width: 768px) {\n grid-template-columns: repeat(2, 1fr);\n }\n @media (max-width: 576px) {\n grid-template-columns: repeat(1, 1fr);\n }\n"])));
|
|
13
13
|
exports.ColorItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n display: block;\n border-radius: 1rem;\n position: relative;\n overflow: hidden;\n"], ["\n border: 1px solid var(--dark-opacity-10);\n display: block;\n border-radius: 1rem;\n position: relative;\n overflow: hidden;\n"])));
|
|
14
|
-
exports.Bg = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n min-height: 120px;\n background: ", "
|
|
15
|
-
var _a;
|
|
16
|
-
return (
|
|
17
|
-
? "linear-gradient(0deg,
|
|
18
|
-
:
|
|
14
|
+
exports.Bg = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n min-height: 120px;\n background: ", ";\n"], ["\n min-height: 120px;\n background: ", ";\n"])), function (_a) {
|
|
15
|
+
var $gradient = _a.$gradient, $data = _a.$data;
|
|
16
|
+
return ($gradient === null || $gradient === void 0 ? void 0 : $gradient.length) > 0
|
|
17
|
+
? "linear-gradient(0deg, ".concat($gradient.join(", "), ")")
|
|
18
|
+
: ($data === null || $data === void 0 ? void 0 : $data.hex) || "transparent";
|
|
19
19
|
});
|
|
20
20
|
exports.Text = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 16px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 22px;\n"], ["\n padding: 16px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 22px;\n"])));
|
|
21
21
|
exports.Title = styled_components_1.default.strong(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: block;\n margin-bottom: 3px;\n text-transform: uppercase;\n color: var(--dark);\n font: var(--caption-bold-12-15);\n"], ["\n display: block;\n margin-bottom: 3px;\n text-transform: uppercase;\n color: var(--dark);\n font: var(--caption-bold-12-15);\n"])));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var react_1 = require("@testing-library/react");
|
|
8
|
+
var ColorPalette_1 = __importDefault(require("./ColorPalette"));
|
|
9
|
+
var renderPalette = function () {
|
|
10
|
+
return (0, react_1.render)((0, jsx_runtime_1.jsx)(ColorPalette_1.default, { data: { name: "", hex: "", rgb: "", hex2: "", rgb2: "" } }));
|
|
11
|
+
};
|
|
12
|
+
var swatchFor = function (label) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
var item = (_b = (_a = react_1.screen.getByText(label).closest("div")) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
15
|
+
return (0, react_1.within)(item).getByTestId("color-palette-bg");
|
|
16
|
+
};
|
|
17
|
+
describe("ColorPalette", function () {
|
|
18
|
+
it("paints a solid swatch from the hex value", function () {
|
|
19
|
+
renderPalette();
|
|
20
|
+
expect(swatchFor("#9763F6")).toHaveStyle({
|
|
21
|
+
minHeight: "120px",
|
|
22
|
+
background: "#9763F6",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
it("paints a gradient swatch from gradient stops", function () {
|
|
26
|
+
renderPalette();
|
|
27
|
+
expect(swatchFor("#7730FA")).toHaveStyle({
|
|
28
|
+
background: "linear-gradient(0deg, #7730FA, #9961FF)",
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DescriptionCardProps } from "./props";
|
|
3
|
-
declare const DescriptionCard: ({ title, titleSize, headerSize, headerAlignItems, headerDescription, headerButtonText, hasHeaderDropdown, hasHeaderBackButton, list, hasBadge, badgeText, hasTitleBadgeBetween, hasHeader, hasHeaderBackground, hasHeaderBorder, hasRounded, hasBorder, hasShadow, headerImage, headerRightContent, dropdownList, dropdownWidth, accordionList, boxSize, hasHeaderButton, headerButtonWidth, hasHeaderPrimaryButton, headerPrimaryButtonAction, headerPrimaryButtonText, headerPrimaryButtonIcon, headerPrimaryButtonSize, content, hasNoContentSidePadding, middleTitle, status, subcategoryList, hasCategoryLayout, hasTwoColumnHeader, hasDragHandle, dragHandleProps, headerButtonAction, onHeaderBack, onHeaderClick, onSubcategoryReorder, customColumnSpan }: DescriptionCardProps) => React.JSX.Element;
|
|
3
|
+
declare const DescriptionCard: ({ title, titleSize, headerSize, headerAlignItems, headerDescription, headerButtonText, hasHeaderDropdown, hasHeaderBackButton, list, hasBadge, badgeText, hasTitleBadgeBetween, hasHeader, hasHeaderBackground, hasHeaderBorder, hasRounded, hasBorder, hasShadow, headerImage, headerRightContent, dropdownList, dropdownWidth, accordionList, boxSize, hasHeaderButton, headerButtonWidth, hasHeaderPrimaryButton, headerPrimaryButtonAction, headerPrimaryButtonText, headerPrimaryButtonIcon, headerPrimaryButtonSize, content, hasNoContentSidePadding, middleTitle, status, subcategoryList, hasCategoryLayout, hasTwoColumnHeader, hasDragHandle, hasDisableSubcategorySort, dragHandleProps, headerButtonAction, onHeaderBack, onHeaderClick, onSubcategoryReorder, customColumnSpan }: DescriptionCardProps) => React.JSX.Element;
|
|
4
4
|
export default DescriptionCard;
|
|
@@ -41,10 +41,12 @@ var useSortableSensors_1 = require("./utils/useSortableSensors");
|
|
|
41
41
|
var getReorderIndexes_1 = require("./utils/getReorderIndexes");
|
|
42
42
|
var getSubcategoryId = function (item, index) { var _a; return (_a = item.id) !== null && _a !== void 0 ? _a : "subcategory-".concat(index); };
|
|
43
43
|
var DragHandle = function (_a) {
|
|
44
|
-
var dragHandleProps = _a.dragHandleProps;
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.DragHandleStyled, __assign({ type: "button", "aria-label": "S\u00FCr\u00FCkle" }, dragHandleProps, { onClick: function (e) {
|
|
44
|
+
var dragHandleProps = _a.dragHandleProps, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.DragHandleStyled, __assign({ type: "button", "aria-label": "S\u00FCr\u00FCkle", "aria-disabled": disabled || undefined, "$disabled": disabled, tabIndex: disabled ? -1 : undefined }, (disabled ? undefined : dragHandleProps), { onClick: function (e) {
|
|
46
46
|
var _a;
|
|
47
47
|
e.stopPropagation();
|
|
48
|
+
if (disabled)
|
|
49
|
+
return;
|
|
48
50
|
(_a = dragHandleProps === null || dragHandleProps === void 0 ? void 0 : dragHandleProps.onClick) === null || _a === void 0 ? void 0 : _a.call(dragHandleProps, e);
|
|
49
51
|
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "Drag", width: "16", height: "16" }) })));
|
|
50
52
|
};
|
|
@@ -56,11 +58,11 @@ var CategoryStatusCell = function (_a) {
|
|
|
56
58
|
};
|
|
57
59
|
var SubcategoryRowContent = function (_a) {
|
|
58
60
|
var _b, _c, _d, _e, _f;
|
|
59
|
-
var item = _a.item, defaultButtonText = _a.defaultButtonText, defaultButtonWidth = _a.defaultButtonWidth, hasCategoryLayout = _a.hasCategoryLayout, hasDragHandle = _a.hasDragHandle, dragHandleProps = _a.dragHandleProps, setNodeRef = _a.setNodeRef, style = _a.style, isDragging = _a.isDragging;
|
|
61
|
+
var item = _a.item, defaultButtonText = _a.defaultButtonText, defaultButtonWidth = _a.defaultButtonWidth, hasCategoryLayout = _a.hasCategoryLayout, hasDragHandle = _a.hasDragHandle, isSortDisabled = _a.isSortDisabled, dragHandleProps = _a.dragHandleProps, setNodeRef = _a.setNodeRef, style = _a.style, isDragging = _a.isDragging;
|
|
60
62
|
var hasButton = (_b = item.hasButton) !== null && _b !== void 0 ? _b : true;
|
|
61
63
|
var buttonText = (_c = item.buttonText) !== null && _c !== void 0 ? _c : defaultButtonText;
|
|
62
64
|
var isClickable = !!item.onClick;
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(DescriptionCard_styled_1.SubcategoryRowStyled, __assign({ ref: setNodeRef, style: style, "$hasCategoryLayout": hasCategoryLayout, "$isClickable": isClickable, "$isDragging": isDragging, onClick: item.onClick }, { children: [(0, jsx_runtime_1.jsxs)(DescriptionCard_styled_1.SubcategoryNameWrapper, { children: [hasDragHandle && (0, jsx_runtime_1.jsx)(DragHandle, { dragHandleProps: dragHandleProps }), (0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubcategoryIconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "Subcategory", width: "24", height: "24", color: "var(--dark)" }) }), (0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubcategoryNameStyled, { children: item.name })] }), (hasCategoryLayout || item.middleTitle) && ((0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.RowMiddleTitleStyled, { children: item.middleTitle })), (hasCategoryLayout || item.status) && ((0, jsx_runtime_1.jsx)(CategoryStatusCell, { status: item.status })), (0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubcategoryActionWrapper, __assign({ "$hasCategoryLayout": hasCategoryLayout, onClick: function (e) { return e.stopPropagation(); } }, { children: hasButton && ((0, jsx_runtime_1.jsxs)(DescriptionCard_styled_1.DropdownWrapper, { children: [(0, jsx_runtime_1.jsx)(Button_1.default, __assign({ width: (_e = (_d = item.buttonWidth) !== null && _d !== void 0 ? _d : defaultButtonWidth) !== null && _e !== void 0 ? _e : null, onClick: item.buttonAction, size: "xsmall", variant: "inverted", icon: item.hasDropdown ? "ArrowSmallDown" : null }, { children: buttonText })), item.hasDropdown && ((_f = item.dropdownList) === null || _f === void 0 ? void 0 : _f.length) > 0 && ((0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubMenu, { children: (0, jsx_runtime_1.jsx)(OptionMenu_1.default, { hasActiveItem: false, data: item.dropdownList, rowLength: 20, gridItemWidth: item.dropdownWidth }) }))] })) }))] })));
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(DescriptionCard_styled_1.SubcategoryRowStyled, __assign({ ref: setNodeRef, style: style, "$hasCategoryLayout": hasCategoryLayout, "$isClickable": isClickable, "$isDragging": isDragging, onClick: item.onClick }, { children: [(0, jsx_runtime_1.jsxs)(DescriptionCard_styled_1.SubcategoryNameWrapper, { children: [hasDragHandle && ((0, jsx_runtime_1.jsx)(DragHandle, { dragHandleProps: dragHandleProps, disabled: isSortDisabled })), (0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubcategoryIconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "Subcategory", width: "24", height: "24", color: "var(--dark)" }) }), (0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubcategoryNameStyled, { children: item.name })] }), (hasCategoryLayout || item.middleTitle) && ((0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.RowMiddleTitleStyled, { children: item.middleTitle })), (hasCategoryLayout || item.status) && ((0, jsx_runtime_1.jsx)(CategoryStatusCell, { status: item.status })), (0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubcategoryActionWrapper, __assign({ "$hasCategoryLayout": hasCategoryLayout, onClick: function (e) { return e.stopPropagation(); } }, { children: hasButton && ((0, jsx_runtime_1.jsxs)(DescriptionCard_styled_1.DropdownWrapper, { children: [(0, jsx_runtime_1.jsx)(Button_1.default, __assign({ width: (_e = (_d = item.buttonWidth) !== null && _d !== void 0 ? _d : defaultButtonWidth) !== null && _e !== void 0 ? _e : null, onClick: item.buttonAction, size: "xsmall", variant: "inverted", icon: item.hasDropdown ? "ArrowSmallDown" : null }, { children: buttonText })), item.hasDropdown && ((_f = item.dropdownList) === null || _f === void 0 ? void 0 : _f.length) > 0 && ((0, jsx_runtime_1.jsx)(DescriptionCard_styled_1.SubMenu, { children: (0, jsx_runtime_1.jsx)(OptionMenu_1.default, { hasActiveItem: false, data: item.dropdownList, rowLength: 20, gridItemWidth: item.dropdownWidth }) }))] })) }))] })));
|
|
64
66
|
};
|
|
65
67
|
var SortableSubcategoryRow = function (_a) {
|
|
66
68
|
var id = _a.id, rowProps = __rest(_a, ["id"]);
|
|
@@ -71,7 +73,7 @@ var SortableSubcategoryRow = function (_a) {
|
|
|
71
73
|
}, dragHandleProps: __assign(__assign({}, attributes), listeners) })));
|
|
72
74
|
};
|
|
73
75
|
var DescriptionCard = function (_a) {
|
|
74
|
-
var _b = _a.title, title = _b === void 0 ? props_1.DescriptionCardDefault.title : _b, _c = _a.titleSize, titleSize = _c === void 0 ? props_1.DescriptionCardDefault.titleSize : _c, _d = _a.headerSize, headerSize = _d === void 0 ? props_1.DescriptionCardDefault.headerSize : _d, _e = _a.headerAlignItems, headerAlignItems = _e === void 0 ? props_1.DescriptionCardDefault.headerAlignItems : _e, _f = _a.headerDescription, headerDescription = _f === void 0 ? props_1.DescriptionCardDefault.headerDescription : _f, _g = _a.headerButtonText, headerButtonText = _g === void 0 ? props_1.DescriptionCardDefault.headerButtonText : _g, _h = _a.hasHeaderDropdown, hasHeaderDropdown = _h === void 0 ? props_1.DescriptionCardDefault.hasHeaderDropdown : _h, _j = _a.hasHeaderBackButton, hasHeaderBackButton = _j === void 0 ? props_1.DescriptionCardDefault.hasHeaderBackButton : _j, _k = _a.list, list = _k === void 0 ? props_1.DescriptionCardDefault.list : _k, _l = _a.hasBadge, hasBadge = _l === void 0 ? props_1.DescriptionCardDefault.hasBadge : _l, _m = _a.badgeText, badgeText = _m === void 0 ? props_1.DescriptionCardDefault.badgeText : _m, _o = _a.hasTitleBadgeBetween, hasTitleBadgeBetween = _o === void 0 ? props_1.DescriptionCardDefault.hasTitleBadgeBetween : _o, _p = _a.hasHeader, hasHeader = _p === void 0 ? props_1.DescriptionCardDefault.hasHeader : _p, _q = _a.hasHeaderBackground, hasHeaderBackground = _q === void 0 ? props_1.DescriptionCardDefault.hasHeaderBackground : _q, _r = _a.hasHeaderBorder, hasHeaderBorder = _r === void 0 ? props_1.DescriptionCardDefault.hasHeaderBorder : _r, _s = _a.hasRounded, hasRounded = _s === void 0 ? props_1.DescriptionCardDefault.hasRounded : _s, _t = _a.hasBorder, hasBorder = _t === void 0 ? props_1.DescriptionCardDefault.hasBorder : _t, _u = _a.hasShadow, hasShadow = _u === void 0 ? props_1.DescriptionCardDefault.hasShadow : _u, _v = _a.headerImage, headerImage = _v === void 0 ? props_1.DescriptionCardDefault.headerImage : _v, _w = _a.headerRightContent, headerRightContent = _w === void 0 ? props_1.DescriptionCardDefault.headerRightContent : _w, _x = _a.dropdownList, dropdownList = _x === void 0 ? props_1.DescriptionCardDefault.dropdownList : _x, _y = _a.dropdownWidth, dropdownWidth = _y === void 0 ? props_1.DescriptionCardDefault.dropdownWidth : _y, _z = _a.accordionList, accordionList = _z === void 0 ? props_1.DescriptionCardDefault.accordionList : _z, _0 = _a.boxSize, boxSize = _0 === void 0 ? props_1.DescriptionCardDefault.boxSize : _0, _1 = _a.hasHeaderButton, hasHeaderButton = _1 === void 0 ? props_1.DescriptionCardDefault.hasHeaderButton : _1, _2 = _a.headerButtonWidth, headerButtonWidth = _2 === void 0 ? props_1.DescriptionCardDefault.headerButtonWidth : _2, _3 = _a.hasHeaderPrimaryButton, hasHeaderPrimaryButton = _3 === void 0 ? props_1.DescriptionCardDefault.hasHeaderPrimaryButton : _3, _4 = _a.headerPrimaryButtonAction, headerPrimaryButtonAction = _4 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonAction : _4, _5 = _a.headerPrimaryButtonText, headerPrimaryButtonText = _5 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonText : _5, _6 = _a.headerPrimaryButtonIcon, headerPrimaryButtonIcon = _6 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonIcon : _6, _7 = _a.headerPrimaryButtonSize, headerPrimaryButtonSize = _7 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonSize : _7, _8 = _a.content, content = _8 === void 0 ? props_1.DescriptionCardDefault.content : _8, _9 = _a.hasNoContentSidePadding, hasNoContentSidePadding = _9 === void 0 ? props_1.DescriptionCardDefault.hasNoContentSidePadding : _9, _10 = _a.middleTitle, middleTitle = _10 === void 0 ? props_1.DescriptionCardDefault.middleTitle : _10, _11 = _a.status, status = _11 === void 0 ? props_1.DescriptionCardDefault.status : _11, _12 = _a.subcategoryList, subcategoryList = _12 === void 0 ? props_1.DescriptionCardDefault.subcategoryList : _12, _13 = _a.hasCategoryLayout, hasCategoryLayout = _13 === void 0 ? props_1.DescriptionCardDefault.hasCategoryLayout : _13, _14 = _a.hasTwoColumnHeader, hasTwoColumnHeader = _14 === void 0 ? props_1.DescriptionCardDefault.hasTwoColumnHeader : _14, _15 = _a.hasDragHandle, hasDragHandle = _15 === void 0 ? props_1.DescriptionCardDefault.hasDragHandle : _15, _16 = _a.dragHandleProps, dragHandleProps =
|
|
76
|
+
var _b = _a.title, title = _b === void 0 ? props_1.DescriptionCardDefault.title : _b, _c = _a.titleSize, titleSize = _c === void 0 ? props_1.DescriptionCardDefault.titleSize : _c, _d = _a.headerSize, headerSize = _d === void 0 ? props_1.DescriptionCardDefault.headerSize : _d, _e = _a.headerAlignItems, headerAlignItems = _e === void 0 ? props_1.DescriptionCardDefault.headerAlignItems : _e, _f = _a.headerDescription, headerDescription = _f === void 0 ? props_1.DescriptionCardDefault.headerDescription : _f, _g = _a.headerButtonText, headerButtonText = _g === void 0 ? props_1.DescriptionCardDefault.headerButtonText : _g, _h = _a.hasHeaderDropdown, hasHeaderDropdown = _h === void 0 ? props_1.DescriptionCardDefault.hasHeaderDropdown : _h, _j = _a.hasHeaderBackButton, hasHeaderBackButton = _j === void 0 ? props_1.DescriptionCardDefault.hasHeaderBackButton : _j, _k = _a.list, list = _k === void 0 ? props_1.DescriptionCardDefault.list : _k, _l = _a.hasBadge, hasBadge = _l === void 0 ? props_1.DescriptionCardDefault.hasBadge : _l, _m = _a.badgeText, badgeText = _m === void 0 ? props_1.DescriptionCardDefault.badgeText : _m, _o = _a.hasTitleBadgeBetween, hasTitleBadgeBetween = _o === void 0 ? props_1.DescriptionCardDefault.hasTitleBadgeBetween : _o, _p = _a.hasHeader, hasHeader = _p === void 0 ? props_1.DescriptionCardDefault.hasHeader : _p, _q = _a.hasHeaderBackground, hasHeaderBackground = _q === void 0 ? props_1.DescriptionCardDefault.hasHeaderBackground : _q, _r = _a.hasHeaderBorder, hasHeaderBorder = _r === void 0 ? props_1.DescriptionCardDefault.hasHeaderBorder : _r, _s = _a.hasRounded, hasRounded = _s === void 0 ? props_1.DescriptionCardDefault.hasRounded : _s, _t = _a.hasBorder, hasBorder = _t === void 0 ? props_1.DescriptionCardDefault.hasBorder : _t, _u = _a.hasShadow, hasShadow = _u === void 0 ? props_1.DescriptionCardDefault.hasShadow : _u, _v = _a.headerImage, headerImage = _v === void 0 ? props_1.DescriptionCardDefault.headerImage : _v, _w = _a.headerRightContent, headerRightContent = _w === void 0 ? props_1.DescriptionCardDefault.headerRightContent : _w, _x = _a.dropdownList, dropdownList = _x === void 0 ? props_1.DescriptionCardDefault.dropdownList : _x, _y = _a.dropdownWidth, dropdownWidth = _y === void 0 ? props_1.DescriptionCardDefault.dropdownWidth : _y, _z = _a.accordionList, accordionList = _z === void 0 ? props_1.DescriptionCardDefault.accordionList : _z, _0 = _a.boxSize, boxSize = _0 === void 0 ? props_1.DescriptionCardDefault.boxSize : _0, _1 = _a.hasHeaderButton, hasHeaderButton = _1 === void 0 ? props_1.DescriptionCardDefault.hasHeaderButton : _1, _2 = _a.headerButtonWidth, headerButtonWidth = _2 === void 0 ? props_1.DescriptionCardDefault.headerButtonWidth : _2, _3 = _a.hasHeaderPrimaryButton, hasHeaderPrimaryButton = _3 === void 0 ? props_1.DescriptionCardDefault.hasHeaderPrimaryButton : _3, _4 = _a.headerPrimaryButtonAction, headerPrimaryButtonAction = _4 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonAction : _4, _5 = _a.headerPrimaryButtonText, headerPrimaryButtonText = _5 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonText : _5, _6 = _a.headerPrimaryButtonIcon, headerPrimaryButtonIcon = _6 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonIcon : _6, _7 = _a.headerPrimaryButtonSize, headerPrimaryButtonSize = _7 === void 0 ? props_1.DescriptionCardDefault.headerPrimaryButtonSize : _7, _8 = _a.content, content = _8 === void 0 ? props_1.DescriptionCardDefault.content : _8, _9 = _a.hasNoContentSidePadding, hasNoContentSidePadding = _9 === void 0 ? props_1.DescriptionCardDefault.hasNoContentSidePadding : _9, _10 = _a.middleTitle, middleTitle = _10 === void 0 ? props_1.DescriptionCardDefault.middleTitle : _10, _11 = _a.status, status = _11 === void 0 ? props_1.DescriptionCardDefault.status : _11, _12 = _a.subcategoryList, subcategoryList = _12 === void 0 ? props_1.DescriptionCardDefault.subcategoryList : _12, _13 = _a.hasCategoryLayout, hasCategoryLayout = _13 === void 0 ? props_1.DescriptionCardDefault.hasCategoryLayout : _13, _14 = _a.hasTwoColumnHeader, hasTwoColumnHeader = _14 === void 0 ? props_1.DescriptionCardDefault.hasTwoColumnHeader : _14, _15 = _a.hasDragHandle, hasDragHandle = _15 === void 0 ? props_1.DescriptionCardDefault.hasDragHandle : _15, _16 = _a.hasDisableSubcategorySort, hasDisableSubcategorySort = _16 === void 0 ? props_1.DescriptionCardDefault.hasDisableSubcategorySort : _16, _17 = _a.dragHandleProps, dragHandleProps = _17 === void 0 ? props_1.DescriptionCardDefault.dragHandleProps : _17, headerButtonAction = _a.headerButtonAction, onHeaderBack = _a.onHeaderBack, onHeaderClick = _a.onHeaderClick, onSubcategoryReorder = _a.onSubcategoryReorder, _18 = _a.customColumnSpan, customColumnSpan = _18 === void 0 ? props_1.DescriptionCardDefault.customColumnSpan : _18;
|
|
75
77
|
var hasSubcategories = (subcategoryList === null || subcategoryList === void 0 ? void 0 : subcategoryList.length) > 0;
|
|
76
78
|
var hasHeaderRightContent = !!headerRightContent;
|
|
77
79
|
var hasHeaderRight = hasHeaderRightContent || hasHeaderPrimaryButton || hasHeaderButton;
|
|
@@ -80,7 +82,7 @@ var DescriptionCard = function (_a) {
|
|
|
80
82
|
var isBackTitleClickable = hasHeaderBackButton && !!handleBackTitleClick;
|
|
81
83
|
var sensors = (0, useSortableSensors_1.useSortableSensors)();
|
|
82
84
|
var subcategoryIds = subcategoryList.map(getSubcategoryId);
|
|
83
|
-
var canSortSubcategories = hasDragHandle && hasSubcategories;
|
|
85
|
+
var canSortSubcategories = hasDragHandle && hasSubcategories && !hasDisableSubcategorySort;
|
|
84
86
|
var handleSubcategoryDragEnd = function (_a) {
|
|
85
87
|
var active = _a.active, over = _a.over;
|
|
86
88
|
var indexes = (0, getReorderIndexes_1.getReorderIndexes)(subcategoryIds, active.id, over === null || over === void 0 ? void 0 : over.id);
|
|
@@ -95,6 +97,7 @@ var DescriptionCard = function (_a) {
|
|
|
95
97
|
defaultButtonWidth: headerButtonWidth,
|
|
96
98
|
hasCategoryLayout: hasCategoryLayout,
|
|
97
99
|
hasDragHandle: hasDragHandle,
|
|
100
|
+
isSortDisabled: hasDisableSubcategorySort,
|
|
98
101
|
};
|
|
99
102
|
if (!canSortSubcategories) {
|
|
100
103
|
return (0, jsx_runtime_1.jsx)(SubcategoryRowContent, __assign({}, rowProps), getSubcategoryId(item, key));
|
|
@@ -8,7 +8,7 @@ export declare const DescriptionCardStyled: import("styled-components/dist/types
|
|
|
8
8
|
export declare const DescriptionCardHeaderStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never>>> & string;
|
|
9
9
|
export declare const HeaderLeftStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never>>> & string;
|
|
10
10
|
export declare const HeaderBackButtonStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
11
|
-
export declare const DragHandleStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
11
|
+
export declare const DragHandleStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never>>> & string;
|
|
12
12
|
export declare const HeaderRightStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never>>> & string;
|
|
13
13
|
export declare const HeaderActionWrapperStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof DescriptionCardStyledProps> & DescriptionCardStyledProps, never>>> & string;
|
|
14
14
|
export declare const HeaderRightContentStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -46,7 +46,7 @@ exports.DescriptionCardHeaderStyled = styled_components_1.default.div(templateOb
|
|
|
46
46
|
}, function (props) { return props.$headerAlignItems || 'center'; }, function (props) { return props.$hasCategoryLayout ? '3.5rem' : '1.5rem'; }, function (props) { return props.$hasHeaderBackground ? 'var(--dark-opacity-3)' : 'transparent'; }, function (props) { return props.$hasHeaderBorder ? '1px solid var(--dark-opacity-10)' : 'none'; });
|
|
47
47
|
exports.HeaderLeftStyled = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n min-width: 0;\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n min-width: 0;\n"])));
|
|
48
48
|
exports.HeaderBackButtonStyled = styled_components_1.default.button(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin: 0 1rem 0 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n color: var(--primary);\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin: 0 1rem 0 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n color: var(--primary);\n"])));
|
|
49
|
-
exports.DragHandleStyled = styled_components_1.default.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n margin-right:
|
|
49
|
+
exports.DragHandleStyled = styled_components_1.default.button(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n margin-right: 1rem;\n padding: 0;\n box-shadow: 0px 0px 16px 0px var(--dark-opacity-10);\n border-radius: 0.5rem;\n background-color: white;\n cursor: ", ";\n color: ", ";\n touch-action: none;\n border: none;\n transition: all 0.2s ease-in-out;\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1.5rem;\n height: 1.5rem;\n margin-right: 1rem;\n padding: 0;\n box-shadow: 0px 0px 16px 0px var(--dark-opacity-10);\n border-radius: 0.5rem;\n background-color: white;\n cursor: ", ";\n color: ", ";\n touch-action: none;\n border: none;\n transition: all 0.2s ease-in-out;\n ", "\n"])), function (props) { return props.$disabled ? 'no-drop' : 'grab'; }, function (props) { return props.$disabled ? 'var(--grey-50)' : 'var(--primary)'; }, function (props) { return !props.$disabled && "\n &:active {\n cursor: grabbing;\n background-color: var(--primary);\n color: white;\n }\n &:hover {\n background-color: var(--primary);\n color: white;\n }\n "; });
|
|
50
50
|
exports.HeaderRightStyled = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n justify-content: ", ";\n width: ", ";\n min-width: 0;\n\n > div + div {\n margin-left: 1rem;\n }\n"], ["\n display: ", ";\n align-items: center;\n justify-content: ", ";\n width: ", ";\n min-width: 0;\n\n > div + div {\n margin-left: 1rem;\n }\n"])), function (props) { return props.$hasHeaderRight ? 'flex' : 'none'; }, function (props) { return props.$hasCategoryLayout || props.$hasHeaderRightContent ? 'flex-end' : 'flex-start'; }, function (props) { return props.$hasCategoryLayout ? '100%' : 'auto'; });
|
|
51
51
|
exports.HeaderActionWrapperStyled = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
|
|
52
52
|
exports.HeaderRightContentStyled = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: block;\n min-width: 0;\n"], ["\n display: block;\n min-width: 0;\n"])));
|
|
@@ -68,9 +68,9 @@ exports.AccordionListWrapper = styled_components_1.default.div(templateObject_23
|
|
|
68
68
|
exports.AccordionItemWrapper = styled_components_1.default.div(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n + div{\n border-top: 1px solid var(--dark-opacity-10);\n margin-top: -1px;\n }\n"], ["\n + div{\n border-top: 1px solid var(--dark-opacity-10);\n margin-top: -1px;\n }\n"])));
|
|
69
69
|
exports.AccordionItemHeader = styled_components_1.default.div(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--primary);\n padding: 1.5rem;\n cursor: pointer;\n border-bottom: ", ";\n strong{\n font: var(--body-bold-14-17);\n display: block;\n color: inherit;\n }\n .icon{\n *{\n display: block;\n }\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--primary);\n padding: 1.5rem;\n cursor: pointer;\n border-bottom: ", ";\n strong{\n font: var(--body-bold-14-17);\n display: block;\n color: inherit;\n }\n .icon{\n *{\n display: block;\n }\n }\n"])), function (props) { return props.$show ? "1px solid var(--dark-opacity-10)" : "none"; });
|
|
70
70
|
exports.HeaderMiddleTitleStyled = styled_components_1.default.span(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n font: var(--body-regular-14-17);\n color: var(--dark-opacity-75);\n white-space: nowrap;\n min-width: 0;\n cursor: ", ";\n"], ["\n font: var(--body-regular-14-17);\n color: var(--dark-opacity-75);\n white-space: nowrap;\n min-width: 0;\n cursor: ", ";\n"])), function (props) { return props.$isClickable ? 'pointer' : 'default'; });
|
|
71
|
-
exports.SubcategoryListWrapper = styled_components_1.default.div(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap:
|
|
72
|
-
exports.SubcategoryRowStyled = styled_components_1.default.div(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: ", ";\n align-items: center;\n gap: ", ";\n padding: 1rem 1.5rem;\n border
|
|
73
|
-
exports.SubcategoryNameWrapper = styled_components_1.default.div(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap:
|
|
71
|
+
exports.SubcategoryListWrapper = styled_components_1.default.div(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-top: 1rem;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-top: 1rem;\n"])));
|
|
72
|
+
exports.SubcategoryRowStyled = styled_components_1.default.div(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: ", ";\n align-items: center;\n gap: ", ";\n padding: 1rem 1.5rem;\n border: none;\n border-radius: 0.5rem;\n transition: all 0.2s ease;\n cursor: ", ";\n opacity: 1;\n z-index: ", ";\n\n ", "\n"], ["\n display: grid;\n grid-template-columns: ", ";\n align-items: center;\n gap: ", ";\n padding: 1rem 1.5rem;\n border: none;\n border-radius: 0.5rem;\n transition: all 0.2s ease;\n cursor: ", ";\n opacity: 1;\n z-index: ", ";\n\n ", "\n"])), function (props) { return props.$hasCategoryLayout ? exports.subcategoryRowGridColumns : '1fr 1fr auto'; }, function (props) { return props.$hasCategoryLayout ? '3.5rem' : '1.5rem'; }, function (props) { return props.$isClickable ? 'pointer' : 'default'; }, function (props) { return props.$isDragging ? 2 : 'auto'; }, function (props) { return props.$hasCategoryLayout && "\n &:hover {\n box-shadow: 0px 6px 30px 0px var(--box-shadow-color);\n }\n "; });
|
|
73
|
+
exports.SubcategoryNameWrapper = styled_components_1.default.div(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 1rem;\n min-width: 0;\n\n ", " {\n margin-right: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n gap: 1rem;\n min-width: 0;\n\n ", " {\n margin-right: 0;\n }\n"])), exports.DragHandleStyled);
|
|
74
74
|
exports.SubcategoryIconWrapper = styled_components_1.default.span(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--dark-opacity-50);\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--dark-opacity-50);\n"])));
|
|
75
75
|
exports.SubcategoryNameStyled = styled_components_1.default.span(templateObject_31 || (templateObject_31 = __makeTemplateObject(["\n font: var(--body-medium-14-17);\n color: var(--dark);\n"], ["\n font: var(--body-medium-14-17);\n color: var(--dark);\n"])));
|
|
76
76
|
exports.RowMiddleTitleStyled = styled_components_1.default.span(templateObject_32 || (templateObject_32 = __makeTemplateObject(["\n font: var(--body-regular-14-17);\n color: var(--dark-opacity-75);\n white-space: nowrap;\n min-width: 0;\n"], ["\n font: var(--body-regular-14-17);\n color: var(--dark-opacity-75);\n white-space: nowrap;\n min-width: 0;\n"])));
|
|
@@ -80,7 +80,7 @@ describe('DescriptionCard', function () {
|
|
|
80
80
|
boxShadow: '0px 6px 30px 0px var(--box-shadow-color)',
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
-
it('
|
|
83
|
+
it('keeps category layout subcategories borderless so hover can use the card shadow', function () {
|
|
84
84
|
var _a;
|
|
85
85
|
renderDescriptionCard({
|
|
86
86
|
hasCategoryLayout: true,
|
|
@@ -89,11 +89,29 @@ describe('DescriptionCard', function () {
|
|
|
89
89
|
var row = (_a = react_1.screen.getByText('Blend').parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
90
90
|
expect(row).toHaveStyle({
|
|
91
91
|
display: 'grid',
|
|
92
|
-
borderWidth: '1px',
|
|
93
|
-
borderStyle: 'solid',
|
|
94
|
-
borderColor: 'transparent',
|
|
95
92
|
});
|
|
96
93
|
});
|
|
94
|
+
it('spaces subcategory rows with a 0.5rem gap', function () {
|
|
95
|
+
var _a;
|
|
96
|
+
renderDescriptionCard({
|
|
97
|
+
hasCategoryLayout: true,
|
|
98
|
+
subcategoryList: [{ name: 'Blend' }, { name: 'Terra' }],
|
|
99
|
+
});
|
|
100
|
+
var row = (_a = react_1.screen.getByText('Blend').parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
101
|
+
expect(row === null || row === void 0 ? void 0 : row.parentElement).toHaveStyle({ gap: '0.5rem' });
|
|
102
|
+
});
|
|
103
|
+
it('spaces subcategory handle, icon and title with a 1rem gap', function () {
|
|
104
|
+
renderDescriptionCard({
|
|
105
|
+
hasDragHandle: true,
|
|
106
|
+
hasCategoryLayout: true,
|
|
107
|
+
subcategoryList: [{ name: 'Blend' }],
|
|
108
|
+
});
|
|
109
|
+
var nameWrapper = react_1.screen.getByText('Blend').parentElement;
|
|
110
|
+
var handles = react_1.screen.getAllByRole('button', { name: 'Sürükle' });
|
|
111
|
+
expect(nameWrapper).toHaveStyle({ gap: '1rem' });
|
|
112
|
+
expect(handles[1]).toHaveStyle({ marginRight: '0' });
|
|
113
|
+
expect(handles[0]).toHaveStyle({ marginRight: '1rem' });
|
|
114
|
+
});
|
|
97
115
|
it('always shows the edit button on main and sub categories', function () {
|
|
98
116
|
renderDescriptionCard({
|
|
99
117
|
title: 'Çekirdek kahve',
|
|
@@ -143,6 +161,20 @@ describe('DescriptionCard', function () {
|
|
|
143
161
|
expect(handles).toHaveLength(2);
|
|
144
162
|
expect(handles[1]).toHaveAttribute('aria-roledescription', 'sortable');
|
|
145
163
|
});
|
|
164
|
+
it('disables subcategory sorting when hasDisableSubcategorySort is true', function () {
|
|
165
|
+
renderDescriptionCard({
|
|
166
|
+
hasDragHandle: true,
|
|
167
|
+
hasDisableSubcategorySort: true,
|
|
168
|
+
hasCategoryLayout: true,
|
|
169
|
+
subcategoryList: [{ name: 'Blend' }],
|
|
170
|
+
});
|
|
171
|
+
var handles = react_1.screen.getAllByRole('button', { name: 'Sürükle' });
|
|
172
|
+
expect(handles).toHaveLength(2);
|
|
173
|
+
expect(handles[0]).toBeEnabled();
|
|
174
|
+
expect(handles[1]).toHaveAttribute('aria-disabled', 'true');
|
|
175
|
+
expect(handles[1]).not.toHaveAttribute('aria-roledescription');
|
|
176
|
+
expect(handles[1]).toHaveStyle({ cursor: 'no-drop' });
|
|
177
|
+
});
|
|
146
178
|
it('maps subcategory drag ids to indexes within the same list', function () {
|
|
147
179
|
expect((0, getReorderIndexes_1.getReorderIndexes)(['blend', 'terra'], 'blend', 'terra')).toEqual({
|
|
148
180
|
fromIndex: 0,
|
|
@@ -35,7 +35,7 @@ var SortableDescriptionCard = function (_a) {
|
|
|
35
35
|
return ((0, jsx_runtime_1.jsx)("div", __assign({ ref: setNodeRef, style: {
|
|
36
36
|
transform: utilities_1.CSS.Transform.toString(transform),
|
|
37
37
|
transition: transition,
|
|
38
|
-
opacity:
|
|
38
|
+
opacity: 1,
|
|
39
39
|
zIndex: isDragging ? 2 : undefined,
|
|
40
40
|
} }, { children: (0, jsx_runtime_1.jsx)(DescriptionCard_1.default, __assign({}, props, { hasDragHandle: true, dragHandleProps: __assign(__assign({}, attributes), listeners) })) })));
|
|
41
41
|
};
|
|
@@ -65,6 +65,8 @@ export interface DescriptionCard {
|
|
|
65
65
|
hasTwoColumnHeader?: boolean;
|
|
66
66
|
/** true ise başlık ve alt kategori satırlarında sürükle tutamacı gösterilir */
|
|
67
67
|
hasDragHandle?: boolean;
|
|
68
|
+
/** true ise alt kategori sıralaması kapatılır (ör. tek alt kategori) */
|
|
69
|
+
hasDisableSubcategorySort?: boolean;
|
|
68
70
|
/** Ana kategori tutamacına dnd-kit listener/attribute geçirmek için */
|
|
69
71
|
dragHandleProps?: React.HTMLAttributes<HTMLButtonElement>;
|
|
70
72
|
headerButtonAction?(e: any): void;
|
|
@@ -102,6 +104,7 @@ export interface DescriptionCardStyledProps {
|
|
|
102
104
|
$headerAlignItems?: HEADER_ALIGN_ITEMS;
|
|
103
105
|
$isClickable?: boolean;
|
|
104
106
|
$isDragging?: boolean;
|
|
107
|
+
$disabled?: boolean;
|
|
105
108
|
$hasAccordion?: boolean;
|
|
106
109
|
$statusVariant?: CATEGORY_STATUS_VARIANT;
|
|
107
110
|
$customColumnSpan?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ title, titleSize, headerSize, headerAlignItems, headerDescription, headerButtonText, hasHeaderDropdown, hasHeaderBackButton, list, hasBadge, badgeText, hasTitleBadgeBetween, hasHeader, hasHeaderBackground, hasHeaderBorder, hasRounded, hasBorder, hasShadow, headerImage, headerRightContent, dropdownList, dropdownWidth, accordionList, boxSize, hasHeaderButton, headerButtonWidth, hasHeaderPrimaryButton, headerPrimaryButtonAction, headerPrimaryButtonText, headerPrimaryButtonIcon, headerPrimaryButtonSize, content, hasNoContentSidePadding, middleTitle, status, subcategoryList, hasCategoryLayout, hasTwoColumnHeader, hasDragHandle, dragHandleProps, headerButtonAction, onHeaderBack, onHeaderClick, onSubcategoryReorder, customColumnSpan }: import("../props").DescriptionCard) => React.JSX.Element;
|
|
4
|
+
component: ({ title, titleSize, headerSize, headerAlignItems, headerDescription, headerButtonText, hasHeaderDropdown, hasHeaderBackButton, list, hasBadge, badgeText, hasTitleBadgeBetween, hasHeader, hasHeaderBackground, hasHeaderBorder, hasRounded, hasBorder, hasShadow, headerImage, headerRightContent, dropdownList, dropdownWidth, accordionList, boxSize, hasHeaderButton, headerButtonWidth, hasHeaderPrimaryButton, headerPrimaryButtonAction, headerPrimaryButtonText, headerPrimaryButtonIcon, headerPrimaryButtonSize, content, hasNoContentSidePadding, middleTitle, status, subcategoryList, hasCategoryLayout, hasTwoColumnHeader, hasDragHandle, hasDisableSubcategorySort, dragHandleProps, headerButtonAction, onHeaderBack, onHeaderClick, onSubcategoryReorder, customColumnSpan }: import("../props").DescriptionCard) => React.JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
argTypes: {
|
|
7
7
|
title: {
|
|
@@ -63,6 +63,10 @@ declare const _default: {
|
|
|
63
63
|
control: string;
|
|
64
64
|
description: string;
|
|
65
65
|
};
|
|
66
|
+
hasDisableSubcategorySort: {
|
|
67
|
+
control: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
66
70
|
hasTwoColumnHeader: {
|
|
67
71
|
control: string;
|
|
68
72
|
description: string;
|
|
@@ -143,6 +147,7 @@ export declare const Default: {
|
|
|
143
147
|
hasCategoryLayout: boolean;
|
|
144
148
|
hasTwoColumnHeader: boolean;
|
|
145
149
|
hasDragHandle: boolean;
|
|
150
|
+
hasDisableSubcategorySort: boolean;
|
|
146
151
|
};
|
|
147
152
|
};
|
|
148
153
|
export declare const WithBadge: {
|
|
@@ -192,6 +197,7 @@ export declare const WithBadge: {
|
|
|
192
197
|
hasCategoryLayout: boolean;
|
|
193
198
|
hasTwoColumnHeader: boolean;
|
|
194
199
|
hasDragHandle: boolean;
|
|
200
|
+
hasDisableSubcategorySort: boolean;
|
|
195
201
|
};
|
|
196
202
|
};
|
|
197
203
|
export declare const WithTitleBadgeBetween: {
|
|
@@ -240,6 +246,7 @@ export declare const WithTitleBadgeBetween: {
|
|
|
240
246
|
hasCategoryLayout: boolean;
|
|
241
247
|
hasTwoColumnHeader: boolean;
|
|
242
248
|
hasDragHandle: boolean;
|
|
249
|
+
hasDisableSubcategorySort: boolean;
|
|
243
250
|
};
|
|
244
251
|
};
|
|
245
252
|
export declare const WithHeaderDescription: {
|
|
@@ -291,6 +298,7 @@ export declare const WithHeaderDescription: {
|
|
|
291
298
|
subcategoryList: any[];
|
|
292
299
|
hasCategoryLayout: boolean;
|
|
293
300
|
hasDragHandle: boolean;
|
|
301
|
+
hasDisableSubcategorySort: boolean;
|
|
294
302
|
};
|
|
295
303
|
};
|
|
296
304
|
export declare const WithHeaderBackground: {
|
|
@@ -340,6 +348,7 @@ export declare const WithHeaderBackground: {
|
|
|
340
348
|
hasCategoryLayout: boolean;
|
|
341
349
|
hasTwoColumnHeader: boolean;
|
|
342
350
|
hasDragHandle: boolean;
|
|
351
|
+
hasDisableSubcategorySort: boolean;
|
|
343
352
|
};
|
|
344
353
|
};
|
|
345
354
|
export declare const WithoutHeaderBorder: {
|
|
@@ -389,6 +398,7 @@ export declare const WithoutHeaderBorder: {
|
|
|
389
398
|
hasCategoryLayout: boolean;
|
|
390
399
|
hasTwoColumnHeader: boolean;
|
|
391
400
|
hasDragHandle: boolean;
|
|
401
|
+
hasDisableSubcategorySort: boolean;
|
|
392
402
|
};
|
|
393
403
|
};
|
|
394
404
|
export declare const WithHeaderButton: {
|
|
@@ -438,6 +448,7 @@ export declare const WithHeaderButton: {
|
|
|
438
448
|
hasCategoryLayout: boolean;
|
|
439
449
|
hasTwoColumnHeader: boolean;
|
|
440
450
|
hasDragHandle: boolean;
|
|
451
|
+
hasDisableSubcategorySort: boolean;
|
|
441
452
|
};
|
|
442
453
|
};
|
|
443
454
|
export declare const WithHeaderPrimaryButton: {
|
|
@@ -487,6 +498,7 @@ export declare const WithHeaderPrimaryButton: {
|
|
|
487
498
|
hasCategoryLayout: boolean;
|
|
488
499
|
hasTwoColumnHeader: boolean;
|
|
489
500
|
hasDragHandle: boolean;
|
|
501
|
+
hasDisableSubcategorySort: boolean;
|
|
490
502
|
};
|
|
491
503
|
};
|
|
492
504
|
export declare const WithHeaderDropdown: {
|
|
@@ -536,6 +548,7 @@ export declare const WithHeaderDropdown: {
|
|
|
536
548
|
hasCategoryLayout: boolean;
|
|
537
549
|
hasTwoColumnHeader: boolean;
|
|
538
550
|
hasDragHandle: boolean;
|
|
551
|
+
hasDisableSubcategorySort: boolean;
|
|
539
552
|
};
|
|
540
553
|
};
|
|
541
554
|
export declare const WithoutHeader: {
|
|
@@ -585,6 +598,7 @@ export declare const WithoutHeader: {
|
|
|
585
598
|
hasCategoryLayout: boolean;
|
|
586
599
|
hasTwoColumnHeader: boolean;
|
|
587
600
|
hasDragHandle: boolean;
|
|
601
|
+
hasDisableSubcategorySort: boolean;
|
|
588
602
|
};
|
|
589
603
|
};
|
|
590
604
|
export declare const WithoutBorder: {
|
|
@@ -634,6 +648,7 @@ export declare const WithoutBorder: {
|
|
|
634
648
|
hasCategoryLayout: boolean;
|
|
635
649
|
hasTwoColumnHeader: boolean;
|
|
636
650
|
hasDragHandle: boolean;
|
|
651
|
+
hasDisableSubcategorySort: boolean;
|
|
637
652
|
};
|
|
638
653
|
};
|
|
639
654
|
export declare const WithoutRounded: {
|
|
@@ -683,6 +698,7 @@ export declare const WithoutRounded: {
|
|
|
683
698
|
hasCategoryLayout: boolean;
|
|
684
699
|
hasTwoColumnHeader: boolean;
|
|
685
700
|
hasDragHandle: boolean;
|
|
701
|
+
hasDisableSubcategorySort: boolean;
|
|
686
702
|
};
|
|
687
703
|
};
|
|
688
704
|
export declare const MinimalList: {
|
|
@@ -732,6 +748,7 @@ export declare const MinimalList: {
|
|
|
732
748
|
hasCategoryLayout: boolean;
|
|
733
749
|
hasTwoColumnHeader: boolean;
|
|
734
750
|
hasDragHandle: boolean;
|
|
751
|
+
hasDisableSubcategorySort: boolean;
|
|
735
752
|
};
|
|
736
753
|
};
|
|
737
754
|
export declare const EmptyList: {
|
|
@@ -778,6 +795,7 @@ export declare const EmptyList: {
|
|
|
778
795
|
hasCategoryLayout: boolean;
|
|
779
796
|
hasTwoColumnHeader: boolean;
|
|
780
797
|
hasDragHandle: boolean;
|
|
798
|
+
hasDisableSubcategorySort: boolean;
|
|
781
799
|
};
|
|
782
800
|
};
|
|
783
801
|
export declare const WithoutHeaderImage: {
|
|
@@ -827,6 +845,7 @@ export declare const WithoutHeaderImage: {
|
|
|
827
845
|
hasCategoryLayout: boolean;
|
|
828
846
|
hasTwoColumnHeader: boolean;
|
|
829
847
|
hasDragHandle: boolean;
|
|
848
|
+
hasDisableSubcategorySort: boolean;
|
|
830
849
|
};
|
|
831
850
|
};
|
|
832
851
|
export declare const CustomColumnSpan: {
|
|
@@ -877,6 +896,7 @@ export declare const CustomColumnSpan: {
|
|
|
877
896
|
hasCategoryLayout: boolean;
|
|
878
897
|
hasTwoColumnHeader: boolean;
|
|
879
898
|
hasDragHandle: boolean;
|
|
899
|
+
hasDisableSubcategorySort: boolean;
|
|
880
900
|
};
|
|
881
901
|
};
|
|
882
902
|
export declare const HasAccordion: {
|
|
@@ -933,6 +953,7 @@ export declare const HasAccordion: {
|
|
|
933
953
|
hasCategoryLayout: boolean;
|
|
934
954
|
hasTwoColumnHeader: boolean;
|
|
935
955
|
hasDragHandle: boolean;
|
|
956
|
+
hasDisableSubcategorySort: boolean;
|
|
936
957
|
};
|
|
937
958
|
};
|
|
938
959
|
export declare const WithContent: {
|
|
@@ -1008,6 +1029,7 @@ export declare const TitleSizeLg: {
|
|
|
1008
1029
|
hasCategoryLayout: boolean;
|
|
1009
1030
|
hasTwoColumnHeader: boolean;
|
|
1010
1031
|
hasDragHandle: boolean;
|
|
1032
|
+
hasDisableSubcategorySort: boolean;
|
|
1011
1033
|
};
|
|
1012
1034
|
};
|
|
1013
1035
|
export declare const HeaderAlignFlexStart: {
|
|
@@ -1058,6 +1080,7 @@ export declare const HeaderAlignFlexStart: {
|
|
|
1058
1080
|
subcategoryList: any[];
|
|
1059
1081
|
hasCategoryLayout: boolean;
|
|
1060
1082
|
hasDragHandle: boolean;
|
|
1083
|
+
hasDisableSubcategorySort: boolean;
|
|
1061
1084
|
};
|
|
1062
1085
|
};
|
|
1063
1086
|
export declare const WithHeaderBackButton: {
|
|
@@ -1106,6 +1129,7 @@ export declare const WithHeaderBackButton: {
|
|
|
1106
1129
|
hasCategoryLayout: boolean;
|
|
1107
1130
|
hasTwoColumnHeader: boolean;
|
|
1108
1131
|
hasDragHandle: boolean;
|
|
1132
|
+
hasDisableSubcategorySort: boolean;
|
|
1109
1133
|
};
|
|
1110
1134
|
};
|
|
1111
1135
|
export declare const WithHeaderRightContent: {
|
|
@@ -1156,6 +1180,7 @@ export declare const WithHeaderRightContent: {
|
|
|
1156
1180
|
subcategoryList: any[];
|
|
1157
1181
|
hasCategoryLayout: boolean;
|
|
1158
1182
|
hasDragHandle: boolean;
|
|
1183
|
+
hasDisableSubcategorySort: boolean;
|
|
1159
1184
|
};
|
|
1160
1185
|
};
|
|
1161
1186
|
export declare const WithMiddleTitleAndStatus: {
|
|
@@ -1205,6 +1230,7 @@ export declare const WithMiddleTitleAndStatus: {
|
|
|
1205
1230
|
hasCategoryLayout: boolean;
|
|
1206
1231
|
hasTwoColumnHeader: boolean;
|
|
1207
1232
|
hasDragHandle: boolean;
|
|
1233
|
+
hasDisableSubcategorySort: boolean;
|
|
1208
1234
|
};
|
|
1209
1235
|
};
|
|
1210
1236
|
export declare const StatusInactive: {
|
|
@@ -1254,6 +1280,7 @@ export declare const StatusInactive: {
|
|
|
1254
1280
|
hasCategoryLayout: boolean;
|
|
1255
1281
|
hasTwoColumnHeader: boolean;
|
|
1256
1282
|
hasDragHandle: boolean;
|
|
1283
|
+
hasDisableSubcategorySort: boolean;
|
|
1257
1284
|
};
|
|
1258
1285
|
};
|
|
1259
1286
|
export declare const WithSubcategories: {
|
|
@@ -1320,6 +1347,7 @@ export declare const WithSubcategories: {
|
|
|
1320
1347
|
hasCategoryLayout: boolean;
|
|
1321
1348
|
hasTwoColumnHeader: boolean;
|
|
1322
1349
|
hasDragHandle: boolean;
|
|
1350
|
+
hasDisableSubcategorySort: boolean;
|
|
1323
1351
|
};
|
|
1324
1352
|
};
|
|
1325
1353
|
export declare const WithPrimaryButtonIcon: {
|
|
@@ -1366,6 +1394,7 @@ export declare const WithPrimaryButtonIcon: {
|
|
|
1366
1394
|
hasCategoryLayout: boolean;
|
|
1367
1395
|
hasTwoColumnHeader: boolean;
|
|
1368
1396
|
hasDragHandle: boolean;
|
|
1397
|
+
hasDisableSubcategorySort: boolean;
|
|
1369
1398
|
};
|
|
1370
1399
|
};
|
|
1371
1400
|
export declare const NoContentSidePadding: {
|
|
@@ -1412,6 +1441,7 @@ export declare const NoContentSidePadding: {
|
|
|
1412
1441
|
hasCategoryLayout: boolean;
|
|
1413
1442
|
hasTwoColumnHeader: boolean;
|
|
1414
1443
|
hasDragHandle: boolean;
|
|
1444
|
+
hasDisableSubcategorySort: boolean;
|
|
1415
1445
|
};
|
|
1416
1446
|
};
|
|
1417
1447
|
export declare const HeaderAndContentOnly: {
|
|
@@ -1458,6 +1488,7 @@ export declare const HeaderAndContentOnly: {
|
|
|
1458
1488
|
hasCategoryLayout: boolean;
|
|
1459
1489
|
hasTwoColumnHeader: boolean;
|
|
1460
1490
|
hasDragHandle: boolean;
|
|
1491
|
+
hasDisableSubcategorySort: boolean;
|
|
1461
1492
|
};
|
|
1462
1493
|
};
|
|
1463
1494
|
export declare const Complete: {
|
|
@@ -1511,5 +1542,6 @@ export declare const Complete: {
|
|
|
1511
1542
|
subcategoryList: any[];
|
|
1512
1543
|
hasCategoryLayout: boolean;
|
|
1513
1544
|
hasDragHandle: boolean;
|
|
1545
|
+
hasDisableSubcategorySort: boolean;
|
|
1514
1546
|
};
|
|
1515
1547
|
};
|
|
@@ -82,6 +82,7 @@ var defaultArgs = {
|
|
|
82
82
|
hasCategoryLayout: false,
|
|
83
83
|
hasTwoColumnHeader: false,
|
|
84
84
|
hasDragHandle: false,
|
|
85
|
+
hasDisableSubcategorySort: false,
|
|
85
86
|
};
|
|
86
87
|
exports.default = {
|
|
87
88
|
title: 'Components/DescriptionCard',
|
|
@@ -121,6 +122,10 @@ exports.default = {
|
|
|
121
122
|
control: 'boolean',
|
|
122
123
|
description: 'Sürükle tutamacı ile sıralama',
|
|
123
124
|
},
|
|
125
|
+
hasDisableSubcategorySort: {
|
|
126
|
+
control: 'boolean',
|
|
127
|
+
description: 'Alt kategori sıralamasını kapatır',
|
|
128
|
+
},
|
|
124
129
|
hasTwoColumnHeader: {
|
|
125
130
|
control: 'boolean',
|
|
126
131
|
description: "Header grid'ini `1fr auto` olarak sabitler",
|
|
@@ -345,7 +350,7 @@ var CategoryStructureDemo = function () {
|
|
|
345
350
|
return (0, sortable_1.arrayMove)(list, from, to);
|
|
346
351
|
});
|
|
347
352
|
};
|
|
348
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: { display: "flex", flexDirection: "column", gap: "1rem", maxWidth: "1050px", width: "100%" } }, { children: [(0, jsx_runtime_1.jsxs)(CategoryListHeader, { children: [(0, jsx_runtime_1.jsx)("span", { children: "Kategori ad\u0131" }), (0, jsx_runtime_1.jsx)(CategoryListHeaderCount, { children: "\u00DCr\u00FCn say\u0131s\u0131" }), (0, jsx_runtime_1.jsx)(CategoryListHeaderStatus, { children: "Kategori durumu" }), (0, jsx_runtime_1.jsx)(CategoryListHeaderAction, {})] }), (0, jsx_runtime_1.jsx)(core_1.DndContext, __assign({ sensors: sensors, collisionDetection: core_1.closestCenter, modifiers: [modifiers_1.restrictToVerticalAxis], onDragEnd: handleCategoryDragEnd }, { children: (0, jsx_runtime_1.jsx)(sortable_1.SortableContext, __assign({ items: categoryIds, strategy: sortable_1.verticalListSortingStrategy }, { children: categories.map(function (category) { return ((0, jsx_runtime_1.jsx)(SortableDescriptionCard_1.default, { id: category.id, title: category.title, headerImage: defaultHeaderImage, middleTitle: category.middleTitle, status: category.status, hasCategoryLayout: true, hasHeader: true, hasRounded: true, hasShadow: true, hasHeaderBorder: category.hasHeaderBorder, hasHeaderButton: true, hasHeaderDropdown: true, headerButtonText: "D\u00FCzenle", headerButtonAction: function () { return console.log("category edit"); }, onHeaderClick: function () { return console.log("category navigate"); }, headerButtonWidth: "120px", dropdownList: categoryDropdownList, dropdownWidth: "200px", list: [], hasNoContentSidePadding: false, subcategoryList: category.subcategoryList, onSubcategoryReorder: function (from, to) {
|
|
353
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: { display: "flex", flexDirection: "column", gap: "1rem", maxWidth: "1050px", width: "100%" } }, { children: [(0, jsx_runtime_1.jsxs)(CategoryListHeader, { children: [(0, jsx_runtime_1.jsx)("span", { children: "Kategori ad\u0131" }), (0, jsx_runtime_1.jsx)(CategoryListHeaderCount, { children: "\u00DCr\u00FCn say\u0131s\u0131" }), (0, jsx_runtime_1.jsx)(CategoryListHeaderStatus, { children: "Kategori durumu" }), (0, jsx_runtime_1.jsx)(CategoryListHeaderAction, {})] }), (0, jsx_runtime_1.jsx)(core_1.DndContext, __assign({ sensors: sensors, collisionDetection: core_1.closestCenter, modifiers: [modifiers_1.restrictToVerticalAxis], onDragEnd: handleCategoryDragEnd }, { children: (0, jsx_runtime_1.jsx)(sortable_1.SortableContext, __assign({ items: categoryIds, strategy: sortable_1.verticalListSortingStrategy }, { children: categories.map(function (category) { return ((0, jsx_runtime_1.jsx)(SortableDescriptionCard_1.default, { id: category.id, title: category.title, headerImage: defaultHeaderImage, middleTitle: category.middleTitle, status: category.status, hasCategoryLayout: true, hasHeader: true, hasRounded: true, hasShadow: true, hasHeaderBorder: category.hasHeaderBorder, hasHeaderButton: true, hasHeaderDropdown: true, headerButtonText: "D\u00FCzenle", headerButtonAction: function () { return console.log("category edit"); }, onHeaderClick: function () { return console.log("category navigate"); }, headerButtonWidth: "120px", dropdownList: categoryDropdownList, dropdownWidth: "200px", list: [], hasNoContentSidePadding: false, subcategoryList: category.subcategoryList, hasDisableSubcategorySort: category.subcategoryList.length === 1, onSubcategoryReorder: function (from, to) {
|
|
349
354
|
setCategories(function (list) { return list.map(function (item) { return (item.id === category.id
|
|
350
355
|
? __assign(__assign({}, item), { subcategoryList: (0, sortable_1.arrayMove)(item.subcategoryList, from, to) }) : item); }); });
|
|
351
356
|
} }, category.id)); }) })) }))] })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from './props';
|
|
3
|
-
declare const Input: ({ hasError, disabled, label, customLinkText, customLinkHref, onCustomLinkClick, onChange, errorMessage, type, name, width, mask, placeholder, hasCopyButton, readOnly, autoFocus, value, format, visible, infoText, tooltipText, tooltipWidth, id, isClearable, onClear, hasNumericFormat, inline, minDate, maxDate, filterDate, onCalendarOpen, maxLength, showMaxLengthCounter, description, ...other }: InputProps) => React.JSX.Element;
|
|
3
|
+
declare const Input: ({ hasError, disabled, label, customLinkText, customLinkHref, onCustomLinkClick, onChange, errorMessage, type, name, width, mask, placeholder, hasCopyButton, readOnly, autoFocus, value, format, visible, infoText, tooltipText, tooltipWidth, id, isClearable, onClear, hasNumericFormat, decimalSeparator, thousandSeparator, inline, minDate, maxDate, filterDate, onCalendarOpen, maxLength, showMaxLengthCounter, description, ...other }: InputProps) => React.JSX.Element;
|
|
4
4
|
export default Input;
|
|
@@ -40,21 +40,21 @@ var locale_1 = require("date-fns/locale");
|
|
|
40
40
|
var useDatePickerCalendar_1 = require("./hooks/useDatePickerCalendar");
|
|
41
41
|
var datePicker_1 = require("./utils/datePicker");
|
|
42
42
|
var Input = function (_a) {
|
|
43
|
-
var _b = _a.hasError, hasError = _b === void 0 ? props_1.InputDefault.hasError : _b, _c = _a.disabled, disabled = _c === void 0 ? props_1.InputDefault.disabled : _c, _d = _a.label, label = _d === void 0 ? props_1.InputDefault.label : _d, _e = _a.customLinkText, customLinkText = _e === void 0 ? props_1.InputDefault.customLinkText : _e, _f = _a.customLinkHref, customLinkHref = _f === void 0 ? props_1.InputDefault.customLinkHref : _f, _g = _a.onCustomLinkClick, onCustomLinkClick = _g === void 0 ? props_1.InputDefault.onCustomLinkClick : _g, _h = _a.onChange, onChange = _h === void 0 ? props_1.InputDefault.onChange : _h, _j = _a.errorMessage, errorMessage = _j === void 0 ? props_1.InputDefault.errorMessage : _j, _k = _a.type, type = _k === void 0 ? props_1.InputDefault.type : _k, _l = _a.name, name = _l === void 0 ? props_1.InputDefault.name : _l, _m = _a.width, width = _m === void 0 ? props_1.InputDefault.width : _m, _o = _a.mask, mask = _o === void 0 ? props_1.InputDefault.mask : _o, _p = _a.placeholder, placeholder = _p === void 0 ? props_1.InputDefault.placeholder : _p, _q = _a.hasCopyButton, hasCopyButton = _q === void 0 ? props_1.InputDefault.hasCopyButton : _q, _r = _a.readOnly, readOnly = _r === void 0 ? props_1.InputDefault.readOnly : _r, _s = _a.autoFocus, autoFocus = _s === void 0 ? props_1.InputDefault.autoFocus : _s, value = _a.value, _t = _a.format, format = _t === void 0 ? props_1.InputDefault.format : _t, _u = _a.visible, visible = _u === void 0 ? props_1.InputDefault.visible : _u, _v = _a.infoText, infoText = _v === void 0 ? props_1.InputDefault.infoText : _v, _w = _a.tooltipText, tooltipText = _w === void 0 ? props_1.InputDefault.tooltipText : _w, _x = _a.tooltipWidth, tooltipWidth = _x === void 0 ? props_1.InputDefault.tooltipWidth : _x, _y = _a.id, id = _y === void 0 ? props_1.InputDefault.id : _y, _z = _a.isClearable, isClearable = _z === void 0 ? props_1.InputDefault.isClearable : _z, _0 = _a.onClear, onClear = _0 === void 0 ? props_1.InputDefault.onClear : _0, _1 = _a.hasNumericFormat, hasNumericFormat = _1 === void 0 ? props_1.InputDefault.hasNumericFormat : _1, _2 = _a.
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
43
|
+
var _b = _a.hasError, hasError = _b === void 0 ? props_1.InputDefault.hasError : _b, _c = _a.disabled, disabled = _c === void 0 ? props_1.InputDefault.disabled : _c, _d = _a.label, label = _d === void 0 ? props_1.InputDefault.label : _d, _e = _a.customLinkText, customLinkText = _e === void 0 ? props_1.InputDefault.customLinkText : _e, _f = _a.customLinkHref, customLinkHref = _f === void 0 ? props_1.InputDefault.customLinkHref : _f, _g = _a.onCustomLinkClick, onCustomLinkClick = _g === void 0 ? props_1.InputDefault.onCustomLinkClick : _g, _h = _a.onChange, onChange = _h === void 0 ? props_1.InputDefault.onChange : _h, _j = _a.errorMessage, errorMessage = _j === void 0 ? props_1.InputDefault.errorMessage : _j, _k = _a.type, type = _k === void 0 ? props_1.InputDefault.type : _k, _l = _a.name, name = _l === void 0 ? props_1.InputDefault.name : _l, _m = _a.width, width = _m === void 0 ? props_1.InputDefault.width : _m, _o = _a.mask, mask = _o === void 0 ? props_1.InputDefault.mask : _o, _p = _a.placeholder, placeholder = _p === void 0 ? props_1.InputDefault.placeholder : _p, _q = _a.hasCopyButton, hasCopyButton = _q === void 0 ? props_1.InputDefault.hasCopyButton : _q, _r = _a.readOnly, readOnly = _r === void 0 ? props_1.InputDefault.readOnly : _r, _s = _a.autoFocus, autoFocus = _s === void 0 ? props_1.InputDefault.autoFocus : _s, value = _a.value, _t = _a.format, format = _t === void 0 ? props_1.InputDefault.format : _t, _u = _a.visible, visible = _u === void 0 ? props_1.InputDefault.visible : _u, _v = _a.infoText, infoText = _v === void 0 ? props_1.InputDefault.infoText : _v, _w = _a.tooltipText, tooltipText = _w === void 0 ? props_1.InputDefault.tooltipText : _w, _x = _a.tooltipWidth, tooltipWidth = _x === void 0 ? props_1.InputDefault.tooltipWidth : _x, _y = _a.id, id = _y === void 0 ? props_1.InputDefault.id : _y, _z = _a.isClearable, isClearable = _z === void 0 ? props_1.InputDefault.isClearable : _z, _0 = _a.onClear, onClear = _0 === void 0 ? props_1.InputDefault.onClear : _0, _1 = _a.hasNumericFormat, hasNumericFormat = _1 === void 0 ? props_1.InputDefault.hasNumericFormat : _1, _2 = _a.decimalSeparator, decimalSeparator = _2 === void 0 ? props_1.InputDefault.decimalSeparator : _2, _3 = _a.thousandSeparator, thousandSeparator = _3 === void 0 ? props_1.InputDefault.thousandSeparator : _3, _4 = _a.inline, inline = _4 === void 0 ? props_1.InputDefault.inline : _4, _5 = _a.minDate, minDate = _5 === void 0 ? props_1.InputDefault.minDate : _5, _6 = _a.maxDate, maxDate = _6 === void 0 ? props_1.InputDefault.maxDate : _6, _7 = _a.filterDate, filterDate = _7 === void 0 ? props_1.InputDefault.filterDate : _7, _8 = _a.onCalendarOpen, onCalendarOpen = _8 === void 0 ? props_1.InputDefault.onCalendarOpen : _8, _9 = _a.maxLength, maxLength = _9 === void 0 ? props_1.InputDefault.maxLength : _9, _10 = _a.showMaxLengthCounter, showMaxLengthCounter = _10 === void 0 ? props_1.InputDefault.showMaxLengthCounter : _10, _11 = _a.description, description = _11 === void 0 ? props_1.InputDefault.description : _11, other = __rest(_a, ["hasError", "disabled", "label", "customLinkText", "customLinkHref", "onCustomLinkClick", "onChange", "errorMessage", "type", "name", "width", "mask", "placeholder", "hasCopyButton", "readOnly", "autoFocus", "value", "format", "visible", "infoText", "tooltipText", "tooltipWidth", "id", "isClearable", "onClear", "hasNumericFormat", "decimalSeparator", "thousandSeparator", "inline", "minDate", "maxDate", "filterDate", "onCalendarOpen", "maxLength", "showMaxLengthCounter", "description"]);
|
|
44
|
+
var _12 = (0, react_1.useState)(type), inputType = _12[0], setInputType = _12[1];
|
|
45
|
+
var _13 = (0, react_1.useState)(false), alert = _13[0], setAlert = _13[1];
|
|
46
|
+
var _14 = (0, react_1.useState)(value), inputValue = _14[0], setInputValue = _14[1];
|
|
47
|
+
var _15 = (0, react_1.useState)(false), isFocused = _15[0], setIsFocused = _15[1];
|
|
48
|
+
var _16 = (0, react_1.useState)(function () { return (0, datePicker_1.parseDateValue)(value, format); }), startDate = _16[0], setStartDate = _16[1];
|
|
49
49
|
var inputRef = (0, react_1.useRef)(null);
|
|
50
50
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
51
51
|
var language = i18n_1.default.language;
|
|
52
|
-
var
|
|
52
|
+
var _17 = (0, useDatePickerCalendar_1.useDatePickerCalendar)({
|
|
53
53
|
disabled: disabled,
|
|
54
54
|
inline: inline,
|
|
55
55
|
onCalendarOpen: onCalendarOpen,
|
|
56
56
|
readOnly: readOnly,
|
|
57
|
-
}), calendarControlProps =
|
|
57
|
+
}), calendarControlProps = _17.calendarControlProps, dateInputRef = _17.dateInputRef, datePickerRef = _17.datePickerRef, isCalendarOpen = _17.isCalendarOpen;
|
|
58
58
|
(0, react_1.useEffect)(function () {
|
|
59
59
|
setInputType(type);
|
|
60
60
|
}, [type]);
|
|
@@ -105,6 +105,7 @@ var Input = function (_a) {
|
|
|
105
105
|
var handleFocus = function () { return setIsFocused(true); };
|
|
106
106
|
var handleBlur = function () { return setIsFocused(false); };
|
|
107
107
|
var isControlled = value !== undefined;
|
|
108
|
+
var numericThousandSeparator = thousandSeparator === true && decimalSeparator === ',' ? '.' : thousandSeparator;
|
|
108
109
|
var fieldValue = isControlled ? value : (inputValue !== null && inputValue !== void 0 ? inputValue : '');
|
|
109
110
|
var fieldValueRef = (0, react_1.useRef)(fieldValue);
|
|
110
111
|
fieldValueRef.current = fieldValue;
|
|
@@ -165,7 +166,7 @@ var Input = function (_a) {
|
|
|
165
166
|
var showCharCount = showMaxLengthCounter && maxLength != null;
|
|
166
167
|
var showTopRow = Boolean(label || customLinkText || showCharCount);
|
|
167
168
|
var hasInputIcon = (isClearable && fieldValue) || ['password', 'date'].includes(type) || hasCopyButton || infoText;
|
|
168
|
-
return ((0, jsx_runtime_1.jsxs)(Input_styled_1.Container, __assign({ "$width": width }, { children: [showTopRow && ((0, jsx_runtime_1.jsxs)(Input_styled_1.FieldTop, { children: [label ? (0, jsx_runtime_1.jsx)(Input_styled_1.FieldLabel, __assign({ htmlFor: id }, { children: label })) : (0, jsx_runtime_1.jsx)("span", {}), (0, jsx_runtime_1.jsxs)(Input_styled_1.FieldTopActions, { children: [showCharCount && ((0, jsx_runtime_1.jsxs)(Input_styled_1.CharCount, { children: [currentLength, "/", maxLength] })), customLinkText && ((0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({}, (customLinkHref && { href: customLinkHref }), { onClick: onCustomLinkClick }, { children: customLinkText })))] })] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "input" }, { children: [hasNumericFormat ? ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, __assign({ "$hasError": hasError, disabled: disabled, onChange: onChange, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, maxLength: maxLength }, other, { customInput: Input_styled_1.InputStyled, id: id, onFocus: handleFocus, onBlur: handleBlur }))) : mask && format ? ((0, jsx_runtime_1.jsx)(react_number_format_1.PatternFormat, __assign({ "$hasError": hasError, disabled: disabled, onChange: onChange, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, maxLength: maxLength }, other, { format: format, mask: mask, customInput: Input_styled_1.InputStyled, id: id, onFocus: handleFocus, onBlur: handleBlur }))) : type === 'date' ? ((0, jsx_runtime_1.jsx)(Input_styled_1.DatePickerWrapperStyled, __assign({ "$inline": inline }, { children: (0, jsx_runtime_1.jsx)(react_datepicker_1.default, __assign({ placeholderText: placeholder, disabled: disabled, name: name, readOnly: readOnly, autoFocus: autoFocus, onChange: handleDateChange, selected: startDate, ref: datePickerRef, id: id, dateFormat: "yyyy-MM-dd", locale: language === 'tr' ? locale_1.tr : locale_1.enGB, customInput: (0, jsx_runtime_1.jsx)(CustomDateInput, {}), inline: inline, minDate: minDate, maxDate: maxDate, filterDate: filterDate, renderCustomHeader: function (_a) {
|
|
169
|
+
return ((0, jsx_runtime_1.jsxs)(Input_styled_1.Container, __assign({ "$width": width }, { children: [showTopRow && ((0, jsx_runtime_1.jsxs)(Input_styled_1.FieldTop, { children: [label ? (0, jsx_runtime_1.jsx)(Input_styled_1.FieldLabel, __assign({ htmlFor: id }, { children: label })) : (0, jsx_runtime_1.jsx)("span", {}), (0, jsx_runtime_1.jsxs)(Input_styled_1.FieldTopActions, { children: [showCharCount && ((0, jsx_runtime_1.jsxs)(Input_styled_1.CharCount, { children: [currentLength, "/", maxLength] })), customLinkText && ((0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({}, (customLinkHref && { href: customLinkHref }), { onClick: onCustomLinkClick }, { children: customLinkText })))] })] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "input" }, { children: [hasNumericFormat ? ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, __assign({ "$hasError": hasError, disabled: disabled, onChange: onChange, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, maxLength: maxLength }, other, { decimalSeparator: decimalSeparator, thousandSeparator: numericThousandSeparator, allowedDecimalSeparators: [decimalSeparator, '.'], customInput: Input_styled_1.InputStyled, id: id, onFocus: handleFocus, onBlur: handleBlur }))) : mask && format ? ((0, jsx_runtime_1.jsx)(react_number_format_1.PatternFormat, __assign({ "$hasError": hasError, disabled: disabled, onChange: onChange, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, maxLength: maxLength }, other, { format: format, mask: mask, customInput: Input_styled_1.InputStyled, id: id, onFocus: handleFocus, onBlur: handleBlur }))) : type === 'date' ? ((0, jsx_runtime_1.jsx)(Input_styled_1.DatePickerWrapperStyled, __assign({ "$inline": inline }, { children: (0, jsx_runtime_1.jsx)(react_datepicker_1.default, __assign({ placeholderText: placeholder, disabled: disabled, name: name, readOnly: readOnly, autoFocus: autoFocus, onChange: handleDateChange, selected: startDate, ref: datePickerRef, id: id, dateFormat: "yyyy-MM-dd", locale: language === 'tr' ? locale_1.tr : locale_1.enGB, customInput: (0, jsx_runtime_1.jsx)(CustomDateInput, {}), inline: inline, minDate: minDate, maxDate: maxDate, filterDate: filterDate, renderCustomHeader: function (_a) {
|
|
169
170
|
var monthDate = _a.monthDate, decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, decreaseYear = _a.decreaseYear, increaseYear = _a.increaseYear, prevMonthButtonDisabled = _a.prevMonthButtonDisabled, nextMonthButtonDisabled = _a.nextMonthButtonDisabled, prevYearButtonDisabled = _a.prevYearButtonDisabled, nextYearButtonDisabled = _a.nextYearButtonDisabled;
|
|
170
171
|
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "headerTopContent" }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "leftButtons" }, { children: [(0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Previous Year", className: "react-datepicker__navigation react-datepicker__navigation--previous", onClick: decreaseYear, type: "button", disabled: prevYearButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "CalenderArrowleftsmall" }) })), (0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Previous Month", className: "react-datepicker__navigation react-datepicker__navigation--previous", onClick: decreaseMonth, type: "button", disabled: prevMonthButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowSmallLeft" }) }))] })), (0, jsx_runtime_1.jsxs)("span", __assign({ className: "react-datepicker__current-month" }, { children: [monthDate.toLocaleString(language === 'tr' ? 'tr-TR' : 'en-GB', { month: 'long' }), ",", ' ', monthDate.toLocaleString(language === 'tr' ? 'tr-TR' : 'en-GB', { year: 'numeric' })] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "rightButtons" }, { children: [(0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Next Month", className: "react-datepicker__navigation react-datepicker__navigation--next", onClick: increaseMonth, type: "button", disabled: nextMonthButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowSmallRight" }) })), (0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Next Year", className: "react-datepicker__navigation react-datepicker__navigation--next", onClick: increaseYear, type: "button", disabled: nextYearButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "Calenderarrowrightsmall" }) }))] }))] })));
|
|
171
172
|
} }, calendarControlProps)) }))) : ((0, jsx_runtime_1.jsx)(Input_styled_1.InputStyled, __assign({ ref: inputRef, type: inputType, "$hasError": hasError, disabled: disabled, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: fieldValue, id: id, maxLength: maxLength, "$hasIcon": hasInputIcon }, other, { onKeyDown: rememberSelection, onSelect: rememberSelection, onMouseUp: rememberSelection, onFocus: handleFocus, onBlur: handleBlur, onChange: handleTextChange }))), isClearable && fieldValue ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: handleClearValue, className: "removeIcon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--dark)", name: "Closebig" }) }))) : type === 'password' ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: toggleInputType, className: "inputIcon hasNoBg" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--dark-opacity-50)", name: inputType === 'password' ? 'Show' : 'Hide' }) }))) : type === 'date' && !inline ? ((0, jsx_runtime_1.jsx)("div", __assign({ className: "inputIcon hasNoBg hasNoCursor" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--grey-50)", name: "Calendar" }) }))) : (hasCopyButton && ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: copyToClipboard, className: "inputIcon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--primary)", name: "Copy" }) })))), infoText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "inputIcon hasNoBg" }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, __assign({ popupSize: "small", position: "topRight", popupWidth: "160px", popupRight: "-10px", iconWidth: "24px", iconHeight: "24px" }, { children: (0, jsx_runtime_1.jsx)(Input_styled_1.PopupText, { dangerouslySetInnerHTML: { __html: infoText } }) })) }))), tooltipText && ((0, jsx_runtime_1.jsx)(Input_styled_1.FocusTooltip, __assign({ "$isOpen": isFocused, "$maxWidth": tooltipWidth }, { children: (0, jsx_runtime_1.jsx)(Input_styled_1.PopupText, { dangerouslySetInnerHTML: { __html: tooltipText } }) }))), (0, jsx_runtime_1.jsx)(Input_styled_1.AlertStyled, __assign({ "$visible": alert }, { children: t('copied') }))] })), hasError && errorMessage && ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "error" }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "SwitchPassive" }), (0, jsx_runtime_1.jsx)("p", { children: errorMessage })] }))), description && (0, jsx_runtime_1.jsx)(Input_styled_1.FieldDescription, { children: description })] })));
|
|
@@ -184,4 +184,24 @@ describe('Input', function () {
|
|
|
184
184
|
expect(onChange).toHaveBeenCalled();
|
|
185
185
|
expect(react_2.screen.getByDisplayValue('ABCD')).toBeInTheDocument();
|
|
186
186
|
});
|
|
187
|
+
it('accepts a comma as decimal separator in numeric format', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
+
var input;
|
|
189
|
+
return __generator(this, function (_a) {
|
|
190
|
+
switch (_a.label) {
|
|
191
|
+
case 0:
|
|
192
|
+
renderInput({
|
|
193
|
+
hasNumericFormat: true,
|
|
194
|
+
label: null,
|
|
195
|
+
placeholder: 'Fiyat',
|
|
196
|
+
mask: null,
|
|
197
|
+
});
|
|
198
|
+
input = react_2.screen.getByPlaceholderText('Fiyat');
|
|
199
|
+
return [4 /*yield*/, user_event_1.default.type(input, '12,5')];
|
|
200
|
+
case 1:
|
|
201
|
+
_a.sent();
|
|
202
|
+
expect(input).toHaveValue('12,5');
|
|
203
|
+
return [2 /*return*/];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}); });
|
|
187
207
|
});
|
|
@@ -22,6 +22,9 @@ export interface Input {
|
|
|
22
22
|
format?: string;
|
|
23
23
|
visible?: boolean;
|
|
24
24
|
hasNumericFormat?: boolean;
|
|
25
|
+
/** Ondalık ayırıcı. Sayısal formatta varsayılan virgüldür (TR fiyat). */
|
|
26
|
+
decimalSeparator?: string;
|
|
27
|
+
thousandSeparator?: boolean | string;
|
|
25
28
|
infoText?: string;
|
|
26
29
|
tooltipText?: string;
|
|
27
30
|
tooltipWidth?: string;
|
|
@@ -343,6 +343,23 @@ export declare const NumericFormat: {
|
|
|
343
343
|
onChange: (e: any) => void;
|
|
344
344
|
};
|
|
345
345
|
};
|
|
346
|
+
export declare const PriceFormat: {
|
|
347
|
+
args: {
|
|
348
|
+
placeholder: string;
|
|
349
|
+
label: string;
|
|
350
|
+
hasError: boolean;
|
|
351
|
+
disabled: boolean;
|
|
352
|
+
readOnly: boolean;
|
|
353
|
+
isClearable: boolean;
|
|
354
|
+
hasNumericFormat: boolean;
|
|
355
|
+
decimalSeparator: string;
|
|
356
|
+
thousandSeparator: string;
|
|
357
|
+
type: string;
|
|
358
|
+
infoText: any;
|
|
359
|
+
id: string;
|
|
360
|
+
onChange: (e: any) => void;
|
|
361
|
+
};
|
|
362
|
+
};
|
|
346
363
|
export declare const PatternFormat: {
|
|
347
364
|
args: {
|
|
348
365
|
placeholder: string;
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Interactive = exports.PercentageMaskWithValue = exports.PercentageMask = exports.WithMaxLengthAndDescription = exports.ErrorWithCustomLink = exports.Complete = exports.CustomWidth = exports.Number = exports.Tel = exports.Email = exports.PatternFormatWithValue = exports.PatternFormat = exports.NumericFormat = exports.WithTooltip = exports.WithInfoText = exports.Clearable = exports.WithCopyButton = exports.DateWithMinMax = exports.DateInline = exports.DateInput = exports.PasswordWithValue = exports.Password = exports.WithCustomLink = exports.ReadOnly = exports.Disabled = exports.WithError = exports.WithLabel = exports.WithValue = exports.Empty = exports.Default = void 0;
|
|
17
|
+
exports.Interactive = exports.PercentageMaskWithValue = exports.PercentageMask = exports.WithMaxLengthAndDescription = exports.ErrorWithCustomLink = exports.Complete = exports.CustomWidth = exports.Number = exports.Tel = exports.Email = exports.PatternFormatWithValue = exports.PatternFormat = exports.PriceFormat = exports.NumericFormat = exports.WithTooltip = exports.WithInfoText = exports.Clearable = exports.WithCopyButton = exports.DateWithMinMax = exports.DateInline = exports.DateInput = exports.PasswordWithValue = exports.Password = exports.WithCustomLink = exports.ReadOnly = exports.Disabled = exports.WithError = exports.WithLabel = exports.WithValue = exports.Empty = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var react_1 = __importDefault(require("react"));
|
|
20
20
|
var Input_1 = __importDefault(require("../Input"));
|
|
@@ -331,6 +331,25 @@ exports.NumericFormat = {
|
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
333
|
};
|
|
334
|
+
exports.PriceFormat = {
|
|
335
|
+
args: {
|
|
336
|
+
placeholder: "0,00",
|
|
337
|
+
label: "Fiyat",
|
|
338
|
+
hasError: false,
|
|
339
|
+
disabled: false,
|
|
340
|
+
readOnly: false,
|
|
341
|
+
isClearable: false,
|
|
342
|
+
hasNumericFormat: true,
|
|
343
|
+
decimalSeparator: ",",
|
|
344
|
+
thousandSeparator: ".",
|
|
345
|
+
type: "text",
|
|
346
|
+
infoText: null,
|
|
347
|
+
id: "input_price",
|
|
348
|
+
onChange: function (e) {
|
|
349
|
+
console.log(e, "onChange");
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
};
|
|
334
353
|
exports.PatternFormat = {
|
|
335
354
|
args: {
|
|
336
355
|
placeholder: "Enter phone number",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "krl-alfred",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
12
12
|
"@dnd-kit/sortable": "^10.0.0",
|
|
13
13
|
"@dnd-kit/utilities": "^3.2.2",
|
|
14
|
-
"@storybook/addon-docs": "10.
|
|
14
|
+
"@storybook/addon-docs": "10.4.6",
|
|
15
15
|
"@storybook/preset-scss": "^1.0.3",
|
|
16
16
|
"@swc/core": "1.5.7",
|
|
17
17
|
"@testing-library/jest-dom": "^5.16.5",
|
|
@@ -119,17 +119,17 @@
|
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@chromatic-com/storybook": "^4.1.3",
|
|
122
|
-
"@storybook/addon-links": "10.
|
|
123
|
-
"@storybook/cli": "10.
|
|
124
|
-
"@storybook/preset-create-react-app": "10.
|
|
125
|
-
"@storybook/react-webpack5": "10.
|
|
122
|
+
"@storybook/addon-links": "10.4.6",
|
|
123
|
+
"@storybook/cli": "10.4.6",
|
|
124
|
+
"@storybook/preset-create-react-app": "10.4.6",
|
|
125
|
+
"@storybook/react-webpack5": "10.4.6",
|
|
126
126
|
"@svgr/cli": "^7.0.0",
|
|
127
127
|
"@svgr/webpack": "^7.0.0",
|
|
128
128
|
"@types/dompurify": "^3.0.5",
|
|
129
129
|
"chromatic": "^18.1.0",
|
|
130
130
|
"next": "^16.0.10",
|
|
131
131
|
"semantic-release": "^21.1.2",
|
|
132
|
-
"storybook": "10.
|
|
132
|
+
"storybook": "10.4.6",
|
|
133
133
|
"storybook-i18n": "^10.0.3"
|
|
134
134
|
}
|
|
135
135
|
}
|