@plasmicpkgs/antd5 0.0.213 → 0.0.215

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
@@ -675,10 +675,70 @@ var __objRest$m = (source, exclude) => {
675
675
  return target;
676
676
  };
677
677
  function AntdDatePicker(props) {
678
- const nativeInput = React__default.default.useRef(null);
679
- const [open, setOpen] = React.useState(false);
680
- const strValue = props.value && typeof props.value === "object" && "toISOString" in props.value ? props.value.toISOString() : props.value === null ? void 0 : props.value;
681
678
  const _a = props, { picker, popupScopeClassName } = _a, rest = __objRest$m(_a, ["picker", "popupScopeClassName"]);
679
+ const css = `
680
+
681
+ @media(max-width: 500px) {
682
+ .ant-picker-dropdown {
683
+ top: 20px !important;
684
+ left: 10px !important;
685
+ right: 10px !important;
686
+ max-height: 95vh;
687
+ position: fixed;
688
+ overflow-y: scroll;
689
+ }
690
+
691
+ .ant-picker-panel-layout {
692
+ flex-direction: column;
693
+ }
694
+
695
+ .ant-picker-presets {
696
+ min-height: 50px;
697
+ min-width: 100%;
698
+ }
699
+
700
+ .ant-picker-presets > ul {
701
+ overflow-y: hidden;
702
+ overflow-x: auto;
703
+ display: flex;
704
+ align-items: center;
705
+ justify-content: center;
706
+ flex-wrap: wrap;
707
+ flex-direction: column;
708
+ }
709
+
710
+ .ant-picker-presets > ul > li {
711
+ margin: 0 !important;
712
+ }
713
+
714
+ .ant-picker-panel-container {
715
+ width: 300px;
716
+ }
717
+
718
+ .ant-picker-datetime-panel {
719
+ flex-direction: column;
720
+ }
721
+
722
+ .ant-picker-header-view {
723
+ line-height: unset !important;
724
+ }
725
+
726
+ .ant-picker-content {
727
+ height: unset !important;
728
+ }
729
+
730
+ .ant-picker-time-panel-column {
731
+ height: 100px;
732
+ }
733
+
734
+ .ant-picker-time-panel-column::after {
735
+ height: 0px !important;
736
+ }
737
+
738
+ .ant-picker-time-panel-column::after {
739
+ display: none;
740
+ }
741
+ }`;
682
742
  return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
683
743
  antd.DatePicker,
684
744
  __spreadProps$m(__spreadValues$y({}, rest), {
@@ -689,29 +749,9 @@ function AntdDatePicker(props) {
689
749
  onChange: (value, _dateString) => {
690
750
  var _a2;
691
751
  (_a2 = props.onChange) == null ? void 0 : _a2.call(props, value !== null ? value.toISOString() : null);
692
- },
693
- open,
694
- onOpenChange: (_open) => {
695
- if (_open && window.innerWidth < 500) {
696
- nativeInput.current.showPicker();
697
- } else {
698
- setOpen(_open);
699
- }
700
752
  }
701
753
  })
702
- ), /* @__PURE__ */ React__default.default.createElement(
703
- "input",
704
- {
705
- hidden: true,
706
- ref: nativeInput,
707
- type: props.showTime ? "datetime-local" : "date",
708
- value: strValue || "",
709
- onChange: (e) => {
710
- var _a2;
711
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e.target.value);
712
- }
713
- }
714
- ));
754
+ ), /* @__PURE__ */ React__default.default.createElement("style", { dangerouslySetInnerHTML: { __html: css } }));
715
755
  }
716
756
  const datePickerComponentName = "plasmic-antd5-date-picker";
717
757
  const datePickerHelpers = {
@@ -4699,30 +4739,45 @@ function AntdDateRangePicker(props) {
4699
4739
  "popupScopeClassName",
4700
4740
  "className"
4701
4741
  ]);
4702
- const popupScopeClassNameSelector = popupScopeClassName ? `.${popupScopeClassName}` : "";
4703
4742
  const css = `
4704
- @media(max-width: 900px) {
4705
- .ant-picker-panels{
4706
- flex-direction: column;
4707
- }
4708
- }
4709
-
4710
4743
  @media(max-width: 500px) {
4711
- ${popupScopeClassNameSelector}.ant-picker-dropdown {
4744
+ .ant-picker-dropdown {
4712
4745
  top: 20px !important;
4713
4746
  left: 10px !important;
4714
4747
  right: 10px !important;
4715
4748
  max-height: 95vh;
4716
4749
  position: fixed;
4717
4750
  overflow-y: scroll;
4718
- max-width: 100vw;
4719
4751
  }
4720
4752
 
4721
- ${popupScopeClassNameSelector} .ant-picker-panel-container {
4722
- min-width: 300px;
4753
+ .ant-picker-panel-layout {
4754
+ flex-direction: column;
4755
+ }
4756
+
4757
+ .ant-picker-presets {
4758
+ min-height: 50px;
4759
+ min-width: 100% !important;
4723
4760
  }
4724
4761
 
4725
- ${popupScopeClassNameSelector} .ant-picker-datetime-panel {
4762
+ .ant-picker-presets > ul {
4763
+ overflow-y: hidden;
4764
+ overflow-x: auto;
4765
+ display: flex;
4766
+ align-items: center;
4767
+ justify-content: center;
4768
+ flex-wrap: wrap;
4769
+ flex-direction: column;
4770
+ }
4771
+
4772
+ .ant-picker-presets > ul > li {
4773
+ margin: 0 !important;
4774
+ }
4775
+
4776
+ .ant-picker-panel-container {
4777
+ width: 300px;
4778
+ }
4779
+
4780
+ .ant-picker-datetime-panel {
4726
4781
  flex-direction: column;
4727
4782
  }
4728
4783
 
@@ -4730,19 +4785,23 @@ function AntdDateRangePicker(props) {
4730
4785
  font-size: 16px !important;
4731
4786
  }
4732
4787
 
4733
- ${popupScopeClassNameSelector} .ant-picker-header-view {
4788
+ .ant-picker-header-view {
4734
4789
  line-height: unset !important;
4735
4790
  }
4736
4791
 
4737
- ${popupScopeClassNameSelector} .ant-picker-content {
4792
+ .ant-picker-content {
4738
4793
  height: unset !important;
4739
4794
  }
4740
4795
 
4741
- ${popupScopeClassNameSelector} .ant-picker-time-panel-column {
4796
+ .ant-picker-time-panel-column {
4742
4797
  height: 100px;
4743
4798
  }
4744
4799
 
4745
- ${popupScopeClassNameSelector} .ant-picker-range-arrow {
4800
+ .ant-picker-time-panel-column::after {
4801
+ height: 0px !important;
4802
+ }
4803
+
4804
+ .ant-picker-range-arrow {
4746
4805
  display: none;
4747
4806
  }
4748
4807
  }