pcm-shared-components 2.1.409 → 2.1.411
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,11 +18,17 @@ export const openNativeDatePicker = e => {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
// Collapsed
|
|
22
|
-
//
|
|
23
|
-
// vertical space; anything longer
|
|
24
|
-
// Short content still renders in full with no link at all (overflow-measured, not
|
|
25
|
-
|
|
21
|
+
// Collapsed size for a notice's rich-text content before it needs a "Show More" link -- clamped
|
|
22
|
+
// on a clean line boundary with an ellipsis via -webkit-line-clamp so a long admin-entered notice
|
|
23
|
+
// doesn't dominate the panel's vertical space; anything longer is offered in full through the
|
|
24
|
+
// dialog below. Short content still renders in full with no link at all (overflow-measured, not
|
|
25
|
+
// char-counted). 6 lines, not fewer: Quill content routinely contains blank spacer paragraphs
|
|
26
|
+
// (<p><br></p>) between sections, and each spacer costs a clamp line -- a tighter clamp left only
|
|
27
|
+
// a couple of REAL text lines visible, which read as "not enough" in practice.
|
|
28
|
+
// NOTICE_COLLAPSED_MAX_HEIGHT is only a fallback ceiling for engines without line-clamp support,
|
|
29
|
+
// sized generously enough that the line-clamp is what actually cuts in normal browsers.
|
|
30
|
+
const NOTICE_COLLAPSED_LINES = 6;
|
|
31
|
+
const NOTICE_COLLAPSED_MAX_HEIGHT = 200;
|
|
26
32
|
|
|
27
33
|
/**
|
|
28
34
|
* The control for a `notice` field: the admin's sanitized rich text inside a bounded-height
|
|
@@ -77,12 +83,17 @@ const NoticeFieldControl = ({
|
|
|
77
83
|
sx: {
|
|
78
84
|
p: 1.5,
|
|
79
85
|
borderRadius: 1,
|
|
80
|
-
bgcolor: 'action.hover'
|
|
81
|
-
maxHeight: NOTICE_COLLAPSED_MAX_HEIGHT,
|
|
82
|
-
overflow: 'hidden'
|
|
86
|
+
bgcolor: 'action.hover'
|
|
83
87
|
}
|
|
84
88
|
}, /*#__PURE__*/React.createElement("div", {
|
|
85
89
|
ref: contentRef,
|
|
90
|
+
style: {
|
|
91
|
+
display: '-webkit-box',
|
|
92
|
+
WebkitLineClamp: NOTICE_COLLAPSED_LINES,
|
|
93
|
+
WebkitBoxOrient: 'vertical',
|
|
94
|
+
maxHeight: NOTICE_COLLAPSED_MAX_HEIGHT,
|
|
95
|
+
overflow: 'hidden'
|
|
96
|
+
},
|
|
86
97
|
dangerouslySetInnerHTML: {
|
|
87
98
|
__html: contentHtml
|
|
88
99
|
}
|