@majoo-ui/react 1.55.16 → 1.55.17
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/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@stitches/react'), require('@majoo-ui/core'), require('@majoo-ui/icons'), require('react-transition-group'), require('react/jsx-runtime'), require('@majoo-ui/helpers'), require('react-i18next'), require('moment'), require('@radix-ui/react-avatar'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-progress'), require('@radix-ui/react-label'), require('@radix-ui/react-checkbox'), require('@radix-ui/react-radio-group'), require('react-number-format'), require('@radix-ui/react-switch'), require('downshift'), require('react-infinite-scroller'), require('lodash.debounce'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', '@stitches/react', '@majoo-ui/core', '@majoo-ui/icons', 'react-transition-group', 'react/jsx-runtime', '@majoo-ui/helpers', 'react-i18next', 'moment', '@radix-ui/react-avatar', '@radix-ui/react-tooltip', '@radix-ui/react-progress', '@radix-ui/react-label', '@radix-ui/react-checkbox', '@radix-ui/react-radio-group', 'react-number-format', '@radix-ui/react-switch', 'downshift', 'react-infinite-scroller', 'lodash.debounce', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.PropTypes, global.react, global.core, global.icons, global.reactTransitionGroup, global.jsxRuntime, global.helpers, global.reactI18next, global.moment, global.AvatarPrimitive, global.TooltipPrimitive, global.ProgressPrimitive, global.LabelPrimitive, global.CheckboxPrimitive, global.RadioGroupPrimitive, global.NumberFormat, global.SwitchPrimitive, global.Downshift, global.InfiniteScroll, global.debounce, global.
|
|
5
|
-
})(this, (function (exports, React, PropTypes, react, core, icons, reactTransitionGroup, jsxRuntime, helpers, reactI18next, moment, AvatarPrimitive, TooltipPrimitive, ProgressPrimitive, LabelPrimitive, CheckboxPrimitive, RadioGroupPrimitive, NumberFormat, SwitchPrimitive, Downshift, InfiniteScroll, debounce,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@stitches/react'), require('@majoo-ui/core'), require('@majoo-ui/icons'), require('react-transition-group'), require('react/jsx-runtime'), require('@majoo-ui/helpers'), require('react-i18next'), require('moment'), require('@radix-ui/react-avatar'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-progress'), require('@radix-ui/react-label'), require('@radix-ui/react-checkbox'), require('@radix-ui/react-radio-group'), require('react-number-format'), require('@radix-ui/react-switch'), require('downshift'), require('react-infinite-scroller'), require('lodash.debounce'), require('@floating-ui/react-dom-interactions'), require('otp-input-react'), require('@radix-ui/react-slider'), require('@radix-ui/react-tabs'), require('@radix-ui/react-separator'), require('@radix-ui/react-toggle-group'), require('@radix-ui/react-dialog'), require('@radix-ui/react-accordion'), require('dayzed'), require('react-table'), require('react-dom'), require('@radix-ui/react-alert-dialog'), require('@radix-ui/react-dropdown-menu'), require('@radix-ui/react-aspect-ratio'), require('react-color/lib/components/common'), require('react-color/lib/helpers/color'), require('react-step-wizard'), require('@react-google-maps/api'), require('superagent'), require('recharts'), require('draft-js'), require('react-draft-wysiwyg'), require('react-contextmenu'), require('react-loading-skeleton'), require('react-loading-skeleton/dist/skeleton.css'), require('react-ui-scrollspy'), require('react-image-crop'), require('browser-image-compression'), require('react-table-sticky')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', '@stitches/react', '@majoo-ui/core', '@majoo-ui/icons', 'react-transition-group', 'react/jsx-runtime', '@majoo-ui/helpers', 'react-i18next', 'moment', '@radix-ui/react-avatar', '@radix-ui/react-tooltip', '@radix-ui/react-progress', '@radix-ui/react-label', '@radix-ui/react-checkbox', '@radix-ui/react-radio-group', 'react-number-format', '@radix-ui/react-switch', 'downshift', 'react-infinite-scroller', 'lodash.debounce', '@floating-ui/react-dom-interactions', 'otp-input-react', '@radix-ui/react-slider', '@radix-ui/react-tabs', '@radix-ui/react-separator', '@radix-ui/react-toggle-group', '@radix-ui/react-dialog', '@radix-ui/react-accordion', 'dayzed', 'react-table', 'react-dom', '@radix-ui/react-alert-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-aspect-ratio', 'react-color/lib/components/common', 'react-color/lib/helpers/color', 'react-step-wizard', '@react-google-maps/api', 'superagent', 'recharts', 'draft-js', 'react-draft-wysiwyg', 'react-contextmenu', 'react-loading-skeleton', 'react-loading-skeleton/dist/skeleton.css', 'react-ui-scrollspy', 'react-image-crop', 'browser-image-compression', 'react-table-sticky'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.React, global.PropTypes, global.react, global.core, global.icons, global.reactTransitionGroup, global.jsxRuntime, global.helpers, global.reactI18next, global.moment, global.AvatarPrimitive, global.TooltipPrimitive, global.ProgressPrimitive, global.LabelPrimitive, global.CheckboxPrimitive, global.RadioGroupPrimitive, global.NumberFormat, global.SwitchPrimitive, global.Downshift, global.InfiniteScroll, global.debounce, global.reactDomInteractions, global.OTPInput, global.SliderPrimitive, global.TabsPrimitive, global.SeparatorPrimitive, global.ToggleGroupPrimitive, global.DialogPrimitive, global.AccordionPrimitive, global.dayzed, global.reactTable, global.ReactDOM, global.ADialog, global.DropdownMenuPrimitive, global.AspectRatioPrimitive, global.common, global.color, global.StepWizard$1, global.api, global.request, global.recharts, global.draftJs, global.reactDraftWysiwyg, global.reactContextmenu, global.ReactSkeleton, null, global.ScrollSpy, global.ReactCrop, global.imageCompressionComponent, global.reactTableSticky));
|
|
5
|
+
})(this, (function (exports, React, PropTypes, react, core, icons, reactTransitionGroup, jsxRuntime, helpers, reactI18next, moment, AvatarPrimitive, TooltipPrimitive, ProgressPrimitive, LabelPrimitive, CheckboxPrimitive, RadioGroupPrimitive, NumberFormat, SwitchPrimitive, Downshift, InfiniteScroll, debounce, reactDomInteractions, OTPInput, SliderPrimitive, TabsPrimitive, SeparatorPrimitive, ToggleGroupPrimitive, DialogPrimitive, AccordionPrimitive, dayzed, reactTable, ReactDOM, ADialog, DropdownMenuPrimitive, AspectRatioPrimitive, common, color, StepWizard$1, api, request, recharts, draftJs, reactDraftWysiwyg, reactContextmenu, ReactSkeleton, skeleton_css, ScrollSpy, ReactCrop, imageCompressionComponent, reactTableSticky) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -2818,7 +2818,7 @@
|
|
|
2818
2818
|
fontWeight: '600'
|
|
2819
2819
|
},
|
|
2820
2820
|
pageTitle: {
|
|
2821
|
-
fontSize: '$page-title',
|
|
2821
|
+
fontSize: '$page-title-2',
|
|
2822
2822
|
lineHeight: '$page-title',
|
|
2823
2823
|
letterSpacing: '$page-title',
|
|
2824
2824
|
fontWeight: '600'
|
|
@@ -2854,7 +2854,7 @@
|
|
|
2854
2854
|
color: 'primary',
|
|
2855
2855
|
heading: 'h1'
|
|
2856
2856
|
};
|
|
2857
|
-
Heading.displayName =
|
|
2857
|
+
Heading.displayName = 'Heading';
|
|
2858
2858
|
|
|
2859
2859
|
const Paragraph = styled(Text$1, {
|
|
2860
2860
|
variants: {
|
|
@@ -5439,7 +5439,7 @@
|
|
|
5439
5439
|
color: "disable",
|
|
5440
5440
|
css: {
|
|
5441
5441
|
alignSelf: 'end',
|
|
5442
|
-
marginBottom: '$spacing-03'
|
|
5442
|
+
marginBottom: '$spacing-03 !important'
|
|
5443
5443
|
},
|
|
5444
5444
|
__self: undefined,
|
|
5445
5445
|
__source: {
|
|
@@ -6708,6 +6708,10 @@
|
|
|
6708
6708
|
}
|
|
6709
6709
|
}]
|
|
6710
6710
|
});
|
|
6711
|
+
const ContainerLabel = styled('label', {
|
|
6712
|
+
width: 'fit-content',
|
|
6713
|
+
cursor: 'pointer'
|
|
6714
|
+
});
|
|
6711
6715
|
const InputRadio = _ref => {
|
|
6712
6716
|
let {
|
|
6713
6717
|
id,
|
|
@@ -6719,28 +6723,38 @@
|
|
|
6719
6723
|
readOnly
|
|
6720
6724
|
} = _ref,
|
|
6721
6725
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
6722
|
-
function renderInputType(type,
|
|
6726
|
+
function renderInputType(type, checkedValue, onValueChange) {
|
|
6723
6727
|
switch (type) {
|
|
6724
6728
|
case 'number':
|
|
6725
6729
|
return /*#__PURE__*/React__default["default"].createElement(InputNumber, _extends({}, inputProps, {
|
|
6726
|
-
readOnly: readOnly
|
|
6730
|
+
readOnly: readOnly,
|
|
6731
|
+
onFocus: () => {
|
|
6732
|
+
var _inputProps$onFocus;
|
|
6733
|
+
onValueChange(props.value);
|
|
6734
|
+
inputProps === null || inputProps === void 0 ? void 0 : (_inputProps$onFocus = inputProps.onFocus) === null || _inputProps$onFocus === void 0 ? void 0 : _inputProps$onFocus.call(inputProps);
|
|
6735
|
+
},
|
|
6727
6736
|
asChild: true,
|
|
6728
6737
|
__self: this,
|
|
6729
6738
|
__source: {
|
|
6730
6739
|
fileName: _jsxFileName$G,
|
|
6731
|
-
lineNumber:
|
|
6732
|
-
columnNumber:
|
|
6740
|
+
lineNumber: 162,
|
|
6741
|
+
columnNumber: 11
|
|
6733
6742
|
}
|
|
6734
6743
|
}));
|
|
6735
6744
|
case 'text':
|
|
6736
6745
|
return /*#__PURE__*/React__default["default"].createElement(InputText, _extends({}, inputProps, {
|
|
6737
|
-
disabled: disabled
|
|
6738
|
-
readOnly: readOnly
|
|
6746
|
+
disabled: disabled,
|
|
6747
|
+
readOnly: readOnly,
|
|
6748
|
+
onFocus: () => {
|
|
6749
|
+
var _inputProps$onFocus2;
|
|
6750
|
+
onValueChange(props.value);
|
|
6751
|
+
inputProps === null || inputProps === void 0 ? void 0 : (_inputProps$onFocus2 = inputProps.onFocus) === null || _inputProps$onFocus2 === void 0 ? void 0 : _inputProps$onFocus2.call(inputProps);
|
|
6752
|
+
},
|
|
6739
6753
|
asChild: true,
|
|
6740
6754
|
__self: this,
|
|
6741
6755
|
__source: {
|
|
6742
6756
|
fileName: _jsxFileName$G,
|
|
6743
|
-
lineNumber:
|
|
6757
|
+
lineNumber: 175,
|
|
6744
6758
|
columnNumber: 11
|
|
6745
6759
|
}
|
|
6746
6760
|
}));
|
|
@@ -6754,12 +6768,12 @@
|
|
|
6754
6768
|
letterSpacing: '$long-content-regular',
|
|
6755
6769
|
fontWeight: '400',
|
|
6756
6770
|
cursor: 'pointer',
|
|
6757
|
-
color: disabled || readOnly &&
|
|
6771
|
+
color: disabled || readOnly && checkedValue !== props.value ? '$textDisable' : '$textPrimary'
|
|
6758
6772
|
},
|
|
6759
6773
|
__self: this,
|
|
6760
6774
|
__source: {
|
|
6761
6775
|
fileName: _jsxFileName$G,
|
|
6762
|
-
lineNumber:
|
|
6776
|
+
lineNumber: 189,
|
|
6763
6777
|
columnNumber: 11
|
|
6764
6778
|
}
|
|
6765
6779
|
}, props.label);
|
|
@@ -6769,28 +6783,37 @@
|
|
|
6769
6783
|
__self: undefined,
|
|
6770
6784
|
__source: {
|
|
6771
6785
|
fileName: _jsxFileName$G,
|
|
6772
|
-
lineNumber:
|
|
6786
|
+
lineNumber: 208,
|
|
6773
6787
|
columnNumber: 5
|
|
6774
6788
|
}
|
|
6775
6789
|
}, ({
|
|
6776
6790
|
defaultValue,
|
|
6777
6791
|
value,
|
|
6778
|
-
outlined
|
|
6792
|
+
outlined,
|
|
6793
|
+
onValueChange
|
|
6779
6794
|
}) => {
|
|
6780
|
-
const
|
|
6781
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
6795
|
+
const checkedValue = value != null ? value : defaultValue;
|
|
6796
|
+
return /*#__PURE__*/React__default["default"].createElement(ContainerLabel, {
|
|
6797
|
+
htmlFor: id,
|
|
6798
|
+
__self: undefined,
|
|
6799
|
+
__source: {
|
|
6800
|
+
fileName: _jsxFileName$G,
|
|
6801
|
+
lineNumber: 213,
|
|
6802
|
+
columnNumber: 11
|
|
6803
|
+
}
|
|
6804
|
+
}, /*#__PURE__*/React__default["default"].createElement(Container$a, {
|
|
6782
6805
|
direction: "column",
|
|
6783
6806
|
outlined: outlined,
|
|
6784
6807
|
disabledOutlined: outlined && (readOnly || disabled),
|
|
6785
6808
|
disabled: disabled,
|
|
6786
|
-
active: outlined &&
|
|
6809
|
+
active: outlined && checkedValue === props.value && !disabled && !readOnly,
|
|
6787
6810
|
withInputProps: !!inputProps,
|
|
6788
6811
|
css: css,
|
|
6789
6812
|
__self: undefined,
|
|
6790
6813
|
__source: {
|
|
6791
6814
|
fileName: _jsxFileName$G,
|
|
6792
|
-
lineNumber:
|
|
6793
|
-
columnNumber:
|
|
6815
|
+
lineNumber: 214,
|
|
6816
|
+
columnNumber: 13
|
|
6794
6817
|
}
|
|
6795
6818
|
}, /*#__PURE__*/React__default["default"].createElement(Flex$1, {
|
|
6796
6819
|
align: "center",
|
|
@@ -6798,8 +6821,8 @@
|
|
|
6798
6821
|
__self: undefined,
|
|
6799
6822
|
__source: {
|
|
6800
6823
|
fileName: _jsxFileName$G,
|
|
6801
|
-
lineNumber:
|
|
6802
|
-
columnNumber:
|
|
6824
|
+
lineNumber: 223,
|
|
6825
|
+
columnNumber: 15
|
|
6803
6826
|
}
|
|
6804
6827
|
}, /*#__PURE__*/React__default["default"].createElement(StyledRadio, _extends({
|
|
6805
6828
|
id: id,
|
|
@@ -6809,17 +6832,17 @@
|
|
|
6809
6832
|
__self: undefined,
|
|
6810
6833
|
__source: {
|
|
6811
6834
|
fileName: _jsxFileName$G,
|
|
6812
|
-
lineNumber:
|
|
6813
|
-
columnNumber:
|
|
6835
|
+
lineNumber: 224,
|
|
6836
|
+
columnNumber: 17
|
|
6814
6837
|
}
|
|
6815
6838
|
}), /*#__PURE__*/React__default["default"].createElement(StyledIndicator$1, {
|
|
6816
6839
|
__self: undefined,
|
|
6817
6840
|
__source: {
|
|
6818
6841
|
fileName: _jsxFileName$G,
|
|
6819
|
-
lineNumber:
|
|
6820
|
-
columnNumber:
|
|
6842
|
+
lineNumber: 225,
|
|
6843
|
+
columnNumber: 19
|
|
6821
6844
|
}
|
|
6822
|
-
})), renderInputType(inputType,
|
|
6845
|
+
})), renderInputType(inputType, checkedValue, onValueChange)), description && /*#__PURE__*/React__default["default"].createElement(Text$1, {
|
|
6823
6846
|
variant: "caption",
|
|
6824
6847
|
color: "secondary",
|
|
6825
6848
|
css: {
|
|
@@ -6828,10 +6851,10 @@
|
|
|
6828
6851
|
__self: undefined,
|
|
6829
6852
|
__source: {
|
|
6830
6853
|
fileName: _jsxFileName$G,
|
|
6831
|
-
lineNumber:
|
|
6832
|
-
columnNumber:
|
|
6854
|
+
lineNumber: 230,
|
|
6855
|
+
columnNumber: 17
|
|
6833
6856
|
}
|
|
6834
|
-
}, description));
|
|
6857
|
+
}, description)));
|
|
6835
6858
|
});
|
|
6836
6859
|
};
|
|
6837
6860
|
InputRadio.propTypes = {
|
|
@@ -8248,7 +8271,7 @@
|
|
|
8248
8271
|
size: 24
|
|
8249
8272
|
};
|
|
8250
8273
|
|
|
8251
|
-
const _excluded$e = ["size", "onChange", "css", "disabled"];
|
|
8274
|
+
const _excluded$e = ["size", "onChange", "css", "disabled", "withDebounce", "defaultValue"];
|
|
8252
8275
|
var _jsxFileName$z = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\form\\components\\InputSearchbox\\InputSearchbox.js";
|
|
8253
8276
|
const InputSearchbox = _ref => {
|
|
8254
8277
|
var _props$value;
|
|
@@ -8256,20 +8279,25 @@
|
|
|
8256
8279
|
size,
|
|
8257
8280
|
onChange,
|
|
8258
8281
|
css,
|
|
8259
|
-
disabled
|
|
8282
|
+
disabled,
|
|
8283
|
+
withDebounce,
|
|
8284
|
+
defaultValue
|
|
8260
8285
|
} = _ref,
|
|
8261
8286
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
8262
8287
|
const {
|
|
8263
8288
|
t
|
|
8264
8289
|
} = reactI18next.useTranslation(['MajooUI/inputSearchbox', 'translation']);
|
|
8265
|
-
const [value, setValue] =
|
|
8290
|
+
const [value, setValue] = React.useState(defaultValue);
|
|
8266
8291
|
const inputValue = (_props$value = props === null || props === void 0 ? void 0 : props.value) != null ? _props$value : value;
|
|
8267
|
-
const
|
|
8292
|
+
const debounceChange = React.useCallback(() => debounce__default["default"](e => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value), 1000), [onChange]);
|
|
8293
|
+
const handleChange = React.useCallback(e => {
|
|
8268
8294
|
setValue(e.target.value);
|
|
8269
|
-
if (
|
|
8270
|
-
|
|
8295
|
+
if (withDebounce) {
|
|
8296
|
+
debounceChange(e);
|
|
8297
|
+
} else {
|
|
8298
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
8271
8299
|
}
|
|
8272
|
-
}, [onChange]);
|
|
8300
|
+
}, [onChange, debounceChange, withDebounce]);
|
|
8273
8301
|
const handleClearButtonClick = e => {
|
|
8274
8302
|
e.preventDefault();
|
|
8275
8303
|
if (!disabled) {
|
|
@@ -8284,7 +8312,7 @@
|
|
|
8284
8312
|
__self: undefined,
|
|
8285
8313
|
__source: {
|
|
8286
8314
|
fileName: _jsxFileName$z,
|
|
8287
|
-
lineNumber:
|
|
8315
|
+
lineNumber: 38,
|
|
8288
8316
|
columnNumber: 5
|
|
8289
8317
|
}
|
|
8290
8318
|
}, /*#__PURE__*/React__default["default"].createElement(InputLeftElement, {
|
|
@@ -8292,14 +8320,14 @@
|
|
|
8292
8320
|
__self: undefined,
|
|
8293
8321
|
__source: {
|
|
8294
8322
|
fileName: _jsxFileName$z,
|
|
8295
|
-
lineNumber:
|
|
8323
|
+
lineNumber: 39,
|
|
8296
8324
|
columnNumber: 35
|
|
8297
8325
|
}
|
|
8298
8326
|
}),
|
|
8299
8327
|
__self: undefined,
|
|
8300
8328
|
__source: {
|
|
8301
8329
|
fileName: _jsxFileName$z,
|
|
8302
|
-
lineNumber:
|
|
8330
|
+
lineNumber: 39,
|
|
8303
8331
|
columnNumber: 7
|
|
8304
8332
|
}
|
|
8305
8333
|
}), /*#__PURE__*/React__default["default"].createElement(InputText, _extends({
|
|
@@ -8314,30 +8342,30 @@
|
|
|
8314
8342
|
__self: undefined,
|
|
8315
8343
|
__source: {
|
|
8316
8344
|
fileName: _jsxFileName$z,
|
|
8317
|
-
lineNumber:
|
|
8345
|
+
lineNumber: 40,
|
|
8318
8346
|
columnNumber: 7
|
|
8319
8347
|
}
|
|
8320
8348
|
})), /*#__PURE__*/React__default["default"].createElement(InputRightElement, {
|
|
8321
|
-
children: inputValue.length > 0 ? /*#__PURE__*/React__default["default"].createElement(SvgCloseFilled, {
|
|
8349
|
+
children: (inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) > 0 ? /*#__PURE__*/React__default["default"].createElement(SvgCloseFilled, {
|
|
8322
8350
|
__self: undefined,
|
|
8323
8351
|
__source: {
|
|
8324
8352
|
fileName: _jsxFileName$z,
|
|
8325
|
-
lineNumber:
|
|
8326
|
-
columnNumber:
|
|
8353
|
+
lineNumber: 51,
|
|
8354
|
+
columnNumber: 44
|
|
8327
8355
|
}
|
|
8328
8356
|
}) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8329
8357
|
__self: undefined,
|
|
8330
8358
|
__source: {
|
|
8331
8359
|
fileName: _jsxFileName$z,
|
|
8332
|
-
lineNumber:
|
|
8333
|
-
columnNumber:
|
|
8360
|
+
lineNumber: 51,
|
|
8361
|
+
columnNumber: 62
|
|
8334
8362
|
}
|
|
8335
8363
|
}),
|
|
8336
8364
|
onClick: handleClearButtonClick,
|
|
8337
8365
|
__self: undefined,
|
|
8338
8366
|
__source: {
|
|
8339
8367
|
fileName: _jsxFileName$z,
|
|
8340
|
-
lineNumber:
|
|
8368
|
+
lineNumber: 50,
|
|
8341
8369
|
columnNumber: 7
|
|
8342
8370
|
}
|
|
8343
8371
|
}));
|
|
@@ -8349,7 +8377,8 @@
|
|
|
8349
8377
|
isInvalid: PropTypes__default["default"].bool,
|
|
8350
8378
|
readOnly: PropTypes__default["default"].bool,
|
|
8351
8379
|
disabled: PropTypes__default["default"].bool,
|
|
8352
|
-
onChange: PropTypes__default["default"].func
|
|
8380
|
+
onChange: PropTypes__default["default"].func,
|
|
8381
|
+
withDebounce: PropTypes__default["default"].bool
|
|
8353
8382
|
};
|
|
8354
8383
|
InputSearchbox.defaultProps = {
|
|
8355
8384
|
size: 'sm'
|
|
@@ -8507,6 +8536,144 @@
|
|
|
8507
8536
|
];
|
|
8508
8537
|
});
|
|
8509
8538
|
|
|
8539
|
+
const _excluded$d = ["children"];
|
|
8540
|
+
var _jsxFileName$y = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\popover\\Popover.js";
|
|
8541
|
+
const {
|
|
8542
|
+
zIndices
|
|
8543
|
+
} = core.foundations;
|
|
8544
|
+
const PopoverContext = /*#__PURE__*/React.createContext();
|
|
8545
|
+
const Popover = ({
|
|
8546
|
+
children,
|
|
8547
|
+
open: _open = false,
|
|
8548
|
+
onOpenChange,
|
|
8549
|
+
placement,
|
|
8550
|
+
sideOffset: _sideOffset = 5,
|
|
8551
|
+
hideOnScroll: _hideOnScroll = false
|
|
8552
|
+
}) => {
|
|
8553
|
+
const [openState, setOpenState] = React.useState(false);
|
|
8554
|
+
React.useEffect(() => {
|
|
8555
|
+
setOpenState(_open);
|
|
8556
|
+
}, [_open]);
|
|
8557
|
+
React.useEffect(() => {
|
|
8558
|
+
if (onOpenChange) onOpenChange(openState);
|
|
8559
|
+
}, [openState, onOpenChange]);
|
|
8560
|
+
const floatingHook = reactDomInteractions.useFloating({
|
|
8561
|
+
open: openState,
|
|
8562
|
+
onOpenChange: setOpenState,
|
|
8563
|
+
middleware: [reactDomInteractions.offset(_sideOffset), reactDomInteractions.flip(), reactDomInteractions.shift()],
|
|
8564
|
+
placement
|
|
8565
|
+
});
|
|
8566
|
+
const {
|
|
8567
|
+
getReferenceProps,
|
|
8568
|
+
getFloatingProps
|
|
8569
|
+
} = reactDomInteractions.useInteractions([reactDomInteractions.useClick(floatingHook.context), reactDomInteractions.useDismiss(floatingHook.context, {
|
|
8570
|
+
ancestorScroll: _hideOnScroll
|
|
8571
|
+
})]);
|
|
8572
|
+
const value = {
|
|
8573
|
+
openState,
|
|
8574
|
+
setOpenState,
|
|
8575
|
+
floatingHook,
|
|
8576
|
+
getReferenceProps,
|
|
8577
|
+
getFloatingProps
|
|
8578
|
+
};
|
|
8579
|
+
return /*#__PURE__*/React__default["default"].createElement(PopoverContext.Provider, {
|
|
8580
|
+
value: value,
|
|
8581
|
+
__self: undefined,
|
|
8582
|
+
__source: {
|
|
8583
|
+
fileName: _jsxFileName$y,
|
|
8584
|
+
lineNumber: 46,
|
|
8585
|
+
columnNumber: 10
|
|
8586
|
+
}
|
|
8587
|
+
}, children);
|
|
8588
|
+
};
|
|
8589
|
+
const PopoverTrigger = ({
|
|
8590
|
+
children,
|
|
8591
|
+
disabled
|
|
8592
|
+
}) => {
|
|
8593
|
+
const {
|
|
8594
|
+
floatingHook: {
|
|
8595
|
+
reference
|
|
8596
|
+
},
|
|
8597
|
+
getReferenceProps
|
|
8598
|
+
} = React.useContext(PopoverContext);
|
|
8599
|
+
return disabled ? children : /*#__PURE__*/React.cloneElement(children, getReferenceProps(Object.assign({
|
|
8600
|
+
ref: reference
|
|
8601
|
+
}, children.props)));
|
|
8602
|
+
};
|
|
8603
|
+
const PopoverContent = ({
|
|
8604
|
+
children,
|
|
8605
|
+
isMobile,
|
|
8606
|
+
style
|
|
8607
|
+
}) => {
|
|
8608
|
+
const {
|
|
8609
|
+
openState,
|
|
8610
|
+
floatingHook: {
|
|
8611
|
+
x,
|
|
8612
|
+
y,
|
|
8613
|
+
floating,
|
|
8614
|
+
strategy,
|
|
8615
|
+
context
|
|
8616
|
+
},
|
|
8617
|
+
getFloatingProps
|
|
8618
|
+
} = React.useContext(PopoverContext);
|
|
8619
|
+
return openState ? /*#__PURE__*/React__default["default"].createElement(reactDomInteractions.FloatingFocusManager, {
|
|
8620
|
+
context: context,
|
|
8621
|
+
modal: false,
|
|
8622
|
+
order: ['reference', 'content'],
|
|
8623
|
+
returnFocus: false,
|
|
8624
|
+
__self: undefined,
|
|
8625
|
+
__source: {
|
|
8626
|
+
fileName: _jsxFileName$y,
|
|
8627
|
+
lineNumber: 64,
|
|
8628
|
+
columnNumber: 5
|
|
8629
|
+
}
|
|
8630
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", _extends({}, getFloatingProps({
|
|
8631
|
+
ref: floating,
|
|
8632
|
+
style: Object.assign({
|
|
8633
|
+
position: strategy,
|
|
8634
|
+
top: isMobile ? 0 : y != null ? y : '',
|
|
8635
|
+
left: isMobile ? 0 : x != null ? x : '',
|
|
8636
|
+
zIndex: zIndices.popover
|
|
8637
|
+
}, style)
|
|
8638
|
+
}), {
|
|
8639
|
+
__self: undefined,
|
|
8640
|
+
__source: {
|
|
8641
|
+
fileName: _jsxFileName$y,
|
|
8642
|
+
lineNumber: 65,
|
|
8643
|
+
columnNumber: 7
|
|
8644
|
+
}
|
|
8645
|
+
}), children)) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
8646
|
+
};
|
|
8647
|
+
const PopoverClose = _ref => {
|
|
8648
|
+
let {
|
|
8649
|
+
children
|
|
8650
|
+
} = _ref,
|
|
8651
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
8652
|
+
const {
|
|
8653
|
+
setOpenState
|
|
8654
|
+
} = React.useContext(PopoverContext);
|
|
8655
|
+
return /*#__PURE__*/React__default["default"].createElement(Flex$1, _extends({}, props, {
|
|
8656
|
+
onClick: () => {
|
|
8657
|
+
if (props.onClick) props.onClick();
|
|
8658
|
+
setOpenState(false);
|
|
8659
|
+
},
|
|
8660
|
+
__self: undefined,
|
|
8661
|
+
__source: {
|
|
8662
|
+
fileName: _jsxFileName$y,
|
|
8663
|
+
lineNumber: 88,
|
|
8664
|
+
columnNumber: 5
|
|
8665
|
+
}
|
|
8666
|
+
}), children);
|
|
8667
|
+
};
|
|
8668
|
+
Popover.propTypes = {
|
|
8669
|
+
open: PropTypes__default["default"].bool,
|
|
8670
|
+
onOpenChange: PropTypes__default["default"].func,
|
|
8671
|
+
placement: PropTypes__default["default"].oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end']),
|
|
8672
|
+
sideOffset: PropTypes__default["default"].number,
|
|
8673
|
+
hideOnScroll: PropTypes__default["default"].bool
|
|
8674
|
+
};
|
|
8675
|
+
Popover.displayName = 'Popover';
|
|
8676
|
+
|
|
8510
8677
|
var SelectContainer = styled('div', {
|
|
8511
8678
|
margin: 0,
|
|
8512
8679
|
flexDirection: 'column',
|
|
@@ -8664,6 +8831,11 @@
|
|
|
8664
8831
|
var OptionWrapper$2 = styled('div', {
|
|
8665
8832
|
display: 'none',
|
|
8666
8833
|
overflow: 'auto',
|
|
8834
|
+
fontFamily: 'inherit',
|
|
8835
|
+
fontVariantNumeric: 'tabular-nums',
|
|
8836
|
+
fontSize: '$short-content-regular',
|
|
8837
|
+
fontWeight: '400',
|
|
8838
|
+
textAlign: 'left',
|
|
8667
8839
|
zIndex: 1,
|
|
8668
8840
|
borderRadius: '$sm',
|
|
8669
8841
|
backgroundColor: '$bgWhite',
|
|
@@ -8852,6 +9024,10 @@
|
|
|
8852
9024
|
var _u = React.useState(),
|
|
8853
9025
|
query = _u[0],
|
|
8854
9026
|
setQuery = _u[1];
|
|
9027
|
+
var _v = React.useState(false),
|
|
9028
|
+
openOptions = _v[0],
|
|
9029
|
+
setOpenOptions = _v[1];
|
|
9030
|
+
var selectBoxRef = React.useRef(null);
|
|
8855
9031
|
var scrollerRef = React.useRef(null);
|
|
8856
9032
|
React.useEffect(function () {
|
|
8857
9033
|
var _a;
|
|
@@ -8939,6 +9115,7 @@
|
|
|
8939
9115
|
}
|
|
8940
9116
|
}, {
|
|
8941
9117
|
children: function (_a) {
|
|
9118
|
+
var _b, _c;
|
|
8942
9119
|
var getRootProps = _a.getRootProps,
|
|
8943
9120
|
getToggleButtonProps = _a.getToggleButtonProps,
|
|
8944
9121
|
getMenuProps = _a.getMenuProps,
|
|
@@ -8962,200 +9139,227 @@
|
|
|
8962
9139
|
}, void 0)
|
|
8963
9140
|
}), void 0);
|
|
8964
9141
|
};
|
|
8965
|
-
return jsxRuntime.
|
|
8966
|
-
|
|
9142
|
+
return jsxRuntime.jsx(Popover, __assign({
|
|
9143
|
+
open: openOptions,
|
|
9144
|
+
onOpenChange: setOpenOptions,
|
|
9145
|
+
placement: placement,
|
|
9146
|
+
hideOnScroll: true
|
|
8967
9147
|
}, {
|
|
8968
|
-
children:
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
return jsxRuntime.jsx(Tooltip$1, __assign({
|
|
8972
|
-
color: "dark",
|
|
8973
|
-
label: selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.name
|
|
8974
|
-
}, {
|
|
8975
|
-
children: children
|
|
8976
|
-
}), void 0);
|
|
8977
|
-
}
|
|
9148
|
+
children: jsxRuntime.jsxs(SelectContainer, __assign({
|
|
9149
|
+
css: css,
|
|
9150
|
+
ref: selectBoxRef
|
|
8978
9151
|
}, {
|
|
8979
|
-
children: jsxRuntime.
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
9152
|
+
children: [jsxRuntime.jsx(ConditionalWrapper, __assign({
|
|
9153
|
+
condition: showTooltip && selectedValue,
|
|
9154
|
+
wrapper: function (children) {
|
|
9155
|
+
return jsxRuntime.jsx(Tooltip$1, __assign({
|
|
9156
|
+
color: "dark",
|
|
9157
|
+
label: selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.name
|
|
9158
|
+
}, {
|
|
9159
|
+
children: children
|
|
9160
|
+
}), void 0);
|
|
9161
|
+
}
|
|
8988
9162
|
}, {
|
|
8989
|
-
children:
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
showLeadingIcon: showLeadingIcon,
|
|
8997
|
-
showClearIcon: hideArrowicon,
|
|
9163
|
+
children: jsxRuntime.jsx(PopoverTrigger, {
|
|
9164
|
+
children: jsxRuntime.jsxs(SelectBox, __assign({}, getRootProps({
|
|
9165
|
+
refKey: 'ref'
|
|
9166
|
+
}, {
|
|
9167
|
+
suppressRefError: true
|
|
9168
|
+
}), {
|
|
9169
|
+
size: size,
|
|
8998
9170
|
disabled: disabled,
|
|
8999
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t('placeholder', 'Pilih Item'),
|
|
9000
9171
|
readOnly: readOnly,
|
|
9001
|
-
|
|
9002
|
-
if (onSearch) onSearch(query);
|
|
9003
|
-
setQuery(query);
|
|
9004
|
-
},
|
|
9005
|
-
inputProps: getInputProps({
|
|
9006
|
-
onChange: function (event) {
|
|
9007
|
-
if (event.type !== 'change') return;
|
|
9008
|
-
var query = event.target.value;
|
|
9009
|
-
if (!fetchData) handleInputValue(query);else debouncedSearch(query);
|
|
9010
|
-
},
|
|
9011
|
-
disabled: disabled
|
|
9012
|
-
}),
|
|
9013
|
-
onClick: !isOpen ? getToggleButtonProps({
|
|
9014
|
-
disabled: disabled || readOnly
|
|
9015
|
-
}).onClick : undefined
|
|
9016
|
-
}, void 0)
|
|
9017
|
-
}), void 0) : jsxRuntime.jsx(Button$3, __assign({}, getToggleButtonProps({
|
|
9018
|
-
disabled: disabled || readOnly
|
|
9019
|
-
}), {
|
|
9020
|
-
disabled: disabled,
|
|
9021
|
-
size: size,
|
|
9022
|
-
readOnly: readOnly,
|
|
9023
|
-
type: "button"
|
|
9024
|
-
}, {
|
|
9025
|
-
children: selectedItem ? selectedItem.render ? selectedItem.render(selectedItem) : jsxRuntime.jsx(Text$1, __assign({
|
|
9026
|
-
color: disabled ? 'disable' : 'primary',
|
|
9027
|
-
css: StyledText$1
|
|
9028
|
-
}, {
|
|
9029
|
-
children: selectedItem.name
|
|
9030
|
-
}), void 0) : jsxRuntime.jsx(Text$1, __assign({
|
|
9031
|
-
color: "disable",
|
|
9032
|
-
css: StyledText$1
|
|
9172
|
+
isInvalid: isInvalid
|
|
9033
9173
|
}, {
|
|
9034
|
-
children:
|
|
9174
|
+
children: [search ? jsxRuntime.jsx(Box, __assign({
|
|
9175
|
+
style: {
|
|
9176
|
+
width: '100%',
|
|
9177
|
+
flex: 1
|
|
9178
|
+
}
|
|
9179
|
+
}, {
|
|
9180
|
+
children: jsxRuntime.jsx(SelectInputSearch, {
|
|
9181
|
+
showLeadingIcon: showLeadingIcon,
|
|
9182
|
+
showClearIcon: hideArrowicon,
|
|
9183
|
+
disabled: disabled,
|
|
9184
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t('placeholder', 'Pilih Item'),
|
|
9185
|
+
readOnly: readOnly,
|
|
9186
|
+
handleInputValue: !fetchData ? handleInputValue : function (query) {
|
|
9187
|
+
if (onSearch) onSearch(query);
|
|
9188
|
+
setQuery(query);
|
|
9189
|
+
},
|
|
9190
|
+
inputProps: getInputProps({
|
|
9191
|
+
onChange: function (event) {
|
|
9192
|
+
if (event.type !== 'change') return;
|
|
9193
|
+
var query = event.target.value;
|
|
9194
|
+
if (!fetchData) handleInputValue(query);else debouncedSearch(query);
|
|
9195
|
+
},
|
|
9196
|
+
disabled: disabled
|
|
9197
|
+
}),
|
|
9198
|
+
onClick: !isOpen ? getToggleButtonProps({
|
|
9199
|
+
disabled: disabled || readOnly
|
|
9200
|
+
}).onClick : undefined
|
|
9201
|
+
}, void 0)
|
|
9202
|
+
}), void 0) : jsxRuntime.jsx(Button$3, __assign({}, getToggleButtonProps({
|
|
9203
|
+
disabled: disabled || readOnly
|
|
9204
|
+
}), {
|
|
9205
|
+
disabled: disabled,
|
|
9206
|
+
size: size,
|
|
9207
|
+
readOnly: readOnly,
|
|
9208
|
+
type: "button"
|
|
9209
|
+
}, {
|
|
9210
|
+
children: selectedItem ? selectedItem.render ? selectedItem.render(selectedItem) : jsxRuntime.jsx(Text$1, __assign({
|
|
9211
|
+
color: disabled ? 'disable' : 'primary',
|
|
9212
|
+
css: StyledText$1
|
|
9213
|
+
}, {
|
|
9214
|
+
children: selectedItem.name
|
|
9215
|
+
}), void 0) : jsxRuntime.jsx(Text$1, __assign({
|
|
9216
|
+
color: "disable",
|
|
9217
|
+
css: StyledText$1
|
|
9218
|
+
}, {
|
|
9219
|
+
children: placeholder !== null && placeholder !== void 0 ? placeholder : t('placeholder', 'Pilih Item')
|
|
9220
|
+
}), void 0)
|
|
9221
|
+
}), void 0), handleDownOption()]
|
|
9035
9222
|
}), void 0)
|
|
9036
|
-
}
|
|
9037
|
-
}), void 0)
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
css: {
|
|
9042
|
-
position: 'absolute',
|
|
9043
|
-
inset: 0,
|
|
9044
|
-
zIndex: '$sticky',
|
|
9045
|
-
top: placement === 'top' ? '-20px' : item.length > 0 ? size === 'lg' ? '40px' : '32px' : size === 'lg' ? '64px' : '56px',
|
|
9046
|
-
// bottom: '80px',
|
|
9047
|
-
width: '100%',
|
|
9048
|
-
height: scrollerRef.current ? scrollerRef.current.clientHeight : '40px',
|
|
9049
|
-
backgroundColor: '$bgWhite',
|
|
9050
|
-
opacity: 0.8,
|
|
9051
|
-
transform: placement === 'top' ? 'translate(0, -100%)' : 'none'
|
|
9052
|
-
}
|
|
9053
|
-
}, {
|
|
9054
|
-
children: jsxRuntime.jsx(Text$1, __assign({
|
|
9055
|
-
variant: "caption"
|
|
9056
|
-
}, {
|
|
9057
|
-
children: "Loading...."
|
|
9058
|
-
}), void 0)
|
|
9059
|
-
}), void 0), jsxRuntime.jsx(ConditionalWrapper, __assign({
|
|
9060
|
-
condition: renderFooter && typeof renderFooter === 'function',
|
|
9061
|
-
wrapper: function (child) {
|
|
9062
|
-
return jsxRuntime.jsxs(Box, __assign({
|
|
9063
|
-
css: {
|
|
9064
|
-
position: 'absolute',
|
|
9065
|
-
float: 'left',
|
|
9066
|
-
display: isOpen ? 'block' : 'none',
|
|
9067
|
-
zIndex: '$popover',
|
|
9068
|
-
width: '100%'
|
|
9069
|
-
}
|
|
9070
|
-
}, {
|
|
9071
|
-
children: [child, renderFooter && typeof renderFooter === 'function' && jsxRuntime.jsx(StyledFooter, {
|
|
9072
|
-
children: renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter()
|
|
9073
|
-
}, void 0)]
|
|
9074
|
-
}), void 0);
|
|
9075
|
-
}
|
|
9076
|
-
}, {
|
|
9077
|
-
children: jsxRuntime.jsxs(OptionWrapper$2, __assign({}, getMenuProps({
|
|
9078
|
-
ref: scrollerRef
|
|
9079
|
-
}, {
|
|
9080
|
-
suppressRefError: true
|
|
9081
|
-
}), {
|
|
9082
|
-
css: {
|
|
9083
|
-
display: isOpen ? 'block' : 'none',
|
|
9084
|
-
zIndex: '$popover'
|
|
9085
|
-
},
|
|
9086
|
-
withFooter: renderFooter && typeof renderFooter === 'function',
|
|
9087
|
-
placement: placement
|
|
9088
|
-
}, {
|
|
9089
|
-
children: [!search && embedSearch && isOpen && jsxRuntime.jsx(SelectContainer, __assign({
|
|
9090
|
-
css: {
|
|
9091
|
-
position: 'sticky',
|
|
9092
|
-
top: 0,
|
|
9093
|
-
zIndex: '$sticky',
|
|
9094
|
-
padding: '$spacing-04 $spacing-05 0',
|
|
9095
|
-
backgroundColor: '$bgWhite'
|
|
9223
|
+
}, void 0)
|
|
9224
|
+
}), void 0), jsxRuntime.jsx(helpers.Portal, {
|
|
9225
|
+
children: jsxRuntime.jsx(PopoverContent, __assign({
|
|
9226
|
+
style: {
|
|
9227
|
+
width: (_c = (_b = selectBoxRef === null || selectBoxRef === void 0 ? void 0 : selectBoxRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) !== null && _c !== void 0 ? _c : 0
|
|
9096
9228
|
}
|
|
9097
9229
|
}, {
|
|
9098
|
-
children: jsxRuntime.
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
useWindow: false
|
|
9230
|
+
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9231
|
+
children: [isOpen && isLoading && jsxRuntime.jsx(Flex$1, __assign({
|
|
9232
|
+
justify: "center",
|
|
9233
|
+
align: "center",
|
|
9234
|
+
css: {
|
|
9235
|
+
position: 'absolute',
|
|
9236
|
+
inset: 0,
|
|
9237
|
+
zIndex: '$tooltip',
|
|
9238
|
+
top: item.length > 0 ? '0px' : placement === 'top' ? '-20px' : '20px',
|
|
9239
|
+
// bottom: '80px',
|
|
9240
|
+
width: '100%',
|
|
9241
|
+
height: scrollerRef.current ? scrollerRef.current.clientHeight : '40px',
|
|
9242
|
+
backgroundColor: '$bgWhite',
|
|
9243
|
+
opacity: 0.8,
|
|
9244
|
+
transform: placement === 'top' ? 'translate(0, -100%)' : 'none'
|
|
9245
|
+
}
|
|
9115
9246
|
}, {
|
|
9116
|
-
children:
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
}
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
}
|
|
9137
|
-
}), item.render ? item.render(selectedItem) : item.name);
|
|
9138
|
-
})
|
|
9139
|
-
}, void 0)
|
|
9140
|
-
}), void 0) : jsxRuntime.jsx(SelectOption, {
|
|
9141
|
-
children: jsxRuntime.jsxs(StyledDiv$2, {
|
|
9142
|
-
children: [jsxRuntime.jsx("div", __assign({
|
|
9143
|
-
style: {
|
|
9144
|
-
marginRight: '6px'
|
|
9247
|
+
children: jsxRuntime.jsx(Text$1, __assign({
|
|
9248
|
+
variant: "caption"
|
|
9249
|
+
}, {
|
|
9250
|
+
children: "Loading...."
|
|
9251
|
+
}), void 0)
|
|
9252
|
+
}), void 0), jsxRuntime.jsx(ConditionalWrapper, __assign({
|
|
9253
|
+
condition: renderFooter && typeof renderFooter === 'function',
|
|
9254
|
+
wrapper: function (child) {
|
|
9255
|
+
return jsxRuntime.jsxs(Box, __assign({
|
|
9256
|
+
css: {
|
|
9257
|
+
position: 'absolute',
|
|
9258
|
+
float: 'left',
|
|
9259
|
+
display: isOpen ? 'block' : 'none',
|
|
9260
|
+
zIndex: '$popover',
|
|
9261
|
+
width: '100%'
|
|
9262
|
+
}
|
|
9263
|
+
}, {
|
|
9264
|
+
children: [child, renderFooter && typeof renderFooter === 'function' && jsxRuntime.jsx(StyledFooter, {
|
|
9265
|
+
children: renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter()
|
|
9266
|
+
}, void 0)]
|
|
9267
|
+
}), void 0);
|
|
9145
9268
|
}
|
|
9146
9269
|
}, {
|
|
9147
|
-
children: jsxRuntime.
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9270
|
+
children: jsxRuntime.jsxs(OptionWrapper$2, __assign({}, getMenuProps({
|
|
9271
|
+
ref: scrollerRef
|
|
9272
|
+
}, {
|
|
9273
|
+
suppressRefError: true
|
|
9274
|
+
}), {
|
|
9275
|
+
css: {
|
|
9276
|
+
display: isOpen ? 'block' : 'none',
|
|
9277
|
+
zIndex: '$popover',
|
|
9278
|
+
pointerEvents: 'auto'
|
|
9279
|
+
},
|
|
9280
|
+
withFooter: renderFooter && typeof renderFooter === 'function',
|
|
9281
|
+
placement: placement
|
|
9282
|
+
}, {
|
|
9283
|
+
children: [!search && embedSearch && isOpen && jsxRuntime.jsx(SelectContainer, __assign({
|
|
9284
|
+
css: {
|
|
9285
|
+
position: 'sticky',
|
|
9286
|
+
top: 0,
|
|
9287
|
+
zIndex: '$sticky',
|
|
9288
|
+
padding: '$spacing-04 $spacing-05 0',
|
|
9289
|
+
backgroundColor: '$bgWhite'
|
|
9290
|
+
}
|
|
9291
|
+
}, {
|
|
9292
|
+
children: jsxRuntime.jsx(InputSearchbox, {
|
|
9293
|
+
size: 'sm',
|
|
9294
|
+
onChange: handleInputValue,
|
|
9295
|
+
placeholder: searchPlaceholder !== null && searchPlaceholder !== void 0 ? searchPlaceholder : t('searchPlaceholder', 'Cari ...')
|
|
9296
|
+
}, void 0)
|
|
9297
|
+
}), void 0), item.length > 0 || isLoading ? jsxRuntime.jsx(ConditionalWrapper, __assign({
|
|
9298
|
+
condition: !!fetchData && item.length > 0,
|
|
9299
|
+
wrapper: function (children) {
|
|
9300
|
+
return jsxRuntime.jsx(InfiniteScroll__default["default"], __assign({
|
|
9301
|
+
loadMore: function (_) {
|
|
9302
|
+
if (!isLoading && fetchData) fetchData({
|
|
9303
|
+
query: query
|
|
9304
|
+
});
|
|
9305
|
+
},
|
|
9306
|
+
hasMore: true,
|
|
9307
|
+
threshold: 5,
|
|
9308
|
+
useWindow: false
|
|
9309
|
+
}, {
|
|
9310
|
+
children: children
|
|
9311
|
+
}), void 0);
|
|
9312
|
+
}
|
|
9313
|
+
}, {
|
|
9314
|
+
children: jsxRuntime.jsx(PopoverClose, __assign({
|
|
9315
|
+
css: {
|
|
9316
|
+
display: 'block !important'
|
|
9317
|
+
}
|
|
9318
|
+
}, {
|
|
9319
|
+
children: jsxRuntime.jsx(SelectOption, {
|
|
9320
|
+
children: item.map(function (item, index) {
|
|
9321
|
+
var _a;
|
|
9322
|
+
return /*#__PURE__*/React.createElement(SelectItem, __assign({}, getItemProps({
|
|
9323
|
+
item: item,
|
|
9324
|
+
disabled: item.isDisabled
|
|
9325
|
+
}), {
|
|
9326
|
+
key: (_a = item.value) !== null && _a !== void 0 ? _a : index,
|
|
9327
|
+
css: item.isDisabled ? {
|
|
9328
|
+
backgroundColor: 'unset',
|
|
9329
|
+
cursor: 'not-allowed',
|
|
9330
|
+
color: '$textDisable'
|
|
9331
|
+
} : {
|
|
9332
|
+
backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
|
|
9333
|
+
fontWeight: 'normal',
|
|
9334
|
+
color: selectedItem && selectedItem.value === item.value ? '$textGreen' : '$textPrimary'
|
|
9335
|
+
}
|
|
9336
|
+
}), item.render ? item.render(selectedItem) : item.name);
|
|
9337
|
+
})
|
|
9338
|
+
}, void 0)
|
|
9339
|
+
}), void 0)
|
|
9340
|
+
}), void 0) : jsxRuntime.jsx(SelectOption, {
|
|
9341
|
+
children: jsxRuntime.jsxs(StyledDiv$2, {
|
|
9342
|
+
children: [jsxRuntime.jsx("div", __assign({
|
|
9343
|
+
style: {
|
|
9344
|
+
marginRight: '6px'
|
|
9345
|
+
}
|
|
9346
|
+
}, {
|
|
9347
|
+
children: jsxRuntime.jsx(icons.CircleInfoOutline, {
|
|
9348
|
+
size: "16px",
|
|
9349
|
+
color: colors$4.iconDisable,
|
|
9350
|
+
style: {
|
|
9351
|
+
verticalAlign: 'text-bottom'
|
|
9352
|
+
}
|
|
9353
|
+
}, void 0)
|
|
9354
|
+
}), void 0), t('noItemPlaceholder', 'Item tidak ditemukan')]
|
|
9355
|
+
}, void 0)
|
|
9356
|
+
}, void 0)]
|
|
9357
|
+
}), void 0)
|
|
9358
|
+
}), void 0)]
|
|
9155
9359
|
}, void 0)
|
|
9156
|
-
}, void 0)
|
|
9157
|
-
}
|
|
9158
|
-
}), void 0)
|
|
9360
|
+
}), void 0)
|
|
9361
|
+
}, void 0)]
|
|
9362
|
+
}), void 0)
|
|
9159
9363
|
}), void 0);
|
|
9160
9364
|
}
|
|
9161
9365
|
}), void 0);
|
|
@@ -9441,7 +9645,7 @@
|
|
|
9441
9645
|
}
|
|
9442
9646
|
});
|
|
9443
9647
|
|
|
9444
|
-
var _jsxFileName$
|
|
9648
|
+
var _jsxFileName$x = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\form\\components\\InputSelectCheck\\icon\\CheckOutline.js";
|
|
9445
9649
|
const CheckOutline = props => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
9446
9650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9447
9651
|
xmlSpace: "preserve",
|
|
@@ -9458,7 +9662,7 @@
|
|
|
9458
9662
|
}, props, {
|
|
9459
9663
|
__self: undefined,
|
|
9460
9664
|
__source: {
|
|
9461
|
-
fileName: _jsxFileName$
|
|
9665
|
+
fileName: _jsxFileName$x,
|
|
9462
9666
|
lineNumber: 4,
|
|
9463
9667
|
columnNumber: 3
|
|
9464
9668
|
}
|
|
@@ -9470,7 +9674,7 @@
|
|
|
9470
9674
|
},
|
|
9471
9675
|
__self: undefined,
|
|
9472
9676
|
__source: {
|
|
9473
|
-
fileName: _jsxFileName$
|
|
9677
|
+
fileName: _jsxFileName$x,
|
|
9474
9678
|
lineNumber: 19,
|
|
9475
9679
|
columnNumber: 5
|
|
9476
9680
|
}
|
|
@@ -9482,14 +9686,14 @@
|
|
|
9482
9686
|
},
|
|
9483
9687
|
__self: undefined,
|
|
9484
9688
|
__source: {
|
|
9485
|
-
fileName: _jsxFileName$
|
|
9689
|
+
fileName: _jsxFileName$x,
|
|
9486
9690
|
lineNumber: 26,
|
|
9487
9691
|
columnNumber: 5
|
|
9488
9692
|
}
|
|
9489
9693
|
}));
|
|
9490
9694
|
|
|
9491
|
-
const _excluded$
|
|
9492
|
-
var _jsxFileName$
|
|
9695
|
+
const _excluded$c = ["placeholder", "option", "value", "size", "disabled", "onChange", "search", "readOnly", "placement", "disabledOptions", "textEmptyItem", "onRemoveItem", "isInvalid", "sortBy", "showSelectAll", "selectAllLabel", "showSelectedTag", "unremovableTags", "helperText", "css", "showCounter", "labelCounter", "collapsible"];
|
|
9696
|
+
var _jsxFileName$w = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\form\\components\\InputSelectCheck\\InputSelectCheck.js";
|
|
9493
9697
|
const Wrapper$1 = styled('div', {
|
|
9494
9698
|
margin: 0,
|
|
9495
9699
|
flexDirection: 'column',
|
|
@@ -9746,7 +9950,7 @@
|
|
|
9746
9950
|
labelCounter,
|
|
9747
9951
|
collapsible
|
|
9748
9952
|
} = _ref,
|
|
9749
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9953
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
9750
9954
|
const {
|
|
9751
9955
|
t
|
|
9752
9956
|
} = reactI18next.useTranslation(['MajooUI/inputSelectCheck', 'translation']);
|
|
@@ -9976,7 +10180,7 @@
|
|
|
9976
10180
|
}, props, {
|
|
9977
10181
|
__self: undefined,
|
|
9978
10182
|
__source: {
|
|
9979
|
-
fileName: _jsxFileName$
|
|
10183
|
+
fileName: _jsxFileName$w,
|
|
9980
10184
|
lineNumber: 523,
|
|
9981
10185
|
columnNumber: 7
|
|
9982
10186
|
}
|
|
@@ -9986,7 +10190,7 @@
|
|
|
9986
10190
|
isInvalid: isInvalid,
|
|
9987
10191
|
__self: undefined,
|
|
9988
10192
|
__source: {
|
|
9989
|
-
fileName: _jsxFileName$
|
|
10193
|
+
fileName: _jsxFileName$w,
|
|
9990
10194
|
lineNumber: 524,
|
|
9991
10195
|
columnNumber: 9
|
|
9992
10196
|
}
|
|
@@ -10001,7 +10205,7 @@
|
|
|
10001
10205
|
disabled: disabled || readOnly,
|
|
10002
10206
|
__self: undefined,
|
|
10003
10207
|
__source: {
|
|
10004
|
-
fileName: _jsxFileName$
|
|
10208
|
+
fileName: _jsxFileName$w,
|
|
10005
10209
|
lineNumber: 525,
|
|
10006
10210
|
columnNumber: 11
|
|
10007
10211
|
}
|
|
@@ -10017,7 +10221,7 @@
|
|
|
10017
10221
|
hiddden: !search,
|
|
10018
10222
|
__self: undefined,
|
|
10019
10223
|
__source: {
|
|
10020
|
-
fileName: _jsxFileName$
|
|
10224
|
+
fileName: _jsxFileName$w,
|
|
10021
10225
|
lineNumber: 535,
|
|
10022
10226
|
columnNumber: 13
|
|
10023
10227
|
}
|
|
@@ -10030,7 +10234,7 @@
|
|
|
10030
10234
|
hiddden: search,
|
|
10031
10235
|
__self: undefined,
|
|
10032
10236
|
__source: {
|
|
10033
|
-
fileName: _jsxFileName$
|
|
10237
|
+
fileName: _jsxFileName$w,
|
|
10034
10238
|
lineNumber: 541,
|
|
10035
10239
|
columnNumber: 13
|
|
10036
10240
|
}
|
|
@@ -10041,7 +10245,7 @@
|
|
|
10041
10245
|
readOnly: readOnly,
|
|
10042
10246
|
__self: undefined,
|
|
10043
10247
|
__source: {
|
|
10044
|
-
fileName: _jsxFileName$
|
|
10248
|
+
fileName: _jsxFileName$w,
|
|
10045
10249
|
lineNumber: 551,
|
|
10046
10250
|
columnNumber: 11
|
|
10047
10251
|
}
|
|
@@ -10049,7 +10253,7 @@
|
|
|
10049
10253
|
color: disabled || readOnly ? colors$4.iconDisable : colors$4.iconPrimary,
|
|
10050
10254
|
__self: undefined,
|
|
10051
10255
|
__source: {
|
|
10052
|
-
fileName: _jsxFileName$
|
|
10256
|
+
fileName: _jsxFileName$w,
|
|
10053
10257
|
lineNumber: 556,
|
|
10054
10258
|
columnNumber: 13
|
|
10055
10259
|
}
|
|
@@ -10062,7 +10266,7 @@
|
|
|
10062
10266
|
},
|
|
10063
10267
|
__self: undefined,
|
|
10064
10268
|
__source: {
|
|
10065
|
-
fileName: _jsxFileName$
|
|
10269
|
+
fileName: _jsxFileName$w,
|
|
10066
10270
|
lineNumber: 560,
|
|
10067
10271
|
columnNumber: 11
|
|
10068
10272
|
}
|
|
@@ -10070,7 +10274,7 @@
|
|
|
10070
10274
|
disabled: disabled,
|
|
10071
10275
|
__self: undefined,
|
|
10072
10276
|
__source: {
|
|
10073
|
-
fileName: _jsxFileName$
|
|
10277
|
+
fileName: _jsxFileName$w,
|
|
10074
10278
|
lineNumber: 566,
|
|
10075
10279
|
columnNumber: 13
|
|
10076
10280
|
}
|
|
@@ -10100,7 +10304,7 @@
|
|
|
10100
10304
|
},
|
|
10101
10305
|
__self: undefined,
|
|
10102
10306
|
__source: {
|
|
10103
|
-
fileName: _jsxFileName$
|
|
10307
|
+
fileName: _jsxFileName$w,
|
|
10104
10308
|
lineNumber: 577,
|
|
10105
10309
|
columnNumber: 19
|
|
10106
10310
|
}
|
|
@@ -10110,14 +10314,14 @@
|
|
|
10110
10314
|
onClick: toggleCollapsible,
|
|
10111
10315
|
__self: undefined,
|
|
10112
10316
|
__source: {
|
|
10113
|
-
fileName: _jsxFileName$
|
|
10317
|
+
fileName: _jsxFileName$w,
|
|
10114
10318
|
lineNumber: 598,
|
|
10115
10319
|
columnNumber: 15
|
|
10116
10320
|
}
|
|
10117
10321
|
}, /*#__PURE__*/React__default["default"].createElement(Separator$2, {
|
|
10118
10322
|
__self: undefined,
|
|
10119
10323
|
__source: {
|
|
10120
|
-
fileName: _jsxFileName$
|
|
10324
|
+
fileName: _jsxFileName$w,
|
|
10121
10325
|
lineNumber: 599,
|
|
10122
10326
|
columnNumber: 17
|
|
10123
10327
|
}
|
|
@@ -10131,7 +10335,7 @@
|
|
|
10131
10335
|
},
|
|
10132
10336
|
__self: undefined,
|
|
10133
10337
|
__source: {
|
|
10134
|
-
fileName: _jsxFileName$
|
|
10338
|
+
fileName: _jsxFileName$w,
|
|
10135
10339
|
lineNumber: 600,
|
|
10136
10340
|
columnNumber: 17
|
|
10137
10341
|
}
|
|
@@ -10139,7 +10343,7 @@
|
|
|
10139
10343
|
color: colors$4.iconSecondary,
|
|
10140
10344
|
__self: undefined,
|
|
10141
10345
|
__source: {
|
|
10142
|
-
fileName: _jsxFileName$
|
|
10346
|
+
fileName: _jsxFileName$w,
|
|
10143
10347
|
lineNumber: 606,
|
|
10144
10348
|
columnNumber: 21
|
|
10145
10349
|
}
|
|
@@ -10147,7 +10351,7 @@
|
|
|
10147
10351
|
color: colors$4.iconSecondary,
|
|
10148
10352
|
__self: undefined,
|
|
10149
10353
|
__source: {
|
|
10150
|
-
fileName: _jsxFileName$
|
|
10354
|
+
fileName: _jsxFileName$w,
|
|
10151
10355
|
lineNumber: 608,
|
|
10152
10356
|
columnNumber: 21
|
|
10153
10357
|
}
|
|
@@ -10159,14 +10363,14 @@
|
|
|
10159
10363
|
color: "secondary",
|
|
10160
10364
|
__self: undefined,
|
|
10161
10365
|
__source: {
|
|
10162
|
-
fileName: _jsxFileName$
|
|
10366
|
+
fileName: _jsxFileName$w,
|
|
10163
10367
|
lineNumber: 610,
|
|
10164
10368
|
columnNumber: 19
|
|
10165
10369
|
}
|
|
10166
10370
|
}, showAllTags ? t('showSomeText', 'Tampilkan Sebagian') : t('showAllText', 'Tampilkan Semua'))), /*#__PURE__*/React__default["default"].createElement(Separator$2, {
|
|
10167
10371
|
__self: undefined,
|
|
10168
10372
|
__source: {
|
|
10169
|
-
fileName: _jsxFileName$
|
|
10373
|
+
fileName: _jsxFileName$w,
|
|
10170
10374
|
lineNumber: 614,
|
|
10171
10375
|
columnNumber: 17
|
|
10172
10376
|
}
|
|
@@ -10174,7 +10378,7 @@
|
|
|
10174
10378
|
disabled: disabled,
|
|
10175
10379
|
__self: undefined,
|
|
10176
10380
|
__source: {
|
|
10177
|
-
fileName: _jsxFileName$
|
|
10381
|
+
fileName: _jsxFileName$w,
|
|
10178
10382
|
lineNumber: 620,
|
|
10179
10383
|
columnNumber: 11
|
|
10180
10384
|
}
|
|
@@ -10202,7 +10406,7 @@
|
|
|
10202
10406
|
},
|
|
10203
10407
|
__self: undefined,
|
|
10204
10408
|
__source: {
|
|
10205
|
-
fileName: _jsxFileName$
|
|
10409
|
+
fileName: _jsxFileName$w,
|
|
10206
10410
|
lineNumber: 621,
|
|
10207
10411
|
columnNumber: 13
|
|
10208
10412
|
}
|
|
@@ -10214,7 +10418,7 @@
|
|
|
10214
10418
|
},
|
|
10215
10419
|
__self: undefined,
|
|
10216
10420
|
__source: {
|
|
10217
|
-
fileName: _jsxFileName$
|
|
10421
|
+
fileName: _jsxFileName$w,
|
|
10218
10422
|
lineNumber: 641,
|
|
10219
10423
|
columnNumber: 9
|
|
10220
10424
|
}
|
|
@@ -10223,7 +10427,7 @@
|
|
|
10223
10427
|
}), {
|
|
10224
10428
|
__self: undefined,
|
|
10225
10429
|
__source: {
|
|
10226
|
-
fileName: _jsxFileName$
|
|
10430
|
+
fileName: _jsxFileName$w,
|
|
10227
10431
|
lineNumber: 646,
|
|
10228
10432
|
columnNumber: 13
|
|
10229
10433
|
}
|
|
@@ -10241,7 +10445,7 @@
|
|
|
10241
10445
|
},
|
|
10242
10446
|
__self: undefined,
|
|
10243
10447
|
__source: {
|
|
10244
|
-
fileName: _jsxFileName$
|
|
10448
|
+
fileName: _jsxFileName$w,
|
|
10245
10449
|
lineNumber: 649,
|
|
10246
10450
|
columnNumber: 19
|
|
10247
10451
|
}
|
|
@@ -10254,7 +10458,7 @@
|
|
|
10254
10458
|
},
|
|
10255
10459
|
__self: undefined,
|
|
10256
10460
|
__source: {
|
|
10257
|
-
fileName: _jsxFileName$
|
|
10461
|
+
fileName: _jsxFileName$w,
|
|
10258
10462
|
lineNumber: 662,
|
|
10259
10463
|
columnNumber: 21
|
|
10260
10464
|
}
|
|
@@ -10262,7 +10466,7 @@
|
|
|
10262
10466
|
color: colors$4.iconDisable,
|
|
10263
10467
|
__self: undefined,
|
|
10264
10468
|
__source: {
|
|
10265
|
-
fileName: _jsxFileName$
|
|
10469
|
+
fileName: _jsxFileName$w,
|
|
10266
10470
|
lineNumber: 671,
|
|
10267
10471
|
columnNumber: 25
|
|
10268
10472
|
}
|
|
@@ -10270,21 +10474,21 @@
|
|
|
10270
10474
|
color: colors$4.iconGreen,
|
|
10271
10475
|
__self: undefined,
|
|
10272
10476
|
__source: {
|
|
10273
|
-
fileName: _jsxFileName$
|
|
10477
|
+
fileName: _jsxFileName$w,
|
|
10274
10478
|
lineNumber: 675,
|
|
10275
10479
|
columnNumber: 27
|
|
10276
10480
|
}
|
|
10277
10481
|
}), showSelectAll && (item === null || item === void 0 ? void 0 : item.id) === '!all' && selectedValue !== null && selectedValue !== void 0 && selectedValue.length && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) < (items === null || items === void 0 ? void 0 : items.length) ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled, {
|
|
10278
10482
|
__self: undefined,
|
|
10279
10483
|
__source: {
|
|
10280
|
-
fileName: _jsxFileName$
|
|
10484
|
+
fileName: _jsxFileName$w,
|
|
10281
10485
|
lineNumber: 682,
|
|
10282
10486
|
columnNumber: 25
|
|
10283
10487
|
}
|
|
10284
10488
|
}, "-") : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
10285
10489
|
__self: undefined,
|
|
10286
10490
|
__source: {
|
|
10287
|
-
fileName: _jsxFileName$
|
|
10491
|
+
fileName: _jsxFileName$w,
|
|
10288
10492
|
lineNumber: 684,
|
|
10289
10493
|
columnNumber: 25
|
|
10290
10494
|
}
|
|
@@ -10294,7 +10498,7 @@
|
|
|
10294
10498
|
},
|
|
10295
10499
|
__self: undefined,
|
|
10296
10500
|
__source: {
|
|
10297
|
-
fileName: _jsxFileName$
|
|
10501
|
+
fileName: _jsxFileName$w,
|
|
10298
10502
|
lineNumber: 687,
|
|
10299
10503
|
columnNumber: 21
|
|
10300
10504
|
}
|
|
@@ -10307,14 +10511,14 @@
|
|
|
10307
10511
|
}), {
|
|
10308
10512
|
__self: undefined,
|
|
10309
10513
|
__source: {
|
|
10310
|
-
fileName: _jsxFileName$
|
|
10514
|
+
fileName: _jsxFileName$w,
|
|
10311
10515
|
lineNumber: 692,
|
|
10312
10516
|
columnNumber: 13
|
|
10313
10517
|
}
|
|
10314
10518
|
}), /*#__PURE__*/React__default["default"].createElement(StyledDiv$1, {
|
|
10315
10519
|
__self: undefined,
|
|
10316
10520
|
__source: {
|
|
10317
|
-
fileName: _jsxFileName$
|
|
10521
|
+
fileName: _jsxFileName$w,
|
|
10318
10522
|
lineNumber: 693,
|
|
10319
10523
|
columnNumber: 15
|
|
10320
10524
|
}
|
|
@@ -10324,7 +10528,7 @@
|
|
|
10324
10528
|
},
|
|
10325
10529
|
__self: undefined,
|
|
10326
10530
|
__source: {
|
|
10327
|
-
fileName: _jsxFileName$
|
|
10531
|
+
fileName: _jsxFileName$w,
|
|
10328
10532
|
lineNumber: 694,
|
|
10329
10533
|
columnNumber: 17
|
|
10330
10534
|
}
|
|
@@ -10336,7 +10540,7 @@
|
|
|
10336
10540
|
},
|
|
10337
10541
|
__self: undefined,
|
|
10338
10542
|
__source: {
|
|
10339
|
-
fileName: _jsxFileName$
|
|
10543
|
+
fileName: _jsxFileName$w,
|
|
10340
10544
|
lineNumber: 695,
|
|
10341
10545
|
columnNumber: 19
|
|
10342
10546
|
}
|
|
@@ -10383,7 +10587,7 @@
|
|
|
10383
10587
|
collapsible: true
|
|
10384
10588
|
};
|
|
10385
10589
|
|
|
10386
|
-
var _jsxFileName$
|
|
10590
|
+
var _jsxFileName$v = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\form\\components\\InputSelectTag\\InputSelectTag.js";
|
|
10387
10591
|
const InputSelectTag = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
|
|
10388
10592
|
return /*#__PURE__*/React__namespace.createElement(InputSelectCheck, _extends({
|
|
10389
10593
|
ref: ref,
|
|
@@ -10391,7 +10595,7 @@
|
|
|
10391
10595
|
}, props, {
|
|
10392
10596
|
__self: undefined,
|
|
10393
10597
|
__source: {
|
|
10394
|
-
fileName: _jsxFileName$
|
|
10598
|
+
fileName: _jsxFileName$v,
|
|
10395
10599
|
lineNumber: 6,
|
|
10396
10600
|
columnNumber: 10
|
|
10397
10601
|
}
|
|
@@ -10433,7 +10637,7 @@
|
|
|
10433
10637
|
collapsible: true
|
|
10434
10638
|
};
|
|
10435
10639
|
|
|
10436
|
-
var _jsxFileName$
|
|
10640
|
+
var _jsxFileName$u = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\form\\components\\InputCreatable\\InputCreatable.js";
|
|
10437
10641
|
const Wrapper = styled('div', {
|
|
10438
10642
|
margin: 0,
|
|
10439
10643
|
flexDirection: 'column',
|
|
@@ -10606,7 +10810,7 @@
|
|
|
10606
10810
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper, {
|
|
10607
10811
|
__self: this,
|
|
10608
10812
|
__source: {
|
|
10609
|
-
fileName: _jsxFileName$
|
|
10813
|
+
fileName: _jsxFileName$u,
|
|
10610
10814
|
lineNumber: 169,
|
|
10611
10815
|
columnNumber: 5
|
|
10612
10816
|
}
|
|
@@ -10616,7 +10820,7 @@
|
|
|
10616
10820
|
disabled: disabled || readOnly,
|
|
10617
10821
|
__self: this,
|
|
10618
10822
|
__source: {
|
|
10619
|
-
fileName: _jsxFileName$
|
|
10823
|
+
fileName: _jsxFileName$u,
|
|
10620
10824
|
lineNumber: 170,
|
|
10621
10825
|
columnNumber: 7
|
|
10622
10826
|
}
|
|
@@ -10630,7 +10834,7 @@
|
|
|
10630
10834
|
onChange: event => handleInputValue(event.target.value),
|
|
10631
10835
|
__self: this,
|
|
10632
10836
|
__source: {
|
|
10633
|
-
fileName: _jsxFileName$
|
|
10837
|
+
fileName: _jsxFileName$u,
|
|
10634
10838
|
lineNumber: 171,
|
|
10635
10839
|
columnNumber: 9
|
|
10636
10840
|
}
|
|
@@ -10640,14 +10844,14 @@
|
|
|
10640
10844
|
},
|
|
10641
10845
|
__self: this,
|
|
10642
10846
|
__source: {
|
|
10643
|
-
fileName: _jsxFileName$
|
|
10847
|
+
fileName: _jsxFileName$u,
|
|
10644
10848
|
lineNumber: 181,
|
|
10645
10849
|
columnNumber: 7
|
|
10646
10850
|
}
|
|
10647
10851
|
}, /*#__PURE__*/React__default["default"].createElement(ItemWrapper, {
|
|
10648
10852
|
__self: this,
|
|
10649
10853
|
__source: {
|
|
10650
|
-
fileName: _jsxFileName$
|
|
10854
|
+
fileName: _jsxFileName$u,
|
|
10651
10855
|
lineNumber: 182,
|
|
10652
10856
|
columnNumber: 9
|
|
10653
10857
|
}
|
|
@@ -10655,7 +10859,7 @@
|
|
|
10655
10859
|
color: colors$4.iconGreen,
|
|
10656
10860
|
__self: this,
|
|
10657
10861
|
__source: {
|
|
10658
|
-
fileName: _jsxFileName$
|
|
10862
|
+
fileName: _jsxFileName$u,
|
|
10659
10863
|
lineNumber: 183,
|
|
10660
10864
|
columnNumber: 11
|
|
10661
10865
|
}
|
|
@@ -10666,7 +10870,7 @@
|
|
|
10666
10870
|
},
|
|
10667
10871
|
__self: this,
|
|
10668
10872
|
__source: {
|
|
10669
|
-
fileName: _jsxFileName$
|
|
10873
|
+
fileName: _jsxFileName$u,
|
|
10670
10874
|
lineNumber: 184,
|
|
10671
10875
|
columnNumber: 11
|
|
10672
10876
|
}
|
|
@@ -11064,7 +11268,18 @@
|
|
|
11064
11268
|
var _g = React.useState(items),
|
|
11065
11269
|
inputItems = _g[0],
|
|
11066
11270
|
setInputItems = _g[1];
|
|
11067
|
-
var _h =
|
|
11271
|
+
var _h = React.useState(false),
|
|
11272
|
+
openOptions = _h[0],
|
|
11273
|
+
setOpenOptions = _h[1];
|
|
11274
|
+
var selectBoxRef = React.useRef(null);
|
|
11275
|
+
var _j = React.useState(0),
|
|
11276
|
+
optionsWidth = _j[0],
|
|
11277
|
+
setOptionsWidth = _j[1];
|
|
11278
|
+
React.useLayoutEffect(function () {
|
|
11279
|
+
var _a, _b;
|
|
11280
|
+
setOptionsWidth((_b = (_a = selectBoxRef === null || selectBoxRef === void 0 ? void 0 : selectBoxRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0);
|
|
11281
|
+
}, [selectBoxRef]);
|
|
11282
|
+
var _k = Downshift.useCombobox({
|
|
11068
11283
|
items: inputItems,
|
|
11069
11284
|
defaultInputValue: defaultValue,
|
|
11070
11285
|
onInputValueChange: function (_a) {
|
|
@@ -11076,51 +11291,70 @@
|
|
|
11076
11291
|
}));
|
|
11077
11292
|
}
|
|
11078
11293
|
}),
|
|
11079
|
-
isOpen =
|
|
11080
|
-
getMenuProps =
|
|
11081
|
-
getInputProps =
|
|
11082
|
-
getComboboxProps =
|
|
11083
|
-
highlightedIndex =
|
|
11084
|
-
getItemProps =
|
|
11085
|
-
return jsxRuntime.
|
|
11086
|
-
|
|
11294
|
+
isOpen = _k.isOpen,
|
|
11295
|
+
getMenuProps = _k.getMenuProps,
|
|
11296
|
+
getInputProps = _k.getInputProps,
|
|
11297
|
+
getComboboxProps = _k.getComboboxProps,
|
|
11298
|
+
highlightedIndex = _k.highlightedIndex,
|
|
11299
|
+
getItemProps = _k.getItemProps;
|
|
11300
|
+
return jsxRuntime.jsx(Popover, __assign({
|
|
11301
|
+
open: openOptions || isOpen,
|
|
11302
|
+
onOpenChange: setOpenOptions,
|
|
11303
|
+
placement: placement,
|
|
11304
|
+
hideOnScroll: true
|
|
11087
11305
|
}, {
|
|
11088
|
-
children:
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
isInvalid: isInvalid
|
|
11092
|
-
}, {
|
|
11093
|
-
children: jsxRuntime.jsx(SelectInputSearch, __assign({
|
|
11094
|
-
showLeadingIcon: showLeadingIcon,
|
|
11095
|
-
disabled: disabled,
|
|
11096
|
-
placeholder: placeholder,
|
|
11097
|
-
inputProps: getInputProps({}, {
|
|
11098
|
-
suppressRefError: true
|
|
11099
|
-
})
|
|
11100
|
-
}, props, {
|
|
11101
|
-
ref: forwardedRef
|
|
11102
|
-
}), void 0)
|
|
11103
|
-
}), void 0), inputItems.length > 0 && jsxRuntime.jsx(OptionWrapper$2, __assign({}, getMenuProps(), {
|
|
11104
|
-
css: {
|
|
11105
|
-
display: isOpen ? 'block' : 'none'
|
|
11106
|
-
},
|
|
11107
|
-
placement: placement
|
|
11306
|
+
children: jsxRuntime.jsxs(SelectContainer, __assign({
|
|
11307
|
+
css: css,
|
|
11308
|
+
ref: selectBoxRef
|
|
11108
11309
|
}, {
|
|
11109
|
-
children: jsxRuntime.jsx(
|
|
11110
|
-
children:
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11310
|
+
children: [jsxRuntime.jsx(PopoverTrigger, {
|
|
11311
|
+
children: jsxRuntime.jsx(SelectBox, __assign({}, getComboboxProps(), {
|
|
11312
|
+
size: size,
|
|
11313
|
+
disabled: disabled,
|
|
11314
|
+
isInvalid: isInvalid
|
|
11315
|
+
}, {
|
|
11316
|
+
children: jsxRuntime.jsx(SelectInputSearch, __assign({
|
|
11317
|
+
showLeadingIcon: showLeadingIcon,
|
|
11318
|
+
disabled: disabled,
|
|
11319
|
+
placeholder: placeholder,
|
|
11320
|
+
inputProps: getInputProps({}, {
|
|
11321
|
+
suppressRefError: true
|
|
11322
|
+
})
|
|
11323
|
+
}, props, {
|
|
11324
|
+
ref: forwardedRef
|
|
11325
|
+
}), void 0)
|
|
11326
|
+
}), void 0)
|
|
11327
|
+
}, void 0), jsxRuntime.jsx(helpers.Portal, {
|
|
11328
|
+
children: jsxRuntime.jsx(PopoverContent, __assign({
|
|
11329
|
+
style: {
|
|
11330
|
+
width: optionsWidth
|
|
11331
|
+
}
|
|
11332
|
+
}, {
|
|
11333
|
+
children: inputItems.length > 0 && jsxRuntime.jsx(OptionWrapper$2, __assign({}, getMenuProps(), {
|
|
11116
11334
|
css: {
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
}
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11335
|
+
display: isOpen ? 'block' : 'none',
|
|
11336
|
+
pointerEvents: 'auto'
|
|
11337
|
+
},
|
|
11338
|
+
placement: placement
|
|
11339
|
+
}, {
|
|
11340
|
+
children: jsxRuntime.jsx(SelectOption, {
|
|
11341
|
+
children: inputItems.map(function (item, index) {
|
|
11342
|
+
return /*#__PURE__*/React.createElement(SelectItem, __assign({}, getItemProps({
|
|
11343
|
+
item: item,
|
|
11344
|
+
index: index
|
|
11345
|
+
}), {
|
|
11346
|
+
key: "".concat(item).concat(index),
|
|
11347
|
+
css: {
|
|
11348
|
+
backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
|
|
11349
|
+
fontWeight: 'normal'
|
|
11350
|
+
}
|
|
11351
|
+
}), item);
|
|
11352
|
+
})
|
|
11353
|
+
}, void 0)
|
|
11354
|
+
}), void 0)
|
|
11355
|
+
}), void 0)
|
|
11356
|
+
}, void 0)]
|
|
11357
|
+
}), void 0)
|
|
11124
11358
|
}), void 0);
|
|
11125
11359
|
});
|
|
11126
11360
|
|
|
@@ -11438,140 +11672,6 @@
|
|
|
11438
11672
|
size: 'lg'
|
|
11439
11673
|
};
|
|
11440
11674
|
|
|
11441
|
-
const _excluded$c = ["children"];
|
|
11442
|
-
var _jsxFileName$u = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\popover\\Popover.js";
|
|
11443
|
-
const {
|
|
11444
|
-
zIndices
|
|
11445
|
-
} = core.foundations;
|
|
11446
|
-
const PopoverContext = /*#__PURE__*/React.createContext();
|
|
11447
|
-
const Popover = ({
|
|
11448
|
-
children,
|
|
11449
|
-
open: _open = false,
|
|
11450
|
-
onOpenChange,
|
|
11451
|
-
placement,
|
|
11452
|
-
sideOffset: _sideOffset = 5
|
|
11453
|
-
}) => {
|
|
11454
|
-
const [openState, setOpenState] = React.useState(false);
|
|
11455
|
-
React.useEffect(() => {
|
|
11456
|
-
setOpenState(_open);
|
|
11457
|
-
}, [_open]);
|
|
11458
|
-
React.useEffect(() => {
|
|
11459
|
-
if (onOpenChange) onOpenChange(openState);
|
|
11460
|
-
}, [openState, onOpenChange]);
|
|
11461
|
-
const floatingHook = reactDomInteractions.useFloating({
|
|
11462
|
-
open: openState,
|
|
11463
|
-
onOpenChange: setOpenState,
|
|
11464
|
-
middleware: [reactDomInteractions.offset(_sideOffset), reactDomInteractions.flip(), reactDomInteractions.shift()],
|
|
11465
|
-
placement
|
|
11466
|
-
});
|
|
11467
|
-
const {
|
|
11468
|
-
getReferenceProps,
|
|
11469
|
-
getFloatingProps
|
|
11470
|
-
} = reactDomInteractions.useInteractions([reactDomInteractions.useClick(floatingHook.context), reactDomInteractions.useDismiss(floatingHook.context)]);
|
|
11471
|
-
const value = {
|
|
11472
|
-
openState,
|
|
11473
|
-
setOpenState,
|
|
11474
|
-
floatingHook,
|
|
11475
|
-
getReferenceProps,
|
|
11476
|
-
getFloatingProps
|
|
11477
|
-
};
|
|
11478
|
-
return /*#__PURE__*/React__default["default"].createElement(PopoverContext.Provider, {
|
|
11479
|
-
value: value,
|
|
11480
|
-
__self: undefined,
|
|
11481
|
-
__source: {
|
|
11482
|
-
fileName: _jsxFileName$u,
|
|
11483
|
-
lineNumber: 44,
|
|
11484
|
-
columnNumber: 10
|
|
11485
|
-
}
|
|
11486
|
-
}, children);
|
|
11487
|
-
};
|
|
11488
|
-
const PopoverTrigger = ({
|
|
11489
|
-
children,
|
|
11490
|
-
disabled
|
|
11491
|
-
}) => {
|
|
11492
|
-
const {
|
|
11493
|
-
floatingHook: {
|
|
11494
|
-
reference
|
|
11495
|
-
},
|
|
11496
|
-
getReferenceProps
|
|
11497
|
-
} = React.useContext(PopoverContext);
|
|
11498
|
-
return disabled ? children : /*#__PURE__*/React.cloneElement(children, getReferenceProps(Object.assign({
|
|
11499
|
-
ref: reference
|
|
11500
|
-
}, children.props)));
|
|
11501
|
-
};
|
|
11502
|
-
const PopoverContent = ({
|
|
11503
|
-
children,
|
|
11504
|
-
isMobile,
|
|
11505
|
-
style
|
|
11506
|
-
}) => {
|
|
11507
|
-
const {
|
|
11508
|
-
openState,
|
|
11509
|
-
floatingHook: {
|
|
11510
|
-
x,
|
|
11511
|
-
y,
|
|
11512
|
-
floating,
|
|
11513
|
-
strategy,
|
|
11514
|
-
context
|
|
11515
|
-
},
|
|
11516
|
-
getFloatingProps
|
|
11517
|
-
} = React.useContext(PopoverContext);
|
|
11518
|
-
return openState ? /*#__PURE__*/React__default["default"].createElement(reactDomInteractions.FloatingFocusManager, {
|
|
11519
|
-
context: context,
|
|
11520
|
-
modal: false,
|
|
11521
|
-
order: ['reference', 'content'],
|
|
11522
|
-
returnFocus: false,
|
|
11523
|
-
__self: undefined,
|
|
11524
|
-
__source: {
|
|
11525
|
-
fileName: _jsxFileName$u,
|
|
11526
|
-
lineNumber: 62,
|
|
11527
|
-
columnNumber: 5
|
|
11528
|
-
}
|
|
11529
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", _extends({}, getFloatingProps({
|
|
11530
|
-
ref: floating,
|
|
11531
|
-
style: Object.assign({
|
|
11532
|
-
position: strategy,
|
|
11533
|
-
top: isMobile ? 0 : y != null ? y : '',
|
|
11534
|
-
left: isMobile ? 0 : x != null ? x : '',
|
|
11535
|
-
zIndex: zIndices.popover
|
|
11536
|
-
}, style)
|
|
11537
|
-
}), {
|
|
11538
|
-
__self: undefined,
|
|
11539
|
-
__source: {
|
|
11540
|
-
fileName: _jsxFileName$u,
|
|
11541
|
-
lineNumber: 63,
|
|
11542
|
-
columnNumber: 7
|
|
11543
|
-
}
|
|
11544
|
-
}), children)) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
11545
|
-
};
|
|
11546
|
-
const PopoverClose = _ref => {
|
|
11547
|
-
let {
|
|
11548
|
-
children
|
|
11549
|
-
} = _ref,
|
|
11550
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
11551
|
-
const {
|
|
11552
|
-
setOpenState
|
|
11553
|
-
} = React.useContext(PopoverContext);
|
|
11554
|
-
return /*#__PURE__*/React__default["default"].createElement(Flex$1, _extends({}, props, {
|
|
11555
|
-
onClick: () => {
|
|
11556
|
-
if (props.onClick) props.onClick();
|
|
11557
|
-
setOpenState(false);
|
|
11558
|
-
},
|
|
11559
|
-
__self: undefined,
|
|
11560
|
-
__source: {
|
|
11561
|
-
fileName: _jsxFileName$u,
|
|
11562
|
-
lineNumber: 86,
|
|
11563
|
-
columnNumber: 5
|
|
11564
|
-
}
|
|
11565
|
-
}), children);
|
|
11566
|
-
};
|
|
11567
|
-
Popover.propTypes = {
|
|
11568
|
-
open: PropTypes__default["default"].bool,
|
|
11569
|
-
onOpenChange: PropTypes__default["default"].func,
|
|
11570
|
-
placement: PropTypes__default["default"].oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end']),
|
|
11571
|
-
sideOffset: PropTypes__default["default"].number
|
|
11572
|
-
};
|
|
11573
|
-
Popover.displayName = 'Popover';
|
|
11574
|
-
|
|
11575
11675
|
const _excluded$b = ["className", "defaultValue", "value", "name", "disabled", "orientation", "dir", "min", "max", "step", "onValueChange", "minStepsBetweenThumbs", "color", "size", "width", "height"];
|
|
11576
11676
|
var _jsxFileName$t = "C:\\Users\\Acer\\Documents\\project\\majoo\\majoo-ui\\packages\\react\\src\\components\\slider\\Slider.js";
|
|
11577
11677
|
const StyledSlider = react.styled(SliderPrimitive__namespace.Root, {
|