@teamias/rex-pro 0.1.3 → 0.1.4

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.
@@ -20,11 +20,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
20
20
  /* eslint-disable no-param-reassign */
21
21
  import { ProForm } from '@ant-design/pro-components';
22
22
  import { BaseForm, getFieldsDefaultValues, resetFormTouched, useRequestFields, useRequestFieldsConfig, useRexProConfigProvider, useStateData } from '@teamias/rex-design';
23
- import { Button, Checkbox, Dropdown, Skeleton, Space } from 'antd';
23
+ import { Button, Checkbox, Dropdown, Skeleton, Space, version } from 'antd';
24
24
  import { cloneDeep } from 'lodash';
25
25
  import { useEffect, useImperativeHandle, useRef } from 'react';
26
26
  import { FilterFormAutoWidthStyle, FilterFormStyle } from "./style";
27
27
 
28
+ // parseInt(version) >= 6
29
+
28
30
  /**
29
31
  * FilterForm 组件 - 支持多语言的筛选表单
30
32
  * @param T 表单数据类型
@@ -296,7 +298,9 @@ export var FilterForm = function FilterForm(_ref) {
296
298
  });
297
299
  }
298
300
  return /*#__PURE__*/_jsxs(_Fragment, {
299
- children: [displayType === 'auto' ? /*#__PURE__*/_jsx(FilterFormAutoWidthStyle, {}) : /*#__PURE__*/_jsx(FilterFormStyle, {}), /*#__PURE__*/_jsx("div", {
301
+ children: [displayType === 'auto' ? /*#__PURE__*/_jsx(FilterFormAutoWidthStyle, {
302
+ $version: parseInt(version)
303
+ }) : /*#__PURE__*/_jsx(FilterFormStyle, {}), /*#__PURE__*/_jsx("div", {
300
304
  className: "pro-rex-filter-form-root-box",
301
305
  children: /*#__PURE__*/_jsxs(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
302
306
  formRef: formRef,
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const FilterFormStyle: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & object>;
3
- export declare const FilterFormAutoWidthStyle: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & object>;
3
+ export declare const FilterFormAutoWidthStyle: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
4
+ $version?: number | undefined;
5
+ }>;
@@ -1,3 +1,7 @@
1
- import { createGlobalStyle } from 'styled-components';
1
+ import { createGlobalStyle, css } from 'styled-components';
2
2
  export var FilterFormStyle = createGlobalStyle([".pro-rex-filter-form-root-box{width:100%;overflow-x:hidden;}.pro-rex-filter-form{container-type:inline-size;container-name:form-container;margin-left:-5px;margin-right:-5px;row-gap:10px;}.pro-rex-filter-form>.ant-form-item{margin:0;padding-inline:5px;}.pro-rex-filter-form .ant-form-item-control{width:0;}.ant-form-item{margin-inline-end:0 !important;}.pro-rex-filter-form .ant-picker{width:100%;}.pro-rex-filter-button-group{display:inline-flex;gap:10px;justify-content:end;flex:1 !important;}.base-form-field-multiple-group .base-form-item{min-width:initial !important;width:initial;margin:0;}@container form-container (min-width:1700px){.ant-form > .ant-form-item{width:16.666% !important;}}@container form-container (max-width:1200px){.ant-form > .ant-form-item{width:25% !important;}}@container form-container (max-width:1000px){.ant-form > .ant-form-item{width:33.33% !important;}}@container form-container (max-width:700px){.ant-form > .ant-form-item{width:50% !important;}}@container form-container (max-width:500px){.ant-form > .ant-form-item{width:100% !important;}}"]);
3
- export var FilterFormAutoWidthStyle = createGlobalStyle([".pro-rex-filter-form-root-box{width:100%;overflow-x:hidden;.pro-rex-filter-form{gap:10px;>.ant-form-item{margin:0;}.pro-rex-filter-button-group{display:inline-flex;gap:10px;justify-content:end;}.base-form-field-multiple-group > .base-form-item{margin:0;width:100%;}.base-form-item{min-width:initial !important;width:var(--item-width,initial);}.ant-select{min-width:initial !important;width:100%;}.ant-input-number{max-width:100px;width:100%;}.base-form-item .ant-form-item{margin-inline-end:0;}.base-form-field-multiple-group .base-form-item{min-width:initial !important;width:var(--item-width,initial) !important;}.ant-picker{width:100%;}.ant-select-multiple .ant-select-selection-placeholder{position:relative;top:initial;padding-inline-end:18px;transform:initial;transition:none;pointer-events:none;display:block;line-height:28px;transition:all 0.3s,visibility 0s;align-self:center;}.ant-select-multiple .ant-select-selection-overflow-item{position:relative !important;}.ant-select-multiple .ant-select-selection-overflow:has(+.ant-select-selection-placeholder){position:absolute;}.ant-select-multiple .ant-select-content-item{height:auto !important;}.ant-select-multiple .ant-select-content-item>.ant-select-placeholder{position:initial !important;padding-left:4px !important;width:auto !important;transform:none !important;}}}"]);
3
+ var autoWidthStyle = css([".ant-select-content{.ant-select-content-item-prefix + .ant-select-content-item-suffix{order:-1;margin:0;transform:translateX(6px);}}"]);
4
+ export var FilterFormAutoWidthStyle = createGlobalStyle([".pro-rex-filter-form-root-box{width:100%;overflow-x:hidden;.pro-rex-filter-form{gap:10px;>.ant-form-item{margin:0;}.pro-rex-filter-button-group{display:inline-flex;gap:10px;justify-content:end;}.base-form-field-multiple-group > .base-form-item{margin:0;width:100%;}.base-form-item{min-width:initial !important;width:var(--item-width,initial);}.ant-select{min-width:initial !important;width:100%;}.ant-input-number{max-width:100px;width:100%;}.base-form-item .ant-form-item{margin-inline-end:0;}.base-form-field-multiple-group .base-form-item{min-width:initial !important;width:var(--item-width,initial) !important;}.ant-picker{width:100%;}.ant-select-multiple .ant-select-selection-placeholder{position:relative;top:initial;padding-inline-end:18px;transform:initial;transition:none;pointer-events:none;display:block;line-height:28px;transition:all 0.3s,visibility 0s;align-self:center;}.ant-select-multiple .ant-select-selection-overflow-item{position:relative !important;}.ant-select-multiple .ant-select-selection-overflow:has(+.ant-select-selection-placeholder){position:absolute;}.ant-select-multiple .ant-select-content-item{height:auto !important;}.ant-select-multiple .ant-select-content-item>.ant-select-placeholder{position:initial !important;padding-left:4px !important;width:auto !important;transform:none !important;}", "}}"], function (_ref) {
5
+ var $version = _ref.$version;
6
+ return (!$version || $version >= 6) && autoWidthStyle;
7
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamias/rex-pro",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",