krl-alfred 2.17.53 → 2.17.55
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.
|
@@ -48,9 +48,9 @@ var ActionButton = function (_a) {
|
|
|
48
48
|
end: now
|
|
49
49
|
});
|
|
50
50
|
setMonths(deadline - now > 0 ? (0, date_fns_1.differenceInMonths)(deadline, now) : 0);
|
|
51
|
-
setDays(deadline - now > 0 ? isMonthVisible ? duration === null || duration === void 0 ? void 0 : duration.days : (0, date_fns_1.differenceInDays)(deadline, now) : 0);
|
|
52
|
-
setMinutes(deadline - now > 0 ? duration === null || duration === void 0 ? void 0 : duration.minutes : 0);
|
|
53
|
-
setHours(deadline - now > 0 ? duration === null || duration === void 0 ? void 0 : duration.hours : 0);
|
|
51
|
+
setDays(deadline - now > 0 ? isMonthVisible ? (duration === null || duration === void 0 ? void 0 : duration.days) * -1 : (0, date_fns_1.differenceInDays)(deadline, now) : 0);
|
|
52
|
+
setMinutes(deadline - now > 0 ? (duration === null || duration === void 0 ? void 0 : duration.minutes) * -1 : 0);
|
|
53
|
+
setHours(deadline - now > 0 ? (duration === null || duration === void 0 ? void 0 : duration.hours) * -1 : 0);
|
|
54
54
|
//setSecounds(deadline - now > 0 ? duration?.seconds : 0)
|
|
55
55
|
if (deadline - now < 0)
|
|
56
56
|
clearInterval(timer);
|
|
@@ -59,6 +59,6 @@ var ActionButton = function (_a) {
|
|
|
59
59
|
(0, react_1.useEffect)(function () {
|
|
60
60
|
count();
|
|
61
61
|
}, [date]);
|
|
62
|
-
return ((0, jsx_runtime_1.jsxs)(ActionButton_styled_1.ActionButtonStyled, __assign({ "$width": width, "$hasTimer": hasTimer, "$hasInfo": hasInfo }, other, { children: [hasInfo && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "actionInfoText" }, { children: infoText })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "dashedLine" }, { children: (0, jsx_runtime_1.jsxs)("svg", __assign({ viewBox: "0 0 335 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M10.0009 0C12.653 0 15.1966 1.05357 17.0719 2.92893C18.9473 4.8043 20.0009 7.34783 20.0009 10C20.0009 12.6522 18.9473 15.1957 17.0719 17.0711C15.1966 18.9464 12.653 20 10.0009 20L10.0009 10V0Z", fill: "white" }), (0, jsx_runtime_1.jsx)("path", { d: "M28.0009 9.5L306.999 10.4925", stroke: "white", "stroke-width": "6", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-dasharray": "12 12" }), (0, jsx_runtime_1.jsx)("path", { d: "M324.999 20C322.347 20 319.804 18.9464 317.928 17.0711C316.053 15.1957 314.999 12.6522 314.999 10C314.999 7.34784 316.053 4.8043 317.928 2.92893C319.804 1.05357 322.347 -3.16267e-08 324.999 0V10V20Z", fill: "white" })] })) }))] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "actionInner" }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "top" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "icon" }, { children: img })), (0, jsx_runtime_1.jsx)("strong", { className: "title", dangerouslySetInnerHTML: { __html: title } }), !hasTimer && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "xsmall", width: "32px", icon: "ArrowSmallRight", variant: "primary" }))] })), hasTimer && ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "bottom" }, { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "timer" }, { children: [isMonthVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children: months })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "timerDescription" }, { children: t('month') }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "dots" }, { children: ":" }))] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children: days })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "timerDescription" }, { children: t('day') }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "dots" }, { children: ":" })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children:
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)(ActionButton_styled_1.ActionButtonStyled, __assign({ "$width": width, "$hasTimer": hasTimer, "$hasInfo": hasInfo }, other, { children: [hasInfo && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "actionInfoText" }, { children: infoText })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "dashedLine" }, { children: (0, jsx_runtime_1.jsxs)("svg", __assign({ viewBox: "0 0 335 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M10.0009 0C12.653 0 15.1966 1.05357 17.0719 2.92893C18.9473 4.8043 20.0009 7.34783 20.0009 10C20.0009 12.6522 18.9473 15.1957 17.0719 17.0711C15.1966 18.9464 12.653 20 10.0009 20L10.0009 10V0Z", fill: "white" }), (0, jsx_runtime_1.jsx)("path", { d: "M28.0009 9.5L306.999 10.4925", stroke: "white", "stroke-width": "6", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-dasharray": "12 12" }), (0, jsx_runtime_1.jsx)("path", { d: "M324.999 20C322.347 20 319.804 18.9464 317.928 17.0711C316.053 15.1957 314.999 12.6522 314.999 10C314.999 7.34784 316.053 4.8043 317.928 2.92893C319.804 1.05357 322.347 -3.16267e-08 324.999 0V10V20Z", fill: "white" })] })) }))] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "actionInner" }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "top" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "icon" }, { children: img })), (0, jsx_runtime_1.jsx)("strong", { className: "title", dangerouslySetInnerHTML: { __html: title } }), !hasTimer && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "xsmall", width: "32px", icon: "ArrowSmallRight", variant: "primary" }))] })), hasTimer && ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "bottom" }, { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "timer" }, { children: [isMonthVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children: months })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "timerDescription" }, { children: t('month') }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "dots" }, { children: ":" }))] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children: days.toString().padStart(2, '0') })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "timerDescription" }, { children: t('day') }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "dots" }, { children: ":" })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children: hours.toString().padStart(2, '0') })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "timerDescription" }, { children: t('hour') }))] })), !isMonthVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "dots" }, { children: ":" })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "box" }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "timerTitle" }, { children: minutes.toString().padStart(2, '0') })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "timerDescription" }, { children: t('minute') }))] }))] }))] })), (0, jsx_runtime_1.jsx)(Button_1.default, { size: "xsmall", width: "32px", icon: "ArrowSmallRight", variant: "primary", isLoading: isLoading })] })] })))] }))] })));
|
|
63
63
|
};
|
|
64
64
|
exports.default = ActionButton;
|
|
@@ -110,7 +110,7 @@ var SelectBox = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
110
110
|
// Add +N indicator if there are additional selections
|
|
111
111
|
var additionalCount = selectedValues.length - 1;
|
|
112
112
|
var additionalText = additionalCount > 0 ? " (+".concat(additionalCount, ")") : '';
|
|
113
|
-
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "customSelect__multi-value" }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "customSelect__multi-value__label" }, { children: [(0, jsx_runtime_1.jsx)("span", { children: firstLabel }), (0, jsx_runtime_1.jsx)("span", { children: additionalText })] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "customSelect__multi-value__remove", onClick: function (e) {
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "customSelect__multi-value" }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "customSelect__multi-value__label" }, { children: [(0, jsx_runtime_1.jsx)("span", { children: firstLabel }), additionalText && (0, jsx_runtime_1.jsx)("span", { children: additionalText })] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "customSelect__multi-value__remove", onClick: function (e) {
|
|
114
114
|
e.stopPropagation();
|
|
115
115
|
// Use onChange to clear all selections
|
|
116
116
|
if (selectProps.onChange) {
|
|
@@ -122,6 +122,30 @@ var SelectBox = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
122
122
|
var ValueContainer = function (props) {
|
|
123
123
|
return ((0, jsx_runtime_1.jsx)(react_select_1.components.ValueContainer, __assign({}, props, { children: props.children })));
|
|
124
124
|
};
|
|
125
|
+
// Helper function to extract string label from option for search/filtering
|
|
126
|
+
var getOptionLabel = function (option) {
|
|
127
|
+
var _a, _b, _c, _d, _e;
|
|
128
|
+
if (!option)
|
|
129
|
+
return '';
|
|
130
|
+
// If label is a React component, try to extract text or use a fallback
|
|
131
|
+
if (react_1.default.isValidElement(option.label)) {
|
|
132
|
+
// For React components, try to get text content or use value as fallback
|
|
133
|
+
return ((_a = option.value) === null || _a === void 0 ? void 0 : _a.toString()) || '';
|
|
134
|
+
}
|
|
135
|
+
if (react_1.default.isValidElement(option.optionLabel)) {
|
|
136
|
+
return ((_b = option.value) === null || _b === void 0 ? void 0 : _b.toString()) || '';
|
|
137
|
+
}
|
|
138
|
+
// Return string label or optionLabel
|
|
139
|
+
return ((_c = option.optionLabel) === null || _c === void 0 ? void 0 : _c.toString()) || ((_d = option.label) === null || _d === void 0 ? void 0 : _d.toString()) || ((_e = option.value) === null || _e === void 0 ? void 0 : _e.toString()) || '';
|
|
140
|
+
};
|
|
141
|
+
// Wrapper for filterOption to handle React component labels
|
|
142
|
+
var wrappedFilterOption = filterOption ? function (option, inputValue) {
|
|
143
|
+
// Create a normalized option with string labels for filtering
|
|
144
|
+
var normalizedOption = __assign(__assign({}, option), { label: getOptionLabel(option), optionLabel: typeof option.optionLabel === 'string' ? option.optionLabel : getOptionLabel(option) });
|
|
145
|
+
return filterOption(normalizedOption, inputValue);
|
|
146
|
+
} : undefined;
|
|
147
|
+
// Remove filterOption from other to avoid duplicate props
|
|
148
|
+
var _5 = other, _ = _5.filterOption, restOther = __rest(_5, ["filterOption"]);
|
|
125
149
|
return ((0, jsx_runtime_1.jsxs)(SelectBox_styled_1.Container, __assign({ "$width": width, "$hasError": hasError, "$maxOptionListHeight": maxOptionListHeight, "$hasShowDropdownIcon": hasShowDropdownIcon, "$MenuPlacement": menuPlacement, "$size": size, "$isMulti": isMulti, "$menuPosition": menuPosition }, { children: [label && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "top" }, { children: (0, jsx_runtime_1.jsx)("label", __assign({ htmlFor: id }, { children: label })) }))), (0, jsx_runtime_1.jsx)("div", __assign({ className: "select" }, { children: isAsync ? ((0, jsx_runtime_1.jsx)(async_1.default, __assign({ components: {
|
|
126
150
|
Option: CustomOption,
|
|
127
151
|
Input: Input,
|
|
@@ -129,13 +153,13 @@ var SelectBox = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
129
153
|
MenuList: MenuList,
|
|
130
154
|
LoadingIndicator: LoadingIndicator,
|
|
131
155
|
MultiValue: MultiValue
|
|
132
|
-
}, options: options || [], instanceId: instanceId, filterOption:
|
|
156
|
+
}, options: options || [], instanceId: instanceId, getOptionLabel: getOptionLabel, filterOption: wrappedFilterOption, isSearchable: isSearchable, name: name, menuIsOpen: menuIsOpen, onChange: onChange, classNamePrefix: "customSelect", className: (0, classnames_1.default)("customSelect", (_b = {}, _b['isSearchable'] = isSearchable && hasShowSearchIcon, _b), (_c = {}, _c['lightBg'] = lightBg, _c)), placeholder: placeholder, noOptionsMessage: function () { return 'Sonuç bulunamadı'; }, loadingMessage: function () { return 'Sonuç bulunamadı'; }, captureMenuScroll: false, isClearable: isClearable, defaultValue: defaultValue, isMulti: isMulti, closeMenuOnSelect: !isMulti }, restOther, { ref: ref, id: id }))) : ((0, jsx_runtime_1.jsx)(react_select_1.default, __assign({ components: {
|
|
133
157
|
Option: CustomOption,
|
|
134
158
|
Input: Input,
|
|
135
159
|
DropdownIndicator: DropdownIndicator,
|
|
136
160
|
MenuList: MenuList,
|
|
137
161
|
LoadingIndicator: LoadingIndicator,
|
|
138
162
|
MultiValue: MultiValue
|
|
139
|
-
}, options: options || [], instanceId: instanceId, filterOption:
|
|
163
|
+
}, options: options || [], instanceId: instanceId, getOptionLabel: getOptionLabel, filterOption: wrappedFilterOption, isSearchable: isSearchable, name: name, menuIsOpen: menuIsOpen, onChange: onChange, classNamePrefix: "customSelect", className: (0, classnames_1.default)("customSelect", (_d = {}, _d['isSearchable'] = isSearchable && hasShowSearchIcon, _d), (_e = {}, _e['lightBg'] = lightBg, _e)), placeholder: placeholder, noOptionsMessage: function () { return 'Sonuç bulunamadı'; }, captureMenuScroll: false, isClearable: isClearable, defaultValue: defaultValue, isMulti: isMulti, closeMenuOnSelect: !isMulti, hideSelectedOptions: false }, restOther, { ref: ref, id: id }))) })), hasError && ((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 })] })))] })));
|
|
140
164
|
});
|
|
141
165
|
exports.default = SelectBox;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export declare const sizes: string[];
|
|
2
3
|
type SIZES = typeof sizes[number];
|
|
4
|
+
export interface SelectBoxOption {
|
|
5
|
+
label?: string | React.ReactNode;
|
|
6
|
+
value?: any;
|
|
7
|
+
optionLabel?: string | React.ReactNode;
|
|
8
|
+
labelBottom?: string | React.ReactNode;
|
|
9
|
+
price?: string;
|
|
10
|
+
priceSm?: string;
|
|
11
|
+
period?: string;
|
|
12
|
+
isCustom?: boolean;
|
|
13
|
+
customContent?: React.ReactNode;
|
|
14
|
+
isFixedBottom?: boolean;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isHideSelected?: boolean;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
3
19
|
export interface SelectBox {
|
|
4
20
|
size?: SIZES;
|
|
5
21
|
isSearchable?: boolean;
|
|
@@ -9,10 +25,10 @@ export interface SelectBox {
|
|
|
9
25
|
name?: string;
|
|
10
26
|
placeholder?: string;
|
|
11
27
|
instanceId?: string;
|
|
12
|
-
options?:
|
|
28
|
+
options?: SelectBoxOption[];
|
|
13
29
|
lightBg?: boolean;
|
|
14
30
|
onChange?(): void;
|
|
15
|
-
filterOption?():
|
|
31
|
+
filterOption?(option: SelectBoxOption, inputValue: string): boolean;
|
|
16
32
|
hasError?: boolean;
|
|
17
33
|
isClearable?: boolean;
|
|
18
34
|
errorMessage?: string;
|