@wavemaker/react-runtime 11.14.3-rc.6401 → 11.15.0-2.247
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/actions/base-action.js +5 -7
- package/actions/login-action.js +7 -8
- package/actions/logout-action.js +5 -7
- package/actions/navigation-action.js +73 -18
- package/actions/notification-action.js +22 -8
- package/actions/timer-action.js +13 -15
- package/actions/toast.js +4 -2
- package/actions/toast.service.js +1 -2
- package/components/advanced/carousel/index.js +1 -1
- package/components/advanced/carousel/template.js +1 -1
- package/components/basic/anchor/index.js +31 -11
- package/components/basic/html/index.js +115 -24
- package/components/basic/icon/index.js +2 -1
- package/components/basic/iframe/index.js +2 -1
- package/components/basic/label/index.js +12 -9
- package/components/basic/message/index.js +12 -3
- package/components/basic/picture/index.js +11 -4
- package/components/basic/progress-bar/index.js +4 -1
- package/components/basic/progress-circle/index.js +34 -28
- package/components/basic/progress-circle/props.js +10 -2
- package/components/basic/richtexteditor/index.js +95 -94
- package/components/basic/search/index.js +401 -156
- package/components/basic/search/providers.js +126 -61
- package/components/basic/spinner/index.js +2 -1
- package/components/basic/tree/index.js +34 -34
- package/components/basic/tree/utils.js +10 -4
- package/components/chart/components/barColumnChart/index.js +36 -33
- package/components/chart/components/bubbleChart/index.js +35 -25
- package/components/chart/components/chartLegend/utils.js +2 -1
- package/components/chart/components/cumulativeLineChart/index.js +30 -26
- package/components/chart/components/lineAreaChart/index.js +50 -32
- package/components/chart/components/pieDonutChart/index.js +13 -4
- package/components/chart/hooks/useXAxisConfig.js +15 -8
- package/components/chart/index.js +223 -53
- package/components/chart/utils.js +12 -1
- package/components/constants.js +5 -2
- package/components/container/accordion/accordion-pane/index.js +17 -12
- package/components/container/accordion/index.js +9 -4
- package/components/container/alignment-utils.js +56 -1
- package/components/container/index.js +49 -20
- package/components/container/panel/components/panel-header/index.js +3 -4
- package/components/container/panel/index.js +15 -10
- package/components/container/repeat-template/index.js +33 -0
- package/components/container/tabs/index.js +83 -14
- package/components/container/tabs/tab-pane/index.js +33 -10
- package/components/container/tabs/utils.js +51 -0
- package/components/container/wizard/components/StepComponents.js +2 -1
- package/components/container/wizard/components/WizardStep.js +2 -1
- package/components/container/wizard/index.js +64 -35
- package/components/container/wizard/utils.js +46 -1
- package/components/container/wizard/wizard-step/index.js +11 -1
- package/components/data/card/card-content/index.js +1 -1
- package/components/data/form/base-form/index.js +985 -183
- package/components/data/form/base-form/props.js +3 -1
- package/components/data/form/base-form/utils.js +159 -1
- package/components/data/form/dynamic-fields/constant.js +53 -0
- package/components/data/form/dynamic-fields/index.js +10 -45
- package/components/data/form/dynamic-fields/utils.js +37 -2
- package/components/data/form/form-action/index.js +5 -4
- package/components/data/form/form-context.js +5 -1
- package/components/data/form/form-controller/utils.js +84 -0
- package/components/data/form/form-controller/validation-contrustor.js +402 -189
- package/components/data/form/form-controller/withFormController.js +191 -52
- package/components/data/form/form-field/base-field.js +67 -45
- package/components/data/form/form-field/index.js +28 -5
- package/components/data/form/form-header/index.js +3 -4
- package/components/data/form/index.js +20 -1
- package/components/data/list/components/ListDND.js +2 -1
- package/components/data/list/components/ListItem.js +6 -2
- package/components/data/list/components/ListItemWithTemplate.js +46 -2
- package/components/data/list/components/ListItems.js +17 -26
- package/components/data/list/components/ListPagination.js +3 -3
- package/components/data/list/components/StandardListItems.js +3 -4
- package/components/data/list/hooks/useListEffects.js +55 -14
- package/components/data/list/hooks/useListEventHandlers.js +3 -1
- package/components/data/list/hooks/useListState.js +3 -1
- package/components/data/list/hooks/usePaginatedGroupedData.js +18 -5
- package/components/data/list/index.js +74 -55
- package/components/data/list/utils/list-helpers.js +73 -35
- package/components/data/list/utils/list-widget-methods.js +138 -95
- package/components/data/live-filter/index.js +26 -15
- package/components/data/live-form/index.js +51 -18
- package/components/data/live-form/props.js +1 -1
- package/components/data/pagination/components/BasicPagination.js +71 -16
- package/components/data/pagination/components/PageSizeSelector.js +8 -3
- package/components/data/pagination/components/TotalRecords.js +1 -5
- package/components/data/pagination/hooks/usePagination.js +349 -66
- package/components/data/pagination/index.js +137 -19
- package/components/data/table/components/AddNewRow.js +5 -1
- package/components/data/table/components/EditableCell.js +2 -2
- package/components/data/table/components/RowCells.js +64 -0
- package/components/data/table/components/RowExpansionButton.js +2 -2
- package/components/data/table/components/SummaryCell.js +111 -0
- package/components/data/table/components/SummaryRow.js +54 -0
- package/components/data/table/components/SummaryRowFooter.js +46 -0
- package/components/data/table/components/TableBody.js +61 -59
- package/components/data/table/components/TableDataRow.js +109 -0
- package/components/data/table/components/TableFilters.js +225 -121
- package/components/data/table/components/TableHeader.js +291 -23
- package/components/data/table/components/TablePanelHeading.js +139 -8
- package/components/data/table/components/index.js +22 -1
- package/components/data/table/hooks/use-edited-rows.js +141 -0
- package/components/data/table/hooks/useCellState.js +5 -12
- package/components/data/table/hooks/useFormWidget.js +58 -52
- package/components/data/table/hooks/usePaginationState.js +45 -24
- package/components/data/table/hooks/usePanelStructure.js +4 -4
- package/components/data/table/hooks/useRowHandlers.js +39 -5
- package/components/data/table/hooks/useRowSelection.js +244 -50
- package/components/data/table/hooks/useServerSideSorting.js +81 -37
- package/components/data/table/hooks/useTableColumns.js +211 -118
- package/components/data/table/hooks/useTableData.js +54 -9
- package/components/data/table/hooks/useTableEdit.js +272 -97
- package/components/data/table/hooks/useTableEffects.js +31 -13
- package/components/data/table/hooks/useTableFilter.js +1 -1
- package/components/data/table/hooks/useTableInitialization.js +23 -22
- package/components/data/table/hooks/useTableState.js +11 -5
- package/components/data/table/hooks/useTableStateManager.js +140 -65
- package/components/data/table/index.js +637 -274
- package/components/data/table/live-table/index.js +54 -22
- package/components/data/table/table-action/index.js +1 -1
- package/components/data/table/table-group/index.js +26 -0
- package/components/data/table/table-row-action/index.js +32 -18
- package/components/data/table/utils/buildSelectionColumns.js +12 -21
- package/components/data/table/utils/columnBuilder.js +29 -14
- package/components/data/table/utils/columnProxy.js +68 -1
- package/components/data/table/utils/constants.js +6 -2
- package/components/data/table/utils/crud-handlers.js +68 -63
- package/components/data/table/utils/groupHeaderUtils.js +102 -0
- package/components/data/table/utils/index.js +210 -21
- package/components/data/table/utils/renderDisplayCell.js +6 -6
- package/components/data/table/utils/selectionUtils.js +25 -26
- package/components/data/table/utils/validation.js +1 -0
- package/components/data/utils/filter-field-util.js +3 -3
- package/components/dialogs/alert-dialog/index.js +1 -1
- package/components/dialogs/confirm-dialog/index.js +1 -1
- package/components/dialogs/dialog/index.js +4 -1
- package/components/dialogs/dialog-content/index.js +3 -1
- package/components/dialogs/dialog-header/index.js +2 -2
- package/components/dialogs/iframe-dialog/index.js +11 -5
- package/components/dialogs/index.js +1 -1
- package/components/dialogs/login-dialog/index.js +1 -1
- package/components/dialogs/page-dialog/index.js +1 -1
- package/components/form/button/index.js +33 -7
- package/components/input/calendar/index.js +18 -6
- package/components/input/chips/index.js +99 -28
- package/components/input/chips/utils.js +34 -4
- package/components/input/color-picker/index.js +74 -25
- package/components/input/composite/index.js +3 -3
- package/components/input/currency/index.js +35 -49
- package/components/input/default/checkbox/index.js +23 -28
- package/components/input/default/checkboxset/index.js +38 -18
- package/components/input/default/checkboxset/utils.js +30 -0
- package/components/input/default/radioset/index.js +36 -39
- package/components/input/default/switch/index.js +30 -13
- package/components/input/epoch/date/index.js +130 -69
- package/components/input/epoch/date/utils.js +94 -1
- package/components/input/epoch/datetime/index.js +72 -22
- package/components/input/epoch/datetime/utils.js +49 -10
- package/components/input/epoch/time/index.js +68 -19
- package/components/input/epoch/time/utils.js +62 -14
- package/components/input/fileupload/Utils.js +12 -7
- package/components/input/fileupload/components/MultiUpload.js +2 -6
- package/components/input/fileupload/components/SingleUpload.js +3 -7
- package/components/input/fileupload/index.js +6 -10
- package/components/input/fileupload/useFileUpload.js +16 -5
- package/components/input/number/index.js +158 -43
- package/components/input/rating/index.js +90 -7
- package/components/input/select/index.js +209 -72
- package/components/input/slider/index.js +84 -26
- package/components/input/text/index.js +38 -18
- package/components/input/text/util.js +283 -130
- package/components/input/textarea/index.js +13 -10
- package/components/input/upload/index.js +124 -0
- package/components/input/upload/props.js +5 -0
- package/components/input/util/index.js +11 -0
- package/components/navbar/index.js +51 -3
- package/components/navbar/nav/index.js +46 -16
- package/components/navbar/nav-item/index.js +11 -5
- package/components/navigation/menu/components/ListItems.js +3 -0
- package/components/navigation/menu/constants.js +2 -1
- package/components/navigation/menu/hooks/useHoverState.hook.js +48 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +37 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.js +15 -0
- package/components/navigation/menu/index.js +326 -188
- package/components/navigation/menu/utils/action-task.js +14 -0
- package/components/navigation/menu/utils/role-filter.js +76 -0
- package/components/navigation/popover/index.js +105 -32
- package/components/page/partial-container/index.js +34 -5
- package/components/prefab/index.js +2 -4
- package/context/PrefabContext.js +10 -6
- package/context/WidgetProvider.js +30 -31
- package/core/app.service.js +1 -1
- package/core/constants/events.js +57 -1
- package/core/dialog.service.js +1 -2
- package/core/event-notifier.js +1 -2
- package/core/formatter/array-formatters.js +33 -0
- package/core/formatter/date-formatters.js +2 -4
- package/core/formatter/index.js +2 -1
- package/core/formatter/number-formatters.js +5 -10
- package/core/formatter/security-formatters.js +2 -4
- package/core/formatter/string-formatters.js +3 -6
- package/core/proxy-service.js +85 -13
- package/core/script-registry.js +108 -48
- package/core/util/common.js +4 -4
- package/core/util/compare.js +30 -0
- package/core/util/dom.js +8 -8
- package/core/util/index.js +16 -6
- package/core/util/safe-is-equal.js +156 -0
- package/core/util/security.js +1 -2
- package/core/util/utils.js +16 -7
- package/higherOrder/BaseApp.js +108 -65
- package/higherOrder/BaseDateTime.js +31 -13
- package/higherOrder/BasePage.js +268 -144
- package/higherOrder/BasePartial.js +1 -1
- package/higherOrder/BasePrefab.js +33 -15
- package/higherOrder/DataNav.js +99 -16
- package/higherOrder/helper.js +41 -3
- package/higherOrder/withBaseWrapper.js +41 -28
- package/hooks/useAuth.js +11 -5
- package/hooks/useHttp.js +280 -94
- package/mui-config/theme-provider.js +1 -1
- package/mui-config/theme.js +1 -1
- package/package-lock.json +423 -331
- package/package.json +8 -8
- package/store/bindActions/i18nActions.js +18 -0
- package/store/index.js +3 -1
- package/store/slices/appConfigSlice.js +2 -2
- package/store/slices/authSlice.js +31 -28
- package/store/slices/i18nSlice.js +2 -2
- package/store/slices/navigationSlice.js +35 -0
- package/store/viewport.service.js +255 -0
- package/utils/attr.js +35 -0
- package/utils/dataset-util.js +1 -2
- package/utils/form-state.util.js +43 -12
- package/utils/form-utils.js +47 -2
- package/utils/format-util.js +28 -13
- package/utils/page-params-util.js +33 -1
- package/utils/state-persistance.js +72 -13
- package/utils/transformedDataset-utils.js +35 -24
- package/variables/base-variable.js +12 -14
- package/variables/crud-variable.js +225 -0
- package/variables/live-variable.js +56 -20
- package/variables/metadata.service.js +123 -0
- package/variables/model-variable.js +21 -15
- package/variables/service-variable.js +88 -83
|
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
16
|
var _NativeSelect = _interopRequireDefault(require("@mui/material/NativeSelect"));
|
|
@@ -21,7 +23,7 @@ var __jsx = _react["default"].createElement;
|
|
|
21
23
|
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; }
|
|
22
24
|
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) { (0, _defineProperty2["default"])(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; }
|
|
23
25
|
var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
24
|
-
var
|
|
26
|
+
var _ref2, _key;
|
|
25
27
|
var autofocus = props.autofocus,
|
|
26
28
|
className = props.className,
|
|
27
29
|
_props$datafield = props.datafield,
|
|
@@ -30,7 +32,7 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
30
32
|
datavalue = props.datavalue,
|
|
31
33
|
_props$disabled = props.disabled,
|
|
32
34
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
33
|
-
|
|
35
|
+
displayExpression = props.displayExpression,
|
|
34
36
|
displaylabel = props.displaylabel,
|
|
35
37
|
_props$displayfield = props.displayfield,
|
|
36
38
|
displayfield = _props$displayfield === void 0 ? "value" : _props$displayfield,
|
|
@@ -52,6 +54,7 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
52
54
|
listener = props.listener,
|
|
53
55
|
_props$tabindex = props.tabindex,
|
|
54
56
|
tabindex = _props$tabindex === void 0 ? 0 : _props$tabindex,
|
|
57
|
+
match = props.match,
|
|
55
58
|
onClick = props.onClick,
|
|
56
59
|
onChange = props.onChange,
|
|
57
60
|
onBlur = props.onBlur,
|
|
@@ -63,6 +66,8 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
63
66
|
onKeyUp = props.onKeyUp;
|
|
64
67
|
var DEFAULT_CLASS = "app-select-wrapper ng-dirty";
|
|
65
68
|
var selectRef = (0, _react.useRef)(null);
|
|
69
|
+
var lastDatavalueRef = (0, _react.useRef)(datavalue);
|
|
70
|
+
var externalDatavalueRef = (0, _react.useRef)(null);
|
|
66
71
|
var _useState = (0, _react.useState)(""),
|
|
67
72
|
displayValue = _useState[0],
|
|
68
73
|
setDisplayValue = _useState[1];
|
|
@@ -81,7 +86,9 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
81
86
|
var _useState6 = (0, _react.useState)(datavalue),
|
|
82
87
|
prevDatavalue = _useState6[0],
|
|
83
88
|
setPrevDatavalue = _useState6[1];
|
|
84
|
-
|
|
89
|
+
// Check if dataset is a function and call it to get the actual dataset value
|
|
90
|
+
var resolvedDataset = typeof dataset === "function" ? dataset() : dataset;
|
|
91
|
+
var transformedDataset = (0, _transformedDatasetUtils.transformDataset)(resolvedDataset, datafield, displayfield, displaylabel, displayExpression, orderby, groupby, dataPath, "", match);
|
|
85
92
|
var validateInput = (0, _react.useCallback)(function (value) {
|
|
86
93
|
// Handle special case value
|
|
87
94
|
if (value === "") {
|
|
@@ -103,71 +110,112 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
103
110
|
}, [required]);
|
|
104
111
|
|
|
105
112
|
// Handle value change
|
|
106
|
-
var handleValueChange = function
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
});
|
|
130
|
-
} else {
|
|
131
|
-
var findItem = function findItem(val) {
|
|
132
|
-
return transformedDataset.find(function (item) {
|
|
133
|
-
return (0, _typeof2["default"])(item.value) === "object" ? String(item.key) === String(val) : String(item.value) === String(val);
|
|
113
|
+
var handleValueChange = /*#__PURE__*/function () {
|
|
114
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(event) {
|
|
115
|
+
var _listener$Widgets, _transformedDataset;
|
|
116
|
+
var newValue, filteredValues, selectedTexts, findItem, selectedValues, selectedDisplayValues, _event$target$options;
|
|
117
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
118
|
+
while (1) switch (_context.prev = _context.next) {
|
|
119
|
+
case 0:
|
|
120
|
+
if (!(props.readonly || disabled)) {
|
|
121
|
+
_context.next = 2;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return _context.abrupt("return");
|
|
125
|
+
case 2:
|
|
126
|
+
newValue = multiple ? Array.from(event.target.selectedOptions, function (option) {
|
|
127
|
+
return option.value;
|
|
128
|
+
}) : event.target.selectedIndex;
|
|
129
|
+
if (!multiple) {
|
|
130
|
+
_context.next = 20;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
// Filter out placeholder value from multiple selection
|
|
134
|
+
filteredValues = newValue.filter(function (val) {
|
|
135
|
+
return val !== placeholder;
|
|
134
136
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
137
|
+
setLocalDatavalue(filteredValues);
|
|
138
|
+
selectedTexts = Array.from(event.target.selectedOptions, function (option) {
|
|
139
|
+
return option.text;
|
|
140
|
+
}).filter(function (text) {
|
|
141
|
+
return text !== placeholder;
|
|
142
|
+
});
|
|
143
|
+
setDisplayValue(selectedTexts.join(", "));
|
|
144
|
+
if (!(listener !== null && listener !== void 0 && listener.onChange)) {
|
|
145
|
+
_context.next = 18;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
if (!(filteredValues.length === 0)) {
|
|
149
|
+
_context.next = 14;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
_context.next = 12;
|
|
153
|
+
return listener.onChange(props.fieldName || name, {
|
|
154
|
+
datavalue: [],
|
|
155
|
+
displayValue: []
|
|
156
|
+
});
|
|
157
|
+
case 12:
|
|
158
|
+
_context.next = 18;
|
|
159
|
+
break;
|
|
160
|
+
case 14:
|
|
161
|
+
findItem = function findItem(val) {
|
|
162
|
+
return transformedDataset.find(function (item) {
|
|
163
|
+
return (0, _typeof2["default"])(item.value) === "object" ? String(item.key) === String(val) : String(item.value) === String(val);
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
selectedValues = filteredValues.map(function (val) {
|
|
167
|
+
var item = findItem(val);
|
|
168
|
+
return item ? item.value : val;
|
|
169
|
+
});
|
|
170
|
+
selectedDisplayValues = filteredValues.map(function (val) {
|
|
171
|
+
var item = findItem(val);
|
|
172
|
+
return item ? item.label : val;
|
|
173
|
+
});
|
|
174
|
+
listener.onChange(props.fieldName || name, {
|
|
175
|
+
datavalue: selectedValues,
|
|
176
|
+
displayValue: selectedDisplayValues
|
|
177
|
+
});
|
|
178
|
+
case 18:
|
|
179
|
+
_context.next = 30;
|
|
180
|
+
break;
|
|
181
|
+
case 20:
|
|
182
|
+
setLocalDatavalue(event.target.value);
|
|
183
|
+
setDisplayValue(((_event$target$options = event.target.options[event.target.selectedIndex]) === null || _event$target$options === void 0 ? void 0 : _event$target$options.text) || "");
|
|
184
|
+
if (!(listener !== null && listener !== void 0 && listener.onChange)) {
|
|
185
|
+
_context.next = 30;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
if (!(newValue === 0 || event.target.value === placeholder)) {
|
|
189
|
+
_context.next = 28;
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
_context.next = 26;
|
|
193
|
+
return listener.onChange(props.fieldName || name, {
|
|
194
|
+
datavalue: "",
|
|
195
|
+
displayValue: ""
|
|
196
|
+
});
|
|
197
|
+
case 26:
|
|
198
|
+
_context.next = 30;
|
|
199
|
+
break;
|
|
200
|
+
case 28:
|
|
201
|
+
_context.next = 30;
|
|
202
|
+
return listener.onChange(props.fieldName || name, {
|
|
203
|
+
datavalue: transformedDataset[newValue - 1].value,
|
|
204
|
+
displayValue: transformedDataset[newValue - 1].label
|
|
205
|
+
});
|
|
206
|
+
case 30:
|
|
207
|
+
if (onChange) onChange === null || onChange === void 0 || onChange(event, listener === null || listener === void 0 || (_listener$Widgets = listener.Widgets) === null || _listener$Widgets === void 0 ? void 0 : _listener$Widgets[name], (transformedDataset === null || transformedDataset === void 0 || (_transformedDataset = transformedDataset[newValue - 1]) === null || _transformedDataset === void 0 ? void 0 : _transformedDataset.value) || "en", prevDatavalue);
|
|
208
|
+
setPrevDatavalue(newValue);
|
|
209
|
+
case 32:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context.stop();
|
|
165
212
|
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
213
|
+
}, _callee);
|
|
214
|
+
}));
|
|
215
|
+
return function handleValueChange(_x) {
|
|
216
|
+
return _ref.apply(this, arguments);
|
|
217
|
+
};
|
|
218
|
+
}();
|
|
171
219
|
var handleBlur = function handleBlur(e) {
|
|
172
220
|
var newValue = e.target.value;
|
|
173
221
|
var selectedItem = transformedDataset.find(function (item) {
|
|
@@ -231,9 +279,13 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
231
279
|
}
|
|
232
280
|
}
|
|
233
281
|
}, [transformedDataset, datavalue, multiple]);
|
|
234
|
-
|
|
235
282
|
// Sync localDatavalue with incoming datavalue prop
|
|
236
283
|
(0, _react.useEffect)(function () {
|
|
284
|
+
if (lastDatavalueRef.current !== datavalue) {
|
|
285
|
+
lastDatavalueRef.current = datavalue;
|
|
286
|
+
} else {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
237
289
|
if (multiple) {
|
|
238
290
|
var normalizedValue = Array.isArray(datavalue) ? datavalue : datavalue ? [datavalue] : [];
|
|
239
291
|
if (JSON.stringify(normalizedValue) !== JSON.stringify(localDatavalue)) {
|
|
@@ -241,10 +293,33 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
241
293
|
}
|
|
242
294
|
} else {
|
|
243
295
|
if (datavalue !== localDatavalue) {
|
|
296
|
+
var _listener$onChange;
|
|
297
|
+
// Compute displayValue for the external value
|
|
298
|
+
var computedDisplayValue = "";
|
|
299
|
+
if ((0, _typeof2["default"])(datavalue) === "object" && datavalue !== null) {
|
|
300
|
+
var matchingItem = transformedDataset.find(function (item) {
|
|
301
|
+
return item.value === datavalue || JSON.stringify(item.value) === JSON.stringify(datavalue);
|
|
302
|
+
});
|
|
303
|
+
computedDisplayValue = (matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.label) || "";
|
|
304
|
+
} else {
|
|
305
|
+
var _matchingItem = transformedDataset.find(function (item) {
|
|
306
|
+
return item.value == datavalue;
|
|
307
|
+
});
|
|
308
|
+
computedDisplayValue = (_matchingItem === null || _matchingItem === void 0 ? void 0 : _matchingItem.label) || "";
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Store the DATAVALUE so listener useEffect can skip until localDatavalue matches
|
|
312
|
+
externalDatavalueRef.current = datavalue;
|
|
244
313
|
setLocalDatavalue(datavalue);
|
|
314
|
+
|
|
315
|
+
// Call listener.onChange with BOTH datavalue and displayValue in a single call
|
|
316
|
+
listener === null || listener === void 0 || (_listener$onChange = listener.onChange) === null || _listener$onChange === void 0 || _listener$onChange.call(listener, props.fieldName || name, {
|
|
317
|
+
datavalue: datavalue,
|
|
318
|
+
displayValue: computedDisplayValue
|
|
319
|
+
});
|
|
245
320
|
}
|
|
246
321
|
}
|
|
247
|
-
}, [datavalue, multiple]);
|
|
322
|
+
}, [datavalue, multiple, transformedDataset]);
|
|
248
323
|
var handleClick = (0, _react.useCallback)(function (event) {
|
|
249
324
|
onClick === null || onClick === void 0 || onClick(event);
|
|
250
325
|
}, [onClick]);
|
|
@@ -279,7 +354,68 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
279
354
|
} : {}), onMouseLeave ? {
|
|
280
355
|
onMouseLeave: handleMouseLeave
|
|
281
356
|
} : {});
|
|
357
|
+
|
|
358
|
+
// Memoize the computed select value to prevent re-renders
|
|
359
|
+
var computedSelectValue = (0, _react.useMemo)(function () {
|
|
360
|
+
if (multiple) {
|
|
361
|
+
return Array.isArray(localDatavalue) ? localDatavalue : [];
|
|
362
|
+
}
|
|
363
|
+
if ((0, _typeof2["default"])(localDatavalue) === "object" && localDatavalue !== null) {
|
|
364
|
+
var _matchingItem2 = transformedDataset.find(function (item) {
|
|
365
|
+
return item.value === localDatavalue || JSON.stringify(item.value) === JSON.stringify(localDatavalue);
|
|
366
|
+
});
|
|
367
|
+
if (_matchingItem2) {
|
|
368
|
+
return {
|
|
369
|
+
key: _matchingItem2.key,
|
|
370
|
+
displayValue: _matchingItem2.label
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
var matchingItem = transformedDataset.find(function (item) {
|
|
375
|
+
return item.value == localDatavalue;
|
|
376
|
+
});
|
|
377
|
+
var displayLabel = (matchingItem === null || matchingItem === void 0 ? void 0 : matchingItem.label) || "";
|
|
378
|
+
return {
|
|
379
|
+
key: localDatavalue,
|
|
380
|
+
displayValue: displayLabel
|
|
381
|
+
};
|
|
382
|
+
}, [localDatavalue, transformedDataset, multiple]);
|
|
383
|
+
|
|
384
|
+
// Track previous computed value to avoid unnecessary listener calls
|
|
385
|
+
var prevComputedValueRef = (0, _react.useRef)(null);
|
|
386
|
+
|
|
387
|
+
// Handle side effect (listener.onChange) in useEffect, not during render
|
|
388
|
+
// This effect ONLY handles displayValue updates for INTERNAL state changes
|
|
389
|
+
// External prop changes are handled in sync useEffect above
|
|
390
|
+
(0, _react.useEffect)(function () {
|
|
391
|
+
if (multiple) return;
|
|
392
|
+
var currentValue = computedSelectValue;
|
|
393
|
+
|
|
394
|
+
// Check if localDatavalue matches the external datavalue (final state reached)
|
|
395
|
+
var isExternalChange = externalDatavalueRef.current !== null && (localDatavalue === externalDatavalueRef.current || (0, _typeof2["default"])(localDatavalue) === "object" && (0, _typeof2["default"])(externalDatavalueRef.current) === "object" && JSON.stringify(localDatavalue) === JSON.stringify(externalDatavalueRef.current));
|
|
396
|
+
|
|
397
|
+
// Skip if we have a pending external change (already handled in sync useEffect)
|
|
398
|
+
if (externalDatavalueRef.current !== null) {
|
|
399
|
+
// Only clear when localDatavalue has been updated to match the external value
|
|
400
|
+
if (isExternalChange) {
|
|
401
|
+
externalDatavalueRef.current = null;
|
|
402
|
+
}
|
|
403
|
+
prevComputedValueRef.current = currentValue;
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
var prevValue = prevComputedValueRef.current;
|
|
407
|
+
|
|
408
|
+
// Only call listener if the computed value actually changed
|
|
409
|
+
if (currentValue.displayValue && (!prevValue || prevValue.key !== currentValue.key || prevValue.displayValue !== currentValue.displayValue)) {
|
|
410
|
+
var _listener$onChange2;
|
|
411
|
+
listener === null || listener === void 0 || (_listener$onChange2 = listener.onChange) === null || _listener$onChange2 === void 0 || _listener$onChange2.call(listener, props.fieldName || name, {
|
|
412
|
+
displayValue: currentValue.displayValue
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
prevComputedValueRef.current = currentValue;
|
|
416
|
+
}, [computedSelectValue, multiple, listener, props.fieldName, name, localDatavalue]);
|
|
282
417
|
return __jsx(_material.Box, {
|
|
418
|
+
hidden: props.hidden,
|
|
283
419
|
sx: {
|
|
284
420
|
display: "inherit !important"
|
|
285
421
|
},
|
|
@@ -289,7 +425,7 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
289
425
|
IconComponent: function IconComponent() {
|
|
290
426
|
return null;
|
|
291
427
|
},
|
|
292
|
-
value: multiple ?
|
|
428
|
+
value: multiple ? computedSelectValue : (_ref2 = (_key = computedSelectValue.key) !== null && _key !== void 0 ? _key : placeholder) !== null && _ref2 !== void 0 ? _ref2 : ""
|
|
293
429
|
}, events, {
|
|
294
430
|
sx: {
|
|
295
431
|
"& .MuiNativeSelect-select": _objectSpread(_objectSpread({}, styles), {}, {
|
|
@@ -304,12 +440,13 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
304
440
|
tabIndex: tabindex,
|
|
305
441
|
"aria-label": arialabel,
|
|
306
442
|
multiple: multiple,
|
|
307
|
-
disabled: disabled
|
|
443
|
+
disabled: disabled,
|
|
308
444
|
"aria-readonly": readonly,
|
|
309
445
|
className: "app-select ".concat(className, " form-control ng-valid ng-touched ng-dirty wm-app "),
|
|
310
446
|
accessKey: shortcutkey,
|
|
311
447
|
title: hint
|
|
312
|
-
}
|
|
448
|
+
},
|
|
449
|
+
readOnly: readonly
|
|
313
450
|
}), __jsx("option", {
|
|
314
451
|
value: placeholder,
|
|
315
452
|
id: "placeholderOption",
|
|
@@ -335,7 +472,7 @@ var WmSelect = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
|
335
472
|
}, item.label);
|
|
336
473
|
})));
|
|
337
474
|
}, function (prevProps, nextProps) {
|
|
338
|
-
var keys = ["dataset", "datafield", "displayfield", "displaylabel", "
|
|
475
|
+
var keys = ["dataset", "datafield", "displayfield", "displaylabel", "displayExpression", "orderby", "groupby", "dataPath", "arialabel", "multiple", "styles", "autofocus", "disabled", "readonly", "required", "datavalue", "hidden", "className"];
|
|
339
476
|
return keys.every(function (key) {
|
|
340
477
|
return prevProps[key] === nextProps[key];
|
|
341
478
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -13,13 +14,14 @@ var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
|
13
14
|
var _input = require("@base-ui-components/react/input");
|
|
14
15
|
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
15
16
|
var _withFormController = _interopRequireDefault(require("@wavemaker/react-runtime/components/data/form/form-controller/withFormController"));
|
|
16
|
-
|
|
17
|
+
var _transformedDatasetUtils = require("@wavemaker/react-runtime/utils/transformedDataset-utils");
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
17
19
|
var __jsx = _react["default"].createElement;
|
|
18
20
|
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
21
|
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) { (0, _defineProperty2["default"])(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
22
|
var DEFAULT_CLASS = "app-slider slider";
|
|
21
23
|
var WmSlider = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
22
|
-
var className = props
|
|
24
|
+
var className = props.className,
|
|
23
25
|
_props$disabled = props.disabled,
|
|
24
26
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
25
27
|
hint = props.hint,
|
|
@@ -29,8 +31,7 @@ var WmSlider = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
29
31
|
readonly = _props$readonly === void 0 ? false : _props$readonly,
|
|
30
32
|
_props$tabindex = props.tabindex,
|
|
31
33
|
tabindex = _props$tabindex === void 0 ? 0 : _props$tabindex,
|
|
32
|
-
|
|
33
|
-
datavalue = _props$datavalue === void 0 ? 0 : _props$datavalue,
|
|
34
|
+
datavalue = props.datavalue,
|
|
34
35
|
_props$minvalue = props.minvalue,
|
|
35
36
|
minvalue = _props$minvalue === void 0 ? 0 : _props$minvalue,
|
|
36
37
|
_props$maxvalue = props.maxvalue,
|
|
@@ -40,13 +41,17 @@ var WmSlider = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
40
41
|
onChange = props.onChange,
|
|
41
42
|
styles = props.styles,
|
|
42
43
|
listener = props.listener,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
arialabel = props.arialabel,
|
|
45
|
+
_props$showmarkers = props.showmarkers,
|
|
46
|
+
showmarkers = _props$showmarkers === void 0 ? false : _props$showmarkers,
|
|
47
|
+
markerlabeltext = props.markerlabeltext;
|
|
48
|
+
|
|
49
|
+
// Always provide a number value to keep the input controlled
|
|
50
|
+
var initialValue = datavalue !== undefined ? datavalue : (minvalue + maxvalue) / 2;
|
|
51
|
+
var _useState = (0, _react.useState)(initialValue),
|
|
47
52
|
value = _useState[0],
|
|
48
53
|
setValue = _useState[1];
|
|
49
|
-
var prevDatavalueRef = (0, _react.useRef)(
|
|
54
|
+
var prevDatavalueRef = (0, _react.useRef)(initialValue);
|
|
50
55
|
var sliderRef = (0, _react.useRef)(null);
|
|
51
56
|
var _useState2 = (0, _react.useState)(false),
|
|
52
57
|
isTouched = _useState2[0],
|
|
@@ -54,15 +59,19 @@ var WmSlider = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
54
59
|
var _useState3 = (0, _react.useState)(false),
|
|
55
60
|
isDirty = _useState3[0],
|
|
56
61
|
setIsDirty = _useState3[1];
|
|
62
|
+
var _useState4 = (0, _react.useState)([]),
|
|
63
|
+
markerItems = _useState4[0],
|
|
64
|
+
setMarkerItems = _useState4[1];
|
|
57
65
|
(0, _react.useEffect)(function () {
|
|
66
|
+
var newValue = datavalue !== undefined ? datavalue : (minvalue + maxvalue) / 2;
|
|
58
67
|
if (datavalue !== prevDatavalueRef.current) {
|
|
59
|
-
setValue(
|
|
60
|
-
prevDatavalueRef.current =
|
|
68
|
+
setValue(newValue);
|
|
69
|
+
prevDatavalueRef.current = newValue;
|
|
61
70
|
}
|
|
62
|
-
}, [datavalue, listener]);
|
|
71
|
+
}, [datavalue, listener, minvalue, maxvalue]);
|
|
63
72
|
(0, _react.useEffect)(function () {
|
|
64
|
-
if (props.datavalue !== value) {
|
|
65
|
-
setValue(props.datavalue
|
|
73
|
+
if (props.datavalue !== undefined && props.datavalue !== value) {
|
|
74
|
+
setValue(props.datavalue);
|
|
66
75
|
}
|
|
67
76
|
}, [props.datavalue]);
|
|
68
77
|
|
|
@@ -120,18 +129,50 @@ var WmSlider = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
120
129
|
};
|
|
121
130
|
}
|
|
122
131
|
}, [sliderRef, disabled, readonly]);
|
|
132
|
+
var getMarkersItems = (0, _react.useCallback)(function () {
|
|
133
|
+
var sliderTrack = sliderRef.current;
|
|
134
|
+
if (!sliderTrack) return;
|
|
135
|
+
var trackWidth = sliderTrack.offsetWidth - 9 || 0;
|
|
136
|
+
|
|
137
|
+
// Calculate tick count based on min/max/step values
|
|
138
|
+
var tickCount = 0;
|
|
139
|
+
if (props.minvalue !== undefined && props.maxvalue !== undefined) {
|
|
140
|
+
tickCount = step > 0 ? Math.floor((props.maxvalue - props.minvalue) / step) + 1 : 0;
|
|
141
|
+
} else {
|
|
142
|
+
tickCount = step > 0 ? Math.floor(100 / step) + 1 : 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Convert marker label text to object format
|
|
146
|
+
var labels = (0, _transformedDatasetUtils.convertDataToObject)(markerlabeltext);
|
|
147
|
+
var newMarkerItems = [];
|
|
148
|
+
for (var i = 0; i < tickCount; i++) {
|
|
149
|
+
var _labels$i$dataValue, _labels$i, _labels$i2, _labels$i3;
|
|
150
|
+
var left = trackWidth / (tickCount - 1) * i;
|
|
151
|
+
var label = (_labels$i$dataValue = labels === null || labels === void 0 || (_labels$i = labels[i]) === null || _labels$i === void 0 ? void 0 : _labels$i.dataValue) !== null && _labels$i$dataValue !== void 0 ? _labels$i$dataValue : Array.isArray(labels) ? (0, _typeof2["default"])(labels[i]) === "object" && (_labels$i2 = labels[i]) !== null && _labels$i2 !== void 0 && _labels$i2.title ? labels[i].title : labels[i] : "".concat(i);
|
|
152
|
+
var position = Array.isArray(labels) && (0, _typeof2["default"])(labels[i]) === "object" && (_labels$i3 = labels[i]) !== null && _labels$i3 !== void 0 && _labels$i3.position ? labels[i].position : "up";
|
|
153
|
+
newMarkerItems.push({
|
|
154
|
+
label: label,
|
|
155
|
+
position: position,
|
|
156
|
+
left: left
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
setMarkerItems(newMarkerItems);
|
|
160
|
+
}, [props.minvalue, props.maxvalue, step, markerlabeltext]);
|
|
161
|
+
(0, _react.useEffect)(function () {
|
|
162
|
+
if (showmarkers) {
|
|
163
|
+
getMarkersItems();
|
|
164
|
+
}
|
|
165
|
+
}, [props.minvalue, props.maxvalue, step, markerlabeltext, showmarkers]);
|
|
123
166
|
return __jsx(_Box["default"], {
|
|
167
|
+
hidden: props.hidden,
|
|
124
168
|
className: (0, _clsx["default"])(DEFAULT_CLASS, className, isTouched ? "ng-touched" : "ng-untouched", isDirty ? "ng-invalid" : "ng-valid"),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
width: width
|
|
128
|
-
})
|
|
129
|
-
}, (minvalue || maxvalue) && __jsx(_react["default"].Fragment, null, __jsx(_Box["default"], {
|
|
169
|
+
style: styles
|
|
170
|
+
}, !showmarkers && (minvalue || maxvalue) && __jsx(_react["default"].Fragment, null, __jsx(_Box["default"], {
|
|
130
171
|
component: "span",
|
|
131
|
-
className: "app-slider-value pull-left"
|
|
172
|
+
className: "app-slider-value fa-pull-left"
|
|
132
173
|
}, minvalue || minvalue == 0 ? minvalue : null), __jsx(_Box["default"], {
|
|
133
174
|
component: "span",
|
|
134
|
-
className: "app-slider-value pull-right"
|
|
175
|
+
className: "app-slider-value fa-pull-right"
|
|
135
176
|
}, maxvalue || maxvalue == 0 ? maxvalue : null)), __jsx(_input.Input, {
|
|
136
177
|
type: "range",
|
|
137
178
|
ref: sliderRef,
|
|
@@ -143,22 +184,39 @@ var WmSlider = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
143
184
|
max: maxvalue,
|
|
144
185
|
disabled: disabled // Only disabled when explicitly disabled, not when readonly
|
|
145
186
|
,
|
|
146
|
-
"aria-label":
|
|
187
|
+
"aria-label": arialabel,
|
|
147
188
|
"aria-orientation": "horizontal",
|
|
148
189
|
role: "slider",
|
|
149
190
|
"aria-valuenow": value,
|
|
150
191
|
"aria-valuemin": minvalue,
|
|
151
192
|
"aria-valuemax": maxvalue,
|
|
152
193
|
tabIndex: tabindex,
|
|
153
|
-
title:
|
|
194
|
+
title: props.datavalue !== undefined ? String(value) : "undefined",
|
|
154
195
|
onBlur: handleBlur
|
|
155
196
|
}), readonly && __jsx(_Box["default"], {
|
|
156
197
|
className: "readonly-wrapper",
|
|
157
198
|
"aria-readonly": "true"
|
|
158
|
-
})
|
|
199
|
+
}), showmarkers && __jsx(_Box["default"], {
|
|
200
|
+
className: "marker-container"
|
|
201
|
+
}, markerItems.map(function (marker, index) {
|
|
202
|
+
return __jsx("span", {
|
|
203
|
+
key: index,
|
|
204
|
+
className: "marker-wrapper",
|
|
205
|
+
style: {
|
|
206
|
+
left: marker.left + "px"
|
|
207
|
+
},
|
|
208
|
+
title: marker.label
|
|
209
|
+
}, __jsx("span", {
|
|
210
|
+
className: "marker-label ".concat(marker.position),
|
|
211
|
+
title: marker.label
|
|
212
|
+
}, marker.label), __jsx("span", {
|
|
213
|
+
className: "marker-dot",
|
|
214
|
+
title: marker.label
|
|
215
|
+
}));
|
|
216
|
+
})));
|
|
159
217
|
}, function (prev, current) {
|
|
160
218
|
// Enhanced memo comparison
|
|
161
|
-
var keys = ["datavalue", "disabled", "readonly", "minvalue", "maxvalue", "step", "
|
|
219
|
+
var keys = ["datavalue", "disabled", "readonly", "minvalue", "maxvalue", "step", "className", "styles", "hidden", "showmarkers", "markerlabeltext"];
|
|
162
220
|
return keys.every(function (key) {
|
|
163
221
|
return prev[key] === current[key];
|
|
164
222
|
});
|