@onesy/ui-react 1.0.12 → 1.0.14
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/CalendarAvailability/CalendarAvailability.js +1 -1
- package/CalendarWeek/CalendarWeek.js +1 -1
- package/SmartTextField/SmartTextField.js +3 -4
- package/esm/CalendarAvailability/CalendarAvailability.js +1 -1
- package/esm/CalendarWeek/CalendarWeek.js +1 -1
- package/esm/SmartTextField/SmartTextField.js +4 -4
- package/esm/index.js +1 -1
- package/package.json +1 -1
@@ -368,7 +368,7 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
|
|
368
368
|
]) }, { children: [startHeader, (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 2, direction: 'row', wrap: 'wrap', justify: 'space-between', align: 'center', fullWidth: true }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'row', wrap: 'wrap', align: 'center', className: classes.aside }, { children: [startLeft, (0, jsx_runtime_1.jsx)(Button, Object.assign({ color: 'inherit', version: 'outlined', size: 'small', onClick: onToday, selected: now.days === date.days }, { children: "Today" })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: `Previous ${view}` }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onPrevious }, IconButtonProps, { children: (0, jsx_runtime_1.jsx)(IconPrevious, { size: 'regular' }) })) })), (0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: `Next ${view}` }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onNext }, IconButtonProps, { children: (0, jsx_runtime_1.jsx)(IconNext, { size: 'regular' }) })) }))] })), (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h2', weight: 500, whiteSpace: 'nowrap' }, { children: formattedDate })), endLeft] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'row', align: 'center', flexNo: true, className: (0, style_react_1.classNames)([
|
369
369
|
classes.aside,
|
370
370
|
classes.overflowX
|
371
|
-
]) }, { children: [startRight, ['week', 'day'].includes(view) && ((0, jsx_runtime_1.jsxs)(Label, Object.assign({
|
371
|
+
]) }, { children: [startRight, ['week', 'day'].includes(view) && ((0, jsx_runtime_1.jsxs)(Label, Object.assign({ checked: displayTime, onChange: onChangeDisplayTime }, { children: [(0, jsx_runtime_1.jsx)(Switch, {}), "Display time"] }))), (0, jsx_runtime_1.jsx)(Select, { name: 'View', value: view, onChange: onChangeView, options: viewOptions, size: 'small', MenuProps: {
|
372
372
|
portal: true,
|
373
373
|
size: 'regular'
|
374
374
|
}, WrapperProps: {
|
@@ -305,7 +305,7 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
|
305
305
|
color: getColor(item)
|
306
306
|
} : undefined;
|
307
307
|
const itemProps = {
|
308
|
-
|
308
|
+
onClick: (event) => onOpen(Object.assign(Object.assign({}, item), { day, weekly }), event),
|
309
309
|
className: classes.range
|
310
310
|
};
|
311
311
|
const style = Object.assign({ top: `${top}%`, bottom: `${bottom}%`, color: theme.methods.palette.color.text(background), background, left: `calc(0px + ${level * 10}px)` }, (top === 0 && bottom === 0 && {
|
@@ -197,9 +197,8 @@ const SmartTextField = react_1.default.forwardRef((props_, ref) => {
|
|
197
197
|
init();
|
198
198
|
}, []);
|
199
199
|
react_1.default.useEffect(() => {
|
200
|
-
|
201
|
-
|
202
|
-
}, [optionsMention_]);
|
200
|
+
setOptionsMention([...(optionsMention_ || [])]);
|
201
|
+
}, [(0, utils_1.hash)(optionsMention_)]);
|
203
202
|
react_1.default.useEffect(() => {
|
204
203
|
const valuePrevious = (refs.root.current.innerHTML || '').replaceAll(' ', ' ');
|
205
204
|
const valueNew = (0, utils_1.textToInnerHTML)(value_);
|
@@ -472,7 +471,7 @@ const SmartTextField = react_1.default.forwardRef((props_, ref) => {
|
|
472
471
|
if (mention) {
|
473
472
|
if (refs.openMenu.current && !optionsMention.length)
|
474
473
|
onCloseSearch();
|
475
|
-
else if (!refs.openMenu.current &&
|
474
|
+
else if (!refs.openMenu.current && !!optionsMention.length)
|
476
475
|
onOpenSearch();
|
477
476
|
}
|
478
477
|
}, [mention, optionsMention]);
|
@@ -523,7 +523,7 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
523
523
|
flexNo: true,
|
524
524
|
className: classNames([classes.aside, classes.overflowX])
|
525
525
|
}, startRight, ['week', 'day'].includes(view) && /*#__PURE__*/React.createElement(Label, {
|
526
|
-
|
526
|
+
checked: displayTime,
|
527
527
|
onChange: onChangeDisplayTime
|
528
528
|
}, /*#__PURE__*/React.createElement(Switch, null), "Display time"), /*#__PURE__*/React.createElement(Select, {
|
529
529
|
name: "View",
|
@@ -288,7 +288,7 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
288
288
|
color: getColor(item)
|
289
289
|
} : undefined;
|
290
290
|
const itemProps = {
|
291
|
-
|
291
|
+
onClick: event => onOpen(_objectSpread(_objectSpread({}, item), {}, {
|
292
292
|
day,
|
293
293
|
weekly
|
294
294
|
}), event),
|
@@ -8,7 +8,7 @@ const _excluded = ["version", "size", "valueDefault", "value", "inputProps", "on
|
|
8
8
|
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; }
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
10
10
|
import React from 'react';
|
11
|
-
import { innerHTMLToText, is, isEnvironment, parse, stringToColor, textToInnerHTML } from '@onesy/utils';
|
11
|
+
import { hash, innerHTMLToText, is, isEnvironment, parse, stringToColor, textToInnerHTML } from '@onesy/utils';
|
12
12
|
import { classNames, style as styleMethod, useOnesyTheme } from '@onesy/style-react';
|
13
13
|
import IconMaterialFormatItalic from '@onesy/icons-material-rounded-react/IconMaterialFormatItalicW100';
|
14
14
|
import IconMaterialFormatUnderlined from '@onesy/icons-material-rounded-react/IconMaterialFormatUnderlinedW100';
|
@@ -223,8 +223,8 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
223
223
|
init();
|
224
224
|
}, []);
|
225
225
|
React.useEffect(() => {
|
226
|
-
|
227
|
-
}, [optionsMention_]);
|
226
|
+
setOptionsMention([...(optionsMention_ || [])]);
|
227
|
+
}, [hash(optionsMention_)]);
|
228
228
|
React.useEffect(() => {
|
229
229
|
const valuePrevious = (refs.root.current.innerHTML || '').replaceAll(' ', ' ');
|
230
230
|
const valueNew = textToInnerHTML(value_);
|
@@ -491,7 +491,7 @@ const SmartTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
491
491
|
// else if no users response & opened, close the search
|
492
492
|
React.useEffect(() => {
|
493
493
|
if (mention) {
|
494
|
-
if (refs.openMenu.current && !optionsMention.length) onCloseSearch();else if (!refs.openMenu.current &&
|
494
|
+
if (refs.openMenu.current && !optionsMention.length) onCloseSearch();else if (!refs.openMenu.current && !!optionsMention.length) onOpenSearch();
|
495
495
|
}
|
496
496
|
}, [mention, optionsMention]);
|
497
497
|
React.useEffect(() => {
|
package/esm/index.js
CHANGED