@majoo-ui/react 1.57.4 → 1.57.6
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.
|
@@ -587,7 +587,7 @@ export declare const SelectItem: import("@stitches/react/types/styled-component"
|
|
|
587
587
|
backgroundColor: string;
|
|
588
588
|
};
|
|
589
589
|
}>>;
|
|
590
|
-
export declare const SelectInputSearch: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
|
590
|
+
export declare const SelectInputSearch: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLInputElement | HTMLButtonElement>>;
|
|
591
591
|
export declare type Option = {
|
|
592
592
|
value: string;
|
|
593
593
|
name: string;
|
|
@@ -709,5 +709,5 @@ interface InputSelectProps extends Omit<DownshiftProps<Option>, 'initialSelected
|
|
|
709
709
|
*/
|
|
710
710
|
renderFooter?: () => React.ReactNode;
|
|
711
711
|
}
|
|
712
|
-
|
|
712
|
+
declare const InputSelect: React.ForwardRefExoticComponent<InputSelectProps & React.RefAttributes<HTMLInputElement | HTMLButtonElement>>;
|
|
713
713
|
export default InputSelect;
|
|
@@ -4,14 +4,18 @@ export interface SelectedItem {
|
|
|
4
4
|
name: string;
|
|
5
5
|
}
|
|
6
6
|
interface TagListProps {
|
|
7
|
+
/**
|
|
8
|
+
* List of selected item.
|
|
9
|
+
*/
|
|
7
10
|
selectedItems: SelectedItem[];
|
|
11
|
+
/**
|
|
12
|
+
* onRemoveItem event handler.
|
|
13
|
+
*/
|
|
8
14
|
onRemoveItem?: (SelectedItem: any) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Custom counter label.
|
|
17
|
+
*/
|
|
9
18
|
counterLabel?: string;
|
|
10
19
|
}
|
|
11
20
|
declare function TagList({ selectedItems, onRemoveItem, counterLabel }: TagListProps): JSX.Element;
|
|
12
|
-
declare namespace TagList {
|
|
13
|
-
var defaultProps: {
|
|
14
|
-
counterLabel: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
21
|
export default TagList;
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useState, createContext, useContext, useEffect, useRef, useCallback, cloneElement, createElement as createElement$2,
|
|
2
|
+
import React__default, { useState, createContext, useContext, useEffect, useRef, useCallback, cloneElement, forwardRef, createElement as createElement$2, useLayoutEffect, useReducer, useMemo, memo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { createStitches, styled as styled$1 } from '@stitches/react';
|
|
5
5
|
import { foundations } from '@majoo-ui/core';
|
|
@@ -9125,7 +9125,7 @@ const SelectInputSearch = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
|
|
|
9125
9125
|
}, void 0)]
|
|
9126
9126
|
}), void 0);
|
|
9127
9127
|
});
|
|
9128
|
-
|
|
9128
|
+
const InputSelect = /*#__PURE__*/forwardRef((_a, ref) => {
|
|
9129
9129
|
var {
|
|
9130
9130
|
option,
|
|
9131
9131
|
onChange,
|
|
@@ -9206,7 +9206,7 @@ function InputSelect(_a) {
|
|
|
9206
9206
|
setItem(generatedOption);
|
|
9207
9207
|
setOptions(generatedOption);
|
|
9208
9208
|
}, [option, disabledOptions, valueSelector, textSelector]);
|
|
9209
|
-
const debouncedSearch = React.useRef(debounce(query => __awaiter(
|
|
9209
|
+
const debouncedSearch = React.useRef(debounce(query => __awaiter(void 0, void 0, void 0, function* () {
|
|
9210
9210
|
setQuery(query);
|
|
9211
9211
|
if (onSearch) onSearch(query);
|
|
9212
9212
|
}), 1000)).current;
|
|
@@ -9292,6 +9292,7 @@ function InputSelect(_a) {
|
|
|
9292
9292
|
}
|
|
9293
9293
|
}, {
|
|
9294
9294
|
children: jsx(SelectInputSearch, {
|
|
9295
|
+
ref: ref,
|
|
9295
9296
|
showLeadingIcon: showLeadingIcon,
|
|
9296
9297
|
showClearIcon: hideArrowicon,
|
|
9297
9298
|
disabled: disabled,
|
|
@@ -9316,6 +9317,7 @@ function InputSelect(_a) {
|
|
|
9316
9317
|
}), void 0) : jsx(Button$3, Object.assign({}, getToggleButtonProps({
|
|
9317
9318
|
disabled: disabled || readOnly
|
|
9318
9319
|
}), {
|
|
9320
|
+
ref: ref,
|
|
9319
9321
|
disabled: disabled,
|
|
9320
9322
|
size: size,
|
|
9321
9323
|
readOnly: readOnly,
|
|
@@ -9474,7 +9476,7 @@ function InputSelect(_a) {
|
|
|
9474
9476
|
}), void 0);
|
|
9475
9477
|
}
|
|
9476
9478
|
}), void 0);
|
|
9477
|
-
}
|
|
9479
|
+
});
|
|
9478
9480
|
|
|
9479
9481
|
var tryToString$3 = tryToString$5;
|
|
9480
9482
|
|
|
@@ -16857,7 +16859,7 @@ function InputTimePicker({
|
|
|
16857
16859
|
defaultValue: defaultValue,
|
|
16858
16860
|
onChange: () => {},
|
|
16859
16861
|
isPicker: true,
|
|
16860
|
-
|
|
16862
|
+
autoComplete: "false"
|
|
16861
16863
|
// tabIndex="-1"
|
|
16862
16864
|
,
|
|
16863
16865
|
__self: this,
|
|
@@ -17569,7 +17571,7 @@ function InputDateRangePicker(props) {
|
|
|
17569
17571
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17570
17572
|
onChange: () => {},
|
|
17571
17573
|
isPicker: true,
|
|
17572
|
-
|
|
17574
|
+
autoComplete: "false"
|
|
17573
17575
|
}, void 0)]
|
|
17574
17576
|
}), void 0);
|
|
17575
17577
|
}
|
|
@@ -17674,7 +17676,7 @@ function InputDatePicker({
|
|
|
17674
17676
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17675
17677
|
onChange: () => {},
|
|
17676
17678
|
isPicker: true,
|
|
17677
|
-
|
|
17679
|
+
autoComplete: "false"
|
|
17678
17680
|
}, void 0)]
|
|
17679
17681
|
}), void 0);
|
|
17680
17682
|
} else {
|
|
@@ -20718,6 +20720,8 @@ const PageDialog = props => {
|
|
|
20718
20720
|
}, void 0)
|
|
20719
20721
|
}), void 0);
|
|
20720
20722
|
return jsxs(Dialog, Object.assign({}, rest, {
|
|
20723
|
+
modal: false
|
|
20724
|
+
}, {
|
|
20721
20725
|
children: [pageDialogTrigger && jsx(DialogTrigger, Object.assign({}, pageDialogTrigger.props), void 0), jsx(ConditionalWrapper, Object.assign({
|
|
20722
20726
|
condition: withPortal,
|
|
20723
20727
|
wrapper: _child => jsx(DialogPortal, {
|
|
@@ -50176,6 +50180,9 @@ function TagList({
|
|
|
50176
50180
|
onRemoveItem,
|
|
50177
50181
|
counterLabel
|
|
50178
50182
|
}) {
|
|
50183
|
+
const {
|
|
50184
|
+
t
|
|
50185
|
+
} = useTranslation(['MajooUI/inputSelectCheck', 'translation']);
|
|
50179
50186
|
const [showAllTags, setShowAllTags] = useState(false);
|
|
50180
50187
|
return jsxs(React__default.Fragment, {
|
|
50181
50188
|
children: [jsx(TagWrapper, {
|
|
@@ -50224,7 +50231,7 @@ function TagList({
|
|
|
50224
50231
|
},
|
|
50225
50232
|
color: "secondary"
|
|
50226
50233
|
}, {
|
|
50227
|
-
children: showAllTags ? 'Tampilkan Sebagian' : 'Tampilkan Semua'
|
|
50234
|
+
children: showAllTags ? t('showSomeText', 'Tampilkan Sebagian') : t('showAllText', 'Tampilkan Semua')
|
|
50228
50235
|
}), void 0)]
|
|
50229
50236
|
}), void 0), jsx(Separator$2, {}, void 0)]
|
|
50230
50237
|
}), void 0), jsxs(Text$1, Object.assign({
|
|
@@ -50234,13 +50241,10 @@ function TagList({
|
|
|
50234
50241
|
marginTop: '$spacing-03 !important'
|
|
50235
50242
|
}
|
|
50236
50243
|
}, {
|
|
50237
|
-
children: [selectedItems.length, " ", counterLabel]
|
|
50244
|
+
children: [selectedItems.length, " ", counterLabel || t('labelCounterText', 'Item terpilih')]
|
|
50238
50245
|
}), void 0)]
|
|
50239
50246
|
}, void 0);
|
|
50240
50247
|
}
|
|
50241
|
-
TagList.defaultProps = {
|
|
50242
|
-
counterLabel: 'produk dipilih'
|
|
50243
|
-
};
|
|
50244
50248
|
|
|
50245
50249
|
const {
|
|
50246
50250
|
colors: colors$1
|
|
@@ -50689,6 +50693,7 @@ const PieChartComponent = ({
|
|
|
50689
50693
|
setActiveIndex(formattedData.findIndex(y => y.name === x.name));
|
|
50690
50694
|
activeRef.current = true;
|
|
50691
50695
|
},
|
|
50696
|
+
onMouseLeave: () => activeRef.current = false,
|
|
50692
50697
|
blendStroke: true
|
|
50693
50698
|
}, (label === null || label === void 0 ? void 0 : label.show) && (label === null || label === void 0 ? void 0 : label.render) && {
|
|
50694
50699
|
label: e => {
|
package/index.umd.js
CHANGED
|
@@ -9197,8 +9197,7 @@
|
|
|
9197
9197
|
}, void 0)]
|
|
9198
9198
|
}), void 0);
|
|
9199
9199
|
});
|
|
9200
|
-
|
|
9201
|
-
var _this = this;
|
|
9200
|
+
var InputSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
9202
9201
|
var option = _a.option,
|
|
9203
9202
|
onChange = _a.onChange,
|
|
9204
9203
|
value = _a.value,
|
|
@@ -9311,7 +9310,7 @@
|
|
|
9311
9310
|
setOptions(generatedOption);
|
|
9312
9311
|
}, [option, disabledOptions, valueSelector, textSelector]);
|
|
9313
9312
|
var debouncedSearch = React__namespace.useRef(debounce__default["default"](function (query) {
|
|
9314
|
-
return __awaiter(
|
|
9313
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
9315
9314
|
return __generator(this, function (_a) {
|
|
9316
9315
|
setQuery(query);
|
|
9317
9316
|
if (onSearch) onSearch(query);
|
|
@@ -9406,6 +9405,7 @@
|
|
|
9406
9405
|
}
|
|
9407
9406
|
}, {
|
|
9408
9407
|
children: jsxRuntime.jsx(SelectInputSearch, {
|
|
9408
|
+
ref: ref,
|
|
9409
9409
|
showLeadingIcon: showLeadingIcon,
|
|
9410
9410
|
showClearIcon: hideArrowicon,
|
|
9411
9411
|
disabled: disabled,
|
|
@@ -9430,6 +9430,7 @@
|
|
|
9430
9430
|
}), void 0) : jsxRuntime.jsx(Button$3, __assign({}, getToggleButtonProps({
|
|
9431
9431
|
disabled: disabled || readOnly
|
|
9432
9432
|
}), {
|
|
9433
|
+
ref: ref,
|
|
9433
9434
|
disabled: disabled,
|
|
9434
9435
|
size: size,
|
|
9435
9436
|
readOnly: readOnly,
|
|
@@ -9592,7 +9593,7 @@
|
|
|
9592
9593
|
}), void 0);
|
|
9593
9594
|
}
|
|
9594
9595
|
}), void 0);
|
|
9595
|
-
}
|
|
9596
|
+
});
|
|
9596
9597
|
|
|
9597
9598
|
var tryToString$3 = tryToString$5;
|
|
9598
9599
|
|
|
@@ -17106,7 +17107,7 @@
|
|
|
17106
17107
|
defaultValue: defaultValue,
|
|
17107
17108
|
onChange: () => {},
|
|
17108
17109
|
isPicker: true,
|
|
17109
|
-
|
|
17110
|
+
autoComplete: "false"
|
|
17110
17111
|
// tabIndex="-1"
|
|
17111
17112
|
,
|
|
17112
17113
|
__self: this,
|
|
@@ -17826,7 +17827,7 @@
|
|
|
17826
17827
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17827
17828
|
onChange: function () {},
|
|
17828
17829
|
isPicker: true,
|
|
17829
|
-
|
|
17830
|
+
autoComplete: "false"
|
|
17830
17831
|
}, void 0)]
|
|
17831
17832
|
}), void 0);
|
|
17832
17833
|
}
|
|
@@ -17939,7 +17940,7 @@
|
|
|
17939
17940
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17940
17941
|
onChange: function () {},
|
|
17941
17942
|
isPicker: true,
|
|
17942
|
-
|
|
17943
|
+
autoComplete: "false"
|
|
17943
17944
|
}, void 0)]
|
|
17944
17945
|
}), void 0);
|
|
17945
17946
|
} else {
|
|
@@ -21094,6 +21095,8 @@
|
|
|
21094
21095
|
}), void 0);
|
|
21095
21096
|
};
|
|
21096
21097
|
return jsxRuntime.jsxs(Dialog, __assign({}, rest, {
|
|
21098
|
+
modal: false
|
|
21099
|
+
}, {
|
|
21097
21100
|
children: [pageDialogTrigger && jsxRuntime.jsx(DialogTrigger, __assign({}, pageDialogTrigger.props), void 0), jsxRuntime.jsx(ConditionalWrapper, __assign({
|
|
21098
21101
|
condition: withPortal,
|
|
21099
21102
|
wrapper: function (_child) {
|
|
@@ -50690,6 +50693,7 @@
|
|
|
50690
50693
|
var selectedItems = _a.selectedItems,
|
|
50691
50694
|
onRemoveItem = _a.onRemoveItem,
|
|
50692
50695
|
counterLabel = _a.counterLabel;
|
|
50696
|
+
var t = reactI18next.useTranslation(['MajooUI/inputSelectCheck', 'translation']).t;
|
|
50693
50697
|
var _b = React.useState(false),
|
|
50694
50698
|
showAllTags = _b[0],
|
|
50695
50699
|
setShowAllTags = _b[1];
|
|
@@ -50748,7 +50752,7 @@
|
|
|
50748
50752
|
},
|
|
50749
50753
|
color: "secondary"
|
|
50750
50754
|
}, {
|
|
50751
|
-
children: showAllTags ? 'Tampilkan Sebagian' : 'Tampilkan Semua'
|
|
50755
|
+
children: showAllTags ? t('showSomeText', 'Tampilkan Sebagian') : t('showAllText', 'Tampilkan Semua')
|
|
50752
50756
|
}), void 0)]
|
|
50753
50757
|
}), void 0), jsxRuntime.jsx(Separator$2, {}, void 0)]
|
|
50754
50758
|
}), void 0), jsxRuntime.jsxs(Text$1, __assign({
|
|
@@ -50758,13 +50762,10 @@
|
|
|
50758
50762
|
marginTop: '$spacing-03 !important'
|
|
50759
50763
|
}
|
|
50760
50764
|
}, {
|
|
50761
|
-
children: [selectedItems.length, " ", counterLabel]
|
|
50765
|
+
children: [selectedItems.length, " ", counterLabel || t('labelCounterText', 'Item terpilih')]
|
|
50762
50766
|
}), void 0)]
|
|
50763
50767
|
}, void 0);
|
|
50764
50768
|
}
|
|
50765
|
-
TagList.defaultProps = {
|
|
50766
|
-
counterLabel: 'produk dipilih'
|
|
50767
|
-
};
|
|
50768
50769
|
|
|
50769
50770
|
var colors$1 = core.foundations.colors;
|
|
50770
50771
|
var renderLegend$1 = function renderLegend(formattedData, legend, subtitle, tickFormatter) {
|
|
@@ -51219,6 +51220,9 @@
|
|
|
51219
51220
|
}));
|
|
51220
51221
|
activeRef.current = true;
|
|
51221
51222
|
},
|
|
51223
|
+
onMouseLeave: function () {
|
|
51224
|
+
return activeRef.current = false;
|
|
51225
|
+
},
|
|
51222
51226
|
blendStroke: true
|
|
51223
51227
|
}, (label === null || label === void 0 ? void 0 : label.show) && (label === null || label === void 0 ? void 0 : label.render) && {
|
|
51224
51228
|
label: function (e) {
|