@lion/ui 0.0.2 → 0.0.4
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/components/core/src/SlotMixin.js +180 -42
- package/components/core/test/SlotMixin.test.js +355 -145
- package/components/core/types/SlotMixinTypes.ts +12 -1
- package/components/input-tel/src/LionInputTel.js +0 -9
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +32 -29
- package/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +5 -6
- package/components/localize/src/number/parseNumber.js +15 -36
- package/components/localize/test/number/parseNumber.test.js +3 -12
- package/components/localize/types/LocalizeMixinTypes.ts +1 -1
- package/custom-elements.json +1435 -133
- package/dist-types/components/calendar/src/LionCalendar.d.ts +1 -37
- package/dist-types/components/calendar/src/LionCalendar.d.ts.map +1 -1
- package/dist-types/components/core/src/SlotMixin.d.ts +2 -0
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/core/test/SlotMixin.test.d.ts +1 -1
- package/dist-types/components/core/test/SlotMixin.test.d.ts.map +1 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts +9 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts +1 -37
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
- package/dist-types/components/input-date/src/LionInputDate.d.ts +1 -37
- package/dist-types/components/input-date/src/LionInputDate.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts +1 -37
- package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts.map +1 -1
- package/dist-types/components/input-email/src/LionInputEmail.d.ts +1 -37
- package/dist-types/components/input-email/src/LionInputEmail.d.ts.map +1 -1
- package/dist-types/components/input-iban/src/LionInputIban.d.ts +1 -37
- package/dist-types/components/input-iban/src/LionInputIban.d.ts.map +1 -1
- package/dist-types/components/input-tel/src/LionInputTel.d.ts +1 -42
- package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +14 -8
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/LocalizeMixin.d.ts +1 -37
- package/dist-types/components/localize/src/LocalizeMixin.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/parseNumber.d.ts.map +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts +1 -1
- package/dist-types/components/localize/types/LocalizeMixinTypes.d.ts.map +1 -1
- package/dist-types/components/pagination/src/LionPagination.d.ts +1 -37
- package/dist-types/components/pagination/src/LionPagination.d.ts.map +1 -1
- package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts +1 -37
- package/dist-types/components/progress-indicator/src/LionProgressIndicator.d.ts.map +1 -1
- package/dist-types/exports/core.d.ts +1 -0
- package/dist-types/exports/core.d.ts.map +1 -1
- package/dist-types/exports/form-core.d.ts +2 -0
- package/dist-types/exports/form-core.d.ts.map +1 -1
- package/dist-types/exports/input-tel-dropdown.d.ts +2 -0
- package/dist-types/exports/input-tel-dropdown.d.ts.map +1 -1
- package/dist-types/exports/input-tel.d.ts +1 -0
- package/dist-types/exports/input-tel.d.ts.map +1 -1
- package/dist-types/exports/localize.d.ts +3 -0
- package/dist-types/exports/localize.d.ts.map +1 -1
- package/dist-types/exports/overlays.d.ts +4 -0
- package/dist-types/exports/overlays.d.ts.map +1 -1
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/accordion/index.md +3 -0
- package/docs/components/accordion/overview.md +129 -0
- package/docs/components/accordion/reference.md +47 -0
- package/docs/components/accordion/use-cases.md +252 -0
- package/docs/components/button/examples.md +30 -0
- package/docs/components/button/index.md +3 -0
- package/docs/components/button/overview.md +30 -0
- package/docs/components/button/src/icon.svg.js +5 -0
- package/docs/components/button/use-cases.md +106 -0
- package/docs/components/calendar/index.md +3 -0
- package/docs/components/calendar/overview.md +49 -0
- package/docs/components/calendar/use-cases.md +192 -0
- package/docs/components/checkbox-group/index.md +3 -0
- package/docs/components/checkbox-group/overview.md +40 -0
- package/docs/components/checkbox-group/use-cases.md +256 -0
- package/docs/components/collapsible/assets/CustomCollapsible.js +113 -0
- package/docs/components/collapsible/assets/applyDemoCollapsibleStyles.js +37 -0
- package/docs/components/collapsible/examples.md +83 -0
- package/docs/components/collapsible/index.md +3 -0
- package/docs/components/collapsible/overview.md +39 -0
- package/docs/components/collapsible/use-cases.md +79 -0
- package/docs/components/combobox/examples.md +153 -0
- package/docs/components/combobox/index.md +3 -0
- package/docs/components/combobox/overview.md +51 -0
- package/docs/components/combobox/src/LinkMixin.js +60 -0
- package/docs/components/combobox/src/demo-selection-display.js +191 -0
- package/docs/components/combobox/src/gh-combobox/gh-button.js +69 -0
- package/docs/components/combobox/src/gh-combobox/gh-combobox.js +508 -0
- package/docs/components/combobox/src/google-combobox/assets/google-clear-icon.js +9 -0
- package/docs/components/combobox/src/google-combobox/assets/google-search-icon.js +9 -0
- package/docs/components/combobox/src/google-combobox/assets/google-voice-search-icon.js +19 -0
- package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
- package/docs/components/combobox/src/google-combobox/google-combobox.js +460 -0
- package/docs/components/combobox/src/lazyRender.js +29 -0
- package/docs/components/combobox/src/levenshtein.js +95 -0
- package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +341 -0
- package/docs/components/combobox/src/md-combobox/md-combobox.js +89 -0
- package/docs/components/combobox/src/md-combobox/md-input.js +5 -0
- package/docs/components/combobox/src/md-combobox/style/load-roboto.js +6 -0
- package/docs/components/combobox/src/md-combobox/style/md-ripple.js +81 -0
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +368 -0
- package/docs/components/combobox/use-cases.md +377 -0
- package/docs/components/dialog/index.md +3 -0
- package/docs/components/dialog/overview.md +63 -0
- package/docs/components/dialog/src/demo-dialog-style.js +3 -0
- package/docs/components/dialog/src/demoStyle.js +39 -0
- package/docs/components/dialog/src/slots-dialog-content.js +32 -0
- package/docs/components/dialog/src/styled-dialog-content.js +38 -0
- package/docs/components/dialog/use-cases.md +154 -0
- package/docs/components/drawer/index.md +3 -0
- package/docs/components/drawer/overview.md +68 -0
- package/docs/components/drawer/src/demoStyle.js +71 -0
- package/docs/components/drawer/use-cases.md +194 -0
- package/docs/components/fieldset/index.md +3 -0
- package/docs/components/fieldset/overview.md +49 -0
- package/docs/components/fieldset/use-cases.md +185 -0
- package/docs/components/form/index.md +3 -0
- package/docs/components/form/overview.md +43 -0
- package/docs/components/form/use-cases.md +72 -0
- package/docs/components/icon/assets/bugs/bug01.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug02.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug05.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug06.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug08.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug12.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug19.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug23.svg.js +2 -0
- package/docs/components/icon/assets/bugs/bug24.svg.js +2 -0
- package/docs/components/icon/assets/iconset-bugs.js +11 -0
- package/docs/components/icon/assets/iconset-misc.js +3 -0
- package/docs/components/icon/assets/iconset-space.js +31 -0
- package/docs/components/icon/assets/misc/arrowLeft.svg.js +6 -0
- package/docs/components/icon/assets/space/aliens-spaceship.svg.js +2 -0
- package/docs/components/icon/assets/space/meteor.svg.js +2 -0
- package/docs/components/icon/assets/space/moon-flag.svg.js +2 -0
- package/docs/components/icon/assets/space/moon.svg.js +2 -0
- package/docs/components/icon/assets/space/night.svg.js +2 -0
- package/docs/components/icon/assets/space/orbit.svg.js +2 -0
- package/docs/components/icon/assets/space/planet.svg.js +2 -0
- package/docs/components/icon/assets/space/robot.svg.js +2 -0
- package/docs/components/icon/assets/space/rocket.svg.js +2 -0
- package/docs/components/icon/assets/space/satellite.svg.js +2 -0
- package/docs/components/icon/assets/space/signal.svg.js +2 -0
- package/docs/components/icon/assets/space/space-helmet.svg.js +2 -0
- package/docs/components/icon/assets/space/sun.svg.js +2 -0
- package/docs/components/icon/assets/space/telescope.svg.js +2 -0
- package/docs/components/icon/index.md +3 -0
- package/docs/components/icon/overview.md +40 -0
- package/docs/components/icon/use-cases.md +93 -0
- package/docs/components/index.md +7 -0
- package/docs/components/input/index.md +3 -0
- package/docs/components/input/overview.md +36 -0
- package/docs/components/input/use-cases.md +77 -0
- package/docs/components/input-amount/index.md +3 -0
- package/docs/components/input-amount/overview.md +49 -0
- package/docs/components/input-amount/use-cases.md +122 -0
- package/docs/components/input-date/index.md +3 -0
- package/docs/components/input-date/overview.md +39 -0
- package/docs/components/input-date/use-cases.md +83 -0
- package/docs/components/input-datepicker/index.md +3 -0
- package/docs/components/input-datepicker/overview.md +42 -0
- package/docs/components/input-datepicker/use-cases.md +78 -0
- package/docs/components/input-email/index.md +3 -0
- package/docs/components/input-email/overview.md +32 -0
- package/docs/components/input-email/use-cases.md +48 -0
- package/docs/components/input-iban/index.md +3 -0
- package/docs/components/input-iban/overview.md +37 -0
- package/docs/components/input-iban/use-cases.md +102 -0
- package/docs/components/input-range/index.md +3 -0
- package/docs/components/input-range/overview.md +34 -0
- package/docs/components/input-range/use-cases.md +108 -0
- package/docs/components/input-stepper/index.md +3 -0
- package/docs/components/input-stepper/overview.md +36 -0
- package/docs/components/input-stepper/use-cases.md +41 -0
- package/docs/components/input-tel/index.md +3 -0
- package/docs/components/input-tel/overview.md +62 -0
- package/docs/components/input-tel/src/h-region-code-table.js +109 -0
- package/docs/components/input-tel/use-cases.md +307 -0
- package/docs/components/input-tel-dropdown/examples.md +32 -0
- package/docs/components/input-tel-dropdown/index.md +3 -0
- package/docs/components/input-tel-dropdown/overview.md +38 -0
- package/docs/components/input-tel-dropdown/src/intl-input-tel-dropdown.js +127 -0
- package/docs/components/input-tel-dropdown/use-cases.md +159 -0
- package/docs/components/listbox/index.md +3 -0
- package/docs/components/listbox/overview.md +42 -0
- package/docs/components/listbox/src/listboxData.js +65 -0
- package/docs/components/listbox/use-cases.md +147 -0
- package/docs/components/pagination/index.md +3 -0
- package/docs/components/pagination/overview.md +29 -0
- package/docs/components/pagination/use-cases.md +99 -0
- package/docs/components/progress-indicator/assets/my-determinate-progress-bar.js +30 -0
- package/docs/components/progress-indicator/assets/my-indeterminate-progress-spinner.js +55 -0
- package/docs/components/progress-indicator/examples.md +125 -0
- package/docs/components/progress-indicator/index.md +3 -0
- package/docs/components/progress-indicator/overview.md +36 -0
- package/docs/components/radio-group/index.md +3 -0
- package/docs/components/radio-group/overview.md +46 -0
- package/docs/components/radio-group/use-cases.md +140 -0
- package/docs/components/select/index.md +3 -0
- package/docs/components/select/overview.md +44 -0
- package/docs/components/select/use-cases.md +55 -0
- package/docs/components/select-rich/examples.md +31 -0
- package/docs/components/select-rich/index.md +3 -0
- package/docs/components/select-rich/overview.md +46 -0
- package/docs/components/select-rich/src/flagStyles.js +1250 -0
- package/docs/components/select-rich/src/flags.png +0 -0
- package/docs/components/select-rich/src/flags@2x.png +0 -0
- package/docs/components/select-rich/src/intl-select-rich.js +194 -0
- package/docs/components/select-rich/src/regionMetaList.js +1717 -0
- package/docs/components/select-rich/use-cases.md +370 -0
- package/docs/components/steps/index.md +3 -0
- package/docs/components/steps/overview.md +63 -0
- package/docs/components/steps/use-cases.md +163 -0
- package/docs/components/switch/index.md +3 -0
- package/docs/components/switch/overview.md +75 -0
- package/docs/components/switch/reference.md +39 -0
- package/docs/components/switch/use-cases.md +76 -0
- package/docs/components/tabs/examples.md +23 -0
- package/docs/components/tabs/index.md +3 -0
- package/docs/components/tabs/overview.md +48 -0
- package/docs/components/tabs/src/lea-tab-panel.js +24 -0
- package/docs/components/tabs/src/lea-tab.js +45 -0
- package/docs/components/tabs/src/lea-tabs.js +28 -0
- package/docs/components/tabs/use-cases.md +219 -0
- package/docs/components/textarea/index.md +3 -0
- package/docs/components/textarea/overview.md +35 -0
- package/docs/components/textarea/use-cases.md +95 -0
- package/docs/components/tooltip/examples.md +39 -0
- package/docs/components/tooltip/index.md +3 -0
- package/docs/components/tooltip/overview.md +44 -0
- package/docs/components/tooltip/use-cases.md +208 -0
- package/docs/fundamentals/index.md +19 -0
- package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +1 -0
- package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +233 -0
- package/docs/fundamentals/node-tools/index.md +1 -0
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +68 -0
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +111 -0
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +69 -0
- package/docs/fundamentals/node-tools/providence-analytics/assets/_mermaid.svg.js +1202 -0
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +22 -0
- package/docs/fundamentals/node-tools/providence-analytics/index.md +1 -0
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +192 -0
- package/docs/fundamentals/node-tools/publish-docs/index.md +1 -0
- package/docs/fundamentals/node-tools/publish-docs/overview.md +136 -0
- package/docs/fundamentals/node-tools/remark-extend/index.md +1 -0
- package/docs/fundamentals/node-tools/remark-extend/overview.md +274 -0
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +1 -0
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +285 -0
- package/docs/fundamentals/rationales/TypeScript.md +18 -0
- package/docs/fundamentals/rationales/index.md +1 -0
- package/docs/fundamentals/rationales/side-effects.md +203 -0
- package/docs/fundamentals/rationales/versioning.md +35 -0
- package/docs/fundamentals/systems/core/index.md +3 -0
- package/docs/fundamentals/systems/core/overview.md +85 -0
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +1 -0
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +1 -0
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +84 -0
- package/docs/fundamentals/systems/form/assets/h-output.js +155 -0
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +245 -0
- package/docs/fundamentals/systems/form/index.md +3 -0
- package/docs/fundamentals/systems/form/interaction-states.md +177 -0
- package/docs/fundamentals/systems/form/model-value.md +35 -0
- package/docs/fundamentals/systems/form/overview.md +82 -0
- package/docs/fundamentals/systems/form/styling.md +101 -0
- package/docs/fundamentals/systems/form/use-cases.md +156 -0
- package/docs/fundamentals/systems/form/validate.md +929 -0
- package/docs/fundamentals/systems/icon/index.md +3 -0
- package/docs/fundamentals/systems/icon/overview.md +124 -0
- package/docs/fundamentals/systems/index.md +1 -0
- package/docs/fundamentals/systems/localize/assets/all-locales.js +437 -0
- package/docs/fundamentals/systems/localize/assets/en-AU.js +6 -0
- package/docs/fundamentals/systems/localize/assets/en-GB.js +6 -0
- package/docs/fundamentals/systems/localize/assets/en-US.js +6 -0
- package/docs/fundamentals/systems/localize/assets/en.js +4 -0
- package/docs/fundamentals/systems/localize/assets/nl-BE.js +6 -0
- package/docs/fundamentals/systems/localize/assets/nl-NL.js +6 -0
- package/docs/fundamentals/systems/localize/assets/nl.js +4 -0
- package/docs/fundamentals/systems/localize/dates.md +195 -0
- package/docs/fundamentals/systems/localize/index.md +3 -0
- package/docs/fundamentals/systems/localize/numbers.md +217 -0
- package/docs/fundamentals/systems/localize/overview.md +48 -0
- package/docs/fundamentals/systems/localize/rationale.md +62 -0
- package/docs/fundamentals/systems/localize/text.md +125 -0
- package/docs/fundamentals/systems/localize/use-cases.md +319 -0
- package/docs/fundamentals/systems/overlays/assets/applyDemoOverlayStyles.js +22 -0
- package/docs/fundamentals/systems/overlays/assets/demo-overlay-backdrop.js +48 -0
- package/docs/fundamentals/systems/overlays/assets/demo-overlay-system.js +42 -0
- package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +133 -0
- package/docs/fundamentals/systems/overlays/configuration.md +453 -0
- package/docs/fundamentals/systems/overlays/form-integration.md +65 -0
- package/docs/fundamentals/systems/overlays/index.md +3 -0
- package/docs/fundamentals/systems/overlays/overview.md +118 -0
- package/docs/fundamentals/systems/overlays/rationale.md +232 -0
- package/docs/fundamentals/systems/overlays/scope.md +176 -0
- package/docs/fundamentals/systems/overlays/use-cases.md +699 -0
- package/docs/fundamentals/tools/ajax/assets/naga.json +9 -0
- package/docs/fundamentals/tools/ajax/assets/pabu.json +9 -0
- package/docs/fundamentals/tools/ajax/index.md +3 -0
- package/docs/fundamentals/tools/ajax/overview.md +128 -0
- package/docs/fundamentals/tools/ajax/use-cases.md +456 -0
- package/docs/fundamentals/tools/helpers/action-logger.md +165 -0
- package/docs/fundamentals/tools/helpers/index.md +3 -0
- package/docs/fundamentals/tools/helpers/overview.md +30 -0
- package/docs/fundamentals/tools/index.md +1 -0
- package/docs/fundamentals/tools/singleton-manager/index.md +3 -0
- package/docs/fundamentals/tools/singleton-manager/overview.md +304 -0
- package/docs/guides/how-to/create-a-custom-field.md +200 -0
- package/docs/guides/how-to/extend-a-native-input.md +66 -0
- package/docs/guides/how-to/get-started.md +77 -0
- package/docs/guides/how-to/index.md +1 -0
- package/docs/guides/index.md +34 -0
- package/docs/guides/principles/definitions-and-terms.md +41 -0
- package/docs/guides/principles/index.md +26 -0
- package/docs/guides/principles/scoped-elements.md +103 -0
- package/docs/guides/principles/styling.md +32 -0
- package/docs/guides/principles/subclasser-apis.md +28 -0
- package/docs/override.js +15 -0
- package/exports/core.js +2 -0
- package/exports/form-core.js +3 -0
- package/exports/input-tel-dropdown.js +3 -0
- package/exports/input-tel.js +2 -0
- package/exports/localize.js +4 -0
- package/exports/overlays.js +5 -0
- package/package.json +3 -2
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { html, css } from 'lit';
|
|
2
|
+
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
3
|
+
|
|
4
|
+
export const MdFieldMixin = dedupeMixin(
|
|
5
|
+
superclass =>
|
|
6
|
+
class extends superclass {
|
|
7
|
+
static get styles() {
|
|
8
|
+
return [
|
|
9
|
+
...super.styles,
|
|
10
|
+
css`
|
|
11
|
+
/** @configure FormControlMixin */
|
|
12
|
+
|
|
13
|
+
/* =======================
|
|
14
|
+
block | .form-field
|
|
15
|
+
======================= */
|
|
16
|
+
|
|
17
|
+
:host {
|
|
18
|
+
position: relative;
|
|
19
|
+
font-family: 'Roboto', sans-serif;
|
|
20
|
+
padding-top: 16px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ==========================
|
|
24
|
+
element | .form-field__label
|
|
25
|
+
========================== */
|
|
26
|
+
|
|
27
|
+
.form-field__label ::slotted(label) {
|
|
28
|
+
display: block;
|
|
29
|
+
color: var(--text-color, #545454);
|
|
30
|
+
font-size: 1rem;
|
|
31
|
+
line-height: 1.5rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([disabled]) .form-field__label ::slotted(label) {
|
|
35
|
+
color: var(--disabled-text-color, lightgray);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.form-field__label {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 4px;
|
|
41
|
+
left: 0;
|
|
42
|
+
font: inherit;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
width: 100%;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
transform: perspective(100px);
|
|
49
|
+
-ms-transform: none;
|
|
50
|
+
transform-origin: 0 0;
|
|
51
|
+
transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
|
|
52
|
+
color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
|
|
53
|
+
width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
54
|
+
/* z-index: 1; */
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([focused]) .form-field__label,
|
|
58
|
+
:host([filled]) .form-field__label {
|
|
59
|
+
transform: translateY(-1.28125em) scale(0.75) perspective(100px) translateZ(0.001px);
|
|
60
|
+
width: 133.333333333333333333%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([focused]) .form-field__label {
|
|
64
|
+
color: var(--color-primary, royalblue);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ==============================
|
|
68
|
+
element | .form-field__help-text
|
|
69
|
+
============================== */
|
|
70
|
+
|
|
71
|
+
.form-field__help-text {
|
|
72
|
+
visibility: hidden;
|
|
73
|
+
margin-top: 8px;
|
|
74
|
+
position: relative;
|
|
75
|
+
font-size: 0.8em;
|
|
76
|
+
display: block;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([disabled]) .form-field__help-text ::slotted(*) {
|
|
80
|
+
color: var(--disabled-text-color, lightgray);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([focused]) .form-field__help-text {
|
|
84
|
+
visibility: visible;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([shows-feedback-for~='error']) .form-field__help-text {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* ==============================
|
|
92
|
+
element | .form-field__feedback
|
|
93
|
+
============================== */
|
|
94
|
+
|
|
95
|
+
.form-field__feedback {
|
|
96
|
+
margin-top: 8px;
|
|
97
|
+
position: relative;
|
|
98
|
+
font-size: 0.8em;
|
|
99
|
+
display: block;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([shows-feedback-for~='error']) .form-field__feedback {
|
|
103
|
+
color: var(--color-error, red);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ==============================
|
|
107
|
+
element | .input-group
|
|
108
|
+
============================== */
|
|
109
|
+
|
|
110
|
+
.input-group {
|
|
111
|
+
display: flex;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* ==============================
|
|
115
|
+
element | .input-group__container
|
|
116
|
+
============================== */
|
|
117
|
+
|
|
118
|
+
.input-group__container {
|
|
119
|
+
position: relative;
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-wrap: wrap;
|
|
122
|
+
align-items: stretch;
|
|
123
|
+
width: 100%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ==============================
|
|
127
|
+
element | .input-group__input
|
|
128
|
+
============================== */
|
|
129
|
+
|
|
130
|
+
.input-group__input {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex: 1;
|
|
133
|
+
position: relative;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ==============================
|
|
137
|
+
element | [slot="input"]
|
|
138
|
+
============================== */
|
|
139
|
+
|
|
140
|
+
* > ::slotted([slot='input']) {
|
|
141
|
+
display: block;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
flex: 1 1 auto;
|
|
144
|
+
width: 1%;
|
|
145
|
+
padding: 0.5rem 0;
|
|
146
|
+
outline: none;
|
|
147
|
+
border: none;
|
|
148
|
+
color: var(--primary-text-color, #333333);
|
|
149
|
+
background: transparent;
|
|
150
|
+
background-clip: padding-box;
|
|
151
|
+
font-size: 100%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:host([disabled])
|
|
155
|
+
.input-group__container
|
|
156
|
+
> .input-group__input
|
|
157
|
+
::slotted([slot='input']) {
|
|
158
|
+
color: var(--disabled-text-color, lightgray);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* ==============================
|
|
162
|
+
element | .input-group__prefix,
|
|
163
|
+
element | .input-group__suffix
|
|
164
|
+
============================== */
|
|
165
|
+
|
|
166
|
+
.input-group__prefix,
|
|
167
|
+
.input-group__suffix {
|
|
168
|
+
display: flex;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.input-group__prefix ::slotted(*),
|
|
172
|
+
.input-group__suffix ::slotted(*) {
|
|
173
|
+
align-self: center;
|
|
174
|
+
text-align: center;
|
|
175
|
+
padding: 0.375rem 0.75rem;
|
|
176
|
+
line-height: 1.5;
|
|
177
|
+
display: flex;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
margin-bottom: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.input-group__container > .input-group__prefix ::slotted(button),
|
|
183
|
+
.input-group__container > .input-group__suffix ::slotted(button) {
|
|
184
|
+
height: 100%;
|
|
185
|
+
border: none;
|
|
186
|
+
background: transparent;
|
|
187
|
+
|
|
188
|
+
position: relative;
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
transform: translate3d(0, 0, 0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.input-group__container > .input-group__prefix ::slotted(button)::after,
|
|
194
|
+
.input-group__container > .input-group__suffix ::slotted(button)::after {
|
|
195
|
+
content: '';
|
|
196
|
+
display: block;
|
|
197
|
+
position: absolute;
|
|
198
|
+
width: 100%;
|
|
199
|
+
height: 100%;
|
|
200
|
+
top: 0;
|
|
201
|
+
left: 0;
|
|
202
|
+
pointer-events: none;
|
|
203
|
+
background-image: radial-gradient(circle, #000 10%, transparent 10.01%);
|
|
204
|
+
background-repeat: no-repeat;
|
|
205
|
+
background-position: 50%;
|
|
206
|
+
transform: scale(10, 10);
|
|
207
|
+
opacity: 0;
|
|
208
|
+
transition: transform 0.25s, opacity 0.5s;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.input-group__container > .input-group__prefix ::slotted(button:active)::after,
|
|
212
|
+
.input-group__container > .input-group__suffix ::slotted(button:active)::after {
|
|
213
|
+
transform: scale(0, 0);
|
|
214
|
+
opacity: 0.2;
|
|
215
|
+
transition: 0s;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* ==== state | :focus ==== */
|
|
219
|
+
|
|
220
|
+
/* ==============================
|
|
221
|
+
element | .input-group__before,
|
|
222
|
+
element | .input-group__after
|
|
223
|
+
============================== */
|
|
224
|
+
|
|
225
|
+
.input-group__before,
|
|
226
|
+
.input-group__after {
|
|
227
|
+
display: flex;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.input-group__before ::slotted(*),
|
|
231
|
+
.input-group__after ::slotted(*) {
|
|
232
|
+
align-self: center;
|
|
233
|
+
text-align: center;
|
|
234
|
+
padding: 0.375rem 0.75rem;
|
|
235
|
+
line-height: 1.5;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.input-group__before ::slotted(*) {
|
|
239
|
+
padding-left: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.input-group__after ::slotted(*) {
|
|
243
|
+
padding-right: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** @enhance FormControlMixin */
|
|
247
|
+
|
|
248
|
+
/* ==============================
|
|
249
|
+
element | .md-input__underline
|
|
250
|
+
============================== */
|
|
251
|
+
|
|
252
|
+
.md-input__underline {
|
|
253
|
+
position: absolute;
|
|
254
|
+
height: 1px;
|
|
255
|
+
width: 100%;
|
|
256
|
+
background-color: rgba(0, 0, 0, 0.42);
|
|
257
|
+
bottom: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:host([disabled]) .md-input__underline {
|
|
261
|
+
border-top: 1px var(--disabled-text-color, lightgray) dashed;
|
|
262
|
+
background-color: transparent;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:host([shows-feedback-for~='error']) .md-input__underline {
|
|
266
|
+
background-color: var(--color-error, red);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* ==============================
|
|
270
|
+
element | .md-input__underline-ripple
|
|
271
|
+
============================== */
|
|
272
|
+
|
|
273
|
+
.md-input__underline-ripple {
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: 0;
|
|
276
|
+
left: 0;
|
|
277
|
+
width: 100%;
|
|
278
|
+
height: 2px;
|
|
279
|
+
transform-origin: 50%;
|
|
280
|
+
transform: scaleX(0.5);
|
|
281
|
+
visibility: hidden;
|
|
282
|
+
opacity: 0;
|
|
283
|
+
transition: background-color 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
|
|
284
|
+
background-color: var(--color-primary, royalblue);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
:host([focused]) .md-input__underline-ripple {
|
|
288
|
+
visibility: visible;
|
|
289
|
+
opacity: 1;
|
|
290
|
+
transform: scaleX(1);
|
|
291
|
+
transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
|
|
292
|
+
opacity 0.1s cubic-bezier(0.25, 0.8, 0.25, 1),
|
|
293
|
+
background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
:host([shows-feedback-for~='error']) .md-input__underline-ripple {
|
|
297
|
+
background-color: var(--color-error, red);
|
|
298
|
+
}
|
|
299
|
+
`,
|
|
300
|
+
];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @override FormControlMixin
|
|
305
|
+
*/
|
|
306
|
+
_groupOneTemplate() {
|
|
307
|
+
return html``;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @override FormControlMixin
|
|
312
|
+
*/
|
|
313
|
+
_inputGroupInputTemplate() {
|
|
314
|
+
return html`
|
|
315
|
+
<div class="input-group__input">
|
|
316
|
+
${this._labelTemplate()}
|
|
317
|
+
<slot name="input"></slot>
|
|
318
|
+
</div>
|
|
319
|
+
`;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @enhance FormControlMixin
|
|
324
|
+
*/
|
|
325
|
+
_inputGroupTemplate() {
|
|
326
|
+
return html`
|
|
327
|
+
<div class="input-group">
|
|
328
|
+
${this._inputGroupBeforeTemplate()}
|
|
329
|
+
<div class="input-group__container">
|
|
330
|
+
${this._inputGroupPrefixTemplate()} ${this._inputGroupInputTemplate()}
|
|
331
|
+
${this._inputGroupSuffixTemplate()}
|
|
332
|
+
<div class="md-input__underline">
|
|
333
|
+
<span class="md-input__underline-ripple"></span>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
${this._inputGroupAfterTemplate()}
|
|
337
|
+
</div>
|
|
338
|
+
`;
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { css, html } from 'lit';
|
|
2
|
+
import { LionOption } from '@lion/ui/listbox.js';
|
|
3
|
+
import { LionCombobox } from '@lion/ui/combobox.js';
|
|
4
|
+
import { MdFieldMixin } from './MdFieldMixin.js';
|
|
5
|
+
import './style/md-ripple.js';
|
|
6
|
+
import './style/load-roboto.js';
|
|
7
|
+
|
|
8
|
+
// TODO: insert ink wc here
|
|
9
|
+
export class MdOption extends LionOption {
|
|
10
|
+
static get styles() {
|
|
11
|
+
return [
|
|
12
|
+
...super.styles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
position: relative;
|
|
16
|
+
padding: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([focused]) {
|
|
20
|
+
background: lightgray;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([active]) {
|
|
24
|
+
color: #1867c0 !important;
|
|
25
|
+
caret-color: #1867c0 !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host ::slotted(.md-highlight) {
|
|
29
|
+
color: rgba(0, 0, 0, 0.38);
|
|
30
|
+
background: #eee;
|
|
31
|
+
}
|
|
32
|
+
`,
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @override
|
|
38
|
+
* @param {string} matchingString
|
|
39
|
+
*/
|
|
40
|
+
onFilterMatch(matchingString) {
|
|
41
|
+
const { innerHTML } = this;
|
|
42
|
+
this.__originalInnerHTML = innerHTML;
|
|
43
|
+
this.innerHTML = innerHTML.replace(
|
|
44
|
+
new RegExp(`(${matchingString})`, 'i'),
|
|
45
|
+
`<span class="md-highlight">$1</span>`,
|
|
46
|
+
);
|
|
47
|
+
this.style.display = '';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @override
|
|
52
|
+
*/
|
|
53
|
+
onFilterUnmatch() {
|
|
54
|
+
if (this.__originalInnerHTML) {
|
|
55
|
+
this.innerHTML = this.__originalInnerHTML;
|
|
56
|
+
}
|
|
57
|
+
this.style.display = 'none';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
render() {
|
|
61
|
+
return html`
|
|
62
|
+
${super.render()}
|
|
63
|
+
<md-ripple></md-ripple>
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
customElements.define('md-option', MdOption);
|
|
68
|
+
|
|
69
|
+
export class MdCombobox extends MdFieldMixin(LionCombobox) {
|
|
70
|
+
static get styles() {
|
|
71
|
+
return [
|
|
72
|
+
...super.styles,
|
|
73
|
+
css`
|
|
74
|
+
.input-group__container {
|
|
75
|
+
display: flex;
|
|
76
|
+
border-bottom: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
* > ::slotted([role='listbox']) {
|
|
80
|
+
box-shadow: 0 4px 6px 0 rgba(32, 33, 36, 0.28);
|
|
81
|
+
padding-top: 8px;
|
|
82
|
+
padding-bottom: 8px;
|
|
83
|
+
top: 2px;
|
|
84
|
+
}
|
|
85
|
+
`,
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
customElements.define('md-combobox', MdCombobox);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// We don't have access to our main index html, so let's add Roboto font like this
|
|
2
|
+
const linkNode = document.createElement('link');
|
|
3
|
+
linkNode.href = 'https://fonts.googleapis.com/css?family=Roboto:300,400,500';
|
|
4
|
+
linkNode.rel = 'stylesheet';
|
|
5
|
+
linkNode.type = 'text/css';
|
|
6
|
+
document.head.appendChild(linkNode);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { html, css, LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Material Design Ripple Element
|
|
5
|
+
*
|
|
6
|
+
* - should be placed in a 'positioned' context (having positon: (realtive/fixed/absolute))
|
|
7
|
+
*/
|
|
8
|
+
class MdRipple extends LitElement {
|
|
9
|
+
static get styles() {
|
|
10
|
+
return [
|
|
11
|
+
css`
|
|
12
|
+
:host {
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
transition: 0.1s ease-in;
|
|
15
|
+
user-select: none;
|
|
16
|
+
display: block;
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host:hover {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#ripple {
|
|
29
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
30
|
+
border-radius: 100%;
|
|
31
|
+
position: relative;
|
|
32
|
+
transform: scale(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.animate {
|
|
36
|
+
animation: ripple 0.4s linear;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@keyframes ripple {
|
|
40
|
+
100% {
|
|
41
|
+
transform: scale(12);
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
render() {
|
|
50
|
+
return html` <div id="ripple"></div> `;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
firstUpdated(c) {
|
|
54
|
+
super.firstUpdated(c);
|
|
55
|
+
this._ripple = this.shadowRoot.querySelector('#ripple');
|
|
56
|
+
this._ripple.style.cssText = `width: ${this.offsetHeight}px; height: ${this.offsetHeight}px;`;
|
|
57
|
+
this.__onRipple = this.__onRipple.bind(this);
|
|
58
|
+
this.addEventListener('mousedown', this.__onRipple);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
disconnectedCallback() {
|
|
62
|
+
this.removeEventListener('mousedown', this.__onRipple);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
__onRipple(e) {
|
|
66
|
+
this._ripple.classList.remove('animate');
|
|
67
|
+
const rect = this.getBoundingClientRect();
|
|
68
|
+
const offset = {
|
|
69
|
+
top: rect.top + document.body.scrollTop,
|
|
70
|
+
left: rect.left + document.body.scrollLeft,
|
|
71
|
+
};
|
|
72
|
+
this._ripple.style.left = `${
|
|
73
|
+
parseInt(e.pageX - offset.left, 10) - this._ripple.offsetWidth / 2
|
|
74
|
+
}px`;
|
|
75
|
+
this._ripple.style.top = `${
|
|
76
|
+
parseInt(e.pageY - offset.top, 10) - this._ripple.offsetHeight / 2
|
|
77
|
+
}px`;
|
|
78
|
+
this._ripple.classList.add('animate');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
customElements.define('md-ripple', MdRipple);
|