@0001-labs/design-system-1 0.3.0-alpha.28 → 0.3.0
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/DS1/0-face/button-label.ts +28 -0
- package/DS1/0-face/calendar.ts +6 -4
- package/DS1/0-face/carousel.ts +70 -0
- package/DS1/0-face/constraint-panel.ts +422 -0
- package/DS1/0-face/constraint-site.ts +200 -0
- package/DS1/0-face/constraints.ts +281 -0
- package/DS1/0-face/copy-text.ts +1 -1
- package/DS1/0-face/cut-fade.ts +312 -0
- package/DS1/0-face/define.ts +30 -2
- package/DS1/0-face/face-correction.ts +96 -0
- package/DS1/0-face/failures.ts +32 -0
- package/DS1/0-face/feedback-overlays.ts +5 -3
- package/DS1/0-face/feedback.ts +3 -0
- package/DS1/0-face/focus-vision.swift +31 -0
- package/DS1/0-face/focus.ts +181 -0
- package/DS1/0-face/google-face-metrics.json +102 -0
- package/DS1/0-face/grid.ts +61 -4
- package/DS1/0-face/i18n.ts +36 -18
- package/DS1/0-face/layout-inspector.ts +124 -98
- package/DS1/0-face/preference-options.ts +4 -0
- package/DS1/0-face/scaling.ts +21 -3
- package/DS1/0-face/shape.ts +43 -0
- package/DS1/0-face/text-contrast.ts +164 -0
- package/DS1/0-face/theme-bootstrap.js +43 -0
- package/DS1/0-face/toast-queue.ts +7 -1
- package/DS1/0-face/translations/da.json +10 -1
- package/DS1/0-face/translations/de.json +10 -1
- package/DS1/0-face/translations/en.json +10 -1
- package/DS1/0-face/translations/es.json +10 -1
- package/DS1/0-face/translations/fi.json +10 -1
- package/DS1/0-face/translations/fr.json +10 -1
- package/DS1/0-face/translations/is.json +10 -1
- package/DS1/0-face/translations/it.json +10 -1
- package/DS1/0-face/translations/ja.json +10 -1
- package/DS1/0-face/translations/ko.json +10 -1
- package/DS1/0-face/translations/nb.json +10 -1
- package/DS1/0-face/translations/pt-BR.json +10 -1
- package/DS1/0-face/translations/pt.json +10 -1
- package/DS1/0-face/translations/sv.json +10 -1
- package/DS1/0-face/translations/zh.json +10 -1
- package/DS1/0-face/word-wrap.ts +113 -0
- package/DS1/1-root/card.css +47 -20
- package/DS1/1-root/carousel.css +7 -0
- package/DS1/1-root/cjk.css +1 -1
- package/DS1/1-root/component-tokens.css +3 -2
- package/DS1/1-root/context.css +44 -6
- package/DS1/1-root/controls.css +99 -8
- package/DS1/1-root/document.css +9 -1
- package/DS1/1-root/empty.css +46 -5
- package/DS1/1-root/figures.css +50 -3
- package/DS1/1-root/fonts.css +1 -1
- package/DS1/1-root/footer.css +147 -16
- package/DS1/1-root/foundation.ts +60 -0
- package/DS1/1-root/guide.css +35 -0
- package/DS1/1-root/header.css +30 -9
- package/DS1/1-root/material.css +67 -0
- package/DS1/1-root/notice.css +10 -2
- package/DS1/1-root/one.css +14 -7
- package/DS1/1-root/progress.css +9 -1
- package/DS1/1-root/row.css +68 -2
- package/DS1/1-root/table.css +47 -4
- package/DS1/1-root/text.css +26 -0
- package/DS1/2-core/button-split.ts +10 -5
- package/DS1/2-core/chart/chart.css +71 -2
- package/DS1/2-core/chart/grid-chart.ts +2 -1
- package/DS1/2-core/ds-activity.ts +32 -0
- package/DS1/2-core/ds-app-chrome.ts +1 -0
- package/DS1/2-core/ds-avatar.ts +35 -6
- package/DS1/2-core/ds-badge.ts +8 -1
- package/DS1/2-core/ds-button.ts +7 -1
- package/DS1/2-core/ds-chart.ts +184 -49
- package/DS1/2-core/ds-cycle.ts +27 -186
- package/DS1/2-core/ds-device-bezel.ts +1 -0
- package/DS1/2-core/ds-empty.ts +6 -4
- package/DS1/2-core/ds-input.ts +23 -3
- package/DS1/2-core/ds-message.ts +22 -0
- package/DS1/2-core/ds-number.ts +349 -0
- package/DS1/2-core/ds-progress.ts +3 -0
- package/DS1/2-core/ds-radio.ts +3 -0
- package/DS1/2-core/ds-stat.ts +3 -0
- package/DS1/2-core/ds-switch.ts +5 -1
- package/DS1/2-core/ds-tag.ts +9 -2
- package/DS1/2-core/ds-text.ts +7 -0
- package/DS1/2-core/ds-token.ts +3 -0
- package/DS1/2-core/ds-tooltip.ts +17 -2
- package/DS1/2-core/ds-window.ts +1 -0
- package/DS1/2-core/generated/ds-icon-map.ts +47 -5
- package/DS1/2-core/generated/icons-extra.ts +24 -3
- package/DS1/2-core/generated/icons-immediate.ts +3 -3
- package/DS1/2-core/number-expression.ts +64 -0
- package/DS1/2-core/styles/ds-activity.css +16 -0
- package/DS1/2-core/styles/ds-badge.css +4 -1
- package/DS1/2-core/styles/ds-button-host.css +45 -12
- package/DS1/2-core/styles/ds-button-split.css +8 -0
- package/DS1/2-core/styles/ds-button.css +92 -19
- package/DS1/2-core/styles/ds-card.css +6 -0
- package/DS1/2-core/styles/ds-checkbox.css +20 -8
- package/DS1/2-core/styles/ds-image.css +2 -1
- package/DS1/2-core/styles/ds-input.css +37 -4
- package/DS1/2-core/styles/ds-number.css +127 -0
- package/DS1/2-core/styles/ds-radio.css +4 -1
- package/DS1/2-core/styles/ds-switch.css +34 -4
- package/DS1/2-core/styles/ds-tag.css +32 -5
- package/DS1/2-core/styles/ds-text.css +13 -4
- package/DS1/2-core/styles/ds-token.css +4 -1
- package/DS1/2-core/styles/ds-tooltip.css +13 -7
- package/DS1/3-unit/calendar-base.ts +5 -2
- package/DS1/3-unit/ds-calendar.ts +711 -37
- package/DS1/3-unit/ds-carousel.ts +13 -1
- package/DS1/3-unit/ds-context.ts +40 -2
- package/DS1/3-unit/ds-form.ts +45 -10
- package/DS1/3-unit/ds-list.ts +31 -3
- package/DS1/3-unit/ds-matrix.ts +3 -0
- package/DS1/3-unit/ds-menu.ts +9 -5
- package/DS1/3-unit/ds-row.ts +17 -2
- package/DS1/3-unit/ds-select.ts +1 -1
- package/DS1/3-unit/ds-sidebar.ts +18 -3
- package/DS1/3-unit/ds-table-of-contents.ts +166 -0
- package/DS1/3-unit/ds-tabs.ts +40 -2
- package/DS1/3-unit/styles/ds-calendar.css +356 -42
- package/DS1/3-unit/styles/ds-context.css +38 -0
- package/DS1/3-unit/styles/ds-list.css +26 -1
- package/DS1/3-unit/styles/ds-matrix.css +4 -1
- package/DS1/3-unit/styles/ds-row.css +39 -0
- package/DS1/3-unit/styles/ds-select.css +22 -12
- package/DS1/3-unit/styles/ds-sidebar.css +16 -2
- package/DS1/3-unit/styles/ds-table-of-contents.css +40 -0
- package/DS1/3-unit/styles/ds-tabs.css +95 -0
- package/DS1/4-page/ds-document.ts +3 -0
- package/DS1/4-page/ds-footer.ts +93 -18
- package/DS1/4-page/ds-header.ts +5 -1
- package/DS1/4-page/ds-overlay.ts +8 -3
- package/DS1/4-page/ds-page.ts +22 -1
- package/DS1/4-page/email.ts +7 -4
- package/DS1/4-page/styles/ds-container.css +0 -1
- package/DS1/4-page/styles/ds-overlay.css +7 -0
- package/DS1/4-page/styles/ds-page.css +10 -0
- package/DS1/5-visual-kit/app-chrome.ts +129 -0
- package/DS1/5-visual-kit/bezels.ts +394 -0
- package/DS1/5-visual-kit/browser-icons.LICENSE +53 -0
- package/DS1/5-visual-kit/browser-icons.ts +47 -0
- package/DS1/5-visual-kit/browser-styles.ts +53 -0
- package/DS1/5-visual-kit/device-bezel.ts +55 -0
- package/DS1/5-visual-kit/instagram-frame.ts +15 -0
- package/DS1/5-visual-kit/instagram.ts +41 -0
- package/DS1/5-visual-kit/mobile-chrome.ts +25 -0
- package/DS1/5-visual-kit/native-icon-paths.ts +145 -0
- package/DS1/5-visual-kit/window.ts +22 -0
- package/DS1/components.ts +1 -0
- package/DS1/index.ts +14 -1
- package/DS1/react/choice.ts +4 -2
- package/DS1/react/context.ts +11 -6
- package/DS1/react/empty.ts +2 -2
- package/DS1/react/footer.ts +5 -5
- package/DS1/react/header.ts +1 -1
- package/DS1/react/message.ts +4 -2
- package/DS1/react/number.ts +53 -0
- package/DS1/react/sidebar.ts +4 -2
- package/DS1/react/table-of-contents.ts +28 -0
- package/DS1/x-flag/LICENSE.md +26 -0
- package/DS1/x-flag/ac.svg +1 -0
- package/DS1/x-flag/ad.svg +1 -0
- package/DS1/x-flag/ae.svg +1 -0
- package/DS1/x-flag/af.svg +1 -0
- package/DS1/x-flag/ag.svg +1 -0
- package/DS1/x-flag/ai.svg +1 -0
- package/DS1/x-flag/al.svg +1 -0
- package/DS1/x-flag/am.svg +1 -0
- package/DS1/x-flag/ao.svg +1 -0
- package/DS1/x-flag/aq.svg +1 -0
- package/DS1/x-flag/ar.svg +1 -0
- package/DS1/x-flag/as.svg +1 -0
- package/DS1/x-flag/at.svg +1 -0
- package/DS1/x-flag/au.svg +1 -0
- package/DS1/x-flag/aw.svg +1 -0
- package/DS1/x-flag/ax.svg +1 -0
- package/DS1/x-flag/az.svg +1 -0
- package/DS1/x-flag/ba.svg +1 -0
- package/DS1/x-flag/bb.svg +1 -0
- package/DS1/x-flag/bd.svg +1 -0
- package/DS1/x-flag/be.svg +1 -0
- package/DS1/x-flag/bf.svg +1 -0
- package/DS1/x-flag/bg.svg +1 -0
- package/DS1/x-flag/bh.svg +1 -0
- package/DS1/x-flag/bi.svg +1 -0
- package/DS1/x-flag/bj.svg +1 -0
- package/DS1/x-flag/bl.svg +1 -0
- package/DS1/x-flag/bm.svg +1 -0
- package/DS1/x-flag/bn.svg +1 -0
- package/DS1/x-flag/bo.svg +1 -0
- package/DS1/x-flag/bq-bo.svg +1 -0
- package/DS1/x-flag/bq-sa.svg +1 -0
- package/DS1/x-flag/bq-se.svg +1 -0
- package/DS1/x-flag/bq.svg +1 -0
- package/DS1/x-flag/br.svg +1 -0
- package/DS1/x-flag/bs.svg +1 -0
- package/DS1/x-flag/bt.svg +1 -0
- package/DS1/x-flag/bv.svg +1 -0
- package/DS1/x-flag/bw.svg +1 -0
- package/DS1/x-flag/by.svg +1 -0
- package/DS1/x-flag/bz.svg +1 -0
- package/DS1/x-flag/ca.svg +1 -0
- package/DS1/x-flag/cc.svg +1 -0
- package/DS1/x-flag/cd.svg +1 -0
- package/DS1/x-flag/cf.svg +1 -0
- package/DS1/x-flag/cg.svg +1 -0
- package/DS1/x-flag/ch.svg +1 -0
- package/DS1/x-flag/ci.svg +1 -0
- package/DS1/x-flag/ck.svg +1 -0
- package/DS1/x-flag/cl.svg +1 -0
- package/DS1/x-flag/cm.svg +1 -0
- package/DS1/x-flag/cn.svg +1 -0
- package/DS1/x-flag/co.svg +1 -0
- package/DS1/x-flag/cr.svg +1 -0
- package/DS1/x-flag/cu.svg +1 -0
- package/DS1/x-flag/cv.svg +1 -0
- package/DS1/x-flag/cw.svg +1 -0
- package/DS1/x-flag/cx.svg +1 -0
- package/DS1/x-flag/cy.svg +1 -0
- package/DS1/x-flag/cz.svg +1 -0
- package/DS1/x-flag/de.svg +1 -0
- package/DS1/x-flag/dj.svg +1 -0
- package/DS1/x-flag/dk.svg +1 -0
- package/DS1/x-flag/dm.svg +1 -0
- package/DS1/x-flag/do.svg +1 -0
- package/DS1/x-flag/dz.svg +1 -0
- package/DS1/x-flag/ec.svg +1 -0
- package/DS1/x-flag/ee.svg +1 -0
- package/DS1/x-flag/eg.svg +1 -0
- package/DS1/x-flag/eh.svg +1 -0
- package/DS1/x-flag/er.svg +1 -0
- package/DS1/x-flag/es-ct.svg +1 -0
- package/DS1/x-flag/es.svg +1 -0
- package/DS1/x-flag/et.svg +1 -0
- package/DS1/x-flag/eu.svg +1 -0
- package/DS1/x-flag/fi.svg +1 -0
- package/DS1/x-flag/fj.svg +1 -0
- package/DS1/x-flag/fk.svg +1 -0
- package/DS1/x-flag/fm.svg +1 -0
- package/DS1/x-flag/fo.svg +1 -0
- package/DS1/x-flag/fr.svg +1 -0
- package/DS1/x-flag/ga.svg +1 -0
- package/DS1/x-flag/gb-eng.svg +1 -0
- package/DS1/x-flag/gb-nir.svg +1 -0
- package/DS1/x-flag/gb-sct.svg +1 -0
- package/DS1/x-flag/gb-wls.svg +1 -0
- package/DS1/x-flag/gb.svg +1 -0
- package/DS1/x-flag/gd.svg +1 -0
- package/DS1/x-flag/ge.svg +1 -0
- package/DS1/x-flag/gf.svg +1 -0
- package/DS1/x-flag/gg.svg +1 -0
- package/DS1/x-flag/gh.svg +1 -0
- package/DS1/x-flag/gi.svg +1 -0
- package/DS1/x-flag/gl.svg +1 -0
- package/DS1/x-flag/gm.svg +1 -0
- package/DS1/x-flag/gn.svg +1 -0
- package/DS1/x-flag/gp.svg +1 -0
- package/DS1/x-flag/gq.svg +1 -0
- package/DS1/x-flag/gr.svg +1 -0
- package/DS1/x-flag/gs.svg +1 -0
- package/DS1/x-flag/gt.svg +1 -0
- package/DS1/x-flag/gu.svg +1 -0
- package/DS1/x-flag/gw.svg +1 -0
- package/DS1/x-flag/gy.svg +1 -0
- package/DS1/x-flag/hk.svg +1 -0
- package/DS1/x-flag/hm.svg +1 -0
- package/DS1/x-flag/hn.svg +1 -0
- package/DS1/x-flag/hr.svg +1 -0
- package/DS1/x-flag/ht.svg +1 -0
- package/DS1/x-flag/hu.svg +1 -0
- package/DS1/x-flag/ic.svg +1 -0
- package/DS1/x-flag/id.svg +1 -0
- package/DS1/x-flag/ie.svg +1 -0
- package/DS1/x-flag/il.svg +1 -0
- package/DS1/x-flag/im.svg +1 -0
- package/DS1/x-flag/in.svg +1 -0
- package/DS1/x-flag/io.svg +1 -0
- package/DS1/x-flag/iq.svg +1 -0
- package/DS1/x-flag/ir.svg +1 -0
- package/DS1/x-flag/is.svg +1 -0
- package/DS1/x-flag/it.svg +1 -0
- package/DS1/x-flag/je.svg +1 -0
- package/DS1/x-flag/jm.svg +1 -0
- package/DS1/x-flag/jo.svg +1 -0
- package/DS1/x-flag/jp.svg +1 -0
- package/DS1/x-flag/ke.svg +1 -0
- package/DS1/x-flag/kg.svg +1 -0
- package/DS1/x-flag/kh.svg +1 -0
- package/DS1/x-flag/ki.svg +1 -0
- package/DS1/x-flag/km.svg +1 -0
- package/DS1/x-flag/kn.svg +1 -0
- package/DS1/x-flag/kp.svg +1 -0
- package/DS1/x-flag/kr.svg +1 -0
- package/DS1/x-flag/kw.svg +1 -0
- package/DS1/x-flag/ky.svg +1 -0
- package/DS1/x-flag/kz.svg +1 -0
- package/DS1/x-flag/la.svg +1 -0
- package/DS1/x-flag/lb.svg +1 -0
- package/DS1/x-flag/lc.svg +1 -0
- package/DS1/x-flag/li.svg +1 -0
- package/DS1/x-flag/lk.svg +1 -0
- package/DS1/x-flag/lr.svg +1 -0
- package/DS1/x-flag/ls.svg +1 -0
- package/DS1/x-flag/lt.svg +1 -0
- package/DS1/x-flag/lu.svg +1 -0
- package/DS1/x-flag/lv.svg +1 -0
- package/DS1/x-flag/ly.svg +1 -0
- package/DS1/x-flag/ma.svg +1 -0
- package/DS1/x-flag/mc.svg +1 -0
- package/DS1/x-flag/md.svg +1 -0
- package/DS1/x-flag/me.svg +1 -0
- package/DS1/x-flag/mf.svg +1 -0
- package/DS1/x-flag/mg.svg +1 -0
- package/DS1/x-flag/mh.svg +1 -0
- package/DS1/x-flag/mk.svg +1 -0
- package/DS1/x-flag/ml.svg +1 -0
- package/DS1/x-flag/mm.svg +1 -0
- package/DS1/x-flag/mn.svg +1 -0
- package/DS1/x-flag/mo.svg +1 -0
- package/DS1/x-flag/mp.svg +1 -0
- package/DS1/x-flag/mq.svg +1 -0
- package/DS1/x-flag/mr.svg +1 -0
- package/DS1/x-flag/ms.svg +1 -0
- package/DS1/x-flag/mt.svg +1 -0
- package/DS1/x-flag/mu.svg +1 -0
- package/DS1/x-flag/mv.svg +1 -0
- package/DS1/x-flag/mw.svg +1 -0
- package/DS1/x-flag/mx.svg +1 -0
- package/DS1/x-flag/my.svg +1 -0
- package/DS1/x-flag/mz.svg +1 -0
- package/DS1/x-flag/na.svg +1 -0
- package/DS1/x-flag/nc.svg +1 -0
- package/DS1/x-flag/ne.svg +1 -0
- package/DS1/x-flag/nf.svg +1 -0
- package/DS1/x-flag/ng.svg +1 -0
- package/DS1/x-flag/ni.svg +1 -0
- package/DS1/x-flag/nl.svg +1 -0
- package/DS1/x-flag/no.svg +1 -0
- package/DS1/x-flag/np.svg +1 -0
- package/DS1/x-flag/nr.svg +1 -0
- package/DS1/x-flag/nu.svg +1 -0
- package/DS1/x-flag/nz.svg +1 -0
- package/DS1/x-flag/om.svg +1 -0
- package/DS1/x-flag/pa.svg +1 -0
- package/DS1/x-flag/pe.svg +1 -0
- package/DS1/x-flag/pf.svg +1 -0
- package/DS1/x-flag/pg.svg +1 -0
- package/DS1/x-flag/ph.svg +1 -0
- package/DS1/x-flag/pk.svg +1 -0
- package/DS1/x-flag/pl.svg +1 -0
- package/DS1/x-flag/pm.svg +1 -0
- package/DS1/x-flag/pn.svg +1 -0
- package/DS1/x-flag/pr.svg +1 -0
- package/DS1/x-flag/ps.svg +1 -0
- package/DS1/x-flag/pt.svg +1 -0
- package/DS1/x-flag/pw.svg +1 -0
- package/DS1/x-flag/py.svg +1 -0
- package/DS1/x-flag/qa.svg +1 -0
- package/DS1/x-flag/re.svg +1 -0
- package/DS1/x-flag/ro.svg +1 -0
- package/DS1/x-flag/rs.svg +1 -0
- package/DS1/x-flag/ru.svg +1 -0
- package/DS1/x-flag/rw.svg +1 -0
- package/DS1/x-flag/sa.svg +1 -0
- package/DS1/x-flag/sb.svg +1 -0
- package/DS1/x-flag/sc.svg +1 -0
- package/DS1/x-flag/sd.svg +1 -0
- package/DS1/x-flag/se.svg +1 -0
- package/DS1/x-flag/sg.svg +1 -0
- package/DS1/x-flag/sh.svg +1 -0
- package/DS1/x-flag/si.svg +1 -0
- package/DS1/x-flag/sj.svg +1 -0
- package/DS1/x-flag/sk.svg +1 -0
- package/DS1/x-flag/sl.svg +1 -0
- package/DS1/x-flag/sm.svg +1 -0
- package/DS1/x-flag/sn.svg +1 -0
- package/DS1/x-flag/so.svg +1 -0
- package/DS1/x-flag/sr.svg +1 -0
- package/DS1/x-flag/ss.svg +1 -0
- package/DS1/x-flag/st.svg +1 -0
- package/DS1/x-flag/sv.svg +1 -0
- package/DS1/x-flag/sx.svg +1 -0
- package/DS1/x-flag/sy.svg +1 -0
- package/DS1/x-flag/sz.svg +1 -0
- package/DS1/x-flag/ta.svg +1 -0
- package/DS1/x-flag/tc.svg +1 -0
- package/DS1/x-flag/td.svg +1 -0
- package/DS1/x-flag/tf.svg +1 -0
- package/DS1/x-flag/tg.svg +1 -0
- package/DS1/x-flag/th.svg +1 -0
- package/DS1/x-flag/tj.svg +1 -0
- package/DS1/x-flag/tk.svg +1 -0
- package/DS1/x-flag/tl.svg +1 -0
- package/DS1/x-flag/tm.svg +1 -0
- package/DS1/x-flag/tn.svg +1 -0
- package/DS1/x-flag/to.svg +1 -0
- package/DS1/x-flag/tr.svg +1 -0
- package/DS1/x-flag/tt.svg +1 -0
- package/DS1/x-flag/tv.svg +1 -0
- package/DS1/x-flag/tw.svg +1 -0
- package/DS1/x-flag/tz.svg +1 -0
- package/DS1/x-flag/ua.svg +1 -0
- package/DS1/x-flag/ug.svg +1 -0
- package/DS1/x-flag/um.svg +1 -0
- package/DS1/x-flag/us.svg +1 -0
- package/DS1/x-flag/uy.svg +1 -0
- package/DS1/x-flag/uz.svg +1 -0
- package/DS1/x-flag/va.svg +1 -0
- package/DS1/x-flag/vc.svg +1 -0
- package/DS1/x-flag/ve.svg +1 -0
- package/DS1/x-flag/vg.svg +1 -0
- package/DS1/x-flag/vi.svg +1 -0
- package/DS1/x-flag/vn.svg +1 -0
- package/DS1/x-flag/vu.svg +1 -0
- package/DS1/x-flag/wf.svg +1 -0
- package/DS1/x-flag/ws.svg +1 -0
- package/DS1/x-flag/xk.svg +1 -0
- package/DS1/x-flag/ye.svg +1 -0
- package/DS1/x-flag/yt.svg +1 -0
- package/DS1/x-flag/za.svg +1 -0
- package/DS1/x-flag/zm.svg +1 -0
- package/DS1/x-flag/zw.svg +1 -0
- package/DS1/x-icon/android.svg +9 -0
- package/DS1/x-icon/arrange-check.svg +1 -1
- package/DS1/x-icon/arrange-page.svg +1 -1
- package/DS1/x-icon/chrome.svg +7 -0
- package/DS1/x-icon/edge-brand.svg +6 -0
- package/DS1/x-icon/firefox.svg +4 -0
- package/DS1/x-icon/health.svg +3 -0
- package/DS1/x-icon/left.svg +2 -3
- package/DS1/x-icon/linux.svg +1 -0
- package/DS1/x-icon/material.svg +1 -0
- package/DS1/x-icon/milestone-planned.svg +3 -0
- package/DS1/x-icon/milestone.svg +3 -0
- package/DS1/x-icon/more.svg +1 -5
- package/DS1/x-icon/network.svg +3 -0
- package/DS1/x-icon/opera.svg +4 -0
- package/DS1/x-icon/prediction.svg +3 -0
- package/DS1/x-icon/priority-high.svg +3 -0
- package/DS1/x-icon/priority-low.svg +3 -0
- package/DS1/x-icon/priority-medium.svg +3 -0
- package/DS1/x-icon/project.svg +3 -0
- package/DS1/x-icon/redo.svg +2 -2
- package/DS1/x-icon/repeat-small.svg +3 -0
- package/DS1/x-icon/safari.svg +4 -0
- package/DS1/x-icon/scaling.svg +3 -0
- package/DS1/x-icon/tabs.svg +4 -0
- package/DS1/x-icon/windows.svg +5 -0
- package/README.md +3 -3
- package/dist/0-face/button-label.d.ts +5 -0
- package/dist/0-face/button-label.d.ts.map +1 -0
- package/dist/0-face/button-label.js +31 -0
- package/dist/0-face/calendar.d.ts +1 -1
- package/dist/0-face/calendar.d.ts.map +1 -1
- package/dist/0-face/calendar.js +6 -3
- package/dist/0-face/carousel.d.ts +9 -0
- package/dist/0-face/carousel.d.ts.map +1 -1
- package/dist/0-face/carousel.js +80 -0
- package/dist/0-face/constraint-panel.d.ts +43 -0
- package/dist/0-face/constraint-panel.d.ts.map +1 -0
- package/dist/0-face/constraint-panel.js +429 -0
- package/dist/0-face/constraint-site.d.ts +72 -0
- package/dist/0-face/constraint-site.d.ts.map +1 -0
- package/dist/0-face/constraint-site.js +185 -0
- package/dist/0-face/constraints.d.ts +47 -0
- package/dist/0-face/constraints.d.ts.map +1 -0
- package/dist/0-face/constraints.js +247 -0
- package/dist/0-face/copy-text.js +1 -1
- package/dist/0-face/cut-fade.d.ts +112 -0
- package/dist/0-face/cut-fade.d.ts.map +1 -0
- package/dist/0-face/cut-fade.js +274 -0
- package/dist/0-face/define.d.ts.map +1 -1
- package/dist/0-face/define.js +24 -3
- package/dist/0-face/face-correction.d.ts +51 -0
- package/dist/0-face/face-correction.d.ts.map +1 -0
- package/dist/0-face/face-correction.js +80 -0
- package/dist/0-face/failures.d.ts +16 -0
- package/dist/0-face/failures.d.ts.map +1 -0
- package/dist/0-face/failures.js +21 -0
- package/dist/0-face/feedback-overlays.d.ts.map +1 -1
- package/dist/0-face/feedback-overlays.js +5 -3
- package/dist/0-face/feedback.d.ts +2 -0
- package/dist/0-face/feedback.d.ts.map +1 -1
- package/dist/0-face/feedback.js +1 -0
- package/dist/0-face/focus.d.ts +71 -0
- package/dist/0-face/focus.d.ts.map +1 -0
- package/dist/0-face/focus.js +196 -0
- package/dist/0-face/grid.d.ts +11 -1
- package/dist/0-face/grid.d.ts.map +1 -1
- package/dist/0-face/grid.js +90 -4
- package/dist/0-face/i18n.d.ts.map +1 -1
- package/dist/0-face/i18n.js +38 -16
- package/dist/0-face/layout-inspector.d.ts +5 -1
- package/dist/0-face/layout-inspector.d.ts.map +1 -1
- package/dist/0-face/layout-inspector.js +130 -104
- package/dist/0-face/preference-options.d.ts +4 -0
- package/dist/0-face/preference-options.d.ts.map +1 -1
- package/dist/0-face/scaling.d.ts +8 -1
- package/dist/0-face/scaling.d.ts.map +1 -1
- package/dist/0-face/scaling.js +19 -2
- package/dist/0-face/shape.d.ts +35 -0
- package/dist/0-face/shape.d.ts.map +1 -0
- package/dist/0-face/shape.js +23 -0
- package/dist/0-face/text-contrast.d.ts +22 -0
- package/dist/0-face/text-contrast.d.ts.map +1 -0
- package/dist/0-face/text-contrast.js +178 -0
- package/dist/0-face/theme-bootstrap.js +56 -0
- package/dist/0-face/toast-queue.d.ts +4 -0
- package/dist/0-face/toast-queue.d.ts.map +1 -1
- package/dist/0-face/toast-queue.js +4 -1
- package/dist/0-face/translations/da.json +10 -1
- package/dist/0-face/translations/de.json +10 -1
- package/dist/0-face/translations/en.json +10 -1
- package/dist/0-face/translations/es.json +10 -1
- package/dist/0-face/translations/fi.json +10 -1
- package/dist/0-face/translations/fr.json +10 -1
- package/dist/0-face/translations/is.json +10 -1
- package/dist/0-face/translations/it.json +10 -1
- package/dist/0-face/translations/ja.json +10 -1
- package/dist/0-face/translations/ko.json +10 -1
- package/dist/0-face/translations/nb.json +10 -1
- package/dist/0-face/translations/pt-BR.json +10 -1
- package/dist/0-face/translations/pt.json +10 -1
- package/dist/0-face/translations/sv.json +10 -1
- package/dist/0-face/translations/zh.json +10 -1
- package/dist/0-face/word-wrap.d.ts +6 -0
- package/dist/0-face/word-wrap.d.ts.map +1 -0
- package/dist/0-face/word-wrap.js +119 -0
- package/dist/1-root/foundation.d.ts +12 -0
- package/dist/1-root/foundation.d.ts.map +1 -0
- package/dist/1-root/foundation.js +59 -0
- package/dist/2-core/button-split.d.ts +1 -0
- package/dist/2-core/button-split.d.ts.map +1 -1
- package/dist/2-core/button-split.js +9 -4
- package/dist/2-core/chart/grid-chart.d.ts +2 -0
- package/dist/2-core/chart/grid-chart.d.ts.map +1 -1
- package/dist/2-core/chart/grid-chart.js +2 -1
- package/dist/2-core/ds-activity.d.ts +25 -0
- package/dist/2-core/ds-activity.d.ts.map +1 -0
- package/dist/2-core/ds-activity.js +28 -0
- package/dist/2-core/ds-app-chrome.d.ts +2 -0
- package/dist/2-core/ds-app-chrome.d.ts.map +1 -0
- package/dist/2-core/ds-app-chrome.js +1 -0
- package/dist/2-core/ds-avatar.d.ts +7 -0
- package/dist/2-core/ds-avatar.d.ts.map +1 -1
- package/dist/2-core/ds-avatar.js +41 -6
- package/dist/2-core/ds-badge.d.ts +7 -1
- package/dist/2-core/ds-badge.d.ts.map +1 -1
- package/dist/2-core/ds-badge.js +8 -1
- package/dist/2-core/ds-button.d.ts +12 -0
- package/dist/2-core/ds-button.d.ts.map +1 -1
- package/dist/2-core/ds-button.js +4 -0
- package/dist/2-core/ds-chart.d.ts +28 -3
- package/dist/2-core/ds-chart.d.ts.map +1 -1
- package/dist/2-core/ds-chart.js +110 -130
- package/dist/2-core/ds-cycle.d.ts +2 -2
- package/dist/2-core/ds-cycle.d.ts.map +1 -1
- package/dist/2-core/ds-cycle.js +36 -171
- package/dist/2-core/ds-device-bezel.d.ts +2 -0
- package/dist/2-core/ds-device-bezel.d.ts.map +1 -0
- package/dist/2-core/ds-device-bezel.js +1 -0
- package/dist/2-core/ds-empty.d.ts +2 -2
- package/dist/2-core/ds-empty.d.ts.map +1 -1
- package/dist/2-core/ds-empty.js +6 -4
- package/dist/2-core/ds-input.d.ts +7 -0
- package/dist/2-core/ds-input.d.ts.map +1 -1
- package/dist/2-core/ds-input.js +23 -3
- package/dist/2-core/ds-message.d.ts +11 -0
- package/dist/2-core/ds-message.d.ts.map +1 -1
- package/dist/2-core/ds-message.js +18 -0
- package/dist/2-core/ds-number.d.ts +86 -0
- package/dist/2-core/ds-number.d.ts.map +1 -0
- package/dist/2-core/ds-number.js +326 -0
- package/dist/2-core/ds-progress.d.ts +3 -0
- package/dist/2-core/ds-progress.d.ts.map +1 -1
- package/dist/2-core/ds-progress.js +3 -0
- package/dist/2-core/ds-radio.d.ts +3 -0
- package/dist/2-core/ds-radio.d.ts.map +1 -1
- package/dist/2-core/ds-radio.js +10 -1
- package/dist/2-core/ds-stat.d.ts +3 -0
- package/dist/2-core/ds-stat.d.ts.map +1 -1
- package/dist/2-core/ds-stat.js +3 -0
- package/dist/2-core/ds-switch.d.ts +14 -1
- package/dist/2-core/ds-switch.d.ts.map +1 -1
- package/dist/2-core/ds-switch.js +3 -1
- package/dist/2-core/ds-tag.d.ts +8 -1
- package/dist/2-core/ds-tag.d.ts.map +1 -1
- package/dist/2-core/ds-tag.js +12 -2
- package/dist/2-core/ds-text.d.ts +7 -0
- package/dist/2-core/ds-text.d.ts.map +1 -1
- package/dist/2-core/ds-text.js +7 -0
- package/dist/2-core/ds-token.d.ts +3 -0
- package/dist/2-core/ds-token.d.ts.map +1 -1
- package/dist/2-core/ds-token.js +3 -0
- package/dist/2-core/ds-tooltip.d.ts.map +1 -1
- package/dist/2-core/ds-tooltip.js +23 -2
- package/dist/2-core/ds-window.d.ts +2 -0
- package/dist/2-core/ds-window.d.ts.map +1 -0
- package/dist/2-core/ds-window.js +1 -0
- package/dist/2-core/generated/ds-icon-map.d.ts +27 -6
- package/dist/2-core/generated/ds-icon-map.d.ts.map +1 -1
- package/dist/2-core/generated/ds-icon-map.js +47 -5
- package/dist/2-core/generated/icons-extra.d.ts.map +1 -1
- package/dist/2-core/generated/icons-extra.js +24 -3
- package/dist/2-core/generated/icons-immediate.d.ts +1 -1
- package/dist/2-core/generated/icons-immediate.d.ts.map +1 -1
- package/dist/2-core/generated/icons-immediate.js +3 -3
- package/dist/2-core/number-expression.d.ts +12 -0
- package/dist/2-core/number-expression.d.ts.map +1 -0
- package/dist/2-core/number-expression.js +82 -0
- package/dist/3-unit/calendar-base.d.ts +5 -0
- package/dist/3-unit/calendar-base.d.ts.map +1 -1
- package/dist/3-unit/calendar-base.js +3 -2
- package/dist/3-unit/ds-calendar.d.ts +197 -4
- package/dist/3-unit/ds-calendar.d.ts.map +1 -1
- package/dist/3-unit/ds-calendar.js +687 -45
- package/dist/3-unit/ds-carousel.d.ts +3 -0
- package/dist/3-unit/ds-carousel.d.ts.map +1 -1
- package/dist/3-unit/ds-carousel.js +13 -1
- package/dist/3-unit/ds-context.d.ts +18 -1
- package/dist/3-unit/ds-context.d.ts.map +1 -1
- package/dist/3-unit/ds-context.js +37 -1
- package/dist/3-unit/ds-form.d.ts +9 -0
- package/dist/3-unit/ds-form.d.ts.map +1 -1
- package/dist/3-unit/ds-form.js +50 -10
- package/dist/3-unit/ds-list.d.ts +20 -1
- package/dist/3-unit/ds-list.d.ts.map +1 -1
- package/dist/3-unit/ds-list.js +31 -3
- package/dist/3-unit/ds-matrix.d.ts +3 -0
- package/dist/3-unit/ds-matrix.d.ts.map +1 -1
- package/dist/3-unit/ds-matrix.js +3 -0
- package/dist/3-unit/ds-menu.d.ts.map +1 -1
- package/dist/3-unit/ds-menu.js +17 -1
- package/dist/3-unit/ds-row.d.ts +13 -0
- package/dist/3-unit/ds-row.d.ts.map +1 -1
- package/dist/3-unit/ds-row.js +15 -2
- package/dist/3-unit/ds-select.js +1 -1
- package/dist/3-unit/ds-sidebar.d.ts +17 -0
- package/dist/3-unit/ds-sidebar.d.ts.map +1 -1
- package/dist/3-unit/ds-sidebar.js +14 -3
- package/dist/3-unit/ds-table-of-contents.d.ts +68 -0
- package/dist/3-unit/ds-table-of-contents.d.ts.map +1 -0
- package/dist/3-unit/ds-table-of-contents.js +190 -0
- package/dist/3-unit/ds-tabs.d.ts +32 -1
- package/dist/3-unit/ds-tabs.d.ts.map +1 -1
- package/dist/3-unit/ds-tabs.js +39 -1
- package/dist/4-page/ds-document.d.ts +3 -0
- package/dist/4-page/ds-document.d.ts.map +1 -1
- package/dist/4-page/ds-document.js +3 -0
- package/dist/4-page/ds-footer.d.ts +47 -7
- package/dist/4-page/ds-footer.d.ts.map +1 -1
- package/dist/4-page/ds-footer.js +58 -14
- package/dist/4-page/ds-header.d.ts +6 -0
- package/dist/4-page/ds-header.d.ts.map +1 -1
- package/dist/4-page/ds-header.js +4 -1
- package/dist/4-page/ds-overlay.d.ts +2 -2
- package/dist/4-page/ds-overlay.d.ts.map +1 -1
- package/dist/4-page/ds-overlay.js +8 -3
- package/dist/4-page/ds-page.d.ts +12 -0
- package/dist/4-page/ds-page.d.ts.map +1 -1
- package/dist/4-page/ds-page.js +19 -1
- package/dist/4-page/email.d.ts +2 -0
- package/dist/4-page/email.d.ts.map +1 -1
- package/dist/4-page/email.js +5 -4
- package/dist/5-visual-kit/app-chrome.d.ts +98 -0
- package/dist/5-visual-kit/app-chrome.d.ts.map +1 -0
- package/dist/5-visual-kit/app-chrome.js +119 -0
- package/dist/5-visual-kit/bezels.d.ts +30 -0
- package/dist/5-visual-kit/bezels.d.ts.map +1 -0
- package/dist/5-visual-kit/bezels.js +388 -0
- package/dist/5-visual-kit/browser-icons.d.ts +5 -0
- package/dist/5-visual-kit/browser-icons.d.ts.map +1 -0
- package/dist/5-visual-kit/browser-icons.js +51 -0
- package/dist/5-visual-kit/browser-styles.d.ts +3 -0
- package/dist/5-visual-kit/browser-styles.d.ts.map +1 -0
- package/dist/5-visual-kit/browser-styles.js +52 -0
- package/dist/5-visual-kit/device-bezel.d.ts +84 -0
- package/dist/5-visual-kit/device-bezel.d.ts.map +1 -0
- package/dist/5-visual-kit/device-bezel.js +56 -0
- package/dist/5-visual-kit/instagram-frame.d.ts +8 -0
- package/dist/5-visual-kit/instagram-frame.d.ts.map +1 -0
- package/dist/5-visual-kit/instagram-frame.js +13 -0
- package/dist/5-visual-kit/instagram.d.ts +18 -0
- package/dist/5-visual-kit/instagram.d.ts.map +1 -0
- package/dist/5-visual-kit/instagram.js +39 -0
- package/dist/5-visual-kit/mobile-chrome.d.ts +4 -0
- package/dist/5-visual-kit/mobile-chrome.d.ts.map +1 -0
- package/dist/5-visual-kit/mobile-chrome.js +24 -0
- package/dist/5-visual-kit/native-icon-paths.d.ts +146 -0
- package/dist/5-visual-kit/native-icon-paths.d.ts.map +1 -0
- package/dist/5-visual-kit/native-icon-paths.js +145 -0
- package/dist/5-visual-kit/window.d.ts +51 -0
- package/dist/5-visual-kit/window.d.ts.map +1 -0
- package/dist/5-visual-kit/window.js +20 -0
- package/dist/browser-icons-BFbS1tIx.js +56 -0
- package/dist/browser-icons-BFbS1tIx.js.map +1 -0
- package/dist/browser-icons-CT8qU77Z.js +48 -0
- package/dist/browser-icons-CT8qU77Z.js.map +1 -0
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +1 -0
- package/dist/design-system-1.bundle.js +5514 -2077
- package/dist/design-system-1.bundle.js.map +1 -1
- package/dist/design-system-1.bundle.min.js +7026 -4628
- package/dist/design-system-1.bundle.min.js.map +1 -1
- package/dist/design-system-1.css +1 -1
- package/dist/feedback.js +197 -167
- package/dist/feedback.js.map +1 -1
- package/dist/{icons-extra-CRxxWFjX.js → icons-extra-BMPvmQPI.js} +25 -4
- package/dist/icons-extra-BMPvmQPI.js.map +1 -0
- package/dist/{icons-extra-H5pqCM_R.js → icons-extra-BfYOw-cR.js} +83 -5
- package/dist/icons-extra-BfYOw-cR.js.map +1 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/instagram-CKofs55A.js +50 -0
- package/dist/instagram-CKofs55A.js.map +1 -0
- package/dist/instagram-CcYf5oiM.js +48 -0
- package/dist/instagram-CcYf5oiM.js.map +1 -0
- package/dist/lit-Ce_uWYM4.js +612 -0
- package/dist/lit-Ce_uWYM4.js.map +1 -0
- package/dist/lit-DGUVm1Ce.js +557 -0
- package/dist/lit-DGUVm1Ce.js.map +1 -0
- package/dist/native-icon-paths-CB9evXBM.js +93 -0
- package/dist/native-icon-paths-CB9evXBM.js.map +1 -0
- package/dist/native-icon-paths-zay-3g_n.js +150 -0
- package/dist/native-icon-paths-zay-3g_n.js.map +1 -0
- package/dist/react/avatar.d.ts +1 -1
- package/dist/react/choice.d.ts +4 -0
- package/dist/react/choice.d.ts.map +1 -1
- package/dist/react/choice.js +2 -2
- package/dist/react/context.d.ts +19 -4
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +4 -4
- package/dist/react/empty.d.ts +2 -2
- package/dist/react/empty.d.ts.map +1 -1
- package/dist/react/empty.js +1 -1
- package/dist/react/footer.d.ts +5 -5
- package/dist/react/footer.d.ts.map +1 -1
- package/dist/react/footer.js +2 -2
- package/dist/react/header.d.ts +2 -2
- package/dist/react/header.d.ts.map +1 -1
- package/dist/react/message.d.ts +4 -0
- package/dist/react/message.d.ts.map +1 -1
- package/dist/react/message.js +2 -2
- package/dist/react/number.d.ts +53 -0
- package/dist/react/number.d.ts.map +1 -0
- package/dist/react/number.js +25 -0
- package/dist/react/page.d.ts +1 -1
- package/dist/react/sidebar.d.ts +4 -0
- package/dist/react/sidebar.d.ts.map +1 -1
- package/dist/react/sidebar.js +2 -2
- package/dist/react/table-of-contents.d.ts +19 -0
- package/dist/react/table-of-contents.d.ts.map +1 -0
- package/dist/react/table-of-contents.js +28 -0
- package/dist/{shared-words-CdMDVtXx.js → shared-words-C5cjxMjZ.js} +151 -16
- package/dist/shared-words-C5cjxMjZ.js.map +1 -0
- package/dist/{shared-words-BtRee8xR.js → shared-words-Cdm7xd-_.js} +163 -28
- package/dist/shared-words-Cdm7xd-_.js.map +1 -0
- package/package.json +23 -12
- package/DS1/3-unit/ds-calendar-large.ts +0 -353
- package/DS1/3-unit/styles/ds-calendar-large.css +0 -178
- package/dist/3-unit/ds-calendar-large.d.ts +0 -142
- package/dist/3-unit/ds-calendar-large.d.ts.map +0 -1
- package/dist/3-unit/ds-calendar-large.js +0 -308
- package/dist/icons-extra-CRxxWFjX.js.map +0 -1
- package/dist/icons-extra-H5pqCM_R.js.map +0 -1
- package/dist/shared-words-BtRee8xR.js.map +0 -1
- package/dist/shared-words-CdMDVtXx.js.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { LitElement, type PropertyDeclarations, type PropertyValues } from "lit";
|
|
2
|
+
import "./ds-icon";
|
|
3
|
+
/**
|
|
4
|
+
* A number a person sets by hand, in the inspector's way: the value on the field's fill, one control
|
|
5
|
+
* high on the sixteen and a whole number of squares wide (`width`, four by default). Its lead, a short
|
|
6
|
+
* `label` or an `icon` in the title grey, is the handle: dragging it sideways scrubs the value a `step`
|
|
7
|
+
* a pixel (Shift: `big-step`), and a double-click puts back `default`. The arrows step it, Shift by the
|
|
8
|
+
* big step. What is typed is read as arithmetic (`10 + 5`, `(3 − 1) × 4`), and an operator first works
|
|
9
|
+
* on the value already there (`*2`, `/2`, `+10`); Enter takes it, Escape puts the value back.
|
|
10
|
+
*
|
|
11
|
+
* `input` fires as a drag moves the value and `change` when a value is taken (the drag's end, Enter,
|
|
12
|
+
* leaving the field, an arrow). `value` is a number; the field takes part in its form under `name`.
|
|
13
|
+
*
|
|
14
|
+
* `drag="value"` makes the whole field the handle, as a music program's tempo is: press the value and
|
|
15
|
+
* drag up to raise it, a step every three pixels (Shift: the big step); a press without a drag types.
|
|
16
|
+
*/
|
|
17
|
+
export declare class NumberField extends LitElement {
|
|
18
|
+
static formAssociated: boolean;
|
|
19
|
+
static styles: import("lit").CSSResult;
|
|
20
|
+
static properties: PropertyDeclarations;
|
|
21
|
+
value: number;
|
|
22
|
+
min: number | undefined;
|
|
23
|
+
max: number | undefined;
|
|
24
|
+
step: number;
|
|
25
|
+
bigStep: number | undefined;
|
|
26
|
+
places: number | undefined;
|
|
27
|
+
defaultValue: number | undefined;
|
|
28
|
+
label: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
unit: string;
|
|
31
|
+
width: number;
|
|
32
|
+
dragMode: "lead" | "value";
|
|
33
|
+
name: string;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
readonly: boolean;
|
|
36
|
+
ariaLabel: string | null;
|
|
37
|
+
_text: string;
|
|
38
|
+
_editing: boolean;
|
|
39
|
+
_scrubbing: boolean;
|
|
40
|
+
private internals;
|
|
41
|
+
private drag;
|
|
42
|
+
constructor();
|
|
43
|
+
/** The decimals the field keeps: `places`, or as many as `step` has. */
|
|
44
|
+
get decimals(): number;
|
|
45
|
+
focus(options?: FocusOptions): void;
|
|
46
|
+
private get input();
|
|
47
|
+
private get locked();
|
|
48
|
+
/** Kept inside min and max, at the field's decimals. */
|
|
49
|
+
private clamp;
|
|
50
|
+
/** Steps from a value, exactly: 1.03 a step of 0.05 up is 1.08, as typed values keep their own figures. */
|
|
51
|
+
private stepped;
|
|
52
|
+
private emit;
|
|
53
|
+
/** Sets the value as a person did: `input` while it is still moving, `change` once it is taken. */
|
|
54
|
+
private set;
|
|
55
|
+
private commitText;
|
|
56
|
+
private onFocus;
|
|
57
|
+
private onBlur;
|
|
58
|
+
private onKeydown;
|
|
59
|
+
private onText;
|
|
60
|
+
/** Sideways from the lead, a step a pixel; up from the value (`drag="value"`), a step every three. */
|
|
61
|
+
private onLeadDown;
|
|
62
|
+
private onLeadMove;
|
|
63
|
+
private onLeadUp;
|
|
64
|
+
private onLeadCancel;
|
|
65
|
+
private onLeadDouble;
|
|
66
|
+
/** Escape during a drag puts the value back where the drag began. */
|
|
67
|
+
private onWindowKey;
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
disconnectedCallback(): void;
|
|
70
|
+
/** The value as the field writes it. */
|
|
71
|
+
get written(): string;
|
|
72
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
73
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
74
|
+
/** A value outside `min` or `max` (one never set by hand, such as a starting 0 above a min) keeps its form from being sent. */
|
|
75
|
+
private validate;
|
|
76
|
+
checkValidity(): boolean;
|
|
77
|
+
reportValidity(): boolean;
|
|
78
|
+
formResetCallback(): void;
|
|
79
|
+
render(): import("lit").TemplateResult<1>;
|
|
80
|
+
}
|
|
81
|
+
declare global {
|
|
82
|
+
interface HTMLElementTagNameMap {
|
|
83
|
+
"ds-number": NumberField;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=ds-number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-number.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-number.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAA4B,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAI3G,OAAO,WAAW,CAAC;AAQnB;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,cAAc,UAAQ;IAC7B,MAAM,CAAC,MAAM,0BAAqB;IAClC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAoBrC;IAEM,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IAE5B,OAAO,CAAC,SAAS,CAA8E;IAC/F,OAAO,CAAC,IAAI,CAA0G;;IAmBtH,wEAAwE;IACxE,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAI5B,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,MAAM,GAEjB;IAED,wDAAwD;IACxD,OAAO,CAAC,KAAK;IAQb,2GAA2G;IAC3G,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,IAAI;IAIZ,mGAAmG;IACnG,OAAO,CAAC,GAAG;IAOX,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,OAAO,CAIb;IAEF,OAAO,CAAC,MAAM,CAEZ;IAEF,OAAO,CAAC,SAAS,CAoBf;IAEF,OAAO,CAAC,MAAM,CAGZ;IAEF,sGAAsG;IACtG,OAAO,CAAC,UAAU,CAUhB;IAEF,OAAO,CAAC,UAAU,CAehB;IAEF,OAAO,CAAC,QAAQ,CAOd;IAEF,OAAO,CAAC,YAAY,CAMlB;IAEF,OAAO,CAAC,YAAY,CAKlB;IAEF,qEAAqE;IACrE,OAAO,CAAC,WAAW,CAMjB;IAEF,iBAAiB;IAKjB,oBAAoB;IAKpB,wCAAwC;IACxC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;IAIlD,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;IAM/C,+HAA+H;IAC/H,OAAO,CAAC,QAAQ;IAShB,aAAa;IAIb,cAAc;IAId,iBAAiB;IAKjB,MAAM;CAmDP;AAGD,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,WAAW,EAAE,WAAW,CAAA;KAAE;CAAE"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
// ds-number.ts
|
|
2
|
+
// Number field: a value one control high, scrubbed by its lead, stepped by the arrows, typed as arithmetic.
|
|
3
|
+
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
4
|
+
import { live } from "lit/directives/live.js";
|
|
5
|
+
import { define } from "../0-face/define";
|
|
6
|
+
import { formatNumberValue, readNumberExpression, stepPlaces } from "./number-expression";
|
|
7
|
+
import "./ds-icon";
|
|
8
|
+
import styles from "./styles/ds-number.css?inline";
|
|
9
|
+
/** How far the pointer moves before a press becomes a drag. */
|
|
10
|
+
const DRAG_THRESHOLD = 3;
|
|
11
|
+
/** With `drag="value"`, the pixels of upward travel a step takes, as a music program's tempo drags. */
|
|
12
|
+
const VALUE_PIXELS = 3;
|
|
13
|
+
/**
|
|
14
|
+
* A number a person sets by hand, in the inspector's way: the value on the field's fill, one control
|
|
15
|
+
* high on the sixteen and a whole number of squares wide (`width`, four by default). Its lead, a short
|
|
16
|
+
* `label` or an `icon` in the title grey, is the handle: dragging it sideways scrubs the value a `step`
|
|
17
|
+
* a pixel (Shift: `big-step`), and a double-click puts back `default`. The arrows step it, Shift by the
|
|
18
|
+
* big step. What is typed is read as arithmetic (`10 + 5`, `(3 − 1) × 4`), and an operator first works
|
|
19
|
+
* on the value already there (`*2`, `/2`, `+10`); Enter takes it, Escape puts the value back.
|
|
20
|
+
*
|
|
21
|
+
* `input` fires as a drag moves the value and `change` when a value is taken (the drag's end, Enter,
|
|
22
|
+
* leaving the field, an arrow). `value` is a number; the field takes part in its form under `name`.
|
|
23
|
+
*
|
|
24
|
+
* `drag="value"` makes the whole field the handle, as a music program's tempo is: press the value and
|
|
25
|
+
* drag up to raise it, a step every three pixels (Shift: the big step); a press without a drag types.
|
|
26
|
+
*/
|
|
27
|
+
export class NumberField extends LitElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.internals = typeof this.attachInternals === "function" ? this.attachInternals() : null;
|
|
31
|
+
this.drag = null;
|
|
32
|
+
this.onFocus = () => {
|
|
33
|
+
this._editing = true;
|
|
34
|
+
this._text = this.written;
|
|
35
|
+
void this.updateComplete.then(() => this.input?.select());
|
|
36
|
+
};
|
|
37
|
+
this.onBlur = () => {
|
|
38
|
+
if (this._editing)
|
|
39
|
+
this.commitText();
|
|
40
|
+
};
|
|
41
|
+
this.onKeydown = (event) => {
|
|
42
|
+
if (this.locked)
|
|
43
|
+
return;
|
|
44
|
+
if (event.key === "Enter") {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
this.commitText();
|
|
47
|
+
this._editing = true;
|
|
48
|
+
this._text = this.written;
|
|
49
|
+
void this.updateComplete.then(() => this.input?.select());
|
|
50
|
+
}
|
|
51
|
+
else if (event.key === "Escape") {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
this._editing = false;
|
|
54
|
+
this.input?.blur();
|
|
55
|
+
}
|
|
56
|
+
else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
const from = readNumberExpression(this._text, this.value) ?? this.value;
|
|
59
|
+
const size = event.shiftKey ? (this.bigStep ?? this.step * 10) : this.step;
|
|
60
|
+
this.set(this.stepped(from, event.key === "ArrowUp" ? 1 : -1, size), "change");
|
|
61
|
+
this._text = this.written;
|
|
62
|
+
void this.updateComplete.then(() => this.input?.select());
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
this.onText = (event) => {
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
this._text = event.target.value;
|
|
68
|
+
};
|
|
69
|
+
/** Sideways from the lead, a step a pixel; up from the value (`drag="value"`), a step every three. */
|
|
70
|
+
this.onLeadDown = (event) => {
|
|
71
|
+
if (this.locked || event.button !== 0 || this.drag)
|
|
72
|
+
return;
|
|
73
|
+
const vertical = this.dragMode === "value";
|
|
74
|
+
// With the value as the handle, a press on a field already being typed in places the caret.
|
|
75
|
+
if (vertical && this._editing)
|
|
76
|
+
return;
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
event.stopPropagation();
|
|
79
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
80
|
+
if (this._editing)
|
|
81
|
+
this.commitText();
|
|
82
|
+
this.drag = { id: event.pointerId, at: vertical ? -event.clientY : event.clientX, from: this.value, moved: false, rest: 0, vertical };
|
|
83
|
+
};
|
|
84
|
+
this.onLeadMove = (event) => {
|
|
85
|
+
const drag = this.drag;
|
|
86
|
+
if (!drag || drag.id !== event.pointerId)
|
|
87
|
+
return;
|
|
88
|
+
const at = drag.vertical ? -event.clientY : event.clientX;
|
|
89
|
+
if (!drag.moved && Math.abs(at - drag.at) < DRAG_THRESHOLD)
|
|
90
|
+
return;
|
|
91
|
+
if (!drag.moved) {
|
|
92
|
+
drag.moved = true;
|
|
93
|
+
this._scrubbing = true;
|
|
94
|
+
}
|
|
95
|
+
const size = event.shiftKey ? (this.bigStep ?? this.step * 10) : this.step;
|
|
96
|
+
const travel = (at - drag.at) / (drag.vertical ? VALUE_PIXELS : 1) + drag.rest;
|
|
97
|
+
const steps = Math.trunc(travel);
|
|
98
|
+
drag.rest = travel - steps;
|
|
99
|
+
drag.at = at;
|
|
100
|
+
if (steps)
|
|
101
|
+
this.set(this.stepped(this.value, steps, size), "input");
|
|
102
|
+
};
|
|
103
|
+
this.onLeadUp = (event) => {
|
|
104
|
+
const drag = this.drag;
|
|
105
|
+
if (!drag || drag.id !== event.pointerId)
|
|
106
|
+
return;
|
|
107
|
+
this.drag = null;
|
|
108
|
+
this._scrubbing = false;
|
|
109
|
+
if (drag.moved && this.value !== drag.from)
|
|
110
|
+
this.emit("change");
|
|
111
|
+
else if (!drag.moved)
|
|
112
|
+
this.focus();
|
|
113
|
+
};
|
|
114
|
+
this.onLeadCancel = (event) => {
|
|
115
|
+
const drag = this.drag;
|
|
116
|
+
if (!drag || drag.id !== event.pointerId)
|
|
117
|
+
return;
|
|
118
|
+
this.drag = null;
|
|
119
|
+
this._scrubbing = false;
|
|
120
|
+
if (this.value !== drag.from)
|
|
121
|
+
this.set(drag.from, "input");
|
|
122
|
+
};
|
|
123
|
+
this.onLeadDouble = () => {
|
|
124
|
+
if (this.locked || this.defaultValue === undefined)
|
|
125
|
+
return;
|
|
126
|
+
// A double-click on the value began as a press that started typing: leave the typing first.
|
|
127
|
+
if (this._editing) {
|
|
128
|
+
this._editing = false;
|
|
129
|
+
this.input?.blur();
|
|
130
|
+
}
|
|
131
|
+
if (this.value !== this.clamp(this.defaultValue))
|
|
132
|
+
this.set(this.defaultValue, "change");
|
|
133
|
+
};
|
|
134
|
+
/** Escape during a drag puts the value back where the drag began. */
|
|
135
|
+
this.onWindowKey = (event) => {
|
|
136
|
+
if (event.key !== "Escape" || !this.drag)
|
|
137
|
+
return;
|
|
138
|
+
const from = this.drag.from;
|
|
139
|
+
this.drag = null;
|
|
140
|
+
this._scrubbing = false;
|
|
141
|
+
if (this.value !== from)
|
|
142
|
+
this.set(from, "input");
|
|
143
|
+
};
|
|
144
|
+
this.value = 0;
|
|
145
|
+
this.step = 1;
|
|
146
|
+
this.label = "";
|
|
147
|
+
this.icon = "";
|
|
148
|
+
this.unit = "";
|
|
149
|
+
this.width = 4;
|
|
150
|
+
this.dragMode = "lead";
|
|
151
|
+
this.name = "";
|
|
152
|
+
this.disabled = false;
|
|
153
|
+
this.readonly = false;
|
|
154
|
+
this._text = "";
|
|
155
|
+
this._editing = false;
|
|
156
|
+
this._scrubbing = false;
|
|
157
|
+
}
|
|
158
|
+
/** The decimals the field keeps: `places`, or as many as `step` has. */
|
|
159
|
+
get decimals() {
|
|
160
|
+
return this.places ?? stepPlaces(this.step || 1);
|
|
161
|
+
}
|
|
162
|
+
focus(options) {
|
|
163
|
+
this.input?.focus(options);
|
|
164
|
+
}
|
|
165
|
+
get input() {
|
|
166
|
+
return this.renderRoot.querySelector("input");
|
|
167
|
+
}
|
|
168
|
+
get locked() {
|
|
169
|
+
return this.disabled || this.readonly;
|
|
170
|
+
}
|
|
171
|
+
/** Kept inside min and max, at the field's decimals. */
|
|
172
|
+
clamp(value) {
|
|
173
|
+
let next = value;
|
|
174
|
+
if (this.min !== undefined && next < this.min)
|
|
175
|
+
next = this.min;
|
|
176
|
+
if (this.max !== undefined && next > this.max)
|
|
177
|
+
next = this.max;
|
|
178
|
+
const factor = 10 ** this.decimals;
|
|
179
|
+
return Math.round(next * factor) / factor;
|
|
180
|
+
}
|
|
181
|
+
/** Steps from a value, exactly: 1.03 a step of 0.05 up is 1.08, as typed values keep their own figures. */
|
|
182
|
+
stepped(from, steps, size) {
|
|
183
|
+
return this.clamp(from + steps * (size || 1));
|
|
184
|
+
}
|
|
185
|
+
emit(type) {
|
|
186
|
+
this.dispatchEvent(new Event(type, { bubbles: true, composed: true }));
|
|
187
|
+
}
|
|
188
|
+
/** Sets the value as a person did: `input` while it is still moving, `change` once it is taken. */
|
|
189
|
+
set(value, type) {
|
|
190
|
+
const next = this.clamp(value);
|
|
191
|
+
if (next === this.value)
|
|
192
|
+
return;
|
|
193
|
+
this.value = next;
|
|
194
|
+
this.emit(type);
|
|
195
|
+
}
|
|
196
|
+
commitText() {
|
|
197
|
+
const read = readNumberExpression(this._text, this.value);
|
|
198
|
+
this._editing = false;
|
|
199
|
+
if (read === null)
|
|
200
|
+
return this.requestUpdate();
|
|
201
|
+
const before = this.value;
|
|
202
|
+
this.value = this.clamp(read);
|
|
203
|
+
if (this.value !== before)
|
|
204
|
+
this.emit("change");
|
|
205
|
+
}
|
|
206
|
+
connectedCallback() {
|
|
207
|
+
super.connectedCallback();
|
|
208
|
+
window.addEventListener("keydown", this.onWindowKey);
|
|
209
|
+
}
|
|
210
|
+
disconnectedCallback() {
|
|
211
|
+
window.removeEventListener("keydown", this.onWindowKey);
|
|
212
|
+
super.disconnectedCallback();
|
|
213
|
+
}
|
|
214
|
+
/** The value as the field writes it. */
|
|
215
|
+
get written() {
|
|
216
|
+
return formatNumberValue(Number.isFinite(this.value) ? this.value : 0, this.decimals);
|
|
217
|
+
}
|
|
218
|
+
willUpdate(changed) {
|
|
219
|
+
if (changed.has("value") && typeof this.value === "string")
|
|
220
|
+
this.value = Number(this.value);
|
|
221
|
+
}
|
|
222
|
+
updated(changed) {
|
|
223
|
+
if (changed.has("width"))
|
|
224
|
+
this.style.setProperty("--ds-number-squares", String(Math.max(1, Math.round(this.width || 4))));
|
|
225
|
+
if (changed.has("value") || changed.has("disabled"))
|
|
226
|
+
this.internals?.setFormValue(this.disabled ? null : String(this.value));
|
|
227
|
+
this.validate();
|
|
228
|
+
}
|
|
229
|
+
/** A value outside `min` or `max` (one never set by hand, such as a starting 0 above a min) keeps its form from being sent. */
|
|
230
|
+
validate() {
|
|
231
|
+
if (!this.internals?.setValidity)
|
|
232
|
+
return;
|
|
233
|
+
const low = this.min !== undefined && this.value < this.min;
|
|
234
|
+
const high = this.max !== undefined && this.value > this.max;
|
|
235
|
+
const message = low ? `At least ${formatNumberValue(this.min, this.decimals)}` : high ? `At most ${formatNumberValue(this.max, this.decimals)}` : "";
|
|
236
|
+
if (low || high)
|
|
237
|
+
this.internals.setValidity({ rangeUnderflow: low, rangeOverflow: high }, message, this.input ?? undefined);
|
|
238
|
+
else
|
|
239
|
+
this.internals.setValidity({});
|
|
240
|
+
}
|
|
241
|
+
checkValidity() {
|
|
242
|
+
return this.internals?.checkValidity() ?? true;
|
|
243
|
+
}
|
|
244
|
+
reportValidity() {
|
|
245
|
+
return this.internals?.reportValidity() ?? true;
|
|
246
|
+
}
|
|
247
|
+
formResetCallback() {
|
|
248
|
+
const initial = Number(this.getAttribute("value") ?? 0);
|
|
249
|
+
this.value = Number.isFinite(initial) ? initial : 0;
|
|
250
|
+
}
|
|
251
|
+
render() {
|
|
252
|
+
const lead = this.icon
|
|
253
|
+
? html `<ds-icon type=${this.icon} size="large"></ds-icon>`
|
|
254
|
+
: this.label ? html `<span class="lead__words">${this.label}</span>` : nothing;
|
|
255
|
+
const valueText = this.unit ? `${this.written} ${this.unit}` : this.written;
|
|
256
|
+
const handle = this.dragMode === "value";
|
|
257
|
+
return html `<span
|
|
258
|
+
class=${this._scrubbing ? "face scrubbing" : "face"}
|
|
259
|
+
part="face"
|
|
260
|
+
@pointerdown=${handle ? this.onLeadDown : nothing}
|
|
261
|
+
@pointermove=${handle ? this.onLeadMove : nothing}
|
|
262
|
+
@pointerup=${handle ? this.onLeadUp : nothing}
|
|
263
|
+
@pointercancel=${handle ? this.onLeadCancel : nothing}
|
|
264
|
+
@lostpointercapture=${handle ? this.onLeadCancel : nothing}
|
|
265
|
+
@dblclick=${handle ? this.onLeadDouble : nothing}
|
|
266
|
+
>
|
|
267
|
+
${lead === nothing ? nothing : html `<span
|
|
268
|
+
class="lead"
|
|
269
|
+
part="lead"
|
|
270
|
+
aria-hidden="true"
|
|
271
|
+
@pointerdown=${handle ? nothing : this.onLeadDown}
|
|
272
|
+
@pointermove=${handle ? nothing : this.onLeadMove}
|
|
273
|
+
@pointerup=${handle ? nothing : this.onLeadUp}
|
|
274
|
+
@pointercancel=${handle ? nothing : this.onLeadCancel}
|
|
275
|
+
@lostpointercapture=${handle ? nothing : this.onLeadCancel}
|
|
276
|
+
@dblclick=${handle ? nothing : this.onLeadDouble}
|
|
277
|
+
>${lead}</span>`}
|
|
278
|
+
<input
|
|
279
|
+
part="input"
|
|
280
|
+
type="text"
|
|
281
|
+
inputmode="decimal"
|
|
282
|
+
autocomplete="off"
|
|
283
|
+
spellcheck="false"
|
|
284
|
+
role="spinbutton"
|
|
285
|
+
aria-label=${this.ariaLabel || this.label || nothing}
|
|
286
|
+
aria-valuenow=${this.value}
|
|
287
|
+
aria-valuemin=${this.min ?? nothing}
|
|
288
|
+
aria-valuemax=${this.max ?? nothing}
|
|
289
|
+
aria-valuetext=${valueText}
|
|
290
|
+
.value=${live(this._editing ? this._text : this.written)}
|
|
291
|
+
?disabled=${this.disabled}
|
|
292
|
+
?readonly=${this.readonly}
|
|
293
|
+
@focus=${this.onFocus}
|
|
294
|
+
@blur=${this.onBlur}
|
|
295
|
+
@keydown=${this.onKeydown}
|
|
296
|
+
@input=${this.onText}
|
|
297
|
+
@change=${(event) => event.stopPropagation()}
|
|
298
|
+
/>
|
|
299
|
+
${this.unit ? html `<span class="unit" part="unit" aria-hidden="true">${this.unit}</span>` : nothing}
|
|
300
|
+
</span>`;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
NumberField.formAssociated = true;
|
|
304
|
+
NumberField.styles = unsafeCSS(styles);
|
|
305
|
+
NumberField.properties = {
|
|
306
|
+
value: { type: Number },
|
|
307
|
+
min: { type: Number },
|
|
308
|
+
max: { type: Number },
|
|
309
|
+
step: { type: Number },
|
|
310
|
+
bigStep: { type: Number, attribute: "big-step" },
|
|
311
|
+
places: { type: Number },
|
|
312
|
+
defaultValue: { type: Number, attribute: "default" },
|
|
313
|
+
label: { type: String },
|
|
314
|
+
icon: { type: String },
|
|
315
|
+
unit: { type: String },
|
|
316
|
+
width: { type: Number, reflect: true },
|
|
317
|
+
dragMode: { type: String, attribute: "drag", reflect: true },
|
|
318
|
+
name: { type: String, reflect: true },
|
|
319
|
+
disabled: { type: Boolean, reflect: true },
|
|
320
|
+
readonly: { type: Boolean, reflect: true },
|
|
321
|
+
ariaLabel: { type: String, attribute: "aria-label" },
|
|
322
|
+
_text: { state: true },
|
|
323
|
+
_editing: { state: true },
|
|
324
|
+
_scrubbing: { state: true },
|
|
325
|
+
};
|
|
326
|
+
define("ds-number", NumberField);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
2
3
|
import { type FigureFormat, type MeterAria } from "./figures";
|
|
3
4
|
import "./ds-icon";
|
|
4
5
|
/** Where a step stands: before the current one, the current one, after it, or stopped. */
|
|
@@ -138,6 +139,8 @@ export declare class Progress extends LitElement {
|
|
|
138
139
|
};
|
|
139
140
|
};
|
|
140
141
|
static styles: import("lit").CSSResult[];
|
|
142
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
143
|
+
protected readonly cuts: CutFades;
|
|
141
144
|
value: number;
|
|
142
145
|
min: number;
|
|
143
146
|
max: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-progress.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-progress.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAA4B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-progress.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-progress.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAA4B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGhF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACvF,OAAO,WAAW,CAAC;AAQnB,0FAA0F;AAC1F,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAGnE,8GAA8G;AAC9G,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAKhF,gHAAgH;AAChH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,CAO/E;AAED,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACtC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBf;IAEF,MAAM,CAAC,MAAM,4BAAgE;IAC7E,yHAAyH;IACzH,SAAS,CAAC,QAAQ,CAAC,IAAI,WAA2D;IAE1E,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IAEzB,8EAA8E;IAC9E,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;;IAkBtD,iGAAiG;IACjG,IAAI,IAAI,IAAI,YAAY,CAIvB;IAED,iBAAiB;IAOjB,oBAAoB;IAOpB,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,SAAS;IAKjB,sEAAsE;IACtE,OAAO,CAAC,OAAO;IAUf,sEAAsE;IACtE,IAAI,IAAI,IAAI,SAAS,CAKpB;IAED,8DAA8D;IAC9D,IAAI,WAAW,IAAI,MAAM,CAGxB;IAID,mCAAmC;IACnC,IAAI,MAAM,IAAI,SAAS,EAAE,CAExB;IAED,OAAO,CAAC,OAAO;IAMf,kEAAkE;IAClE,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,yCAAyC;IACzC,IAAI,UAAU,IAAI,MAAM,CAGvB;IAED,kGAAkG;IAClG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAW9B,OAAO,CAAC,UAAU;IAYlB,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;IA2BlD,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC;IAO/C,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,WAAW;IA4BnB,OAAO,CAAC,UAAU;IAoBlB,MAAM;CAIP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,QAAQ,CAAC;KACzB;CACF"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
10
10
|
import { getText } from "../0-face/i18n";
|
|
11
11
|
import { define } from "../0-face/define";
|
|
12
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
12
13
|
import { formatNumber } from "../0-face/format";
|
|
13
14
|
import { dotForKey, dotState } from "../0-face/carousel";
|
|
14
15
|
import { figureFormat, meterAria } from "./figures";
|
|
@@ -81,6 +82,8 @@ export function stepStates(steps, current) {
|
|
|
81
82
|
export class Progress extends LitElement {
|
|
82
83
|
constructor() {
|
|
83
84
|
super();
|
|
85
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
86
|
+
this.cuts = new CutFades(this, { selector: ".ds-progress__label" });
|
|
84
87
|
/** The role this element last set, so a role the page wrote is left alone. */
|
|
85
88
|
this.ownRole = null;
|
|
86
89
|
this.focusAfterUpdate = false;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
2
3
|
/** Native radios keep their group, keyboard, labels and form. DS1 owns the face. */
|
|
3
4
|
export declare class Radio extends LitElement {
|
|
4
5
|
static properties: {
|
|
@@ -19,6 +20,8 @@ export declare class Radio extends LitElement {
|
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
static styles: import("lit").CSSResult;
|
|
23
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
24
|
+
protected readonly cuts: CutFades;
|
|
22
25
|
choice: boolean;
|
|
23
26
|
compact: boolean;
|
|
24
27
|
preview: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-radio.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-radio.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,oFAAoF;AACpF,qBAAa,KAAM,SAAQ,UAAU;IACnC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;MAKf;IACF,MAAM,CAAC,MAAM,0BAAqB;IAClC,yHAAyH;IACzH,SAAS,CAAC,QAAQ,CAAC,IAAI,WAA8C;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;;IAEtB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAC5B,MAAM;CAGP;AAED,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,UAAU,EAAE,KAAK,CAAA;KAAE;CAAE"}
|
package/dist/2-core/ds-radio.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
3
4
|
import styles from "./styles/ds-radio.css?inline";
|
|
4
5
|
/** Native radios keep their group, keyboard, labels and form. DS1 owns the face. */
|
|
5
6
|
export class Radio extends LitElement {
|
|
6
|
-
constructor() {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
10
|
+
this.cuts = new CutFades(this, { selector: ".label" });
|
|
11
|
+
this.choice = false;
|
|
12
|
+
this.compact = false;
|
|
13
|
+
this.preview = false;
|
|
14
|
+
this.label = "";
|
|
15
|
+
}
|
|
7
16
|
focus(options) { this.querySelector(":scope > input")?.focus(options); }
|
|
8
17
|
render() {
|
|
9
18
|
return html `<slot></slot>${this.choice ? html `<span class="face" aria-hidden="true">${this.preview ? html `<span class="preview"><slot name="preview"></slot></span>` : null}<span class="label">${this.label}</span></span>` : null}`;
|
package/dist/2-core/ds-stat.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
2
3
|
import { type FigureFormat } from "./figures";
|
|
3
4
|
import "./ds-icon";
|
|
4
5
|
export type StatTone = "danger" | "warning";
|
|
@@ -88,6 +89,8 @@ export declare class Stat extends LitElement {
|
|
|
88
89
|
};
|
|
89
90
|
};
|
|
90
91
|
static styles: import("lit").CSSResult[];
|
|
92
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
93
|
+
protected readonly cuts: CutFades;
|
|
91
94
|
label: string | undefined;
|
|
92
95
|
value: number | undefined;
|
|
93
96
|
figure: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-stat.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-stat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAA4B,MAAM,KAAK,CAAC;AAG3D,OAAO,EAA2C,KAAK,YAAY,EAAsB,MAAM,WAAW,CAAC;AAC3G,OAAO,WAAW,CAAC;AAKnB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBf;IAEF,MAAM,CAAC,MAAM,4BAA+D;
|
|
1
|
+
{"version":3,"file":"ds-stat.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-stat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAA4B,MAAM,KAAK,CAAC;AAG3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAA2C,KAAK,YAAY,EAAsB,MAAM,WAAW,CAAC;AAC3G,OAAO,WAAW,CAAC;AAKnB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBf;IAEF,MAAM,CAAC,MAAM,4BAA+D;IAC5E,yHAAyH;IACzH,SAAS,CAAC,QAAQ,CAAC,IAAI,WAAwD;IAEvE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;;IAWtD,iBAAiB;IAOjB,oBAAoB;IAOpB,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,OAAO;IAIf,uGAAuG;IACvG,IAAI,IAAI,IAAI,MAAM,CAGjB;IAED,kEAAkE;IAClE,IAAI,UAAU,IAAI,MAAM,CAIvB;IAED,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,UAAU;IAMlB,MAAM;CAyBP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
|
package/dist/2-core/ds-stat.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
6
6
|
import { getText } from "../0-face/i18n";
|
|
7
7
|
import { define } from "../0-face/define";
|
|
8
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
8
9
|
import { figureCells, figureFormat, formatFigure } from "./figures";
|
|
9
10
|
import "./ds-icon";
|
|
10
11
|
import metrics from "../1-root/component-metrics.css?inline";
|
|
@@ -41,6 +42,8 @@ const TONES = ["danger", "warning"];
|
|
|
41
42
|
export class Stat extends LitElement {
|
|
42
43
|
constructor() {
|
|
43
44
|
super();
|
|
45
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
46
|
+
this.cuts = new CutFades(this, { selector: ".ds-stat__figure" });
|
|
44
47
|
this.relabel = () => this.requestUpdate();
|
|
45
48
|
this.format = "number";
|
|
46
49
|
this.minor = false;
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/** The switch: a pill with a white round thumb, grey when off and the darker green when on,
|
|
3
|
-
whatever the page's accent. The slotted button retains native activation and refs. */
|
|
3
|
+
whatever the page's accent. Compact and monochrome are opt-in control-panel variants. The slotted button retains native activation and refs. */
|
|
4
4
|
export declare class Switch extends LitElement {
|
|
5
|
+
static properties: {
|
|
6
|
+
compact: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
reflect: boolean;
|
|
9
|
+
};
|
|
10
|
+
monochrome: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
reflect: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
compact: boolean;
|
|
16
|
+
monochrome: boolean;
|
|
17
|
+
constructor();
|
|
5
18
|
static styles: import("lit").CSSResult;
|
|
6
19
|
focus(options?: FocusOptions): void;
|
|
7
20
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-switch.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAIlD;
|
|
1
|
+
{"version":3,"file":"ds-switch.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAIlD;mJACmJ;AACnJ,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;MAA+F;IACxG,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;;IAE5B,MAAM,CAAC,MAAM,0BAAqB;IAClC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAC5B,MAAM;CACP;AAGD,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,WAAW,EAAE,MAAM,CAAA;KAAE;CAAE"}
|
package/dist/2-core/ds-switch.js
CHANGED
|
@@ -2,10 +2,12 @@ import { LitElement, html, unsafeCSS } from "lit";
|
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
3
|
import styles from "./styles/ds-switch.css?inline";
|
|
4
4
|
/** The switch: a pill with a white round thumb, grey when off and the darker green when on,
|
|
5
|
-
whatever the page's accent. The slotted button retains native activation and refs. */
|
|
5
|
+
whatever the page's accent. Compact and monochrome are opt-in control-panel variants. The slotted button retains native activation and refs. */
|
|
6
6
|
export class Switch extends LitElement {
|
|
7
|
+
constructor() { super(); this.compact = false; this.monochrome = false; }
|
|
7
8
|
focus(options) { this.querySelector(":scope > button")?.focus(options); }
|
|
8
9
|
render() { return html `<slot></slot>`; }
|
|
9
10
|
}
|
|
11
|
+
Switch.properties = { compact: { type: Boolean, reflect: true }, monochrome: { type: Boolean, reflect: true } };
|
|
10
12
|
Switch.styles = unsafeCSS(styles);
|
|
11
13
|
define("ds-switch", Switch);
|
package/dist/2-core/ds-tag.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
|
|
2
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
3
|
+
/**
|
|
4
|
+
* A noninteractive label whose width follows its words, without grid rounding.
|
|
5
|
+
* Words that do not fit fade out over their last square, never an ellipsis,
|
|
6
|
+
* while the fill stays whole.
|
|
7
|
+
*/
|
|
3
8
|
export declare class Tag extends LitElement {
|
|
4
9
|
static styles: import("lit").CSSResult;
|
|
10
|
+
/** Marks the words `data-cut="end"` while they are wider than the tag. */
|
|
11
|
+
protected readonly cuts: CutFades;
|
|
5
12
|
render(): import("lit").TemplateResult<1>;
|
|
6
13
|
}
|
|
7
14
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-tag.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-tag.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C;;;;GAIG;AACH,qBAAa,GAAI,SAAQ,UAAU;IACjC,MAAM,CAAC,MAAM,0BAAqB;IAClC,0EAA0E;IAC1E,SAAS,CAAC,QAAQ,CAAC,IAAI,WAA0D;IACjF,MAAM;CACP;AAED,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,QAAQ,EAAE,GAAG,CAAA;KAAE;CAAE"}
|
package/dist/2-core/ds-tag.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
3
4
|
import styles from "./styles/ds-tag.css?inline";
|
|
4
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* A noninteractive label whose width follows its words, without grid rounding.
|
|
7
|
+
* Words that do not fit fade out over their last square, never an ellipsis,
|
|
8
|
+
* while the fill stays whole.
|
|
9
|
+
*/
|
|
5
10
|
export class Tag extends LitElement {
|
|
6
|
-
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/** Marks the words `data-cut="end"` while they are wider than the tag. */
|
|
14
|
+
this.cuts = new CutFades(this, { selector: ".words", text: true });
|
|
15
|
+
}
|
|
16
|
+
render() { return html `<span class="frame" part="frame"><span class="words"><slot @slotchange=${() => this.cuts.measure()}></slot></span></span>`; }
|
|
7
17
|
}
|
|
8
18
|
Tag.styles = unsafeCSS(styles);
|
|
9
19
|
define("ds-tag", Tag);
|