UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

45 lines (44 loc) 1.11 kB
"use client"; import { createSlice as l } from "../../../@reduxjs/toolkit/dist/redux-toolkit.modern.js"; import { current as t, castDraft as d } from "../../../immer/dist/immer.js"; var n = { settings: { layout: "horizontal", align: "center", verticalAlign: "middle" }, size: { width: 0, height: 0 }, payload: [] }, g = l({ name: "legend", initialState: n, reducers: { setLegendSize(e, a) { e.size.width = a.payload.width, e.size.height = a.payload.height; }, setLegendSettings(e, a) { e.settings.align = a.payload.align, e.settings.layout = a.payload.layout, e.settings.verticalAlign = a.payload.verticalAlign; }, addLegendPayload(e, a) { e.payload.push(d(a.payload)); }, removeLegendPayload(e, a) { var i = t(e).payload.indexOf(d(a.payload)); i > -1 && e.payload.splice(i, 1); } } }), { setLegendSize: s, setLegendSettings: y, addLegendPayload: p, removeLegendPayload: h } = g.actions; export { p as addLegendPayload, h as removeLegendPayload, y as setLegendSettings, s as setLegendSize };