@wavemaker/react-runtime 11.14.2-1.245 → 12.0.0-next.28533
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 +32 -10
- 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 +26 -9
- 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 +1 -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/tabs/index.js +92 -14
- package/components/container/tabs/tab-pane/index.js +15 -8
- 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 +991 -180
- 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 +54 -33
- 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 +23 -7
- 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 -51
- 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 +147 -70
- 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 +99 -26
- 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 +84 -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 +5 -0
- 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 +711 -669
- 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
|
@@ -1,17 +1,19 @@
|
|
|
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
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _material = require("@mui/material");
|
|
14
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
13
15
|
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
14
|
-
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" !=
|
|
16
|
+
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); }
|
|
15
17
|
var __jsx = _react["default"].createElement;
|
|
16
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (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,7 +25,8 @@ var getStyles = function getStyles(props) {
|
|
|
23
25
|
width = props.width,
|
|
24
26
|
horizontalalign = props.horizontalalign;
|
|
25
27
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, styles), height ? {
|
|
26
|
-
height: height
|
|
28
|
+
height: height,
|
|
29
|
+
overflow: "auto"
|
|
27
30
|
} : {}), width ? {
|
|
28
31
|
width: width
|
|
29
32
|
} : {}), horizontalalign ? {
|
|
@@ -42,30 +45,25 @@ var WmHtml = function WmHtml(props) {
|
|
|
42
45
|
onDoubletap = props.onDoubletap,
|
|
43
46
|
eventCallback = props.eventCallback,
|
|
44
47
|
forwardedRef = props.forwardedRef,
|
|
45
|
-
hint = props.hint
|
|
48
|
+
hint = props.hint,
|
|
49
|
+
content = props.content,
|
|
50
|
+
_props$trustAs = props.trustAs,
|
|
51
|
+
trustAs = _props$trustAs === void 0 ? false : _props$trustAs,
|
|
52
|
+
children = props.children;
|
|
46
53
|
var htmlRef = (0, _react.useRef)(null);
|
|
47
|
-
var _useState = (0, _react.useState)(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var _useState2 = (0, _react.useState)(null),
|
|
51
|
-
boundContentAttr = _useState2[0],
|
|
52
|
-
setBoundContentAttr = _useState2[1];
|
|
54
|
+
var _useState = (0, _react.useState)(null),
|
|
55
|
+
initialContent = _useState[0],
|
|
56
|
+
setInitialContent = _useState[1];
|
|
53
57
|
var touchStartRef = (0, _react.useRef)(0);
|
|
54
58
|
|
|
55
|
-
//
|
|
59
|
+
// Capture initial children content if no content prop is provided
|
|
56
60
|
(0, _react.useEffect)(function () {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var bindAttr = element.getAttribute("content.bind");
|
|
62
|
-
setBoundContentAttr(bindAttr);
|
|
63
|
-
|
|
64
|
-
// If there's a bound content attribute, clear the content
|
|
65
|
-
if (bindAttr && !initialContentSet) {
|
|
66
|
-
setInitialContentSet(true);
|
|
61
|
+
if (!content && !initialContent && htmlRef.current && children) {
|
|
62
|
+
// Store the initial children as content
|
|
63
|
+
var childContent = typeof children === "string" ? children : htmlRef.current.innerHTML;
|
|
64
|
+
setInitialContent(childContent);
|
|
67
65
|
}
|
|
68
|
-
}, [
|
|
66
|
+
}, [content, children, initialContent]);
|
|
69
67
|
|
|
70
68
|
// Event handlers with proper types
|
|
71
69
|
var handleClick = (0, _react.useCallback)(function (e) {
|
|
@@ -143,6 +141,96 @@ var WmHtml = function WmHtml(props) {
|
|
|
143
141
|
}), (props === null || props === void 0 ? void 0 : props.onTouchStart) && {
|
|
144
142
|
onTouchStart: handleTouchStart
|
|
145
143
|
});
|
|
144
|
+
|
|
145
|
+
// Determine what content to render
|
|
146
|
+
// Strategy: Always render through content path
|
|
147
|
+
// 1. If content prop exists -> use content
|
|
148
|
+
// 2. If content prop doesn't exist -> assign children to content
|
|
149
|
+
// 3. Use flag to determine if we can use dangerouslySetInnerHTML or need to render React children
|
|
150
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
151
|
+
// Priority: content prop > children
|
|
152
|
+
// If content is not provided, move children to content
|
|
153
|
+
var contentToRender = content !== undefined ? content : initialContent || children;
|
|
154
|
+
if (!contentToRender) {
|
|
155
|
+
return {
|
|
156
|
+
renderContent: null,
|
|
157
|
+
isReactElement: false
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Check if contentToRender is a React element (component)
|
|
162
|
+
// React elements cannot be used with dangerouslySetInnerHTML
|
|
163
|
+
if (/*#__PURE__*/_react["default"].isValidElement(contentToRender)) {
|
|
164
|
+
return {
|
|
165
|
+
renderContent: contentToRender,
|
|
166
|
+
isReactElement: true
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Handle trusted content (similar to Angular's trustAs:html)
|
|
171
|
+
if ((0, _typeof2["default"])(contentToRender) === "object" && contentToRender !== null) {
|
|
172
|
+
// Check if it's a trusted object (from trustAs pipe)
|
|
173
|
+
var keys = Object.keys(contentToRender);
|
|
174
|
+
if (keys.length > 0 && keys[0] === "changingThisBreaksApplicationSecurity") {
|
|
175
|
+
return {
|
|
176
|
+
renderContent: {
|
|
177
|
+
__html: contentToRender[keys[0]]
|
|
178
|
+
},
|
|
179
|
+
isReactElement: false
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// Otherwise convert to string
|
|
183
|
+
return {
|
|
184
|
+
renderContent: {
|
|
185
|
+
__html: _dompurify["default"].sanitize(String(contentToRender))
|
|
186
|
+
},
|
|
187
|
+
isReactElement: false
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Convert to string if needed
|
|
192
|
+
var stringContent = String(contentToRender);
|
|
193
|
+
|
|
194
|
+
// If trustAs is true, sanitize and render as HTML
|
|
195
|
+
if (trustAs) {
|
|
196
|
+
return {
|
|
197
|
+
renderContent: {
|
|
198
|
+
__html: _dompurify["default"].sanitize(stringContent)
|
|
199
|
+
},
|
|
200
|
+
isReactElement: false
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Otherwise sanitize the content
|
|
205
|
+
return {
|
|
206
|
+
renderContent: {
|
|
207
|
+
__html: _dompurify["default"].sanitize(stringContent)
|
|
208
|
+
},
|
|
209
|
+
isReactElement: false
|
|
210
|
+
};
|
|
211
|
+
}, [content, initialContent, children, trustAs]),
|
|
212
|
+
renderContent = _useMemo.renderContent,
|
|
213
|
+
isReactElement = _useMemo.isReactElement;
|
|
214
|
+
|
|
215
|
+
// Split rendering based on whether it's a React element or HTML string
|
|
216
|
+
// React doesn't allow both children and dangerouslySetInnerHTML on the same element
|
|
217
|
+
if (isReactElement) {
|
|
218
|
+
// Render React elements as children
|
|
219
|
+
return __jsx(_material.Box, (0, _extends2["default"])({
|
|
220
|
+
component: "div",
|
|
221
|
+
ref: handleRefCallback,
|
|
222
|
+
title: hint,
|
|
223
|
+
className: "".concat(className, " app-html-container"),
|
|
224
|
+
"data-element-type": "wm-html",
|
|
225
|
+
"data-name": name,
|
|
226
|
+
"aria-label": arialabel
|
|
227
|
+
}, domEvents, {
|
|
228
|
+
style: getStyles(props),
|
|
229
|
+
hidden: props.hidden
|
|
230
|
+
}), renderContent);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Render HTML strings via dangerouslySetInnerHTML (with no children)
|
|
146
234
|
return __jsx(_material.Box, (0, _extends2["default"])({
|
|
147
235
|
component: "div",
|
|
148
236
|
ref: handleRefCallback,
|
|
@@ -152,7 +240,10 @@ var WmHtml = function WmHtml(props) {
|
|
|
152
240
|
"data-name": name,
|
|
153
241
|
"aria-label": arialabel
|
|
154
242
|
}, domEvents, {
|
|
155
|
-
style: getStyles(props)
|
|
156
|
-
|
|
243
|
+
style: getStyles(props),
|
|
244
|
+
hidden: props.hidden
|
|
245
|
+
}, renderContent && {
|
|
246
|
+
dangerouslySetInnerHTML: renderContent
|
|
247
|
+
}));
|
|
157
248
|
};
|
|
158
249
|
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmHtml);
|
|
@@ -49,7 +49,8 @@ var WmIcon = exports.WmIcon = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
49
49
|
component: "span",
|
|
50
50
|
"aria-label": arialabel,
|
|
51
51
|
id: id,
|
|
52
|
-
"data-icon-position": iconposition
|
|
52
|
+
"data-icon-position": iconposition,
|
|
53
|
+
hidden: props.hidden
|
|
53
54
|
}, __jsx(_Box["default"], {
|
|
54
55
|
component: "span",
|
|
55
56
|
className: "sr-only"
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = exports.WmLabel = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
14
|
var _styles = require("@mui/material/styles");
|
|
@@ -59,7 +60,7 @@ var parseCaption = function parseCaption(caption) {
|
|
|
59
60
|
return parts;
|
|
60
61
|
};
|
|
61
62
|
var WmLabel = exports.WmLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
62
|
-
var _ref, _JSON$stringify;
|
|
63
|
+
var _ref, _JSON$stringify, _props$hidden;
|
|
63
64
|
var _props$required = props.required,
|
|
64
65
|
required = _props$required === void 0 ? false : _props$required,
|
|
65
66
|
_props$trustAs = props.trustAs,
|
|
@@ -68,16 +69,17 @@ var WmLabel = exports.WmLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
68
69
|
type = _props$type === void 0 ? "p" : _props$type,
|
|
69
70
|
styles = props.styles,
|
|
70
71
|
className = props.className,
|
|
71
|
-
|
|
72
|
-
caption = _props$caption === void 0 ? "Label" : _props$caption,
|
|
72
|
+
caption = props.caption,
|
|
73
73
|
hint = props.hint,
|
|
74
74
|
name = props.name,
|
|
75
75
|
htmlFor = props.htmlFor,
|
|
76
76
|
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
77
|
+
var hasCaptionProp = Object.prototype.hasOwnProperty.call(props, "caption");
|
|
78
|
+
var safeCaption = hasCaptionProp ? caption : "Label";
|
|
77
79
|
var ownerState = {
|
|
78
80
|
type: type
|
|
79
81
|
};
|
|
80
|
-
var captionString = (_ref = typeof
|
|
82
|
+
var captionString = (_ref = typeof safeCaption === "string" ? safeCaption : (_JSON$stringify = JSON.stringify(safeCaption)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "") === null || _ref === void 0 ? void 0 : _ref.replace(/ |undefined|null/gi, " ");
|
|
81
83
|
|
|
82
84
|
// Check if caption contains HTML tags
|
|
83
85
|
var hasHTML = containsHTML(captionString);
|
|
@@ -89,7 +91,7 @@ var WmLabel = exports.WmLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
89
91
|
return part.link ? "<a target=\"_blank\" href=\"".concat(part.link, "\">").concat(part.text, "</a>") : part.text;
|
|
90
92
|
});
|
|
91
93
|
if (shouldRenderAsHTML) {
|
|
92
|
-
return __jsx(StyledLabel, (0,
|
|
94
|
+
return __jsx(StyledLabel, (0, _extends3["default"])({
|
|
93
95
|
as: type,
|
|
94
96
|
ownerState: ownerState,
|
|
95
97
|
className: (0, _clsx["default"])(DEFAULT_CLASS, {
|
|
@@ -105,7 +107,8 @@ var WmLabel = exports.WmLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
105
107
|
}
|
|
106
108
|
}, rest));
|
|
107
109
|
}
|
|
108
|
-
return __jsx(StyledLabel, (0,
|
|
110
|
+
return __jsx(StyledLabel, (0, _extends3["default"])((0, _defineProperty2["default"])({
|
|
111
|
+
hidden: props.hidden,
|
|
109
112
|
as: type,
|
|
110
113
|
ownerState: ownerState,
|
|
111
114
|
className: (0, _clsx["default"])(DEFAULT_CLASS, {
|
|
@@ -116,7 +119,7 @@ var WmLabel = exports.WmLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
116
119
|
name: name,
|
|
117
120
|
type: type,
|
|
118
121
|
caption: captionString
|
|
119
|
-
}, rest), parts.map(function (part, index) {
|
|
122
|
+
}, "hidden", (_props$hidden = props.hidden) !== null && _props$hidden !== void 0 ? _props$hidden : false), rest), parts.map(function (part, index) {
|
|
120
123
|
return part.link ? __jsx("a", {
|
|
121
124
|
key: index,
|
|
122
125
|
href: part.link,
|
|
@@ -130,7 +133,7 @@ var WmLabel = exports.WmLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
130
133
|
}, part.text);
|
|
131
134
|
}));
|
|
132
135
|
}, function (prev, current) {
|
|
133
|
-
var keys = ["caption", "required", "trustAs", "type", "id", "htmlFor", "styles", "className", "hint"];
|
|
136
|
+
var keys = ["caption", "required", "trustAs", "type", "id", "htmlFor", "styles", "className", "hint", "hidden"];
|
|
134
137
|
return keys.every(function (key) {
|
|
135
138
|
return prev[key] === current[key];
|
|
136
139
|
});
|
|
@@ -60,6 +60,7 @@ var WmMessage = exports.WmMessage = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
60
60
|
var messageClass = messageType["class"];
|
|
61
61
|
var iconClass = messageType.iconClass;
|
|
62
62
|
return __jsx(_Box["default"], {
|
|
63
|
+
hidden: props.hidden,
|
|
63
64
|
component: "div",
|
|
64
65
|
style: styles,
|
|
65
66
|
className: (0, _clsx["default"])(DEFAULT_CLS, messageClass, animation ? "animated ".concat(animation) : "", className),
|
|
@@ -83,7 +84,7 @@ var WmMessage = exports.WmMessage = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
83
84
|
"aria-hidden": "true"
|
|
84
85
|
}, "\xD7")));
|
|
85
86
|
}, function (prev, next) {
|
|
86
|
-
var keys = ["caption", "type", "hideclose", "onClose", "styles", "open"];
|
|
87
|
+
var keys = ["caption", "type", "hideclose", "onClose", "styles", "open", "hidden"];
|
|
87
88
|
return keys.every(function (key) {
|
|
88
89
|
return prev[key] === next[key];
|
|
89
90
|
});
|
|
@@ -95,10 +96,16 @@ var WmMessageWrapper = function WmMessageWrapper(Component) {
|
|
|
95
96
|
var _useState = (0, _react.useState)(true),
|
|
96
97
|
messageOpen = _useState[0],
|
|
97
98
|
setMessageOpen = _useState[1];
|
|
99
|
+
var _useState2 = (0, _react.useState)(props.caption),
|
|
100
|
+
messageCaption = _useState2[0],
|
|
101
|
+
setMessageCaption = _useState2[1];
|
|
98
102
|
var hideMessage = function hideMessage() {
|
|
99
103
|
setMessageOpen(false);
|
|
100
104
|
};
|
|
101
|
-
var showMessage = function showMessage() {
|
|
105
|
+
var showMessage = function showMessage(caption) {
|
|
106
|
+
if (caption) {
|
|
107
|
+
setMessageCaption(caption);
|
|
108
|
+
}
|
|
102
109
|
setMessageOpen(true);
|
|
103
110
|
};
|
|
104
111
|
var handleClose = function handleClose(event) {
|
|
@@ -111,8 +118,10 @@ var WmMessageWrapper = function WmMessageWrapper(Component) {
|
|
|
111
118
|
showMessage: showMessage,
|
|
112
119
|
close: handleClose,
|
|
113
120
|
open: messageOpen
|
|
121
|
+
}, messageCaption !== undefined && {
|
|
122
|
+
caption: messageCaption
|
|
114
123
|
});
|
|
115
|
-
}, [props, messageOpen, handleClose]);
|
|
124
|
+
}, [props, messageOpen, handleClose, messageCaption]);
|
|
116
125
|
return __jsx(Component, updatedProps);
|
|
117
126
|
};
|
|
118
127
|
return WrappedComponent;
|
|
@@ -14,7 +14,7 @@ var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
16
16
|
var _resourceUrl = require("@wavemaker/react-runtime/utils/resource-url");
|
|
17
|
-
var _excluded = ["pictureaspect", "resizemode", "pictureplaceholder", "tabindex", "onLoad", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"];
|
|
17
|
+
var _excluded = ["pictureaspect", "resizemode", "pictureplaceholder", "tabindex", "onLoad", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "children", "show", "ref"];
|
|
18
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" != _typeof(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); }
|
|
19
19
|
var __jsx = _react["default"].createElement;
|
|
20
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; }
|
|
@@ -38,6 +38,9 @@ var WmPicture = exports.WmPicture = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
38
38
|
onDoubleClick = props.onDoubleClick,
|
|
39
39
|
onMouseEnter = props.onMouseEnter,
|
|
40
40
|
onMouseLeave = props.onMouseLeave,
|
|
41
|
+
children = props.children,
|
|
42
|
+
show = props.show,
|
|
43
|
+
ref = props.ref,
|
|
41
44
|
restProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
42
45
|
var _useState = (0, _react.useState)(props.picturesource),
|
|
43
46
|
imgSource = _useState[0],
|
|
@@ -92,7 +95,8 @@ var WmPicture = exports.WmPicture = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
92
95
|
var onMouseLeaveHandler = function onMouseLeaveHandler(event) {
|
|
93
96
|
onMouseLeave && onMouseLeave(event, props);
|
|
94
97
|
};
|
|
95
|
-
return __jsx(StyledImage, (0, _extends2["default"])({}, restProps, {
|
|
98
|
+
return __jsx(_react["default"].Fragment, null, __jsx(StyledImage, (0, _extends2["default"])({}, restProps, {
|
|
99
|
+
ref: ref,
|
|
96
100
|
"data-identifier": "img",
|
|
97
101
|
title: props.hint || props.name,
|
|
98
102
|
onClick: onClickHandler,
|
|
@@ -109,9 +113,12 @@ var WmPicture = exports.WmPicture = /*#__PURE__*/(0, _react.memo)(function (prop
|
|
|
109
113
|
"aria-label": props.arialabel || "Picture content",
|
|
110
114
|
tabIndex: tabindex,
|
|
111
115
|
name: props.name
|
|
112
|
-
}));
|
|
116
|
+
})), children);
|
|
113
117
|
}, function (prev, current) {
|
|
114
|
-
|
|
118
|
+
var keysToCompare = ["picturesource", "show"];
|
|
119
|
+
return keysToCompare.every(function (key) {
|
|
120
|
+
return prev[key] === current[key];
|
|
121
|
+
});
|
|
115
122
|
});
|
|
116
123
|
WmPicture.displayName = "WmPicture";
|
|
117
124
|
var _default = exports["default"] = (0, _withBaseWrapper["default"])(WmPicture);
|
|
@@ -162,7 +162,7 @@ var WmProgressBar = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
162
162
|
}, bar.displayValue));
|
|
163
163
|
}));
|
|
164
164
|
}, function (prev, current) {
|
|
165
|
-
return prev.datavalue === current.datavalue && prev.type === current.type && prev.height === current.height && prev.width === current.width && JSON.stringify(prev.dataset) === JSON.stringify(current.dataset);
|
|
165
|
+
return prev.datavalue === current.datavalue && prev.type === current.type && prev.height === current.height && prev.width === current.width && JSON.stringify(prev.dataset) === JSON.stringify(current.dataset) && prev.minvalue === current.minvalue && prev.maxvalue === current.maxvalue && prev.hidden === current.hidden;
|
|
166
166
|
});
|
|
167
167
|
WmProgressBar.displayName = "WmProgressBar";
|
|
168
168
|
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmProgressBar);
|
|
@@ -10,15 +10,15 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
12
|
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
13
|
-
var _props = require("
|
|
14
|
-
var _constants = require("
|
|
13
|
+
var _props = require("@wavemaker/react-runtime/components/basic/progress-circle/props");
|
|
14
|
+
var _constants = require("@wavemaker/react-runtime/components/constants");
|
|
15
|
+
var _props2 = require("./props");
|
|
15
16
|
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" != _typeof(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); }
|
|
16
17
|
var __jsx = _react["default"].createElement;
|
|
17
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (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; }
|
|
19
20
|
var WmProgressCircle = function WmProgressCircle(props) {
|
|
20
|
-
var
|
|
21
|
-
datavalue = _props$datavalue === void 0 ? "30" : _props$datavalue,
|
|
21
|
+
var datavalue = props.datavalue,
|
|
22
22
|
_props$minvalue = props.minvalue,
|
|
23
23
|
minvalue = _props$minvalue === void 0 ? _constants.progressBarConstants.DEFAULT_MIN_VALUE : _props$minvalue,
|
|
24
24
|
_props$maxvalue = props.maxvalue,
|
|
@@ -51,39 +51,31 @@ var WmProgressCircle = function WmProgressCircle(props) {
|
|
|
51
51
|
// Memoize core calculations
|
|
52
52
|
var _useMemo = (0, _react.useMemo)(function () {
|
|
53
53
|
// Calculate percentage
|
|
54
|
-
var value = typeof datavalue === "string" ? parseFloat(datavalue) : datavalue;
|
|
54
|
+
var value = typeof datavalue === "string" ? parseFloat(datavalue) : datavalue !== undefined ? datavalue : _constants.progressBarConstants.DEFAULT_DATAVALUE;
|
|
55
55
|
var percent = (value - minvalue) / (maxvalue - minvalue) * 100;
|
|
56
|
-
|
|
56
|
+
// Round to avoid floating-point precision issues (e.g., 55.00000000000001)
|
|
57
|
+
var percentageVal = Math.min(Math.max(Math.round(percent * 1e10) / 1e10, 0), 100);
|
|
57
58
|
|
|
58
59
|
// Format display value
|
|
59
60
|
var decimalPlaces = _constants.progressBarConstants.DECIMAL_COUNT_MAP[displayformat];
|
|
60
61
|
var isPercent = displayformat.includes("%");
|
|
61
62
|
var displayVal = percentageVal.toFixed(decimalPlaces);
|
|
62
|
-
var stroke = 5;
|
|
63
|
-
var radius = 45;
|
|
63
|
+
var stroke = props.strokeWidth || 5;
|
|
64
|
+
var radius = props.radius || 45;
|
|
64
65
|
var normalized = radius - stroke / 2;
|
|
65
66
|
var circum = normalized * 2 * Math.PI;
|
|
66
67
|
var offset = circum - percentageVal / 100 * circum;
|
|
67
|
-
|
|
68
|
-
// Calculate the path for the progress arc
|
|
69
|
-
var angle = percentageVal / 100 * 360;
|
|
70
|
-
var rad = (angle - 90) * Math.PI / 180;
|
|
71
|
-
var x = 50 + normalized * Math.cos(rad);
|
|
72
|
-
var y = 50 + normalized * Math.sin(rad);
|
|
73
|
-
var largeArcFlag = angle > 180 ? 1 : 0;
|
|
74
|
-
var path = "M 50,".concat(50 - normalized, " A ").concat(normalized, " ").concat(normalized, " 0 ").concat(largeArcFlag, " 1 ").concat(x, " ").concat(y);
|
|
75
68
|
return {
|
|
76
69
|
percentageValue: percentageVal,
|
|
77
70
|
displayValue: displayVal,
|
|
78
|
-
progressColor: type !== "default" ? "var(--wm-progress-circle-".concat(type, "-stroke-active)") : "var(--wm-progress-circle-stroke-active)",
|
|
71
|
+
progressColor: type !== "default" ? type in _props2.EnumProgressCircleType ? "var(--wm-progress-circle-".concat(type, "-stroke-active)") : "var(--wm-progress-circle-stroke-active)" : "var(--wm-progress-circle-stroke-active)",
|
|
79
72
|
strokeWidth: stroke,
|
|
80
73
|
normalizedRadius: normalized,
|
|
81
74
|
circumference: circum,
|
|
82
75
|
strokeDashoffset: offset,
|
|
83
|
-
isPercent: isPercent
|
|
84
|
-
progressPath: path
|
|
76
|
+
isPercent: isPercent
|
|
85
77
|
};
|
|
86
|
-
}, [datavalue, minvalue, maxvalue, type, displayformat]),
|
|
78
|
+
}, [datavalue, minvalue, maxvalue, type, displayformat, props.strokeWidth, props.radius]),
|
|
87
79
|
percentageValue = _useMemo.percentageValue,
|
|
88
80
|
displayValue = _useMemo.displayValue,
|
|
89
81
|
progressColor = _useMemo.progressColor,
|
|
@@ -91,8 +83,7 @@ var WmProgressCircle = function WmProgressCircle(props) {
|
|
|
91
83
|
normalizedRadius = _useMemo.normalizedRadius,
|
|
92
84
|
circumference = _useMemo.circumference,
|
|
93
85
|
strokeDashoffset = _useMemo.strokeDashoffset,
|
|
94
|
-
isPercent = _useMemo.isPercent
|
|
95
|
-
progressPath = _useMemo.progressPath;
|
|
86
|
+
isPercent = _useMemo.isPercent;
|
|
96
87
|
|
|
97
88
|
// Default styles if not provided
|
|
98
89
|
var finalStyles = _objectSpread({
|
|
@@ -105,6 +96,13 @@ var WmProgressCircle = function WmProgressCircle(props) {
|
|
|
105
96
|
});
|
|
106
97
|
onBeforerender === null || onBeforerender === void 0 || onBeforerender(listener, listener === null || listener === void 0 ? void 0 : listener.Widgets[name]);
|
|
107
98
|
}, [percentageValue]);
|
|
99
|
+
|
|
100
|
+
// assigning default datavalue to the proxy object
|
|
101
|
+
(0, _react.useEffect)(function () {
|
|
102
|
+
listener.onChange(name, {
|
|
103
|
+
datavalue: datavalue !== undefined ? datavalue : _constants.progressBarConstants.DEFAULT_DATAVALUE
|
|
104
|
+
});
|
|
105
|
+
}, []);
|
|
108
106
|
return __jsx(_Box["default"], {
|
|
109
107
|
component: "div",
|
|
110
108
|
ref: containerRef,
|
|
@@ -128,7 +126,9 @@ var WmProgressCircle = function WmProgressCircle(props) {
|
|
|
128
126
|
"aria-valuemax": maxvalue,
|
|
129
127
|
role: "progressbar",
|
|
130
128
|
title: hint,
|
|
131
|
-
style: finalStyles
|
|
129
|
+
style: finalStyles,
|
|
130
|
+
hidden: props.hidden,
|
|
131
|
+
name: name
|
|
132
132
|
}, __jsx("svg", {
|
|
133
133
|
height: "100%",
|
|
134
134
|
width: "100%",
|
|
@@ -143,14 +143,20 @@ var WmProgressCircle = function WmProgressCircle(props) {
|
|
|
143
143
|
r: normalizedRadius,
|
|
144
144
|
cx: "50",
|
|
145
145
|
cy: "50"
|
|
146
|
-
}), __jsx("
|
|
147
|
-
|
|
148
|
-
fill: "none",
|
|
146
|
+
}), __jsx("circle", {
|
|
147
|
+
fill: "transparent",
|
|
149
148
|
strokeWidth: strokeWidth,
|
|
149
|
+
strokeDasharray: circumference,
|
|
150
|
+
strokeDashoffset: strokeDashoffset,
|
|
151
|
+
strokeLinecap: "round",
|
|
152
|
+
r: normalizedRadius,
|
|
153
|
+
cx: "50",
|
|
154
|
+
cy: "50",
|
|
150
155
|
style: {
|
|
151
156
|
stroke: progressColor,
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
transform: "rotate(-90deg)",
|
|
158
|
+
transformOrigin: "50% 50%",
|
|
159
|
+
transition: "stroke-dashoffset 0.5s ease"
|
|
154
160
|
}
|
|
155
161
|
}), captionplacement === "inside" && __jsx(_react["default"].Fragment, null, !title && __jsx("text", {
|
|
156
162
|
x: "50",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TYPE_CLASS_MAP_PC = void 0;
|
|
6
|
+
exports.TYPE_CLASS_MAP_PC = exports.EnumProgressCircleType = void 0;
|
|
7
7
|
// Type definitions for the component props
|
|
8
8
|
|
|
9
9
|
// Map of progress-bar type and classes
|
|
@@ -13,4 +13,12 @@ var TYPE_CLASS_MAP_PC = exports.TYPE_CLASS_MAP_PC = {
|
|
|
13
13
|
info: "progress-circle-info",
|
|
14
14
|
warning: "progress-circle-warning",
|
|
15
15
|
danger: "progress-circle-danger"
|
|
16
|
-
};
|
|
16
|
+
};
|
|
17
|
+
var EnumProgressCircleType = exports.EnumProgressCircleType = /*#__PURE__*/function (EnumProgressCircleType) {
|
|
18
|
+
EnumProgressCircleType["SUCCESS"] = "success";
|
|
19
|
+
EnumProgressCircleType["INFO"] = "info";
|
|
20
|
+
EnumProgressCircleType["WARNING"] = "warning";
|
|
21
|
+
EnumProgressCircleType["DANGER"] = "danger";
|
|
22
|
+
EnumProgressCircleType["DEFAULT"] = "default";
|
|
23
|
+
return EnumProgressCircleType;
|
|
24
|
+
}({});
|