pds-dev-kit-web 2.2.160 → 2.2.162
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/src/common/styles/colorSet/UIColor.json +7 -3
- package/dist/src/common/styles/colorSet/index.d.ts +8 -4
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +6 -2
- package/dist/src/desktop/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/src/desktop/components/Checkbox/Checkbox.js +17 -3
- package/dist/src/mobile/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/src/mobile/components/Checkbox/Checkbox.js +17 -3
- package/dist/src/mobile/components/DatePicker/DatePicker.js +18 -1
- package/dist/src/mobile/components/DatePicker/DatePickerHeader.d.ts +3 -1
- package/dist/src/mobile/components/DatePicker/DatePickerHeader.js +2 -2
- package/package.json +1 -1
- package/release-note.md +2 -2
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
"ui_cpnt_card_icon_background_03": "sys_widget_success_01",
|
|
309
309
|
"ui_cpnt_bannerslide_gradient_1": "sys_component_base_05",
|
|
310
310
|
"ui_cpnt_bannerslide_gradient_2": "sys_component_base_05_opacity00",
|
|
311
|
-
"
|
|
311
|
+
"ui_cpnt_modal_gradient_1": "sys_component_base_black_opacity00",
|
|
312
312
|
"ui_cpnt_modal_gradient_2": "sys_component_base_black",
|
|
313
313
|
"ui_cpnt_list_icon_04": "sys_widget_white",
|
|
314
314
|
"ui_cpnt_list_thumbnail_border": "sys_border_line_01",
|
|
@@ -316,6 +316,7 @@
|
|
|
316
316
|
"ui_cpnt_list_thumbnail_gradient_2": "sys_component_base_black_opacity00",
|
|
317
317
|
"ui_cpnt_list_base_area_active": "sys_component_base_01",
|
|
318
318
|
"ui_cpnt_contextmenu_base": "sys_component_base_02",
|
|
319
|
+
"ui_cpnt_videoplayer_gradient_1": "sys_component_base_black_opacity50",
|
|
319
320
|
"ui_cpnt_videoplayer_gradient_2": "sys_component_base_black_opacity00",
|
|
320
321
|
"ui_cpnt_videoplayer_overlay": "sys_component_base_black_opacity50",
|
|
321
322
|
"ui_globalmenucontainer_background": "sys_container_background_01",
|
|
@@ -888,10 +889,13 @@
|
|
|
888
889
|
"ui_135": "sys_widget_grey_01",
|
|
889
890
|
"ui_136": "sys_component_base_18",
|
|
890
891
|
"ui_137": "sys_component_base_50",
|
|
891
|
-
"ui_cpnt_modal_gradient_1": "sys_component_base_black_opacity00",
|
|
892
892
|
"ui_138": "sys_cpnt_sheet_base_12",
|
|
893
893
|
"ui_139": "sys_dimmed_01",
|
|
894
894
|
"ui_cpnt_sheet_base_29": "sys_cpnt_sheet_base_51",
|
|
895
895
|
"ui_cpnt_sheet_base_30": "sys_cpnt_sheet_base_52",
|
|
896
|
-
"ui_cpnt_sheet_base_31": "sys_cpnt_sheet_base_53"
|
|
896
|
+
"ui_cpnt_sheet_base_31": "sys_cpnt_sheet_base_53",
|
|
897
|
+
"ui_cpnt_selcontrols_icon_white": "sys_widget_white",
|
|
898
|
+
"ui_cpnt_selcontrols_text_white": "sys_text_white",
|
|
899
|
+
"ui_cpnt_selcontrols_icon_grey_01": "sys_widget_grey_01",
|
|
900
|
+
"ui_cpnt_selcontrols_text_grey_01": "sys_text_grey_01"
|
|
897
901
|
}
|
|
@@ -123,7 +123,7 @@ declare const colorSet: {
|
|
|
123
123
|
grey450: string;
|
|
124
124
|
darkgrey450: string;
|
|
125
125
|
};
|
|
126
|
-
readonly
|
|
126
|
+
readonly PaletteColor_light: {
|
|
127
127
|
sys_container_background_01: string;
|
|
128
128
|
sys_container_background_02: string;
|
|
129
129
|
sys_container_background_03: string;
|
|
@@ -500,7 +500,7 @@ declare const colorSet: {
|
|
|
500
500
|
sys_cpnt_sheet_base_52: string;
|
|
501
501
|
sys_cpnt_sheet_base_53: string;
|
|
502
502
|
};
|
|
503
|
-
readonly
|
|
503
|
+
readonly PaletteColor_Dark: {
|
|
504
504
|
sys_container_background_01: string;
|
|
505
505
|
sys_container_background_02: string;
|
|
506
506
|
sys_container_background_03: string;
|
|
@@ -1187,7 +1187,7 @@ declare const colorSet: {
|
|
|
1187
1187
|
ui_cpnt_card_icon_background_03: string;
|
|
1188
1188
|
ui_cpnt_bannerslide_gradient_1: string;
|
|
1189
1189
|
ui_cpnt_bannerslide_gradient_2: string;
|
|
1190
|
-
|
|
1190
|
+
ui_cpnt_modal_gradient_1: string;
|
|
1191
1191
|
ui_cpnt_modal_gradient_2: string;
|
|
1192
1192
|
ui_cpnt_list_icon_04: string;
|
|
1193
1193
|
ui_cpnt_list_thumbnail_border: string;
|
|
@@ -1195,6 +1195,7 @@ declare const colorSet: {
|
|
|
1195
1195
|
ui_cpnt_list_thumbnail_gradient_2: string;
|
|
1196
1196
|
ui_cpnt_list_base_area_active: string;
|
|
1197
1197
|
ui_cpnt_contextmenu_base: string;
|
|
1198
|
+
ui_cpnt_videoplayer_gradient_1: string;
|
|
1198
1199
|
ui_cpnt_videoplayer_gradient_2: string;
|
|
1199
1200
|
ui_cpnt_videoplayer_overlay: string;
|
|
1200
1201
|
ui_globalmenucontainer_background: string;
|
|
@@ -1767,12 +1768,15 @@ declare const colorSet: {
|
|
|
1767
1768
|
ui_135: string;
|
|
1768
1769
|
ui_136: string;
|
|
1769
1770
|
ui_137: string;
|
|
1770
|
-
ui_cpnt_modal_gradient_1: string;
|
|
1771
1771
|
ui_138: string;
|
|
1772
1772
|
ui_139: string;
|
|
1773
1773
|
ui_cpnt_sheet_base_29: string;
|
|
1774
1774
|
ui_cpnt_sheet_base_30: string;
|
|
1775
1775
|
ui_cpnt_sheet_base_31: string;
|
|
1776
|
+
ui_cpnt_selcontrols_icon_white: string;
|
|
1777
|
+
ui_cpnt_selcontrols_text_white: string;
|
|
1778
|
+
ui_cpnt_selcontrols_icon_grey_01: string;
|
|
1779
|
+
ui_cpnt_selcontrols_text_grey_01: string;
|
|
1776
1780
|
};
|
|
1777
1781
|
};
|
|
1778
1782
|
export default colorSet;
|
|
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable import/order */
|
|
7
7
|
var SemanticColor_json_1 = __importDefault(require("./SemanticColor.json"));
|
|
8
|
-
var PaletteColor_Dark_json_1 = __importDefault(require("./PaletteColor_Dark.json"));
|
|
9
8
|
var PaletteColor_light_json_1 = __importDefault(require("./PaletteColor_light.json"));
|
|
9
|
+
var PaletteColor_Dark_json_1 = __importDefault(require("./PaletteColor_Dark.json"));
|
|
10
10
|
var UIColor_json_1 = __importDefault(require("./UIColor.json"));
|
|
11
11
|
var colorSet = {
|
|
12
12
|
SemanticColor: SemanticColor_json_1.default,
|
|
13
|
-
PaletteColor_Dark: PaletteColor_Dark_json_1.default,
|
|
14
13
|
PaletteColor_light: PaletteColor_light_json_1.default,
|
|
14
|
+
PaletteColor_Dark: PaletteColor_Dark_json_1.default,
|
|
15
15
|
UIColor: UIColor_json_1.default
|
|
16
16
|
};
|
|
17
17
|
exports.default = colorSet;
|
|
@@ -308,7 +308,7 @@ export interface UITheme {
|
|
|
308
308
|
ui_cpnt_card_icon_background_03: string;
|
|
309
309
|
ui_cpnt_bannerslide_gradient_1: string;
|
|
310
310
|
ui_cpnt_bannerslide_gradient_2: string;
|
|
311
|
-
|
|
311
|
+
ui_cpnt_modal_gradient_1: string;
|
|
312
312
|
ui_cpnt_modal_gradient_2: string;
|
|
313
313
|
ui_cpnt_list_icon_04: string;
|
|
314
314
|
ui_cpnt_list_thumbnail_border: string;
|
|
@@ -316,6 +316,7 @@ export interface UITheme {
|
|
|
316
316
|
ui_cpnt_list_thumbnail_gradient_2: string;
|
|
317
317
|
ui_cpnt_list_base_area_active: string;
|
|
318
318
|
ui_cpnt_contextmenu_base: string;
|
|
319
|
+
ui_cpnt_videoplayer_gradient_1: string;
|
|
319
320
|
ui_cpnt_videoplayer_gradient_2: string;
|
|
320
321
|
ui_cpnt_videoplayer_overlay: string;
|
|
321
322
|
ui_globalmenucontainer_background: string;
|
|
@@ -888,10 +889,13 @@ export interface UITheme {
|
|
|
888
889
|
ui_135: string;
|
|
889
890
|
ui_136: string;
|
|
890
891
|
ui_137: string;
|
|
891
|
-
ui_cpnt_modal_gradient_1: string;
|
|
892
892
|
ui_138: string;
|
|
893
893
|
ui_139: string;
|
|
894
894
|
ui_cpnt_sheet_base_29: string;
|
|
895
895
|
ui_cpnt_sheet_base_30: string;
|
|
896
896
|
ui_cpnt_sheet_base_31: string;
|
|
897
|
+
ui_cpnt_selcontrols_icon_white: string;
|
|
898
|
+
ui_cpnt_selcontrols_text_white: string;
|
|
899
|
+
ui_cpnt_selcontrols_icon_grey_01: string;
|
|
900
|
+
ui_cpnt_selcontrols_text_grey_01: string;
|
|
897
901
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Path } from 'react-hook-form';
|
|
3
3
|
import type { IFormValues, PDSTextType } from '../../../common';
|
|
4
|
+
type ColorTheme = 'none' | 'white' | 'grey1';
|
|
4
5
|
type CheckboxProps = {
|
|
5
6
|
text?: PDSTextType;
|
|
6
7
|
fontWeight?: 'bold' | 'regular';
|
|
7
8
|
state?: 'normal' | 'disabled';
|
|
8
9
|
name: Path<IFormValues>;
|
|
10
|
+
colorTheme?: ColorTheme;
|
|
9
11
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
12
|
};
|
|
11
|
-
declare function Checkbox({ text, fontWeight, state, name, onChange }: CheckboxProps): JSX.Element;
|
|
13
|
+
declare function Checkbox({ text, fontWeight, state, name, colorTheme, onChange }: CheckboxProps): JSX.Element;
|
|
12
14
|
export default Checkbox;
|
|
@@ -24,7 +24,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
24
24
|
var hybrid_1 = require("../../../hybrid");
|
|
25
25
|
var TextLabel_1 = require("../TextLabel");
|
|
26
26
|
function Checkbox(_a) {
|
|
27
|
-
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, name = _a.name, onChange = _a.onChange;
|
|
27
|
+
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, name = _a.name, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d, onChange = _a.onChange;
|
|
28
28
|
var register = (0, react_hook_form_1.useFormContext)().register;
|
|
29
29
|
var checkboxFormRegister = register(name);
|
|
30
30
|
var isChecked = (0, react_hook_form_1.useWatch)({ name: name });
|
|
@@ -34,10 +34,24 @@ function Checkbox(_a) {
|
|
|
34
34
|
onChange(e);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
var colorThemeSet = {
|
|
38
|
+
none: {
|
|
39
|
+
iconColorkey: 'ui_cpnt_selcontrols_icon_default',
|
|
40
|
+
textColorKey: 'ui_cpnt_selcontrols_text_default'
|
|
41
|
+
},
|
|
42
|
+
white: {
|
|
43
|
+
iconColorkey: 'ui_cpnt_selcontrols_icon_white',
|
|
44
|
+
textColorKey: 'ui_cpnt_selcontrols_text_white'
|
|
45
|
+
},
|
|
46
|
+
grey1: {
|
|
47
|
+
iconColorkey: 'ui_cpnt_selcontrols_icon_grey_01',
|
|
48
|
+
textColorKey: 'ui_cpnt_selcontrols_text_grey_01'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
37
51
|
var icon = function () {
|
|
38
52
|
switch (state) {
|
|
39
53
|
case 'normal': {
|
|
40
|
-
return isChecked ? ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_primary" })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_off", fillType: "line", colorKey:
|
|
54
|
+
return isChecked ? ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_primary" })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_off", fillType: "line", colorKey: colorThemeSet[colorTheme].iconColorkey }));
|
|
41
55
|
}
|
|
42
56
|
case 'disabled': {
|
|
43
57
|
return isChecked ? ((0, jsx_runtime_1.jsxs)(S_OverrideIconWrapper, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_primary" }) }), (0, jsx_runtime_1.jsx)(S_OverrideIcon, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_on_base_hover" }) })] })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_off", fillType: "line", colorKey: "ui_cpnt_selcontrols_icon_disabled" }));
|
|
@@ -45,7 +59,7 @@ function Checkbox(_a) {
|
|
|
45
59
|
}
|
|
46
60
|
};
|
|
47
61
|
return ((0, jsx_runtime_1.jsx)(S_Checkbox, __assign({ "x-pds-name": "Checkbox", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: (0, jsx_runtime_1.jsxs)(S_Label, __assign({ htmlFor: name, isDisabled: state === 'disabled' }, { children: [icon(), text && ((0, jsx_runtime_1.jsx)(S_TextWrapper, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: text, styleTheme: fontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorOverride: state === 'normal'
|
|
48
|
-
?
|
|
62
|
+
? colorThemeSet[colorTheme].textColorKey
|
|
49
63
|
: 'ui_cpnt_selcontrols_text_disabled' }) })), (0, jsx_runtime_1.jsx)("input", __assign({ hidden: true, type: "checkbox" }, checkboxFormRegister, { id: name, disabled: state === 'disabled', onChange: handleChange }))] })) })));
|
|
50
64
|
}
|
|
51
65
|
var S_Checkbox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 24px;\n"], ["\n align-items: center;\n display: flex;\n height: 24px;\n"])));
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Path } from 'react-hook-form';
|
|
3
3
|
import type { IFormValues, PDSTextType } from '../../../common';
|
|
4
|
+
type ColorTheme = 'none' | 'white' | 'grey1';
|
|
4
5
|
type CheckboxProps = {
|
|
5
6
|
text?: PDSTextType;
|
|
6
7
|
fontWeight?: 'bold' | 'regular';
|
|
7
8
|
state?: 'normal' | 'disabled';
|
|
8
9
|
name: Path<IFormValues>;
|
|
10
|
+
colorTheme?: ColorTheme;
|
|
9
11
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
12
|
};
|
|
11
|
-
declare function Checkbox({ text, fontWeight, state, name, onChange }: CheckboxProps): JSX.Element;
|
|
13
|
+
declare function Checkbox({ text, fontWeight, state, name, colorTheme, onChange }: CheckboxProps): JSX.Element;
|
|
12
14
|
export default Checkbox;
|
|
@@ -24,7 +24,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
24
24
|
var hybrid_1 = require("../../../hybrid");
|
|
25
25
|
var TextLabel_1 = require("../TextLabel");
|
|
26
26
|
function Checkbox(_a) {
|
|
27
|
-
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, name = _a.name, onChange = _a.onChange;
|
|
27
|
+
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, name = _a.name, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d, onChange = _a.onChange;
|
|
28
28
|
var register = (0, react_hook_form_1.useFormContext)().register;
|
|
29
29
|
var checkboxFormRegister = register(name);
|
|
30
30
|
var isChecked = (0, react_hook_form_1.useWatch)({ name: name });
|
|
@@ -34,10 +34,24 @@ function Checkbox(_a) {
|
|
|
34
34
|
onChange(e);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
var colorThemeSet = {
|
|
38
|
+
none: {
|
|
39
|
+
iconColorkey: 'ui_cpnt_selcontrols_icon_default',
|
|
40
|
+
textColorKey: 'ui_cpnt_selcontrols_text_default'
|
|
41
|
+
},
|
|
42
|
+
white: {
|
|
43
|
+
iconColorkey: 'ui_cpnt_selcontrols_icon_white',
|
|
44
|
+
textColorKey: 'ui_cpnt_selcontrols_text_white'
|
|
45
|
+
},
|
|
46
|
+
grey1: {
|
|
47
|
+
iconColorkey: 'ui_cpnt_selcontrols_icon_grey_01',
|
|
48
|
+
textColorKey: 'ui_cpnt_selcontrols_text_grey_01'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
37
51
|
var icon = function () {
|
|
38
52
|
switch (state) {
|
|
39
53
|
case 'normal': {
|
|
40
|
-
return isChecked ? ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_primary" })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_off", fillType: "line", colorKey:
|
|
54
|
+
return isChecked ? ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_primary" })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_off", fillType: "line", colorKey: colorThemeSet[colorTheme].iconColorkey }));
|
|
41
55
|
}
|
|
42
56
|
case 'disabled': {
|
|
43
57
|
return isChecked ? ((0, jsx_runtime_1.jsxs)(S_OverrideIconWrapper, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_primary" }), (0, jsx_runtime_1.jsx)(S_OverrideIcon, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_on", fillType: "fill", colorKey: "ui_cpnt_selcontrols_icon_on_base_hover" }) })] })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, iconName: "ic_checkbox_off", fillType: "line", colorKey: "ui_cpnt_selcontrols_icon_disabled" }));
|
|
@@ -45,7 +59,7 @@ function Checkbox(_a) {
|
|
|
45
59
|
}
|
|
46
60
|
};
|
|
47
61
|
return ((0, jsx_runtime_1.jsx)(S_Checkbox, __assign({ "x-pds-name": "Checkbox", "x-pds-element-type": "component", "x-pds-device-type": "mobile" }, { children: (0, jsx_runtime_1.jsxs)(S_Label, __assign({ htmlFor: name }, { children: [icon(), text && ((0, jsx_runtime_1.jsx)(S_TextWrapper, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: text, styleTheme: fontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorOverride: state === 'normal'
|
|
48
|
-
?
|
|
62
|
+
? colorThemeSet[colorTheme].textColorKey
|
|
49
63
|
: 'ui_cpnt_selcontrols_text_disabled' }) })), (0, jsx_runtime_1.jsx)("input", __assign({ hidden: true, type: "checkbox" }, checkboxFormRegister, { id: name, disabled: state === 'disabled', onChange: handleChange }))] })) })));
|
|
50
64
|
}
|
|
51
65
|
var S_Checkbox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 24px;\n"], ["\n align-items: center;\n display: flex;\n height: 24px;\n"])));
|
|
@@ -57,6 +57,22 @@ var DatePicker = function (_a) {
|
|
|
57
57
|
var _d = (0, react_1.useState)(function () {
|
|
58
58
|
return dateHelper_1.DateHelper.startOfMonth(dateHelper_1.DateHelper.parseDate(startDate));
|
|
59
59
|
}), currentMonth = _d[0], setCurrentMonth = _d[1];
|
|
60
|
+
var isPrevButtonDisabled = (0, react_1.useMemo)(function () {
|
|
61
|
+
if (!minDate)
|
|
62
|
+
return false;
|
|
63
|
+
var parsedMinDate = dateHelper_1.DateHelper.parseDate(minDate);
|
|
64
|
+
return (currentMonth.getFullYear() < parsedMinDate.getFullYear() ||
|
|
65
|
+
(currentMonth.getFullYear() === parsedMinDate.getFullYear() &&
|
|
66
|
+
currentMonth.getMonth() <= parsedMinDate.getMonth()));
|
|
67
|
+
}, [currentMonth, minDate]);
|
|
68
|
+
var isNextButtonDisabled = (0, react_1.useMemo)(function () {
|
|
69
|
+
if (!maxDate)
|
|
70
|
+
return false;
|
|
71
|
+
var parsedMaxDate = dateHelper_1.DateHelper.parseDate(maxDate);
|
|
72
|
+
return (currentMonth.getFullYear() > parsedMaxDate.getFullYear() ||
|
|
73
|
+
(currentMonth.getFullYear() === parsedMaxDate.getFullYear() &&
|
|
74
|
+
currentMonth.getMonth() >= parsedMaxDate.getMonth()));
|
|
75
|
+
}, [currentMonth, maxDate]);
|
|
60
76
|
var handleDateClick = function (target) {
|
|
61
77
|
if (!onChange)
|
|
62
78
|
return;
|
|
@@ -95,7 +111,8 @@ var DatePicker = function (_a) {
|
|
|
95
111
|
return ((0, jsx_runtime_1.jsxs)(CalendarContainer, __assign({ id: id }, { children: [(0, jsx_runtime_1.jsx)(DatePickerHeader_1.default, { headerTitle: t('str_35', {
|
|
96
112
|
year: currentMonth.getFullYear(),
|
|
97
113
|
month: String(currentMonth.getMonth() + 1)
|
|
98
|
-
}), textButtonText: quickActionMode === 'use' ? quickActionBtnText : undefined, isTextButtonDisabled: currentMonth.
|
|
114
|
+
}), textButtonText: quickActionMode === 'use' ? quickActionBtnText : undefined, isTextButtonDisabled: currentMonth.getFullYear() === new Date().getFullYear() &&
|
|
115
|
+
currentMonth.getMonth() === new Date().getMonth(), isPrevButtonDisabled: isPrevButtonDisabled, isNextButtonDisabled: isNextButtonDisabled, onClickPrevButton: function () { return setCurrentMonth(function (prev) { return dateHelper_1.DateHelper.addMonths(prev, -1); }); }, onClickNextButton: function () { return setCurrentMonth(function (prev) { return dateHelper_1.DateHelper.addMonths(prev, 1); }); }, onClickTextButton: handleQuickActionButtonClick }), (0, jsx_runtime_1.jsx)(components_1.Spacing, { size: "spacing_a" }), (0, jsx_runtime_1.jsxs)(S_MonthContainer, { children: [(0, jsx_runtime_1.jsx)(S_DayOfWeekContainer, __assign({ id: "weeks" }, { children: days
|
|
99
116
|
.slice(startOfWeek === 'monday' ? 1 : 0)
|
|
100
117
|
.concat(startOfWeek === 'monday' ? [t('str_3893')] : [])
|
|
101
118
|
.map(function (day) { return ((0, jsx_runtime_1.jsx)(S_DayOfWeek, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: day, styleTheme: "caption2Bold", colorTheme: "sysTextSecondary", textAlign: "center" }) }, "".concat(id, "_").concat(day))); }) })), (0, jsx_runtime_1.jsx)(S_Grid, { children: calendarDates.map(function (d) {
|
|
@@ -4,9 +4,11 @@ type Props = {
|
|
|
4
4
|
headerTitle: string;
|
|
5
5
|
textButtonText?: PDSTextType;
|
|
6
6
|
isTextButtonDisabled: boolean;
|
|
7
|
+
isPrevButtonDisabled: boolean;
|
|
8
|
+
isNextButtonDisabled: boolean;
|
|
7
9
|
onClickPrevButton: () => void;
|
|
8
10
|
onClickNextButton: () => void;
|
|
9
11
|
onClickTextButton: () => void;
|
|
10
12
|
};
|
|
11
|
-
declare function DatePickerHeader({ headerTitle, textButtonText, isTextButtonDisabled, onClickPrevButton, onClickNextButton, onClickTextButton }: Props): JSX.Element;
|
|
13
|
+
declare function DatePickerHeader({ headerTitle, textButtonText, isTextButtonDisabled, isPrevButtonDisabled, isNextButtonDisabled, onClickPrevButton, onClickNextButton, onClickTextButton }: Props): JSX.Element;
|
|
12
14
|
export default DatePickerHeader;
|
|
@@ -13,8 +13,8 @@ var IconButton_1 = require("../IconButton");
|
|
|
13
13
|
var TextButton_1 = require("../TextButton");
|
|
14
14
|
var TextLabel_1 = require("../TextLabel");
|
|
15
15
|
function DatePickerHeader(_a) {
|
|
16
|
-
var headerTitle = _a.headerTitle, textButtonText = _a.textButtonText, isTextButtonDisabled = _a.isTextButtonDisabled, onClickPrevButton = _a.onClickPrevButton, onClickNextButton = _a.onClickNextButton, onClickTextButton = _a.onClickTextButton;
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(S_HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(S_LeftIconWrapper, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { onClick: onClickPrevButton, iconName: "ic_arrow_left", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: 16, baseSize: "medium" }) }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: headerTitle, textAlign: "center" }), (0, jsx_runtime_1.jsx)(S_RightIconWrapper, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { onClick: onClickNextButton, iconName: "ic_arrow_right", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: 16, baseSize: "medium" }) }), textButtonText && ((0, jsx_runtime_1.jsx)(S_TextButtonWrapper, { children: (0, jsx_runtime_1.jsx)(TextButton_1.TextButton, { text: textButtonText, size: "xsmall", fontWeight: "bold", onClick: onClickTextButton, state: isTextButtonDisabled ? 'disabled' : 'normal' }) }))] }));
|
|
16
|
+
var headerTitle = _a.headerTitle, textButtonText = _a.textButtonText, isTextButtonDisabled = _a.isTextButtonDisabled, isPrevButtonDisabled = _a.isPrevButtonDisabled, isNextButtonDisabled = _a.isNextButtonDisabled, onClickPrevButton = _a.onClickPrevButton, onClickNextButton = _a.onClickNextButton, onClickTextButton = _a.onClickTextButton;
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(S_HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(S_LeftIconWrapper, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { onClick: onClickPrevButton, iconName: "ic_arrow_left", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: 16, baseSize: "medium", state: isPrevButtonDisabled ? 'disabled' : 'normal' }) }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: headerTitle, textAlign: "center" }), (0, jsx_runtime_1.jsx)(S_RightIconWrapper, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { onClick: onClickNextButton, iconName: "ic_arrow_right", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: 16, baseSize: "medium", state: isNextButtonDisabled ? 'disabled' : 'normal' }) }), textButtonText && ((0, jsx_runtime_1.jsx)(S_TextButtonWrapper, { children: (0, jsx_runtime_1.jsx)(TextButton_1.TextButton, { text: textButtonText, size: "xsmall", fontWeight: "bold", onClick: onClickTextButton, state: isTextButtonDisabled ? 'disabled' : 'normal' }) }))] }));
|
|
18
18
|
}
|
|
19
19
|
var S_HeaderContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n justify-items: center;\n margin: 0 ", ";\n position: relative;\n"], ["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n justify-items: center;\n margin: 0 ", ";\n position: relative;\n"])), function (_a) {
|
|
20
20
|
var theme = _a.theme;
|
package/package.json
CHANGED
package/release-note.md
CHANGED