@antscorp/antsomi-ui 1.3.5-beta.677 → 1.3.5-beta.679

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.
@@ -64,6 +64,8 @@ export const AdvancedPicker = props => {
64
64
  },
65
65
  date: dayjs().tz(timezone).format(format),
66
66
  dateDisplay: dayjs().tz(timezone).format(format),
67
+ // date: dayjs(propsDate).tz(timezone).format(format),
68
+ // dateDisplay: dayjs(propsDate).tz(timezone).format(format),
67
69
  });
68
70
  const { isOpen, option, date, dateDisplay } = state;
69
71
  const isShowFixed = option.dateType.value === 'fixed' || onlyShowFixed;
@@ -146,9 +148,17 @@ export const AdvancedPicker = props => {
146
148
  }
147
149
  }, [option, format, timezone]);
148
150
  useDeepCompareEffect(() => {
151
+ const DEFAULT_OPTION = onlyShowFixed
152
+ ? {
153
+ dateType: 'fixed',
154
+ calculationDate: 'days',
155
+ calculationType: 'minus',
156
+ value: 0,
157
+ }
158
+ : {};
149
159
  try {
150
- if (propsOption) {
151
- const { dateType, calculationType, calculationDate, value = 0 } = propsOption || {};
160
+ if (propsOption || onlyShowFixed) {
161
+ const { dateType, calculationType, calculationDate, value = 0, } = propsOption || DEFAULT_OPTION;
152
162
  const newDateTypes = DATE_TYPES;
153
163
  const newDateType = newDateTypes.find(dType => dType.value === dateType);
154
164
  const newCalculationType = CALCULATION_TYPES.find(calType => calType.value === calculationType);
@@ -302,7 +302,7 @@ export function MatchesAny(props) {
302
302
  React.createElement(Flex, { align: "center", gap: 10 },
303
303
  React.createElement(Button, { type: "primary", onClick: () => onApply(selectedItems || []) }, t(translations.apply.title).toString()),
304
304
  React.createElement(Button, { onClick: () => onCancel() }, t(translations.cancel.title).toString())),
305
- showExtendValue && (React.createElement(ExtendValuePopup, { onApply: onApplyExtendValue },
305
+ showExtendValue && (React.createElement(ExtendValuePopup, { getPopupContainer: trigger => trigger.parentElement || document.body, onApply: onApplyExtendValue },
306
306
  React.createElement(Button, { icon: React.createElement(Icon, { type: "icon-ants-empty-flag" }) }, t(translations.extendValue.title).toString())))))));
307
307
  }
308
308
  export function MatchesAnySelect(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.677",
3
+ "version": "1.3.5-beta.679",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",