@cashub/ui 0.46.1 → 0.48.0
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/Tab/TabList.js +38 -26
- package/Tab/TabPanel.js +13 -20
- package/Tab/TabTab.js +36 -24
- package/Tab/index.js +15 -1
- package/Tab/subComponent/TabListV2.js +25 -0
- package/Tab/subComponent/TabPanelV2.js +52 -0
- package/Tab/subComponent/TabTabV2.js +63 -0
- package/VerticalTab/TabList.js +13 -18
- package/VerticalTab/TabPanel.js +16 -20
- package/VerticalTab/TabTab.js +40 -21
- package/VerticalTab/VerticalTab.js +8 -4
- package/alert/Alert.js +12 -5
- package/animate/Collapse.js +5 -7
- package/animate/Loader.js +18 -7
- package/animate/PulseRing.js +18 -5
- package/animate/Spinner.js +8 -3
- package/backdrop/BaseBackdrop.js +9 -3
- package/backdrop/LoadingBackdrop.js +7 -3
- package/backdrop/ModalBackdrop.js +5 -3
- package/badge/Badge.js +15 -3
- package/badge/BadgeDot.js +8 -3
- package/badge/BadgeFill.js +24 -6
- package/badge/BadgeWithText.js +13 -3
- package/billing/BarChart.js +1 -1
- package/breadcrumb/Breadcrumb.js +42 -3
- package/button/Button.js +88 -20
- package/button/ButtonGroup.js +33 -9
- package/button/IconButton.js +37 -10
- package/button/ScrollToTopButton.js +12 -4
- package/callout/Callout.js +37 -8
- package/chart/BarChart.js +10 -17
- package/chart/DoughnutChart.js +34 -20
- package/chart/LineChart.js +14 -20
- package/chart/SingleBarChart.js +22 -5
- package/chart/utils/centerTextPlugin.js +2 -2
- package/chart/utils/customTooltip.js +7 -7
- package/chart/utils/htmlLegendPlugin.js +1 -1
- package/container/FlexContainer.js +15 -7
- package/cropper/Cropper.js +1 -2
- package/datetimePicker/DatePicker.js +80 -26
- package/datetimePicker/DatePickerV2.js +95 -36
- package/datetimePicker/DatetimePicker.js +174 -11
- package/datetimePicker/DatetimePickerV2.js +87 -33
- package/datetimePicker/DatetimePickerV3.js +174 -11
- package/datetimePicker/TimeInput.js +35 -10
- package/datetimePicker/TimePicker.js +77 -22
- package/datetimePicker/TimePickerStyle.js +53 -3
- package/datetimePicker/TimePickerV2.js +54 -21
- package/datetimePicker/accordion/Month.js +93 -16
- package/datetimePicker/accordion/Year.js +96 -18
- package/datetimePicker/hooks/useChangeNumber.js +3 -6
- package/datetimePicker/hooks/useDecrease.js +3 -6
- package/datetimePicker/hooks/useIncrease.js +3 -6
- package/datetimePicker/subComponent/Accordion.js +101 -20
- package/descriptionList/DescriptionDetail.js +15 -4
- package/descriptionList/DescriptionList.js +12 -4
- package/descriptionList/DescriptionTerm.js +5 -3
- package/divider/Divider.js +15 -6
- package/dropdown/DropdownButtonOption.js +22 -6
- package/dropdown/DropdownContent.js +29 -15
- package/dropdown/DropdownDivOption.js +17 -3
- package/dropdown/DropdownLinkOption.js +14 -3
- package/dropdown/DropdownToggle.js +7 -15
- package/dropzone/FileDropzone.js +121 -22
- package/dropzone/ImageDropzone.js +83 -14
- package/dropzone/subComponent/Message.js +11 -4
- package/figure/IconFigure.js +16 -7
- package/figure/ImageFigure.js +19 -6
- package/file/HiddenFileInput.js +3 -3
- package/form/Checkbox.js +74 -13
- package/form/Fieldset.js +9 -3
- package/form/FormItem.js +10 -5
- package/form/Input.js +40 -7
- package/form/Label.js +34 -10
- package/form/MutedText.js +8 -4
- package/form/PasswordInput.js +20 -13
- package/form/RadioButton.js +55 -8
- package/form/SearchSelect.js +64 -12
- package/form/Searchbox.js +45 -19
- package/form/Slider.js +28 -10
- package/form/SwitchButton.js +48 -14
- package/form/Textarea.js +30 -3
- package/form/TreeView.js +13 -6
- package/grid/Column.js +23 -10
- package/grid/Grid.js +14 -6
- package/heading/Heading1.js +8 -4
- package/heading/Heading2.js +11 -5
- package/heading/Heading3.js +20 -8
- package/iconbox/ApplicationIconBox.js +48 -12
- package/iconbox/IconBox.js +31 -7
- package/iconbox/IconBoxV2.js +33 -8
- package/iconbox/subComponent/IconBoxFigure.js +17 -9
- package/iconbox/subComponent/IconBoxImage.js +21 -8
- package/image/ImageFluid.js +7 -3
- package/image/UploadImage.js +66 -18
- package/index.js +8 -1
- package/jsoneditor/JsonEditor.js +121 -15
- package/keyframe/Pulse.js +13 -3
- package/keyframe/Spin.js +5 -3
- package/layout/Aside.js +30 -5
- package/layout/Backdrop.js +8 -4
- package/layout/Container.js +21 -5
- package/layout/Footer.js +26 -7
- package/layout/Sidebar.jsx +33 -3
- package/link/LinkSpan.js +37 -19
- package/map/GoogleMap.js +3 -7
- package/map/GoogleReverseGeolocation.js +6 -3
- package/map/LeafletMap.js +2 -2
- package/map/subComponent/GoogleMapContainer.js +16 -4
- package/map/subComponent/GoogleMapPopup.js +7 -10
- package/map/subComponent/GoogleMapWrapper.js +8 -15
- package/map/subComponent/LeafletDrawControl.js +9 -7
- package/map/subComponent/LeafletMapContainer.js +159 -4
- package/modal/StateModal.js +49 -28
- package/modal/TitleModal.js +70 -29
- package/package.json +1 -1
- package/page/Disclaimer.js +119 -3
- package/paginate/Paginate.js +54 -12
- package/popover/Popover.js +30 -25
- package/qrcode/QRCode.js +20 -6
- package/qrcode/QRCodeContainter.js +12 -4
- package/ribbon/Ribbon.js +29 -4
- package/section/Section.js +68 -20
- package/section/SectionBody.js +29 -8
- package/section/SectionHeader.js +36 -11
- package/section/SectionToolbar.js +9 -3
- package/section/SectionToolbarItem.js +8 -3
- package/select/InputSelect.js +16 -23
- package/select/Select.js +112 -43
- package/select/subComponent/Checkbox.js +24 -5
- package/select/subComponent/Footer.js +4 -3
- package/select/subComponent/ListBox.js +12 -5
- package/select/subComponent/Option.js +27 -7
- package/select/subComponent/OptionGroup.js +13 -3
- package/select/subComponent/Options.js +18 -5
- package/select/subComponent/SearchBox.js +34 -12
- package/select/subComponent/SelectedMultipleTags.js +21 -3
- package/select/subComponent/SelectedMultipleText.js +19 -4
- package/select/subComponent/SelectedSingle.js +7 -3
- package/styles/GlobalStyle.js +156 -45
- package/styles/mixin/backgroundColor.js +16 -8
- package/styles/mixin/borderColor.js +13 -7
- package/styles/mixin/color.js +13 -7
- package/styles/mixin/colorOnBackground.js +13 -7
- package/styles/mixin/inputPlaceholder.js +20 -3
- package/styles/mixin/media.js +5 -3
- package/styles/mixin/rounded.js +10 -6
- package/styles/mixin/scrollbar.js +13 -3
- package/styles/theme/dark.theme.js +15 -14
- package/styles/theme/light.theme.js +15 -14
- package/styles/theme/white.theme.js +15 -14
- package/table/GridTable.js +71 -33
- package/table/ImageBox.js +15 -5
- package/table/InfiniteGridTable.js +92 -46
- package/table/PermissionTable.js +32 -10
- package/table/SimpleGridTable.js +143 -0
- package/table/Table.js +198 -48
- package/table/__mock__/columns.js +1 -1
- package/table/index.js +7 -0
- package/table/subComponent/BaseTableHeadCell.js +37 -8
- package/table/subComponent/GridTableFooter.js +10 -4
- package/table/subComponent/GridTableHeadCell.js +6 -4
- package/table/subComponent/Resizer.js +19 -4
- package/table/subComponent/TableFooter.js +15 -6
- package/table/subComponent/TableFooterInfo.js +4 -3
- package/table/subComponent/TableFooterPager.js +19 -6
- package/table/subComponent/TableHeadCell.js +9 -3
- package/table/subComponent/TableSort.js +17 -7
- package/tagify/TagifyStyle.js +49 -3
- package/tagify/Tags.js +37 -21
- package/tagify/templates/getCreateButtonTemplate.js +5 -2
- package/text/Paragraph.js +50 -12
- package/timeline/Timeline.js +94 -17
- package/toast/CustomToastContainer.js +35 -3
- package/toast/MessageContainer.js +22 -4
- package/tooltip/Tooltip.js +47 -19
- package/treeView/TreeViewV2.js +1 -1
- package/treeView/TreeflexStyle.js +38 -3
- package/wizard/Wizard.js +115 -6
package/section/Section.js
CHANGED
|
@@ -8,78 +8,126 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _bgChartTriangle = _interopRequireDefault(require("../assets/images/bg-chart-triangle.png"));
|
|
9
9
|
var _bgChartCircle = _interopRequireDefault(require("../assets/images/bg-chart-circle.png"));
|
|
10
10
|
var _map = _interopRequireDefault(require("../assets/images/map.png"));
|
|
11
|
-
var _templateObject;
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const Section = _styledComponents.default.div`
|
|
13
|
+
background: var(--color-background1);
|
|
14
|
+
border-radius: var(--border-radius);
|
|
15
|
+
color: var(--font-on-background);
|
|
16
|
+
padding: var(--spacing);
|
|
17
|
+
margin-bottom: var(--spacing);
|
|
18
|
+
|
|
19
|
+
${_ref => {
|
|
15
20
|
let {
|
|
16
21
|
backgroundReverse
|
|
17
22
|
} = _ref;
|
|
18
23
|
return backgroundReverse && 'background: var(--color-background2);';
|
|
19
|
-
}
|
|
24
|
+
}}
|
|
25
|
+
|
|
26
|
+
${_ref2 => {
|
|
20
27
|
let {
|
|
21
28
|
paddingS
|
|
22
29
|
} = _ref2;
|
|
23
30
|
return paddingS && 'padding: var(--spacing-s);';
|
|
24
|
-
}
|
|
31
|
+
}}
|
|
32
|
+
|
|
33
|
+
${_ref3 => {
|
|
25
34
|
let {
|
|
26
35
|
paddingXS
|
|
27
36
|
} = _ref3;
|
|
28
37
|
return paddingXS && 'padding: var(--spacing-xs);';
|
|
29
|
-
}
|
|
38
|
+
}}
|
|
39
|
+
|
|
40
|
+
${_ref4 => {
|
|
30
41
|
let {
|
|
31
42
|
noPadding
|
|
32
43
|
} = _ref4;
|
|
33
44
|
return noPadding && 'padding: 0;';
|
|
34
|
-
}
|
|
45
|
+
}}
|
|
46
|
+
|
|
47
|
+
${_ref5 => {
|
|
35
48
|
let {
|
|
36
49
|
noPaddingX
|
|
37
50
|
} = _ref5;
|
|
38
51
|
return noPaddingX && 'padding-left: 0; padding-right: 0;';
|
|
39
|
-
}
|
|
52
|
+
}}
|
|
53
|
+
|
|
54
|
+
${_ref6 => {
|
|
40
55
|
let {
|
|
41
56
|
noPaddingTop
|
|
42
57
|
} = _ref6;
|
|
43
58
|
return noPaddingTop && 'padding-top: 0;';
|
|
44
|
-
}
|
|
59
|
+
}}
|
|
60
|
+
|
|
61
|
+
${_ref7 => {
|
|
45
62
|
let {
|
|
46
63
|
noPaddingBottom
|
|
47
64
|
} = _ref7;
|
|
48
65
|
return noPaddingBottom && 'padding-bottom: 0;';
|
|
49
|
-
}
|
|
66
|
+
}}
|
|
67
|
+
|
|
68
|
+
${_ref8 => {
|
|
50
69
|
let {
|
|
51
70
|
marginBottomS
|
|
52
71
|
} = _ref8;
|
|
53
72
|
return marginBottomS && 'margin-bottom: var(--spacing-s);';
|
|
54
|
-
}
|
|
73
|
+
}}
|
|
74
|
+
|
|
75
|
+
${_ref9 => {
|
|
55
76
|
let {
|
|
56
77
|
noMarginBottom
|
|
57
78
|
} = _ref9;
|
|
58
79
|
return noMarginBottom && 'margin-bottom: 0;';
|
|
59
|
-
}
|
|
80
|
+
}}
|
|
81
|
+
|
|
82
|
+
${_ref10 => {
|
|
60
83
|
let {
|
|
61
84
|
fullHeight
|
|
62
85
|
} = _ref10;
|
|
63
86
|
return fullHeight && 'height: calc(100% - var(--spacing));';
|
|
64
|
-
}
|
|
87
|
+
}}
|
|
88
|
+
|
|
89
|
+
${_ref11 => {
|
|
65
90
|
let {
|
|
66
91
|
backgroundMarker
|
|
67
92
|
} = _ref11;
|
|
68
|
-
return backgroundMarker &&
|
|
69
|
-
|
|
93
|
+
return backgroundMarker && `
|
|
94
|
+
background: var(--color-background2);
|
|
95
|
+
background-image: url(${_bgChartCircle.default}), url(${_bgChartTriangle.default});
|
|
96
|
+
background-repeat: no-repeat;
|
|
97
|
+
background-position: left top, right bottom;
|
|
98
|
+
background-size: 337px 312px, 166px 225px;
|
|
99
|
+
`;
|
|
100
|
+
}}
|
|
101
|
+
|
|
102
|
+
${_ref12 => {
|
|
70
103
|
let {
|
|
71
104
|
backgroundMap
|
|
72
105
|
} = _ref12;
|
|
73
|
-
return backgroundMap &&
|
|
74
|
-
|
|
106
|
+
return backgroundMap && `
|
|
107
|
+
background: var(--color-background2);
|
|
108
|
+
background-image: url(${_map.default});
|
|
109
|
+
background-repeat: no-repeat;
|
|
110
|
+
background-size: cover;
|
|
111
|
+
`;
|
|
112
|
+
}}
|
|
113
|
+
|
|
114
|
+
${_ref13 => {
|
|
75
115
|
let {
|
|
76
116
|
border
|
|
77
117
|
} = _ref13;
|
|
78
118
|
return border && 'border: var(--border-width) solid var(--border-color);';
|
|
79
|
-
}
|
|
119
|
+
}}
|
|
120
|
+
|
|
121
|
+
${_ref14 => {
|
|
80
122
|
let {
|
|
81
123
|
checkboxGroup
|
|
82
124
|
} = _ref14;
|
|
83
|
-
return checkboxGroup &&
|
|
84
|
-
|
|
125
|
+
return checkboxGroup && `
|
|
126
|
+
background: transparent;
|
|
127
|
+
width: 50%;
|
|
128
|
+
margin-left: auto;
|
|
129
|
+
margin-right: auto;
|
|
130
|
+
`;
|
|
131
|
+
}}
|
|
132
|
+
`;
|
|
85
133
|
var _default = exports.default = Section;
|
package/section/SectionBody.js
CHANGED
|
@@ -7,25 +7,46 @@ exports.default = void 0;
|
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _scrollbar = _interopRequireDefault(require("../styles/mixin/scrollbar"));
|
|
9
9
|
var _media = _interopRequireDefault(require("../styles/mixin/media"));
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const SectionBody = _styledComponents.default.div`
|
|
14
|
+
// fix: overflow element(relate to z-index problem)
|
|
15
|
+
// position: relative;
|
|
16
|
+
background: transparent;
|
|
17
|
+
padding: var(--spacing) 0 0 0;
|
|
18
|
+
|
|
19
|
+
${_ref => {
|
|
16
20
|
let {
|
|
17
21
|
noPadding
|
|
18
22
|
} = _ref;
|
|
19
23
|
return noPadding && 'padding: 0;';
|
|
20
|
-
}
|
|
24
|
+
}}
|
|
25
|
+
|
|
26
|
+
${_ref2 => {
|
|
21
27
|
let {
|
|
22
28
|
maxHeight
|
|
23
29
|
} = _ref2;
|
|
24
|
-
return maxHeight && (0, _styledComponents.css)
|
|
25
|
-
|
|
30
|
+
return maxHeight && (0, _styledComponents.css)`
|
|
31
|
+
max-height: ${maxHeight}px;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
overflow-x: hidden;
|
|
34
|
+
${_scrollbar.default}
|
|
35
|
+
`;
|
|
36
|
+
}}
|
|
37
|
+
|
|
38
|
+
${_ref3 => {
|
|
26
39
|
let {
|
|
27
40
|
maxHeightLaptop
|
|
28
41
|
} = _ref3;
|
|
29
|
-
return maxHeightLaptop && (0, _styledComponents.css)
|
|
30
|
-
|
|
42
|
+
return maxHeightLaptop && (0, _styledComponents.css)`
|
|
43
|
+
${_media.default.laptop`
|
|
44
|
+
max-height: ${maxHeightLaptop}px;
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
overflow-x: hidden;
|
|
47
|
+
${_scrollbar.default}
|
|
48
|
+
`}
|
|
49
|
+
`;
|
|
50
|
+
}}
|
|
51
|
+
`;
|
|
31
52
|
var _default = exports.default = SectionBody;
|
package/section/SectionHeader.js
CHANGED
|
@@ -6,40 +6,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _header = _interopRequireDefault(require("../styles/config/header.style"));
|
|
9
|
-
var _templateObject, _templateObject2;
|
|
10
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const SectionHeader = _styledComponents.default.div`
|
|
13
|
+
background: transparent;
|
|
14
|
+
padding: 0;
|
|
15
|
+
margin-bottom: calc(var(--spacing-s) * -1);
|
|
16
|
+
|
|
17
|
+
> * {
|
|
18
|
+
padding-bottom: var(--spacing-s);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
${_ref => {
|
|
15
22
|
let {
|
|
16
23
|
inline
|
|
17
24
|
} = _ref;
|
|
18
|
-
return inline && (0, _styledComponents.css)
|
|
19
|
-
|
|
25
|
+
return inline && (0, _styledComponents.css)`
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: center;
|
|
29
|
+
`;
|
|
30
|
+
}}
|
|
31
|
+
|
|
32
|
+
${_ref2 => {
|
|
20
33
|
let {
|
|
21
34
|
flexStart
|
|
22
35
|
} = _ref2;
|
|
23
36
|
return flexStart && 'justify-content: flex-start;';
|
|
24
|
-
}
|
|
37
|
+
}}
|
|
38
|
+
|
|
39
|
+
${_ref3 => {
|
|
25
40
|
let {
|
|
26
41
|
border
|
|
27
42
|
} = _ref3;
|
|
28
43
|
return border && 'border-bottom: var(--border-width) solid var(--border-color);';
|
|
29
|
-
}
|
|
44
|
+
}}
|
|
45
|
+
|
|
46
|
+
${_ref4 => {
|
|
30
47
|
let {
|
|
31
48
|
backgroundFill
|
|
32
49
|
} = _ref4;
|
|
33
50
|
return backgroundFill && 'background: var(--color-background1);';
|
|
34
|
-
}
|
|
51
|
+
}}
|
|
52
|
+
|
|
53
|
+
${_ref5 => {
|
|
35
54
|
let {
|
|
36
55
|
backgroundReverse
|
|
37
56
|
} = _ref5;
|
|
38
57
|
return backgroundReverse && 'background: var(--color-background2);';
|
|
39
|
-
}
|
|
58
|
+
}}
|
|
59
|
+
|
|
60
|
+
${_ref6 => {
|
|
40
61
|
let {
|
|
41
62
|
sticky
|
|
42
63
|
} = _ref6;
|
|
43
|
-
return sticky &&
|
|
44
|
-
|
|
64
|
+
return sticky && `position: sticky;
|
|
65
|
+
z-index:20;
|
|
66
|
+
top: ${_header.default.height};
|
|
67
|
+
`;
|
|
68
|
+
}}
|
|
69
|
+
`;
|
|
45
70
|
var _default = exports.default = SectionHeader;
|
|
@@ -5,8 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _templateObject;
|
|
9
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const SectionToolbar = _styledComponents.default.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
|
|
14
|
+
> *:not(:first-child) {
|
|
15
|
+
margin-left: var(--spacing-s);
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
12
18
|
var _default = exports.default = SectionToolbar;
|
|
@@ -5,8 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _templateObject;
|
|
9
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const SectionToolbarItem = _styledComponents.default.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
> *:not(:first-child) {
|
|
14
|
+
margin-left: var(--spacing-s);
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
12
17
|
var _default = exports.default = SectionToolbarItem;
|
package/select/InputSelect.js
CHANGED
|
@@ -13,24 +13,16 @@ var _ListBox = _interopRequireDefault(require("./subComponent/ListBox"));
|
|
|
13
13
|
var _Option = _interopRequireDefault(require("./subComponent/Option"));
|
|
14
14
|
var _Options = _interopRequireDefault(require("./subComponent/Options"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["options", "value", "disabled", "onChange", "onSelect"];
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
22
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
24
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
25
17
|
const InputSelect = _ref => {
|
|
26
18
|
let {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
options = [],
|
|
20
|
+
value,
|
|
21
|
+
disabled,
|
|
22
|
+
onChange,
|
|
23
|
+
onSelect,
|
|
24
|
+
...props
|
|
25
|
+
} = _ref;
|
|
34
26
|
const [displayListBox, setDisplayListBox] = (0, _react.useState)(false);
|
|
35
27
|
const [filteredOptions, setFilteredOptions] = (0, _react.useState)([]);
|
|
36
28
|
const [optionList, setOptionList] = (0, _react.useState)([]);
|
|
@@ -229,9 +221,10 @@ const InputSelect = _ref => {
|
|
|
229
221
|
} else {
|
|
230
222
|
selected = false;
|
|
231
223
|
}
|
|
232
|
-
return
|
|
224
|
+
return {
|
|
225
|
+
...option,
|
|
233
226
|
selected
|
|
234
|
-
}
|
|
227
|
+
};
|
|
235
228
|
}));
|
|
236
229
|
}, [filteredOptions, parsedSelected]);
|
|
237
230
|
(0, _react.useEffect)(() => {
|
|
@@ -243,16 +236,16 @@ const InputSelect = _ref => {
|
|
|
243
236
|
onOutsideClick: () => {
|
|
244
237
|
setDisplayListBox(false);
|
|
245
238
|
},
|
|
246
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default,
|
|
247
|
-
autoComplete: "off"
|
|
248
|
-
|
|
239
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
|
|
240
|
+
autoComplete: "off",
|
|
241
|
+
...props,
|
|
249
242
|
onChange: event => {
|
|
250
243
|
onChange(event);
|
|
251
244
|
if (!displayListBox) setDisplayListBox(true);
|
|
252
245
|
},
|
|
253
246
|
value: value,
|
|
254
|
-
ref: setListBoxElement
|
|
255
|
-
|
|
247
|
+
ref: setListBoxElement,
|
|
248
|
+
...attributes.popper,
|
|
256
249
|
placement: state && state.placement,
|
|
257
250
|
onClick: handleDisplay,
|
|
258
251
|
onKeyUp: handleKeyUp,
|
|
@@ -260,7 +253,7 @@ const InputSelect = _ref => {
|
|
|
260
253
|
setDisplayListBox(true);
|
|
261
254
|
},
|
|
262
255
|
onKeyDown: handleKeyDown
|
|
263
|
-
})
|
|
256
|
+
}), optionItem.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListBox.default, {
|
|
264
257
|
style: styles.popper,
|
|
265
258
|
$display: displayListBox,
|
|
266
259
|
ref: setDropdownElement,
|
package/select/Select.js
CHANGED
|
@@ -28,14 +28,7 @@ var _Footer = _interopRequireDefault(require("./subComponent/Footer"));
|
|
|
28
28
|
var _figure = require("../figure");
|
|
29
29
|
var _image = require("../image");
|
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
32
31
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
34
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
37
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
38
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
39
32
|
const Select = _ref => {
|
|
40
33
|
let {
|
|
41
34
|
options,
|
|
@@ -84,9 +77,10 @@ const Select = _ref => {
|
|
|
84
77
|
const newOptions = (0, _react.useMemo)(() => {
|
|
85
78
|
if (!options) return;
|
|
86
79
|
const newOptions = options.map(item => {
|
|
87
|
-
return
|
|
88
|
-
isDisable: false
|
|
89
|
-
|
|
80
|
+
return {
|
|
81
|
+
isDisable: false,
|
|
82
|
+
...item
|
|
83
|
+
};
|
|
90
84
|
});
|
|
91
85
|
if (options.length > 0 && multiple && enableSelectAll) {
|
|
92
86
|
newOptions.unshift({
|
|
@@ -194,13 +188,13 @@ const Select = _ref => {
|
|
|
194
188
|
return id === value;
|
|
195
189
|
});
|
|
196
190
|
});
|
|
197
|
-
const actualOpt = targetOption
|
|
191
|
+
const actualOpt = targetOption?.child ? targetOption.child.find(_ref4 => {
|
|
198
192
|
let {
|
|
199
193
|
id
|
|
200
194
|
} = _ref4;
|
|
201
195
|
return id === value;
|
|
202
196
|
}) : targetOption;
|
|
203
|
-
if (actualOpt
|
|
197
|
+
if (actualOpt?.isDisable) return;
|
|
204
198
|
|
|
205
199
|
// 選取選項
|
|
206
200
|
// 點選 all 全選
|
|
@@ -516,7 +510,8 @@ const Select = _ref => {
|
|
|
516
510
|
if (!filteredOptions) return;
|
|
517
511
|
setOptionList(filteredOptions.map(option => {
|
|
518
512
|
if (option.child && option.child.length > 0) {
|
|
519
|
-
return
|
|
513
|
+
return {
|
|
514
|
+
...option,
|
|
520
515
|
child: option.child.map(option => {
|
|
521
516
|
let selected = false;
|
|
522
517
|
if (multiple && selectedAllOptions.includes(option.id.toString())) {
|
|
@@ -524,11 +519,12 @@ const Select = _ref => {
|
|
|
524
519
|
} else if (selectedAllOptions === option.id.toString()) {
|
|
525
520
|
selected = true;
|
|
526
521
|
}
|
|
527
|
-
return
|
|
522
|
+
return {
|
|
523
|
+
...option,
|
|
528
524
|
selected
|
|
529
|
-
}
|
|
525
|
+
};
|
|
530
526
|
})
|
|
531
|
-
}
|
|
527
|
+
};
|
|
532
528
|
}
|
|
533
529
|
let selected = false;
|
|
534
530
|
if (multiple && selectedAllOptions.includes(option.id.toString())) {
|
|
@@ -536,9 +532,10 @@ const Select = _ref => {
|
|
|
536
532
|
} else if (selectedAllOptions === option.id.toString()) {
|
|
537
533
|
selected = true;
|
|
538
534
|
}
|
|
539
|
-
return
|
|
535
|
+
return {
|
|
536
|
+
...option,
|
|
540
537
|
selected
|
|
541
|
-
}
|
|
538
|
+
};
|
|
542
539
|
}));
|
|
543
540
|
}, [filteredOptions, multiple, selectedAllOptions]);
|
|
544
541
|
|
|
@@ -549,9 +546,10 @@ const Select = _ref => {
|
|
|
549
546
|
if (option.child && option.child.length > 0) {
|
|
550
547
|
const tmpFilteredChildOptions = option.child.filter(option => option.text.toLowerCase().indexOf(search.toLowerCase().trim()) !== -1);
|
|
551
548
|
if (tmpFilteredChildOptions.length > 0) {
|
|
552
|
-
tmpFilteredOptions.push(
|
|
549
|
+
tmpFilteredOptions.push({
|
|
550
|
+
...option,
|
|
553
551
|
child: tmpFilteredChildOptions
|
|
554
|
-
})
|
|
552
|
+
});
|
|
555
553
|
}
|
|
556
554
|
} else if (option.text.toLowerCase().indexOf(search.toLowerCase().trim()) !== -1) {
|
|
557
555
|
tmpFilteredOptions.push(option);
|
|
@@ -605,7 +603,7 @@ const Select = _ref => {
|
|
|
605
603
|
"aria-haspopup": "listbox",
|
|
606
604
|
"aria-expanded": display
|
|
607
605
|
})]
|
|
608
|
-
}), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default,
|
|
606
|
+
}), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
|
|
609
607
|
role: "listbox",
|
|
610
608
|
tabIndex: "0",
|
|
611
609
|
id: id,
|
|
@@ -614,8 +612,8 @@ const Select = _ref => {
|
|
|
614
612
|
onKeyDown: handleKeyDown,
|
|
615
613
|
width: listBoxWidth,
|
|
616
614
|
$display: display,
|
|
617
|
-
style: styles.popper
|
|
618
|
-
|
|
615
|
+
style: styles.popper,
|
|
616
|
+
...attributes.popper,
|
|
619
617
|
placement: state && state.placement,
|
|
620
618
|
children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
|
|
621
619
|
ref: searchBoxElement,
|
|
@@ -631,7 +629,7 @@ const Select = _ref => {
|
|
|
631
629
|
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer.default, {
|
|
632
630
|
children: footer
|
|
633
631
|
})]
|
|
634
|
-
})
|
|
632
|
+
}), document.body)]
|
|
635
633
|
})
|
|
636
634
|
});
|
|
637
635
|
};
|
|
@@ -651,58 +649,129 @@ const Icon = _ref5 => {
|
|
|
651
649
|
}), "\xA0"]
|
|
652
650
|
});
|
|
653
651
|
};
|
|
654
|
-
const Combobox = _styledComponents.default.div
|
|
652
|
+
const Combobox = _styledComponents.default.div`
|
|
653
|
+
display: flex;
|
|
654
|
+
flex-wrap: wrap;
|
|
655
|
+
align-items: center;
|
|
656
|
+
min-height: 36px;
|
|
657
|
+
cursor: pointer;
|
|
658
|
+
position: relative;
|
|
659
|
+
background: transparent;
|
|
660
|
+
color: var(--font-on-background);
|
|
661
|
+
font-size: var(--font-body1);
|
|
662
|
+
border: var(--border-width) solid var(--border-color);
|
|
663
|
+
border-radius: var(--border-radius-l);
|
|
664
|
+
padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);
|
|
665
|
+
|
|
666
|
+
&:focus {
|
|
667
|
+
${_ref6 => {
|
|
655
668
|
let {
|
|
656
669
|
disabled
|
|
657
670
|
} = _ref6;
|
|
658
|
-
return !disabled &&
|
|
659
|
-
|
|
671
|
+
return !disabled && `
|
|
672
|
+
border-color: var(--color-primary);
|
|
673
|
+
outline: none;
|
|
674
|
+
`;
|
|
675
|
+
}};
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
${_ref7 => {
|
|
660
679
|
let {
|
|
661
680
|
flexGrow
|
|
662
681
|
} = _ref7;
|
|
663
682
|
return !flexGrow && 'min-width: 160px;';
|
|
664
|
-
}
|
|
683
|
+
}}
|
|
684
|
+
|
|
685
|
+
${_ref8 => {
|
|
665
686
|
let {
|
|
666
687
|
$display
|
|
667
688
|
} = _ref8;
|
|
668
|
-
return $display &&
|
|
669
|
-
|
|
689
|
+
return $display && `
|
|
690
|
+
border-color: var(--color-primary);
|
|
691
|
+
outline: none;
|
|
692
|
+
`;
|
|
693
|
+
}}
|
|
694
|
+
|
|
695
|
+
${_ref9 => {
|
|
670
696
|
let {
|
|
671
697
|
disabled
|
|
672
698
|
} = _ref9;
|
|
673
699
|
return disabled && 'cursor: not-allowed;opacity: 0.5;';
|
|
674
|
-
}
|
|
700
|
+
}}
|
|
701
|
+
${_ref10 => {
|
|
675
702
|
let {
|
|
676
703
|
placeholder
|
|
677
704
|
} = _ref10;
|
|
678
705
|
return placeholder && 'color: var(--font-on-mute);';
|
|
679
|
-
}
|
|
706
|
+
}}
|
|
707
|
+
|
|
708
|
+
${_ref11 => {
|
|
680
709
|
let {
|
|
681
710
|
fullWidth
|
|
682
711
|
} = _ref11;
|
|
683
712
|
return fullWidth ? 'width: 100%' : 'max-width: 320px';
|
|
684
|
-
}
|
|
713
|
+
}};
|
|
714
|
+
|
|
715
|
+
${_ref12 => {
|
|
685
716
|
let {
|
|
686
717
|
large
|
|
687
718
|
} = _ref12;
|
|
688
|
-
return large &&
|
|
689
|
-
|
|
719
|
+
return large && `
|
|
720
|
+
height: 40px;
|
|
721
|
+
padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);
|
|
722
|
+
`;
|
|
723
|
+
}}
|
|
724
|
+
|
|
725
|
+
${_ref13 => {
|
|
690
726
|
let {
|
|
691
727
|
$fill
|
|
692
728
|
} = _ref13;
|
|
693
|
-
return $fill &&
|
|
694
|
-
|
|
729
|
+
return $fill && `
|
|
730
|
+
background: var(--color-background2);
|
|
731
|
+
border-color: transparent;
|
|
732
|
+
`;
|
|
733
|
+
}}
|
|
734
|
+
|
|
735
|
+
${_ref14 => {
|
|
695
736
|
let {
|
|
696
737
|
fillReverse
|
|
697
738
|
} = _ref14;
|
|
698
|
-
return fillReverse &&
|
|
699
|
-
|
|
739
|
+
return fillReverse && `
|
|
740
|
+
background: var(--color-background1);
|
|
741
|
+
border-color: transparent;
|
|
742
|
+
`;
|
|
743
|
+
}}
|
|
744
|
+
`;
|
|
700
745
|
Combobox.displayName = 'Combobox';
|
|
701
|
-
const CloseButton = (0, _styledComponents.default)(_md.MdClose)
|
|
746
|
+
const CloseButton = (0, _styledComponents.default)(_md.MdClose)`
|
|
747
|
+
position: absolute;
|
|
748
|
+
top: 50%;
|
|
749
|
+
transform: translateY(-50%);
|
|
750
|
+
color: var(--color-primary);
|
|
751
|
+
font-size: var(--font-body1);
|
|
752
|
+
right: var(--spacing-l);
|
|
753
|
+
|
|
754
|
+
${_media.default.tablet`
|
|
755
|
+
right: calc(var(--spacing) + var(--spacing-s));
|
|
756
|
+
`};
|
|
757
|
+
`;
|
|
702
758
|
CloseButton.displayName = 'CloseButton';
|
|
703
|
-
const ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)
|
|
759
|
+
const ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)`
|
|
760
|
+
position: absolute;
|
|
761
|
+
top: 50%;
|
|
762
|
+
transform: translateY(-50%);
|
|
763
|
+
color: var(--color-primary);
|
|
764
|
+
font-size: var(--font-body1);
|
|
765
|
+
right: var(--spacing-s);
|
|
766
|
+
`;
|
|
704
767
|
ExpandArrow.displayName = 'ExpandArrow';
|
|
705
|
-
const Message = _styledComponents.default.p
|
|
768
|
+
const Message = _styledComponents.default.p`
|
|
769
|
+
margin: 0;
|
|
770
|
+
padding: 12px var(--spacing-s);
|
|
771
|
+
`;
|
|
706
772
|
Message.displayName = 'Message';
|
|
707
|
-
const OptionBadge = _styledComponents.default.span
|
|
773
|
+
const OptionBadge = _styledComponents.default.span`
|
|
774
|
+
color: var(--color-danger);
|
|
775
|
+
font-style: italic;
|
|
776
|
+
`;
|
|
708
777
|
var _default = exports.default = Select;
|