@innoways/drip-form-theme-antd 9.0.8 → 9.0.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: add id prop support to StyledFlatPicker for better form labelling 9.0.9
8
+ - Updated dependencies
9
+ - @innoways/hooks@9.0.9
10
+ - @innoways/utils@9.0.9
11
+
3
12
  ## 9.0.8
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -21909,6 +21909,7 @@ var StyledFlatPicker = function StyledFlatPicker(props) {
21909
21909
  _onChange = props.onChange,
21910
21910
  options = props.options,
21911
21911
  className = props.className,
21912
+ id = props.id,
21912
21913
  themeColor = props.themeColor,
21913
21914
  disabled = props.disabled,
21914
21915
  style = props.style,
@@ -22142,7 +22143,12 @@ var StyledFlatPicker = function StyledFlatPicker(props) {
22142
22143
 
22143
22144
  var flatpickrOptions = _objectSpread$5(_objectSpread$5({}, options), {}, {
22144
22145
  onReady: function onReady(selectedDates, dateStr, instance) {
22145
- if (!(instance !== null && instance !== void 0 && instance.calendarContainer)) return;
22146
+ if (!(instance !== null && instance !== void 0 && instance.calendarContainer)) return; // Forward id to the visible altInput so form labelling works correctly
22147
+
22148
+ if (id && instance.altInput) {
22149
+ instance.altInput.name = id;
22150
+ }
22151
+
22146
22152
  var yearInput = instance.calendarContainer.querySelector('.cur-year');
22147
22153
  var numInputWrapper = instance.calendarContainer.querySelector('.numInputWrapper');
22148
22154
  var monthsDropdown = instance.calendarContainer.querySelector('.flatpickr-monthDropdown-months'); // Add id to month dropdown
@@ -22197,6 +22203,7 @@ var StyledFlatPicker = function StyledFlatPicker(props) {
22197
22203
  },
22198
22204
  options: flatpickrOptions,
22199
22205
  disabled: disabled,
22206
+ id: id ? "".concat(id, "-hidden") : undefined,
22200
22207
  className: "".concat(className ? className : '', " form-control flat-date-picker")
22201
22208
  }), allowClear && showClear && /*#__PURE__*/React.createElement(X, {
22202
22209
  type: "button",
@@ -22219,6 +22226,7 @@ StyledFlatPicker.propTypes = {
22219
22226
  value: _pt.any,
22220
22227
  onChange: _pt.func.isRequired,
22221
22228
  className: _pt.string,
22229
+ id: _pt.string,
22222
22230
  themeColor: _pt.string,
22223
22231
  disabled: _pt.bool,
22224
22232
  allowClear: _pt.bool
@@ -22560,7 +22568,7 @@ var DatePickerField = function DatePickerField(_ref) {
22560
22568
  return moment(item).format(format);
22561
22569
  }).join(' ~ ') : moment(fieldData).format(format) : null;
22562
22570
  return /*#__PURE__*/React.createElement(React.Fragment, null, range ? /*#__PURE__*/React.createElement(StyledFlatPicker, {
22563
- id: "range-picker",
22571
+ id: "".concat(fieldKey, "-range-picker"),
22564
22572
  className: "form-control border-0",
22565
22573
  value: fieldData ? [fieldData[0], fieldData[1]] : [],
22566
22574
  onChange: function onChange(date, isCleared) {
@@ -22587,7 +22595,7 @@ var DatePickerField = function DatePickerField(_ref) {
22587
22595
  _onChange(moment(date[0]).format(format));
22588
22596
  }
22589
22597
  },
22590
- id: "default-picker",
22598
+ id: "".concat(fieldKey, "-default-picker"),
22591
22599
  themeColor: themeColor,
22592
22600
  style: style,
22593
22601
  allowClear: allowClear,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innoways/drip-form-theme-antd",
3
- "version": "9.0.8",
3
+ "version": "9.0.9",
4
4
  "author": "JDFED",
5
5
  "description": "drip-form antd主题包",
6
6
  "main": "dist/index.js",
@@ -31,10 +31,10 @@
31
31
  "dependencies": {
32
32
  "@ant-design/icons": "^4.7.0",
33
33
  "@babel/runtime": "^7.10.2",
34
- "@innoways/hooks": "^9.0.8",
35
- "@innoways/utils": "^9.0.8",
34
+ "@innoways/hooks": "^9.0.9",
35
+ "@innoways/utils": "^9.0.9",
36
36
  "antd": "^4.16.13",
37
- "flatpickr": "^4.6.13",
37
+ "flatpickr": "4.6.3",
38
38
  "moment": "^2.26.0",
39
39
  "react-color": "^2.18.1",
40
40
  "react-flatpickr": "^3.10.13",