stalefish 8.0.5 → 8.0.6

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.
@@ -134,20 +134,7 @@ export default ({ wrapperStyle = null, holdingPen, label, placeholder, property,
134
134
  e.target.parentNode.parentNode._flatpickr.close()
135
135
  return false
136
136
  }}>clear</div>` : ''}
137
- <input data-gramm="false" ?disabled=${disabled} style="${disabled ? 'cursor: not-allowed; opacity: 0.3;' : ''}" class="${styles.textfield} ${fieldIsTouched(holdingPen, property) === true ? styles.touched : ''}" ${required ? { required: 'required' } : ''} onfocus=${e => {
138
- e.target.parentNode.parentNode._flatpickr && e.target.parentNode.parentNode._flatpickr.set('onValueUpdate', (fpDate, dateString) => {
139
- const fauxE = {
140
- currentTarget: {
141
- validity: {
142
- valid: true
143
- },
144
- value: dateString
145
- }
146
- }
147
- formField(holdingPen, property)(fauxE)
148
- onchange && onchange(fauxE)
149
- })
150
- }} onchange=${e => { change({ e, holdingPen, property, label: styles.label }); onchange && onchange(e) }} oninput=${e => { e.target.defaultValue = ''; oninput && oninput(e) }} placeholder="${placeholder || ''}${required ? ' *' : ''}" type="${inputType}" ${pattern ? { pattern } : ''} value="${holdingPen[property] || ''}" data-input />
137
+ <input data-gramm="false" ?disabled=${disabled} style="${disabled ? 'cursor: not-allowed; opacity: 0.3;' : ''}" class="${styles.textfield} ${fieldIsTouched(holdingPen, property) === true ? styles.touched : ''}" ${required ? { required: 'required' } : ''} onchange=${e => { change({ e, holdingPen, property, label: styles.label }); onchange && onchange(e) }} oninput=${e => { e.target.defaultValue = ''; oninput && oninput(e) }} placeholder="${placeholder || ''}${required ? ' *' : ''}" type="${inputType}" ${pattern ? { pattern } : ''} .value=${holdingPen[property] || ''} data-input />
151
138
  </div>
152
139
  </div>
153
140
  `
@@ -166,6 +153,16 @@ export default ({ wrapperStyle = null, holdingPen, label, placeholder, property,
166
153
  Object.assign(
167
154
  {},
168
155
  { disableMobile: resolvedDisableMobile },
156
+ // Provide sensible defaults for time-only pickers; allow user config to override
157
+ timeOnly
158
+ ? {
159
+ dateFormat: flatpickrConfig && flatpickrConfig.dateFormat ? flatpickrConfig.dateFormat : 'H:i',
160
+ defaultDate:
161
+ flatpickrConfig && typeof flatpickrConfig.defaultDate !== 'undefined'
162
+ ? flatpickrConfig.defaultDate
163
+ : (holdingPen && property && holdingPen[property] ? holdingPen[property] : undefined)
164
+ }
165
+ : null,
169
166
  flatpickrConfig,
170
167
  {
171
168
  wrap: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stalefish",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "description": "Simple function based component library for halfcab tagged template literals",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",