maquina-components 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/app/assets/stylesheets/calendar.css +222 -0
- data/app/assets/stylesheets/date_picker.css +172 -0
- data/app/assets/tailwind/maquina_components_engine/engine.css +16 -16
- data/app/helpers/maquina_components/calendar_helper.rb +196 -0
- data/app/helpers/maquina_components/icons_helper.rb +220 -0
- data/app/helpers/maquina_components/table_helper.rb +9 -10
- data/app/javascript/controllers/calendar_controller.js +394 -0
- data/app/javascript/controllers/date_picker_controller.js +261 -0
- data/app/views/components/_calendar.html.erb +121 -0
- data/app/views/components/_date_picker.html.erb +102 -0
- data/app/views/components/calendar/_header.html.erb +22 -0
- data/app/views/components/calendar/_week.html.erb +53 -0
- data/lib/maquina_components/version.rb +1 -1
- metadata +10 -1
|
@@ -140,6 +140,12 @@ module MaquinaComponents
|
|
|
140
140
|
<path d="m9 18 6-6-6-6"/>
|
|
141
141
|
</svg>
|
|
142
142
|
SVG
|
|
143
|
+
when :chevron_left
|
|
144
|
+
<<~SVG.freeze
|
|
145
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
146
|
+
<path d="m15 18-6-6 6-6"/>
|
|
147
|
+
</svg>
|
|
148
|
+
SVG
|
|
143
149
|
when :left_panel
|
|
144
150
|
<<~SVG.freeze
|
|
145
151
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
@@ -155,6 +161,220 @@ module MaquinaComponents
|
|
|
155
161
|
<circle cx="5" cy="12" r="1"/>
|
|
156
162
|
</svg>
|
|
157
163
|
SVG
|
|
164
|
+
when :calendar
|
|
165
|
+
<<~SVG.freeze
|
|
166
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
167
|
+
<path d="M8 2v4"/>
|
|
168
|
+
<path d="M16 2v4"/>
|
|
169
|
+
<rect width="18" height="18" x="3" y="4" rx="2"/>
|
|
170
|
+
<path d="M3 10h18"/>
|
|
171
|
+
</svg>
|
|
172
|
+
SVG
|
|
173
|
+
when :info
|
|
174
|
+
<<~SVG.freeze
|
|
175
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
176
|
+
<circle cx="12" cy="12" r="10"/>
|
|
177
|
+
<path d="M12 16v-4"/>
|
|
178
|
+
<path d="M12 8h.01"/>
|
|
179
|
+
</svg>
|
|
180
|
+
SVG
|
|
181
|
+
when :triangle_alert
|
|
182
|
+
<<~SVG.freeze
|
|
183
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
184
|
+
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/>
|
|
185
|
+
<path d="M12 9v4"/>
|
|
186
|
+
<path d="M12 17h.01"/>
|
|
187
|
+
</svg>
|
|
188
|
+
SVG
|
|
189
|
+
when :check_circle
|
|
190
|
+
<<~SVG.freeze
|
|
191
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
192
|
+
<circle cx="12" cy="12" r="10"/>
|
|
193
|
+
<path d="m9 12 2 2 4-4"/>
|
|
194
|
+
</svg>
|
|
195
|
+
SVG
|
|
196
|
+
when :arrow_right
|
|
197
|
+
<<~SVG.freeze
|
|
198
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
199
|
+
<path d="M5 12h14"/>
|
|
200
|
+
<path d="m12 5 7 7-7 7"/>
|
|
201
|
+
</svg>
|
|
202
|
+
SVG
|
|
203
|
+
when :slash
|
|
204
|
+
<<~SVG.freeze
|
|
205
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
206
|
+
<path d="M22 2 2 22"/>
|
|
207
|
+
</svg>
|
|
208
|
+
SVG
|
|
209
|
+
when :inbox
|
|
210
|
+
<<~SVG.freeze
|
|
211
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
212
|
+
<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/>
|
|
213
|
+
<path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>
|
|
214
|
+
</svg>
|
|
215
|
+
SVG
|
|
216
|
+
when :folder
|
|
217
|
+
<<~SVG.freeze
|
|
218
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
219
|
+
<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>
|
|
220
|
+
</svg>
|
|
221
|
+
SVG
|
|
222
|
+
when :search
|
|
223
|
+
<<~SVG.freeze
|
|
224
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
225
|
+
<circle cx="11" cy="11" r="8"/>
|
|
226
|
+
<path d="m21 21-4.3-4.3"/>
|
|
227
|
+
</svg>
|
|
228
|
+
SVG
|
|
229
|
+
when :upload
|
|
230
|
+
<<~SVG.freeze
|
|
231
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
232
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
233
|
+
<polyline points="17 8 12 3 7 8"/>
|
|
234
|
+
<line x1="12" x2="12" y1="3" y2="15"/>
|
|
235
|
+
</svg>
|
|
236
|
+
SVG
|
|
237
|
+
when :user
|
|
238
|
+
<<~SVG.freeze
|
|
239
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
240
|
+
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
|
|
241
|
+
<circle cx="12" cy="7" r="4"/>
|
|
242
|
+
</svg>
|
|
243
|
+
SVG
|
|
244
|
+
when :log_out
|
|
245
|
+
<<~SVG.freeze
|
|
246
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
247
|
+
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/>
|
|
248
|
+
<polyline points="16 17 21 12 16 7"/>
|
|
249
|
+
<line x1="21" x2="9" y1="12" y2="12"/>
|
|
250
|
+
</svg>
|
|
251
|
+
SVG
|
|
252
|
+
when :more_horizontal
|
|
253
|
+
<<~SVG.freeze
|
|
254
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
255
|
+
<circle cx="12" cy="12" r="1"/>
|
|
256
|
+
<circle cx="19" cy="12" r="1"/>
|
|
257
|
+
<circle cx="5" cy="12" r="1"/>
|
|
258
|
+
</svg>
|
|
259
|
+
SVG
|
|
260
|
+
when :settings
|
|
261
|
+
<<~SVG.freeze
|
|
262
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
263
|
+
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
|
|
264
|
+
<circle cx="12" cy="12" r="3"/>
|
|
265
|
+
</svg>
|
|
266
|
+
SVG
|
|
267
|
+
when :mail
|
|
268
|
+
<<~SVG.freeze
|
|
269
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
270
|
+
<rect width="20" height="16" x="2" y="4" rx="2"/>
|
|
271
|
+
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>
|
|
272
|
+
</svg>
|
|
273
|
+
SVG
|
|
274
|
+
when :download
|
|
275
|
+
<<~SVG.freeze
|
|
276
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
277
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
278
|
+
<polyline points="7 10 12 15 17 10"/>
|
|
279
|
+
<line x1="12" x2="12" y1="15" y2="3"/>
|
|
280
|
+
</svg>
|
|
281
|
+
SVG
|
|
282
|
+
when :trash
|
|
283
|
+
<<~SVG.freeze
|
|
284
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
285
|
+
<path d="M3 6h18"/>
|
|
286
|
+
<path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
|
|
287
|
+
<path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
|
|
288
|
+
</svg>
|
|
289
|
+
SVG
|
|
290
|
+
when :pencil
|
|
291
|
+
<<~SVG.freeze
|
|
292
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
293
|
+
<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/>
|
|
294
|
+
<path d="m15 5 4 4"/>
|
|
295
|
+
</svg>
|
|
296
|
+
SVG
|
|
297
|
+
when :home
|
|
298
|
+
<<~SVG.freeze
|
|
299
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
300
|
+
<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/>
|
|
301
|
+
<path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
|
|
302
|
+
</svg>
|
|
303
|
+
SVG
|
|
304
|
+
when :layout_dashboard
|
|
305
|
+
<<~SVG.freeze
|
|
306
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
307
|
+
<rect width="7" height="9" x="3" y="3" rx="1"/>
|
|
308
|
+
<rect width="7" height="5" x="14" y="3" rx="1"/>
|
|
309
|
+
<rect width="7" height="9" x="14" y="12" rx="1"/>
|
|
310
|
+
<rect width="7" height="5" x="3" y="16" rx="1"/>
|
|
311
|
+
</svg>
|
|
312
|
+
SVG
|
|
313
|
+
when :align_left
|
|
314
|
+
<<~SVG.freeze
|
|
315
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
316
|
+
<line x1="21" x2="3" y1="6" y2="6"/>
|
|
317
|
+
<line x1="15" x2="3" y1="12" y2="12"/>
|
|
318
|
+
<line x1="17" x2="3" y1="18" y2="18"/>
|
|
319
|
+
</svg>
|
|
320
|
+
SVG
|
|
321
|
+
when :align_center
|
|
322
|
+
<<~SVG.freeze
|
|
323
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
324
|
+
<line x1="21" x2="3" y1="6" y2="6"/>
|
|
325
|
+
<line x1="17" x2="7" y1="12" y2="12"/>
|
|
326
|
+
<line x1="19" x2="5" y1="18" y2="18"/>
|
|
327
|
+
</svg>
|
|
328
|
+
SVG
|
|
329
|
+
when :align_right
|
|
330
|
+
<<~SVG.freeze
|
|
331
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
332
|
+
<line x1="21" x2="3" y1="6" y2="6"/>
|
|
333
|
+
<line x1="21" x2="9" y1="12" y2="12"/>
|
|
334
|
+
<line x1="21" x2="7" y1="18" y2="18"/>
|
|
335
|
+
</svg>
|
|
336
|
+
SVG
|
|
337
|
+
when :bold
|
|
338
|
+
<<~SVG.freeze
|
|
339
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
340
|
+
<path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"/>
|
|
341
|
+
</svg>
|
|
342
|
+
SVG
|
|
343
|
+
when :italic
|
|
344
|
+
<<~SVG.freeze
|
|
345
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
346
|
+
<line x1="19" x2="10" y1="4" y2="4"/>
|
|
347
|
+
<line x1="14" x2="5" y1="20" y2="20"/>
|
|
348
|
+
<line x1="15" x2="9" y1="4" y2="20"/>
|
|
349
|
+
</svg>
|
|
350
|
+
SVG
|
|
351
|
+
when :underline
|
|
352
|
+
<<~SVG.freeze
|
|
353
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
354
|
+
<path d="M6 4v6a6 6 0 0 0 12 0V4"/>
|
|
355
|
+
<line x1="4" x2="20" y1="20" y2="20"/>
|
|
356
|
+
</svg>
|
|
357
|
+
SVG
|
|
358
|
+
when :list
|
|
359
|
+
<<~SVG.freeze
|
|
360
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
361
|
+
<line x1="8" x2="21" y1="6" y2="6"/>
|
|
362
|
+
<line x1="8" x2="21" y1="12" y2="12"/>
|
|
363
|
+
<line x1="8" x2="21" y1="18" y2="18"/>
|
|
364
|
+
<line x1="3" x2="3.01" y1="6" y2="6"/>
|
|
365
|
+
<line x1="3" x2="3.01" y1="12" y2="12"/>
|
|
366
|
+
<line x1="3" x2="3.01" y1="18" y2="18"/>
|
|
367
|
+
</svg>
|
|
368
|
+
SVG
|
|
369
|
+
when :grid
|
|
370
|
+
<<~SVG.freeze
|
|
371
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
372
|
+
<rect width="7" height="7" x="3" y="3" rx="1"/>
|
|
373
|
+
<rect width="7" height="7" x="14" y="3" rx="1"/>
|
|
374
|
+
<rect width="7" height="7" x="14" y="14" rx="1"/>
|
|
375
|
+
<rect width="7" height="7" x="3" y="14" rx="1"/>
|
|
376
|
+
</svg>
|
|
377
|
+
SVG
|
|
158
378
|
end
|
|
159
379
|
end
|
|
160
380
|
end
|
|
@@ -60,7 +60,7 @@ module MaquinaComponents
|
|
|
60
60
|
# @param variant [Symbol, nil] Table variant (:striped)
|
|
61
61
|
# @return [Hash] Data attributes hash
|
|
62
62
|
def table_data_attrs(variant: nil)
|
|
63
|
-
attrs = {
|
|
63
|
+
attrs = {data: {component: "table"}}
|
|
64
64
|
attrs[:data][:variant] = variant.to_s if variant
|
|
65
65
|
attrs
|
|
66
66
|
end
|
|
@@ -70,7 +70,7 @@ module MaquinaComponents
|
|
|
70
70
|
# @param variant [Symbol, nil] Container variant (:bordered)
|
|
71
71
|
# @return [Hash] Data attributes hash
|
|
72
72
|
def table_container_data_attrs(variant: nil)
|
|
73
|
-
attrs = {
|
|
73
|
+
attrs = {data: {table_part: "container"}}
|
|
74
74
|
attrs[:data][:variant] = variant.to_s if variant
|
|
75
75
|
attrs
|
|
76
76
|
end
|
|
@@ -80,7 +80,7 @@ module MaquinaComponents
|
|
|
80
80
|
# @param selected [Boolean] Whether the row is selected
|
|
81
81
|
# @return [Hash] Data attributes hash
|
|
82
82
|
def table_row_data_attrs(selected: false)
|
|
83
|
-
attrs = {
|
|
83
|
+
attrs = {data: {table_part: "row"}}
|
|
84
84
|
attrs[:data][:state] = "selected" if selected
|
|
85
85
|
attrs
|
|
86
86
|
end
|
|
@@ -90,7 +90,7 @@ module MaquinaComponents
|
|
|
90
90
|
# @param sticky [Boolean] Whether the header is sticky
|
|
91
91
|
# @return [Hash] Data attributes hash
|
|
92
92
|
def table_header_data_attrs(sticky: false)
|
|
93
|
-
attrs = {
|
|
93
|
+
attrs = {data: {table_part: "header"}}
|
|
94
94
|
attrs[:data][:sticky] = "true" if sticky
|
|
95
95
|
attrs
|
|
96
96
|
end
|
|
@@ -98,7 +98,7 @@ module MaquinaComponents
|
|
|
98
98
|
# Generate data attributes for table head cell
|
|
99
99
|
# @return [Hash] Data attributes hash
|
|
100
100
|
def table_head_data_attrs
|
|
101
|
-
{
|
|
101
|
+
{data: {table_part: "head"}}
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
# Generate data attributes for table cell
|
|
@@ -106,7 +106,7 @@ module MaquinaComponents
|
|
|
106
106
|
# @param empty [Boolean] Whether this is an empty state cell
|
|
107
107
|
# @return [Hash] Data attributes hash
|
|
108
108
|
def table_cell_data_attrs(empty: false)
|
|
109
|
-
attrs = {
|
|
109
|
+
attrs = {data: {table_part: "cell"}}
|
|
110
110
|
attrs[:data][:empty] = "true" if empty
|
|
111
111
|
attrs
|
|
112
112
|
end
|
|
@@ -114,19 +114,19 @@ module MaquinaComponents
|
|
|
114
114
|
# Generate data attributes for table body
|
|
115
115
|
# @return [Hash] Data attributes hash
|
|
116
116
|
def table_body_data_attrs
|
|
117
|
-
{
|
|
117
|
+
{data: {table_part: "body"}}
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
# Generate data attributes for table footer
|
|
121
121
|
# @return [Hash] Data attributes hash
|
|
122
122
|
def table_footer_data_attrs
|
|
123
|
-
{
|
|
123
|
+
{data: {table_part: "footer"}}
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
# Generate data attributes for table caption
|
|
127
127
|
# @return [Hash] Data attributes hash
|
|
128
128
|
def table_caption_data_attrs
|
|
129
|
-
{
|
|
129
|
+
{data: {table_part: "caption"}}
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
# Convert alignment symbol to CSS class
|
|
@@ -137,7 +137,6 @@ module MaquinaComponents
|
|
|
137
137
|
case align&.to_sym
|
|
138
138
|
when :right then "text-right"
|
|
139
139
|
when :center then "text-center"
|
|
140
|
-
else nil
|
|
141
140
|
end
|
|
142
141
|
end
|
|
143
142
|
end
|