@pdfme/ui 6.1.9 → 6.1.10

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/dist/index.js CHANGED
@@ -46025,7 +46025,7 @@ function parseExpressionAt(input, pos, options) {
46025
46025
  }
46026
46026
  //#endregion
46027
46027
  //#region ../common/dist/index.js
46028
- var PDFME_VERSION = "6.1.9";
46028
+ var PDFME_VERSION = "6.1.10";
46029
46029
  var PAGE_SIZE_PRESETS = {
46030
46030
  A3: {
46031
46031
  width: 297,
@@ -211021,6 +211021,14 @@ var ErrorScreen = ({ size, error }) => {
211021
211021
  //#endregion
211022
211022
  //#region src/components/CtlBar.tsx
211023
211023
  var { Text: Text$1 } = Typography;
211024
+ var CONTROL_BUTTON_SIZE = 32;
211025
+ var getControlButtonStyle = (active) => ({
211026
+ width: CONTROL_BUTTON_SIZE,
211027
+ minWidth: CONTROL_BUTTON_SIZE,
211028
+ height: CONTROL_BUTTON_SIZE,
211029
+ padding: 0,
211030
+ ...active ? { backgroundColor: "rgba(255, 255, 255, 0.18)" } : {}
211031
+ });
211024
211032
  var ToolbarButton = ({ className, label, disabled, active, onClick, children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip$2, {
211025
211033
  title: label,
211026
211034
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(button_default$1, {
@@ -211030,7 +211038,7 @@ var ToolbarButton = ({ className, label, disabled, active, onClick, children })
211030
211038
  title: label,
211031
211039
  disabled,
211032
211040
  onClick,
211033
- style: active ? { backgroundColor: "rgba(255, 255, 255, 0.18)" } : void 0,
211041
+ style: getControlButtonStyle(active),
211034
211042
  children
211035
211043
  })
211036
211044
  });
@@ -211053,7 +211061,10 @@ var Zoom = ({ zoomLevel, setZoomLevel, zoomMode, fitWidth, fitHeight, style, lab
211053
211061
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
211054
211062
  style: {
211055
211063
  display: "flex",
211056
- alignItems: "center"
211064
+ alignItems: "center",
211065
+ justifyContent: "center",
211066
+ flexWrap: "wrap",
211067
+ rowGap: 0
211057
211068
  },
211058
211069
  children: [
211059
211070
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolbarButton, {
@@ -211065,7 +211076,12 @@ var Zoom = ({ zoomLevel, setZoomLevel, zoomMode, fitWidth, fitHeight, style, lab
211065
211076
  }),
211066
211077
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text$1, {
211067
211078
  strong: true,
211068
- style: style.textStyle,
211079
+ style: {
211080
+ ...style.textStyle,
211081
+ minWidth: 44,
211082
+ textAlign: "center",
211083
+ whiteSpace: "nowrap"
211084
+ },
211069
211085
  children: [Math.round(zoomLevel * 100), "%"]
211070
211086
  }),
211071
211087
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolbarButton, {
@@ -211105,6 +211121,7 @@ var Pager = ({ pageCursor, pageNum, setPageCursor, style }) => {
211105
211121
  type: "text",
211106
211122
  disabled: pageCursor <= 0,
211107
211123
  onClick: () => setPageCursor(pageCursor - 1),
211124
+ style: getControlButtonStyle(),
211108
211125
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronLeft, {
211109
211126
  size: 16,
211110
211127
  color: style.textStyle.color
@@ -211112,7 +211129,12 @@ var Pager = ({ pageCursor, pageNum, setPageCursor, style }) => {
211112
211129
  }),
211113
211130
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text$1, {
211114
211131
  strong: true,
211115
- style: style.textStyle,
211132
+ style: {
211133
+ ...style.textStyle,
211134
+ minWidth: 36,
211135
+ textAlign: "center",
211136
+ whiteSpace: "nowrap"
211137
+ },
211116
211138
  children: [
211117
211139
  pageCursor + 1,
211118
211140
  "/",
@@ -211124,6 +211146,7 @@ var Pager = ({ pageCursor, pageNum, setPageCursor, style }) => {
211124
211146
  type: "text",
211125
211147
  disabled: pageCursor + 1 >= pageNum,
211126
211148
  onClick: () => setPageCursor(pageCursor + 1),
211149
+ style: getControlButtonStyle(),
211127
211150
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronRight, {
211128
211151
  size: 16,
211129
211152
  color: style.textStyle.color
@@ -211140,6 +211163,7 @@ var ContextMenu = ({ items, style }) => /* @__PURE__ */ (0, import_jsx_runtime.j
211140
211163
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(button_default$1, {
211141
211164
  className: UI_CLASSNAME + "context-menu",
211142
211165
  type: "text",
211166
+ style: getControlButtonStyle(),
211143
211167
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Ellipsis, {
211144
211168
  size: 16,
211145
211169
  color: style.textStyle.color
@@ -211178,6 +211202,8 @@ var CtlBar = (props) => {
211178
211202
  width: size.width,
211179
211203
  display: "flex",
211180
211204
  justifyContent: "center",
211205
+ boxSizing: "border-box",
211206
+ padding: `0 ${token.paddingXS}px`,
211181
211207
  pointerEvents: "none"
211182
211208
  },
211183
211209
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -211188,10 +211214,13 @@ var CtlBar = (props) => {
211188
211214
  justifyContent: "center",
211189
211215
  position: "relative",
211190
211216
  zIndex: 1,
211191
- height: 40,
211217
+ minHeight: 40,
211218
+ maxWidth: "100%",
211192
211219
  boxSizing: "border-box",
211193
- padding: token.paddingSM,
211194
- gap: token.marginXS,
211220
+ padding: `${token.paddingXXS}px ${token.paddingSM}px`,
211221
+ columnGap: token.marginXS,
211222
+ rowGap: token.marginXXS,
211223
+ flexWrap: "wrap",
211195
211224
  borderRadius: token.borderRadius,
211196
211225
  backgroundColor: token.colorBgMask,
211197
211226
  pointerEvents: "auto"
@@ -211199,6 +211228,7 @@ var CtlBar = (props) => {
211199
211228
  children: [
211200
211229
  pageNum > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
211201
211230
  className: "pdfme-ui-pager",
211231
+ style: { flexShrink: 0 },
211202
211232
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pager, {
211203
211233
  style: { textStyle },
211204
211234
  pageCursor,
@@ -211208,6 +211238,7 @@ var CtlBar = (props) => {
211208
211238
  }),
211209
211239
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
211210
211240
  className: UI_CLASSNAME + "zoom",
211241
+ style: { minWidth: 0 },
211211
211242
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Zoom, {
211212
211243
  style: { textStyle },
211213
211244
  zoomLevel,