playbook_ui 7.0.0.pre.alpha13 → 7.0.0.pre.alpha14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e329711246ae555c5e6e13504fe7489062e64e67be40c0bbc17c473dbd3e7994
4
- data.tar.gz: 67a8d82f86700372bc6cfb19af7f2f592f12278af0d0731388ff29b2d374dab8
3
+ metadata.gz: 972b3bf2414f87c7f6374f5eff1a0b2de27d145d7394399c13d30d6a96e293ca
4
+ data.tar.gz: 850d50a56e852f315630cd3d9180db0e655607b76a0c6f5cf04a84f601b431b3
5
5
  SHA512:
6
- metadata.gz: 7f0826a7a92bcd1f848ab4e7aea2af39d16d3a030ea28e5e5f83bf8133587f811df372587a1e5fa3c35d1cfd4068414641cc944403d59eb857ed2e62b04580a1
7
- data.tar.gz: 1ed00c2dff812d1dfbcdc0d4bcf0dba1de40356155632be76255b5fa9ffe985800aa0b62c0a5f6889ef4e2abc4e4fc4c3a31f5c5b347fdc12f46992972ca3958
6
+ metadata.gz: 607c7ef165b2d71d6279dc73c159a1326a56c1fafd4b41446bd6b8cd22d49d4ebffbb24e1f339a2b32ddd2559663fa7bc9b51eb8ca7cd5b0b3a8e6231f787773
7
+ data.tar.gz: b9351d4c6df7546eb39ae5742546d3c44e699005ffa6da44c8af1d1e256412e69a95ec208f986bd6619434a1647b7f17bd9f88e4b872556b11d6f57e1ddff568
@@ -129,32 +129,96 @@ const datePickerHelper = (config) => {
129
129
 
130
130
  // Allow the date picker form resetting
131
131
  if (picker.input.form) {
132
+ // let adaptive = false
133
+ // const adaptedReset = (e) => {
134
+ // picker.input.form.removeEventListener('reset', namedFunc)
135
+ // debugger
136
+ // e.target.reset()
137
+ // picker.input.form.addEventListener('reset', namedFunc)
138
+ // picker.monthsDropdownContainer.value = picker.currentMonth
139
+ // dropdown.value = picker.currentYear
140
+ // }
141
+
142
+ // const namedFunc = (e) => {
143
+ // e.preventDefault()
144
+ // debugger
145
+ // adaptedReset(e)
146
+ // }
147
+
148
+ // picker.input.form.addEventListener('reset', namedFunc)
149
+
150
+ // const myAsync = async() => {
151
+ // console.log('reset')
152
+ // return 'arb'
153
+ // }
154
+
155
+ // const promise = new Promise((resolve) => {
156
+ // picker.input.form.addEventListener('reset', () => console.log('reset'))
157
+ // resolve('chyeah')
158
+ // })
159
+
160
+ // promise.then((val) => {
161
+ // console.log('select cleanup', val)
162
+ // picker.monthsDropdownContainer.value = picker.currentMonth
163
+ // dropdown.value = picker.currentYear
164
+ // })
165
+
132
166
  picker.input.form.addEventListener('reset', (e) => {
133
- e.preventDefault()
134
- if (defaultDate){
135
- picker.setDate(defaultDate)
136
- yearChangeHook()
137
- } else {
138
- picker.clear()
139
- }
140
-
141
- const fields = e.target.querySelectorAll('select, input, textarea')
142
-
143
- // Prevent year and month dropdowns from being reset
144
- fields.forEach((field) => {
145
- if (field == picker.monthsDropdownContainer || field == dropdown || field == picker.input){
146
- // console.log(field)
147
- return
148
- } else {
149
- field.value = field.defaultValue
150
- }
151
- })
152
- // setTimeout(() => {
153
- // dropdown.value = picker.currentYear
154
- // picker.monthsDropdownContainer.value = picker.currentMonth
155
- // console.log(picker)
156
- // }, 10)
167
+ setTimeout(() => {
168
+ dropdown.value = picker.currentYear
169
+ picker.monthsDropdownContainer.value = picker.currentMonth
170
+ }, 0)
157
171
  })
172
+
173
+ // picker.input.form.addEventListener('reset', (e) => {
174
+ // // debugger
175
+ // // adaptedReset(e.target)
176
+ // // e.preventDefault()
177
+ // // debugger
178
+ // // e.target.reset()
179
+ // // debugger
180
+
181
+ // // const manualReset = async() => {
182
+ // // e.target.reset()
183
+ // // debugger
184
+ // // return 'test-val'
185
+ // // }
186
+
187
+ // // const resetSelects = async() => {
188
+ // // const arb = await manualReset()
189
+ // // console.log(arb)
190
+ // // debugger
191
+ // // picker.monthsDropdownContainer.value = picker.currentMonth
192
+ // // dropdown.value = picker.currentYear
193
+ // // }
194
+
195
+ // // e.preventDefault()
196
+ // // if (defaultDate){
197
+ // // picker.setDate(defaultDate)
198
+ // // yearChangeHook()
199
+ // // } else {
200
+ // // picker.clear()
201
+ // // }
202
+
203
+ // // const fields = e.target.querySelectorAll('select, input, textarea')
204
+
205
+ // // // Prevent year and month dropdowns from being reset
206
+ // // fields.forEach((field) => {
207
+ // // if (field == picker.monthsDropdownContainer || field == dropdown || field == picker.input){
208
+ // // // console.log(field)
209
+ // // return
210
+ // // } else {
211
+ // // field.value = field.defaultValue
212
+ // // }
213
+ // // })
214
+ // // debugger
215
+ // // setTimeout(() => {
216
+ // // dropdown.value = picker.currentYear
217
+ // // picker.monthsDropdownContainer.value = picker.currentMonth
218
+ // // console.log(picker)
219
+ // // debugger
220
+ // // }, 10)
221
+ // })
158
222
  }
159
223
 
160
224
  // two way binding
@@ -30,7 +30,7 @@
30
30
  <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
31
31
  <%= form.text_field :example_text_field, props: { label: true } %>
32
32
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
33
- <%= form.date_picker :test_id, props: { label: true }%>
33
+ <%= form.date_picker :test_id, props: { label: true, default_date: "10/02/1993" }%>
34
34
 
35
35
  <%= form.actions do |action| %>
36
36
  <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Playbook
3
- VERSION = "7.0.0.pre.alpha13"
3
+ VERSION = "7.0.0.pre.alpha14"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0.pre.alpha13
4
+ version: 7.0.0.pre.alpha14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX