oolib 2.93.0 → 2.95.0

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.
@@ -44,6 +44,8 @@ var handlePos_1 = require("./utils/handlePos");
44
44
  var themes_1 = require("../../themes");
45
45
  var styled_1 = require("./styled");
46
46
  var Buttons_1 = require("../Buttons");
47
+ var mixins_1 = require("../../themes/mixins");
48
+ var Modal_1 = require("../Modals/Modal");
47
49
  var white = themes_1.colors.white, greyColor40 = themes_1.colors.greyColor40;
48
50
  var months = [
49
51
  "January",
@@ -68,17 +70,17 @@ var isEqualDate = function (date1, date2) {
68
70
  date1.getFullYear() === date2.getFullYear();
69
71
  };
70
72
  function DatePicker(props) {
71
- var _a, _b, _c;
72
73
  var value = props.value, onParentChange = props.onChange, id = props.id, from = props.from, readOnly = props.readOnly, previousDateOnly = props.previousDateOnly, futureDateOnly = props.futureDateOnly, invert = props.invert, disabled = props.disabled, debug = props.debug;
73
74
  var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
74
75
  var inputRef = (0, react_1.useRef)(null);
75
76
  var calenderRef = (0, react_1.useRef)(null);
76
77
  var containerRef = (0, react_1.useRef)(null);
77
- var _d = (0, react_1.useState)({}), calender = _d[0], setCalender = _d[1];
78
- var _e = (0, react_1.useState)(false), showCalendar = _e[0], setShowCalendar = _e[1];
79
- var _f = (0, react_1.useState)(null), range = _f[0], setRange = _f[1];
80
- var _g = (0, react_1.useState)(0), monthNumber = _g[0], setMonthNumber = _g[1];
81
- (0, _EXPORTS_1.useHandleClickOutside)(containerRef, setShowCalendar);
78
+ var _a = (0, react_1.useState)({}), calender = _a[0], setCalender = _a[1];
79
+ var _b = (0, react_1.useState)(false), showCalendar = _b[0], setShowCalendar = _b[1];
80
+ var _c = (0, react_1.useState)(null), range = _c[0], setRange = _c[1];
81
+ var _d = (0, react_1.useState)(0), monthNumber = _d[0], setMonthNumber = _d[1];
82
+ // handle click outside should only work when calender container is not shown in modal.
83
+ (0, _EXPORTS_1.useHandleClickOutside)(containerRef, setShowCalendar, { enabled: screenWidth > (0, mixins_1.getBreakPoint)('sm') });
82
84
  var debounce = function (dy, delay) {
83
85
  clearTimeout(dy._tId);
84
86
  dy._tId = setTimeout(function () {
@@ -244,106 +246,113 @@ function DatePicker(props) {
244
246
  return (previousDateOnly && new Date() < item) ||
245
247
  (futureDateOnly && new Date() > item);
246
248
  };
247
- return (react_1.default.createElement("div", { style: { display: "flex", flexDirection: "column" } },
248
- react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
249
- react_1.default.createElement(styled_1.StyledDateInputContainer, { invert: invert, onClick: function () { return setShowCalendar(true); }, ref: containerRef },
250
- readOnly ? (react_1.default.createElement(Typo_1.SANS_3, null, getReadOnlyDate())) : (react_1.default.createElement(styled_1.StyledDateInputWrapper, null,
251
- react_1.default.createElement(styled_1.StyledInput, { ref: inputRef, type: "text", className: "SANS_3", invert: invert, disabled: disabled, onChange: handleOnChange, placeholder: "DD/MM/YYYY", maxLength: "10", onKeyDown: handleKeyDown, onBlur: handleFocusOut, onFocus: function () {
252
- (0, handlePos_1.handleVerticalPos)(calenderRef, inputRef);
253
- } }))),
254
- react_1.default.createElement(styled_1.StyledCalenderContainer, { debug: debug, showCalendar: showCalendar, ref: calenderRef, className: " ".concat(from ? "right-class" : ""), invert: invert },
255
- react_1.default.createElement(styled_1.StyledMonthView, null,
256
- react_1.default.createElement(styled_1.StyledHeader, null,
257
- wrapCaretLeft(),
258
- react_1.default.createElement(styled_1.StyledMonthTitle, { invert: invert },
259
- react_1.default.createElement("span", null,
260
- react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, months[calender === null || calender === void 0 ? void 0 : calender.month])),
261
- react_1.default.createElement("span", null,
262
- react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, calender === null || calender === void 0 ? void 0 : calender.year))),
263
- wrapCaretRight()),
264
- react_1.default.createElement(styled_1.StyledWeekDaysWrapper, null, weeks.map(function (item, i) { return (react_1.default.createElement(styled_1.StyledWeekdays, { key: i, invert: invert },
265
- react_1.default.createElement(Typo_1.SANS_3, null, item))); })),
266
- react_1.default.createElement(styled_1.StyledBodyWrapper, { invert: invert }, (_a = calender === null || calender === void 0 ? void 0 : calender.prevDays) === null || _a === void 0 ? void 0 :
267
- _a.map(function (item, i) {
268
- if (from) {
269
- if (item < range && item > from) {
270
- // Render the day as part of the selected range (when 'from' and 'range' are defined)
271
- return (react_1.default.createElement(styled_1.StyledDateBlock, { range: true, key: i, invert: invert, onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
272
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
273
- }
274
- else if (item < from) {
275
- // Render disabled days before 'from' previous date (last month)
276
- return (react_1.default.createElement(styled_1.StyledDateBlock, { isDisabledDate: true, key: i, invert: invert, disableClick: isDisabledDate(item) },
277
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
278
- }
279
- else {
280
- // Render days in the previous month
281
- // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
282
- // and apply appropriate class name for styling
283
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item) || isEqualDate(from, item), isDisabledDate: isDisabledDate(item), isTodaysDate: isTodaysDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
284
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
285
- }
249
+ var genCalenderContainer = function () {
250
+ var _a, _b, _c;
251
+ return (react_1.default.createElement(styled_1.StyledCalenderContainer, { debug: debug, showCalendar: showCalendar, ref: calenderRef, className: " ".concat(from ? "right-class" : ""), invert: invert },
252
+ react_1.default.createElement(styled_1.StyledMonthView, null,
253
+ react_1.default.createElement(styled_1.StyledHeader, null,
254
+ wrapCaretLeft(),
255
+ react_1.default.createElement(styled_1.StyledMonthTitle, { invert: invert },
256
+ react_1.default.createElement("span", null,
257
+ react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, months[calender === null || calender === void 0 ? void 0 : calender.month])),
258
+ react_1.default.createElement("span", null,
259
+ react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, calender === null || calender === void 0 ? void 0 : calender.year))),
260
+ wrapCaretRight()),
261
+ react_1.default.createElement(styled_1.StyledWeekDaysWrapper, null, weeks.map(function (item, i) { return (react_1.default.createElement(styled_1.StyledWeekdays, { key: i, invert: invert },
262
+ react_1.default.createElement(Typo_1.SANS_3, null, item))); })),
263
+ react_1.default.createElement(styled_1.StyledBodyWrapper, { invert: invert }, (_a = calender === null || calender === void 0 ? void 0 : calender.prevDays) === null || _a === void 0 ? void 0 :
264
+ _a.map(function (item, i) {
265
+ if (from) {
266
+ if (item < range && item > from) {
267
+ // Render the day as part of the selected range (when 'from' and 'range' are defined)
268
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { range: true, key: i, invert: invert, onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
269
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
270
+ }
271
+ else if (item < from) {
272
+ // Render disabled days before 'from' previous date (last month)
273
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { isDisabledDate: true, key: i, invert: invert, disableClick: isDisabledDate(item), calenderRef: calenderRef },
274
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
286
275
  }
287
276
  else {
288
- return (react_1.default.createElement(styled_1.StyledDateBlock, { isDisabledDate: true, key: i, invert: invert, isSelectedDate: isSelectedDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, disableClick: isDisabledDate(item) },
277
+ // Render days in the previous month
278
+ // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
279
+ // and apply appropriate class name for styling
280
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item) || isEqualDate(from, item), isDisabledDate: isDisabledDate(item), isTodaysDate: isTodaysDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
289
281
  react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
290
282
  }
291
- }), (_b = calender === null || calender === void 0 ? void 0 : calender.days) === null || _b === void 0 ? void 0 :
292
- _b.map(function (item, i) {
293
- if (from) {
294
- if (item < from) {
295
- // Render days before 'from' as disabled
296
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isDisabledDate: true, disableClick: isDisabledDate(item) },
297
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
298
- }
299
- else if (item > from && item < range) {
300
- // Render days within the selected range
301
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, range: true, isTodaysDate: isTodaysDate(item), invert: invert, onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
302
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
303
- }
304
- else {
305
- // Render days in the current month
306
- // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
307
- // and apply appropriate class name for styling
308
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item) || isEqualDate(from, item), isDisabledDate: isDisabledDate(item), isTodaysDate: isTodaysDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
309
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
310
- }
283
+ }
284
+ else {
285
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { isDisabledDate: true, key: i, invert: invert, isSelectedDate: isSelectedDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, disableClick: isDisabledDate(item) },
286
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
287
+ }
288
+ }), (_b = calender === null || calender === void 0 ? void 0 : calender.days) === null || _b === void 0 ? void 0 :
289
+ _b.map(function (item, i) {
290
+ if (from) {
291
+ if (item < from) {
292
+ // Render days before 'from' as disabled
293
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isDisabledDate: true, disableClick: isDisabledDate(item) },
294
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
295
+ }
296
+ else if (item > from && item < range) {
297
+ // Render days within the selected range
298
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, range: true, isTodaysDate: isTodaysDate(item), invert: invert, onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
299
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
311
300
  }
312
301
  else {
313
302
  // Render days in the current month
314
303
  // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
315
304
  // and apply appropriate class name for styling
316
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, isSelectedDate: isSelectedDate(item), isTodaysDate: isTodaysDate(item), isDisabledDate: isDisabledDate(item), disableClick: isDisabledDate(item), invert: invert, onMouseDown: function (e) { return handleDayClick(e, item); } },
305
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item) || isEqualDate(from, item), isDisabledDate: isDisabledDate(item), isTodaysDate: isTodaysDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
306
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
307
+ }
308
+ }
309
+ else {
310
+ // Render days in the current month
311
+ // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
312
+ // and apply appropriate class name for styling
313
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, isSelectedDate: isSelectedDate(item), isTodaysDate: isTodaysDate(item), isDisabledDate: isDisabledDate(item), disableClick: isDisabledDate(item), invert: invert, onMouseDown: function (e) { return handleDayClick(e, item); } },
314
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
315
+ }
316
+ }), (_c = calender === null || calender === void 0 ? void 0 : calender.nextDays) === null || _c === void 0 ? void 0 :
317
+ _c.map(function (item, i) {
318
+ if (from) {
319
+ if (item > from && item < range) {
320
+ // Render days within the selected range
321
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, range: true, onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
317
322
  react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
318
323
  }
319
- }), (_c = calender === null || calender === void 0 ? void 0 : calender.nextDays) === null || _c === void 0 ? void 0 :
320
- _c.map(function (item, i) {
321
- if (from) {
322
- if (item > from && item < range) {
323
- // Render days within the selected range
324
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, range: true, onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); }, disableClick: isDisabledDate(item) },
325
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
326
- }
327
- else if (item < from) {
328
- // Render disabled days before 'from'
329
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i,
330
- // className="disabled-date"
331
- invert: invert, isDisabledDate: true, disableClick: isDisabledDate(item) },
332
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
333
- }
334
- else {
335
- // Render days in the next month
336
- // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
337
- // and apply appropriate class name for styling
338
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item) || isEqualDate(from, item), isDisabledDate: isDisabledDate(item), disableClick: isDisabledDate(item), isTodaysDate: isTodaysDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); } },
339
- react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
340
- }
324
+ else if (item < from) {
325
+ // Render disabled days before 'from'
326
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i,
327
+ // className="disabled-date"
328
+ invert: invert, isDisabledDate: true, disableClick: isDisabledDate(item) },
329
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
341
330
  }
342
331
  else {
343
- // Render days in the next month as disabled if 'from' is not defined
344
- return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item), isDisabledDate: true, disableClick: isDisabledDate(item), onMouseDown: function (e) { return handleDayClick(e, item); } },
332
+ // Render days in the next month
333
+ // Check if the current day is 'today' or falls in the range of previousDateOnly or futureDateOnly
334
+ // and apply appropriate class name for styling
335
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item) || isEqualDate(from, item), isDisabledDate: isDisabledDate(item), disableClick: isDisabledDate(item), isTodaysDate: isTodaysDate(item), onMouseDown: function (e) { return handleDayClick(e, item); }, onPointerEnter: function () { return handlePointerEnter(item); } },
345
336
  react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
346
337
  }
347
- })))))));
338
+ }
339
+ else {
340
+ // Render days in the next month as disabled if 'from' is not defined
341
+ return (react_1.default.createElement(styled_1.StyledDateBlock, { key: i, invert: invert, isSelectedDate: isSelectedDate(item), isDisabledDate: true, disableClick: isDisabledDate(item), onMouseDown: function (e) { return handleDayClick(e, item); } },
342
+ react_1.default.createElement(Typo_1.SANS_3, null, item.getDate())));
343
+ }
344
+ })))));
345
+ };
346
+ return (react_1.default.createElement("div", { style: { display: "flex", flexDirection: "column" } },
347
+ react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
348
+ react_1.default.createElement(styled_1.StyledDateInputContainer, { invert: invert, onClick: function () { return setShowCalendar(true); }, ref: containerRef },
349
+ readOnly ? (react_1.default.createElement(Typo_1.SANS_3, null, getReadOnlyDate())) : (react_1.default.createElement(styled_1.StyledDateInputWrapper, null,
350
+ react_1.default.createElement(styled_1.StyledInput, { ref: inputRef, type: "text", className: "SANS_3", invert: invert, disabled: disabled, onChange: handleOnChange, placeholder: "DD/MM/YYYY", maxLength: "10", onKeyDown: handleKeyDown, onBlur: handleFocusOut, onFocus: function () {
351
+ (0, handlePos_1.handleVerticalPos)(calenderRef, inputRef);
352
+ } }))),
353
+ screenWidth > (0, mixins_1.getBreakPoint)('sm') ?
354
+ genCalenderContainer()
355
+ :
356
+ showCalendar ? react_1.default.createElement(Modal_1.Modal, { onClose: function () { return setShowCalendar(false); }, overflowVisible: false, fitToContentHeight: true, title: "Select Date" }, genCalenderContainer()) : null)));
348
357
  }
349
358
  exports.default = react_1.default.memo(DatePicker);
@@ -57,11 +57,11 @@ exports.StyledInput = styled_components_1.default.input(templateObject_3 || (tem
57
57
  return disabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", "\n background-color: ", ";\n cursor: not-allowed;\n &:hover{\n background-color: none !important;\n }\n "], ["\n color: ", "\n background-color: ", ";\n cursor: not-allowed;\n &:hover{\n background-color: none !important;\n }\n "])), greyColor40, greyColor15);
58
58
  }, greyColor40);
59
59
  exports.StyledDateInputWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), globalVariables_1.globalInputElemFocused);
60
- exports.StyledCalenderContainer = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n position: absolute;\n width: 30rem;\n z-index: 10000;\n\n visibility: ", ";\n /* transform: scaleY(0); \n transform-origin: top center; \n transition: transform 0.5s; */\n\n /* &:not(:focus-within .calender-container) {\n transform: scaleY(0);\n visibility: hidden;\n transition: transform 0.5s, visibility 0s 0.5s; /* Delay visibility change after animation */\n /* } */\n\n"], ["\n ", "\n position: absolute;\n width: 30rem;\n z-index: 10000;\n\n visibility: ", ";\n /* transform: scaleY(0); \n transform-origin: top center; \n transition: transform 0.5s; */\n\n /* &:not(:focus-within .calender-container) {\n transform: scaleY(0);\n visibility: hidden;\n transition: transform 0.5s, visibility 0s 0.5s; /* Delay visibility change after animation */\n /* } */\n\n"])), globalVariables_1.globalLightboxStyle, function (_a) {
60
+ exports.StyledCalenderContainer = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n z-index: 10000;\n height: 40rem;\n visibility: ", ";\n \n ", "{\n position: absolute;\n height: unset;\n width: 30rem;\n ", "\n }\n\n"], ["\n z-index: 10000;\n height: 40rem;\n visibility: ", ";\n \n ", "{\n position: absolute;\n height: unset;\n width: 30rem;\n ", "\n }\n\n"])), function (_a) {
61
61
  var showCalendar = _a.showCalendar, debug = _a.debug;
62
62
  return debug ? "" : showCalendar ? "visible" : "hidden";
63
- });
64
- exports.StyledDateBlock = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n font-size: 1.4rem;\n width: calc(280px / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n height: 4rem;\n border-bottom: ", ";\n ", "\n cursor: pointer;\n color: ", ";\n ", "\n ", "\n \n ", "\n\n\n ", " \n \n ", "\n\n\n ", "\n\n ", "\n\n\n ", "\n\n ", "\n"], ["\n font-size: 1.4rem;\n width: calc(280px / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n height: 4rem;\n border-bottom: ", ";\n ", "\n cursor: pointer;\n color: ", ";\n ", "\n ", "\n \n ", "\n\n\n ", " \n \n ", "\n\n\n ", "\n\n ", "\n\n\n ", "\n\n ", "\n"])), function (_a) {
63
+ }, (0, mixins_1.mediaQuery)('sm'), globalVariables_1.globalLightboxStyle);
64
+ exports.StyledDateBlock = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n font-size: 1.4rem;\n width: calc(93.3% / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n height: 4rem;\n border-bottom: ", ";\n ", "\n cursor: pointer;\n color: ", ";\n ", "\n ", "\n \n ", "\n\n\n ", " \n \n ", "\n\n\n ", "\n\n ", "\n\n\n ", "\n\n ", "\n"], ["\n font-size: 1.4rem;\n width: calc(93.3% / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n height: 4rem;\n border-bottom: ", ";\n ", "\n cursor: pointer;\n color: ", ";\n ", "\n ", "\n \n ", "\n\n\n ", " \n \n ", "\n\n\n ", "\n\n ", "\n\n\n ", "\n\n ", "\n"])), function (_a) {
65
65
  var invert = _a.invert;
66
66
  return !invert ? "1px solid ".concat(white) : "1px solid ".concat(greyColor80);
67
67
  }, (0, mixins_1.transition)("background-color 0.2s"), function (_a) {
@@ -117,7 +117,7 @@ exports.StyledMonthTitle = styled_components_1.default.div(templateObject_16 ||
117
117
  });
118
118
  exports.StyledHeader = styled_components_1.default.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n width: 90%;\n margin: auto;\n padding: 1.5rem 0 1rem 0;\n font-size: 1.4rem;\n font-weight: 600;\n align-items: center;\n justify-content: space-between;\n"], ["\n display: flex;\n width: 90%;\n margin: auto;\n padding: 1.5rem 0 1rem 0;\n font-size: 1.4rem;\n font-weight: 600;\n align-items: center;\n justify-content: space-between;\n"])));
119
119
  exports.StyledWeekDaysWrapper = styled_components_1.default.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n height: 3.5rem;\n"], ["\n display: flex;\n justify-content: center;\n height: 3.5rem;\n"])));
120
- exports.StyledWeekdays = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n font-size: 1.4rem;\n /* font-weight: 600; */\n opacity: 0.7;\n width: calc(280px / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n"], ["\n font-size: 1.4rem;\n /* font-weight: 600; */\n opacity: 0.7;\n width: calc(280px / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n"])), function (_a) {
120
+ exports.StyledWeekdays = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n font-size: 1.4rem;\n /* font-weight: 600; */\n opacity: 0.7;\n width: calc(93.3% / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n"], ["\n font-size: 1.4rem;\n /* font-weight: 600; */\n opacity: 0.7;\n width: calc(93.3% / 7);\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n"])), function (_a) {
121
121
  var invert = _a.invert;
122
122
  return invert && white;
123
123
  });
@@ -1,4 +1,9 @@
1
- export function getConfig(preset: any, contentTypeTitle: any, commaSeparatedTags: any): {
1
+ export function getEmptyStatesConfig({ preset, title, contentTypeTitle, commaSeparatedTags }: {
2
+ preset: any;
3
+ title: any;
4
+ contentTypeTitle: any;
5
+ commaSeparatedTags: any;
6
+ }): {
2
7
  align: string;
3
8
  image: {
4
9
  src: string;
@@ -7,9 +12,9 @@ export function getConfig(preset: any, contentTypeTitle: any, commaSeparatedTags
7
12
  opacity: number;
8
13
  };
9
14
  };
15
+ imageSize: number;
10
16
  title: string;
11
17
  subtitle: string;
12
- imageSize?: undefined;
13
18
  button?: undefined;
14
19
  link?: undefined;
15
20
  } | {
@@ -21,9 +26,9 @@ export function getConfig(preset: any, contentTypeTitle: any, commaSeparatedTags
21
26
  opacity: number;
22
27
  };
23
28
  };
24
- imageSize: number;
25
- title: string;
29
+ title: any;
26
30
  subtitle: string;
31
+ imageSize?: undefined;
27
32
  button?: undefined;
28
33
  link?: undefined;
29
34
  } | {
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = void 0;
4
- var getConfig = function (preset, contentTypeTitle, commaSeparatedTags) {
3
+ exports.getEmptyStatesConfig = void 0;
4
+ var getEmptyStatesConfig = function (_a) {
5
+ var preset = _a.preset, title = _a.title, contentTypeTitle = _a.contentTypeTitle, commaSeparatedTags = _a.commaSeparatedTags;
5
6
  switch (preset) {
6
7
  case "multipleCollectionsListing":
7
8
  return {
@@ -105,7 +106,7 @@ var getConfig = function (preset, contentTypeTitle, commaSeparatedTags) {
105
106
  opacity: 1,
106
107
  },
107
108
  },
108
- title: "Content Published Successfully",
109
+ title: title || "Content Published Successfully",
109
110
  subtitle: " ",
110
111
  };
111
112
  case "draftsListing":
@@ -234,4 +235,4 @@ var getConfig = function (preset, contentTypeTitle, commaSeparatedTags) {
234
235
  };
235
236
  }
236
237
  };
237
- exports.getConfig = getConfig;
238
+ exports.getEmptyStatesConfig = getEmptyStatesConfig;
@@ -1,6 +1,7 @@
1
- export function EmptyStates({ preset, contentTypeTitle, tags, onClick, }: {
1
+ export function EmptyStates({ preset, contentTypeTitle, title: titleProp, tags, onClick, }: {
2
2
  preset?: string;
3
3
  contentTypeTitle: any;
4
+ title: any;
4
5
  tags: any;
5
6
  onClick: any;
6
7
  }): React.JSX.Element;
@@ -19,9 +19,14 @@ var react_1 = __importDefault(require("react"));
19
19
  var EmptyStatesRenderer_1 = require("./comps/EmptyStatesRenderer");
20
20
  var config_1 = require("./config");
21
21
  var EmptyStates = function (_a) {
22
- var _b = _a.preset, preset = _b === void 0 ? "multiplePublishingListing" : _b, contentTypeTitle = _a.contentTypeTitle, tags = _a.tags, onClick = _a.onClick;
23
- var commaSeparatedTags = tags === null || tags === void 0 ? void 0 : tags.map(function (item) { return item.toLowerCase(); }).join(',');
24
- var _c = (0, config_1.getConfig)(preset, contentTypeTitle, commaSeparatedTags), image = _c.image, title = _c.title, subtitle = _c.subtitle, link = _c.link, button = _c.button, align = _c.align;
22
+ var _b = _a.preset, preset = _b === void 0 ? "multiplePublishingListing" : _b, contentTypeTitle = _a.contentTypeTitle, titleProp = _a.title, tags = _a.tags, onClick = _a.onClick;
23
+ var commaSeparatedTags = tags === null || tags === void 0 ? void 0 : tags.map(function (item) { return item.toLowerCase(); }).join(",");
24
+ var _c = (0, config_1.getEmptyStatesConfig)({
25
+ preset: preset,
26
+ contentTypeTitle: contentTypeTitle,
27
+ commaSeparatedTags: commaSeparatedTags,
28
+ title: titleProp
29
+ }), image = _c.image, title = _c.title, subtitle = _c.subtitle, link = _c.link, button = _c.button, align = _c.align;
25
30
  return (react_1.default.createElement(EmptyStatesRenderer_1.EmptyStatesRenderer, __assign({}, { image: image, align: align, title: title, subtitle: subtitle, link: link, button: button, onClick: onClick })));
26
31
  };
27
32
  exports.EmptyStates = EmptyStates;
@@ -104,7 +104,7 @@ function PDFInput(_a) {
104
104
  }, []);
105
105
  return (react_1.default.createElement(react_3.Fragment, null,
106
106
  react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props), { invert: invert })),
107
- readOnly ? (value && value.length > 0 && (value === null || value === void 0 ? void 0 : value.map(function (d, i) { return (react_1.default.createElement(PDFEmbed_1.default, { key: i, filePath: d.publicUrl, fileName: d.originalFilename, fileID: d.generation })); })))
107
+ (readOnly && value) ? (value === null || value === void 0 ? void 0 : value.map(function (d, i) { return (react_1.default.createElement(PDFEmbed_1.default, { key: i, filePath: d.publicUrl, fileName: d.originalFilename, fileID: d.generation })); }))
108
108
  : !value || (value === null || value === void 0 ? void 0 : value.length) === 0 && !isLoading ? (react_1.default.createElement(UploadWrapper_1.UploadWrapper, { invert: invert },
109
109
  react_1.default.createElement(Buttons_1.ButtonSecondary, { onClick: function () { return inputRef.current.click(); }, icon: "UploadSimple", value: "Upload Pdf", invert: invert }))) : isLoading ? (react_1.default.createElement(UploadWrapper_1.UploadWrapper, null,
110
110
  react_1.default.createElement(ProgressBar_1.ProgressBar, { progress: uploadProgress, text: uploadProgress && uploadProgress !== 100
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.93.0",
3
+ "version": "2.95.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",