pcm-shared-components 2.1.408 → 2.1.409
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.
|
@@ -18,10 +18,11 @@ export const openNativeDatePicker = e => {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
// Collapsed height for a notice's rich-text content before it needs a "
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
|
|
21
|
+
// Collapsed height for a notice's rich-text content before it needs a "Show More" link -- kept
|
|
22
|
+
// deliberately small (~3 text lines) so a long admin-entered notice doesn't dominate the panel's
|
|
23
|
+
// vertical space; anything longer gets clipped here and offered in full through the dialog below.
|
|
24
|
+
// Short content still renders in full with no link at all (overflow-measured, not char-counted).
|
|
25
|
+
const NOTICE_COLLAPSED_MAX_HEIGHT = 66;
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* The control for a `notice` field: the admin's sanitized rich text inside a bounded-height
|
|
@@ -85,21 +86,32 @@ const NoticeFieldControl = ({
|
|
|
85
86
|
dangerouslySetInnerHTML: {
|
|
86
87
|
__html: contentHtml
|
|
87
88
|
}
|
|
88
|
-
})), overflowing &&
|
|
89
|
+
})), overflowing &&
|
|
90
|
+
/*#__PURE__*/
|
|
91
|
+
// Bottom-right, per the requested layout. NOT disabled in read-only mode -- reading the
|
|
92
|
+
// full notice is always legitimate, only the checkbox below is a mutation. stopPropagation:
|
|
93
|
+
// some hosts render this control inside a click-to-edit card (e.g. the admin reservation
|
|
94
|
+
// review's occupant card) whose background clicks deliberately bubble up to open the
|
|
95
|
+
// editor -- opening the read-more dialog must not also trigger that.
|
|
96
|
+
React.createElement(Button, {
|
|
89
97
|
size: "small",
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
onClick: e => {
|
|
99
|
+
e.stopPropagation();
|
|
100
|
+
setDialogOpen(true);
|
|
101
|
+
},
|
|
92
102
|
sx: {
|
|
93
|
-
alignSelf: 'flex-
|
|
103
|
+
alignSelf: 'flex-end',
|
|
94
104
|
textTransform: 'none',
|
|
95
105
|
minWidth: 0,
|
|
96
106
|
p: 0
|
|
97
107
|
}
|
|
98
|
-
}, i18next.t('
|
|
99
|
-
label: field.label
|
|
100
|
-
})), /*#__PURE__*/React.createElement(Dialog, {
|
|
108
|
+
}, i18next.t('common.app.show_more')), /*#__PURE__*/React.createElement(Dialog, {
|
|
101
109
|
open: dialogOpen,
|
|
102
|
-
onClose:
|
|
110
|
+
onClose: e => {
|
|
111
|
+
if (e && e.stopPropagation) e.stopPropagation();
|
|
112
|
+
setDialogOpen(false);
|
|
113
|
+
},
|
|
114
|
+
onClick: e => e.stopPropagation(),
|
|
103
115
|
maxWidth: "sm",
|
|
104
116
|
fullWidth: true,
|
|
105
117
|
scroll: "paper"
|
|
@@ -110,7 +122,10 @@ const NoticeFieldControl = ({
|
|
|
110
122
|
__html: contentHtml
|
|
111
123
|
}
|
|
112
124
|
})), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button, {
|
|
113
|
-
onClick:
|
|
125
|
+
onClick: e => {
|
|
126
|
+
e.stopPropagation();
|
|
127
|
+
setDialogOpen(false);
|
|
128
|
+
}
|
|
114
129
|
}, i18next.t('common.app.close')))), /*#__PURE__*/React.createElement(FormControlLabel, {
|
|
115
130
|
control: /*#__PURE__*/React.createElement(Checkbox, {
|
|
116
131
|
checked: value === true,
|