@lion/ui 0.2.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -72
- package/components/button/src/LionButton.js +1 -1
- package/components/checkbox-group/src/LionCheckboxIndeterminate.js +2 -2
- package/components/checkbox-group/test/lion-checkbox-indeterminate-integrations.test.js +6 -0
- package/components/checkbox-group/{test/lion-checkbox-indeterminate.test.js → test-suites/CheckboxIndeterminate.suite.js} +209 -187
- package/components/combobox/src/LionCombobox.js +3 -1
- package/components/combobox/test/lion-combobox.test.js +52 -0
- package/components/core/src/SlotMixin.js +3 -2
- package/components/core/test/SlotMixin.test.js +1 -1
- package/components/core/types/SlotMixinTypes.ts +4 -1
- package/components/dialog/test/lion-dialog.test.js +56 -0
- package/components/form-core/src/FocusMixin.js +33 -2
- package/components/form-core/src/LionField.js +3 -1
- package/components/form-core/src/validate/LionValidationFeedback.js +2 -5
- package/components/form-core/src/validate/ResultValidator.js +1 -1
- package/components/form-core/test/FocusMixin.test.js +33 -0
- package/components/form-core/types/validate/ValidateMixinTypes.ts +2 -2
- package/components/form-integrations/test/dialog-integrations.test.js +19 -0
- package/components/form-integrations/test/form-group-methods.test.js +11 -37
- package/components/form-integrations/test/form-integrations.test.js +4 -0
- package/components/form-integrations/test/helpers/umbrella-form.js +21 -18
- package/components/input-amount/src/LionInputAmount.js +13 -4
- package/components/input-amount/test/lion-input-amount.test.js +19 -20
- package/components/input-date/src/LionInputDate.js +2 -11
- package/components/input-datepicker/src/LionInputDatepicker.js +5 -2
- package/components/input-datepicker/test/lion-input-datepicker.test.js +20 -0
- package/components/input-file/src/FileHandle.js +98 -0
- package/components/input-file/src/LionInputFile.js +892 -0
- package/components/input-file/src/LionSelectedFileList.js +232 -0
- package/components/input-file/src/localizeNamespaceLoader.js +75 -0
- package/components/input-file/src/validators.js +114 -0
- package/components/input-file/test/FileValidators.test.js +170 -0
- package/components/input-file/test/lion-input-file.test.js +1168 -0
- package/components/input-file/test/lion-selected-file-list.test.js +207 -0
- package/components/input-file/translations/bg-BG.js +5 -0
- package/components/input-file/translations/bg.js +12 -0
- package/components/input-file/translations/cs-CZ.js +5 -0
- package/components/input-file/translations/cs.js +13 -0
- package/components/input-file/translations/de-DE.js +5 -0
- package/components/input-file/translations/de.js +12 -0
- package/components/input-file/translations/en-AU.js +5 -0
- package/components/input-file/translations/en-GB.js +5 -0
- package/components/input-file/translations/en-PH.js +5 -0
- package/components/input-file/translations/en-US.js +5 -0
- package/components/input-file/translations/en.js +12 -0
- package/components/input-file/translations/es-ES.js +5 -0
- package/components/input-file/translations/es.js +12 -0
- package/components/input-file/translations/fr-BE.js +5 -0
- package/components/input-file/translations/fr-FR.js +5 -0
- package/components/input-file/translations/fr.js +13 -0
- package/components/input-file/translations/hu-HU.js +5 -0
- package/components/input-file/translations/hu.js +12 -0
- package/components/input-file/translations/it-IT.js +5 -0
- package/components/input-file/translations/it.js +12 -0
- package/components/input-file/translations/nl-BE.js +5 -0
- package/components/input-file/translations/nl-NL.js +5 -0
- package/components/input-file/translations/nl.js +12 -0
- package/components/input-file/translations/pl-PL.js +5 -0
- package/components/input-file/translations/pl.js +12 -0
- package/components/input-file/translations/ro-RO.js +5 -0
- package/components/input-file/translations/ro.js +12 -0
- package/components/input-file/translations/ru-RU.js +5 -0
- package/components/input-file/translations/ru.js +12 -0
- package/components/input-file/translations/sk-SK.js +5 -0
- package/components/input-file/translations/sk.js +12 -0
- package/components/input-file/translations/uk-UA.js +5 -0
- package/components/input-file/translations/uk.js +12 -0
- package/components/input-file/translations/zh-CN.js +5 -0
- package/components/input-file/translations/zh.js +12 -0
- package/components/input-file/types/input-file.d.ts +32 -0
- package/components/input-tel-dropdown/src/LionInputTelDropdown.js +1 -4
- package/components/listbox/src/ListboxMixin.js +3 -2
- package/components/listbox/test-suites/ListboxMixin.suite.js +31 -1
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceNoSpaceBetweenCurrencySymbolAndNumber.js +22 -0
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceSymbols.js +64 -0
- package/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.js +13 -7
- package/components/localize/test/number/formatNumber.test.js +6 -28
- package/custom-elements.json +13822 -9246
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts +12 -0
- package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -0
- package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
- package/dist-types/components/combobox/test/lion-combobox.test.d.ts.map +1 -1
- package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
- package/dist-types/components/core/types/SlotMixinTypes.d.ts +4 -0
- package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
- package/dist-types/components/dialog/test/lion-dialog.test.d.ts.map +1 -1
- package/dist-types/components/form-core/src/FocusMixin.d.ts.map +1 -1
- package/dist-types/components/form-core/src/LionField.d.ts +2 -1
- package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +4 -11
- package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
- package/dist-types/components/form-core/src/validate/ResultValidator.d.ts +1 -1
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts +5 -0
- package/dist-types/components/form-core/types/validate/ValidateMixinTypes.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/dialog-integrations.test.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts +1 -0
- package/dist-types/components/form-integrations/test/form-group-methods.test.d.ts.map +1 -1
- package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts.map +1 -1
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts +2 -4
- package/dist-types/components/input-amount/src/LionInputAmount.d.ts.map +1 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts +0 -1
- package/dist-types/components/input-amount/test/lion-input-amount.test.d.ts.map +1 -1
- package/dist-types/components/input-date/src/LionInputDate.d.ts.map +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +1 -1
- package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
- package/dist-types/components/input-file/src/FileHandle.d.ts +55 -0
- package/dist-types/components/input-file/src/FileHandle.d.ts.map +1 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts +230 -0
- package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -0
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts +69 -0
- package/dist-types/components/input-file/src/LionSelectedFileList.d.ts.map +1 -0
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts +2 -0
- package/dist-types/components/input-file/src/localizeNamespaceLoader.d.ts.map +1 -0
- package/dist-types/components/input-file/src/validators.d.ts +58 -0
- package/dist-types/components/input-file/src/validators.d.ts.map +1 -0
- package/dist-types/components/input-file/test/FileValidators.test.d.ts +2 -0
- package/dist-types/components/input-file/test/FileValidators.test.d.ts.map +1 -0
- package/dist-types/components/input-file/test/lion-input-file.test.d.ts +5 -0
- package/dist-types/components/input-file/test/lion-input-file.test.d.ts.map +1 -0
- package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts +4 -0
- package/dist-types/components/input-file/test/lion-selected-file-list.test.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/bg-BG.d.ts +13 -0
- package/dist-types/components/input-file/translations/bg-BG.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/bg.d.ts +13 -0
- package/dist-types/components/input-file/translations/bg.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts +13 -0
- package/dist-types/components/input-file/translations/cs-CZ.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/cs.d.ts +13 -0
- package/dist-types/components/input-file/translations/cs.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts +13 -0
- package/dist-types/components/input-file/translations/de-DE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/de.d.ts +13 -0
- package/dist-types/components/input-file/translations/de.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-AU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-GB.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-PH.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en-US.d.ts +13 -0
- package/dist-types/components/input-file/translations/en-US.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/en.d.ts +13 -0
- package/dist-types/components/input-file/translations/en.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts +13 -0
- package/dist-types/components/input-file/translations/es-ES.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/es.d.ts +13 -0
- package/dist-types/components/input-file/translations/es.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr-BE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr-FR.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/fr.d.ts +13 -0
- package/dist-types/components/input-file/translations/fr.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts +13 -0
- package/dist-types/components/input-file/translations/hu-HU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/hu.d.ts +13 -0
- package/dist-types/components/input-file/translations/hu.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts +13 -0
- package/dist-types/components/input-file/translations/it-IT.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/it.d.ts +13 -0
- package/dist-types/components/input-file/translations/it.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl-BE.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl-NL.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/nl.d.ts +13 -0
- package/dist-types/components/input-file/translations/nl.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts +13 -0
- package/dist-types/components/input-file/translations/pl-PL.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/pl.d.ts +13 -0
- package/dist-types/components/input-file/translations/pl.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts +13 -0
- package/dist-types/components/input-file/translations/ro-RO.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ro.d.ts +13 -0
- package/dist-types/components/input-file/translations/ro.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts +13 -0
- package/dist-types/components/input-file/translations/ru-RU.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/ru.d.ts +13 -0
- package/dist-types/components/input-file/translations/ru.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts +13 -0
- package/dist-types/components/input-file/translations/sk-SK.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/sk.d.ts +13 -0
- package/dist-types/components/input-file/translations/sk.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts +13 -0
- package/dist-types/components/input-file/translations/uk-UA.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/uk.d.ts +13 -0
- package/dist-types/components/input-file/translations/uk.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts +13 -0
- package/dist-types/components/input-file/translations/zh-CN.d.ts.map +1 -0
- package/dist-types/components/input-file/translations/zh.d.ts +13 -0
- package/dist-types/components/input-file/translations/zh.d.ts.map +1 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +6 -0
- package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts +0 -1
- package/dist-types/components/input-tel-dropdown/src/LionInputTelDropdown.d.ts.map +1 -1
- package/dist-types/components/listbox/src/ListboxMixin.d.ts.map +1 -1
- package/dist-types/components/listbox/test-suites/ListboxMixin.suite.d.ts.map +1 -1
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceNoSpaceBetweenCurrencySymbolAndNumber.d.ts +14 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceNoSpaceBetweenCurrencySymbolAndNumber.d.ts.map +1 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceSymbols.d.ts +20 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceSymbols.d.ts.map +1 -0
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/normalizeIntl.d.ts.map +1 -1
- package/dist-types/exports/checkbox-group-test-suites.d.ts +2 -0
- package/dist-types/exports/checkbox-group-test-suites.d.ts.map +1 -0
- package/dist-types/exports/define/lion-input-file.d.ts +2 -0
- package/dist-types/exports/define/lion-input-file.d.ts.map +1 -0
- package/dist-types/exports/define/lion-selected-file-list.d.ts +2 -0
- package/dist-types/exports/define/lion-selected-file-list.d.ts.map +1 -0
- package/dist-types/exports/input-file.d.ts +4 -0
- package/dist-types/exports/input-file.d.ts.map +1 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/button/extensions/bootstrap-button.mjs +240 -0
- package/docs/components/button/extensions.md +30 -0
- package/docs/components/checkbox-group/overview.md +9 -10
- package/docs/components/checkbox-group/use-cases.md +110 -142
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/{examples.md → extensions.md} +51 -43
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/src/google-combobox/google-combobox.js +4 -1
- package/docs/components/combobox/src/md-combobox/md-combobox.js +40 -38
- package/docs/components/combobox/src/wa-combobox/wa-combobox.js +204 -209
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-amount/use-cases.md +4 -2
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-datepicker/use-cases.md +11 -0
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/index.md +3 -0
- package/docs/components/input-file/overview.md +32 -0
- package/docs/components/input-file/use-cases.md +424 -0
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/{examples.md → extensions.md} +1 -1
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
- package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +28 -0
- package/docs/fundamentals/systems/core/SlotMixin.md +148 -0
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/use-cases.md +2 -0
- package/docs/fundamentals/systems/form/validate.md +1 -1
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/_configuration-positioning.md +116 -0
- package/docs/fundamentals/systems/overlays/_edge-cases.md +145 -0
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +21 -0
- package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +19 -0
- package/docs/fundamentals/tools/singleton-manager/example-success/index.md +18 -0
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +88 -0
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/how-to/get-started.md +28 -1
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/exports/checkbox-group-test-suites.js +1 -0
- package/exports/define/lion-input-file.js +3 -0
- package/exports/define/lion-selected-file-list.js +3 -0
- package/exports/input-file.js +3 -0
- package/package.json +3 -2
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.js +0 -25
- package/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.js +0 -15
- package/dist-types/components/checkbox-group/test/lion-checkbox-indeterminate.test.d.ts +0 -4
- package/dist-types/components/checkbox-group/test/lion-checkbox-indeterminate.test.d.ts.map +0 -1
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.d.ts +0 -14
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceENAUSymbols.d.ts.map +0 -1
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.d.ts +0 -9
- package/dist-types/components/localize/src/number/utils/normalize-format-number-to-parts/forceYenSymbol.d.ts.map +0 -1
- package/docs/components/combobox/src/google-combobox/assets/googlelogo_color_272x92dp.png +0 -0
- package/docs/components/dialog/src/demo-dialog-style.js +0 -3
- package/docs/components/select-rich/src/flags.png +0 -0
- package/docs/components/select-rich/src/flags@2x.png +0 -0
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-1.svg +0 -1
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-2.svg +0 -1
- package/docs/fundamentals/systems/form/assets/FormatMixinDiagram-3.svg +0 -84
- package/docs/fundamentals/tools/ajax/assets/naga.json +0 -9
- package/docs/fundamentals/tools/ajax/assets/pabu.json +0 -9
- package/docs/fundamentals/tools/singleton-manager/.gitignore +0 -1
- package/docs/override.js +0 -15
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { LionButton } from '@lion/ui/button.js';
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('./BootstrapButtonTypes.js').BootstrapButtonVariant} BootstrapButtonVariant
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export class BootstrapButton extends LionButton {
|
|
9
|
+
/** @type {any} */
|
|
10
|
+
static properties = {
|
|
11
|
+
variant: { type: String, reflect: true },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
static styles = [
|
|
15
|
+
...super.styles,
|
|
16
|
+
css`
|
|
17
|
+
:host {
|
|
18
|
+
--bs-border-radius: 0.375rem;
|
|
19
|
+
--bs-border-width: 1px;
|
|
20
|
+
|
|
21
|
+
--bs-btn-font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
22
|
+
'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
23
|
+
'Segoe UI Symbol', 'Noto Color Emoji';
|
|
24
|
+
margin: 0.25rem 0.125rem;
|
|
25
|
+
|
|
26
|
+
--bs-btn-padding-x: 0.75rem;
|
|
27
|
+
--bs-btn-padding-y: 0.375rem;
|
|
28
|
+
--bs-btn-font-size: 1rem;
|
|
29
|
+
--bs-btn-font-weight: 400;
|
|
30
|
+
--bs-btn-line-height: 1.5;
|
|
31
|
+
--bs-btn-color: var(--bs-body-color);
|
|
32
|
+
--bs-btn-bg: transparent;
|
|
33
|
+
--bs-btn-border-width: var(--bs-border-width);
|
|
34
|
+
--bs-btn-border-color: transparent;
|
|
35
|
+
--bs-btn-border-radius: var(--bs-border-radius);
|
|
36
|
+
--bs-btn-hover-border-color: transparent;
|
|
37
|
+
--bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
|
|
38
|
+
--bs-btn-disabled-opacity: 0.65;
|
|
39
|
+
--bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), 0.5);
|
|
40
|
+
display: inline-block;
|
|
41
|
+
padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
|
|
42
|
+
font-family: var(--bs-btn-font-family);
|
|
43
|
+
font-size: var(--bs-btn-font-size);
|
|
44
|
+
font-weight: var(--bs-btn-font-weight);
|
|
45
|
+
line-height: var(--bs-btn-line-height);
|
|
46
|
+
color: var(--bs-btn-color);
|
|
47
|
+
text-align: center;
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
vertical-align: middle;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
-webkit-user-select: none;
|
|
52
|
+
-moz-user-select: none;
|
|
53
|
+
user-select: none;
|
|
54
|
+
border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
|
|
55
|
+
border-radius: var(--bs-btn-border-radius);
|
|
56
|
+
background-color: var(--bs-btn-bg);
|
|
57
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
|
|
58
|
+
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
59
|
+
text-transform: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host(:not([disabled])) {
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host(:hover) {
|
|
67
|
+
color: var(--bs-btn-hover-color);
|
|
68
|
+
background-color: var(--bs-btn-hover-bg);
|
|
69
|
+
border-color: var(--bs-btn-hover-border-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host(:active),
|
|
73
|
+
:host([active]) {
|
|
74
|
+
color: var(--bs-btn-active-color);
|
|
75
|
+
background-color: var(--bs-btn-active-bg);
|
|
76
|
+
border-color: var(--bs-btn-active-border-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([variant='primary']) {
|
|
80
|
+
--bs-btn-color: #fff;
|
|
81
|
+
--bs-btn-bg: #0d6efd;
|
|
82
|
+
--bs-btn-border-color: #0d6efd;
|
|
83
|
+
--bs-btn-hover-color: #fff;
|
|
84
|
+
--bs-btn-hover-bg: #0b5ed7;
|
|
85
|
+
--bs-btn-hover-border-color: #0a58ca;
|
|
86
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
87
|
+
--bs-btn-active-color: #fff;
|
|
88
|
+
--bs-btn-active-bg: #0a58ca;
|
|
89
|
+
--bs-btn-active-border-color: #0a53be;
|
|
90
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
91
|
+
--bs-btn-disabled-color: #fff;
|
|
92
|
+
--bs-btn-disabled-bg: #0d6efd;
|
|
93
|
+
--bs-btn-disabled-border-color: #0d6efd;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:host([variant='secondary']) {
|
|
97
|
+
--bs-btn-color: #fff;
|
|
98
|
+
--bs-btn-bg: #6c757d;
|
|
99
|
+
--bs-btn-border-color: #6c757d;
|
|
100
|
+
--bs-btn-hover-color: #fff;
|
|
101
|
+
--bs-btn-hover-bg: #5c636a;
|
|
102
|
+
--bs-btn-hover-border-color: #565e64;
|
|
103
|
+
--bs-btn-focus-shadow-rgb: 130, 138, 145;
|
|
104
|
+
--bs-btn-active-color: #fff;
|
|
105
|
+
--bs-btn-active-bg: #565e64;
|
|
106
|
+
--bs-btn-active-border-color: #51585e;
|
|
107
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
108
|
+
--bs-btn-disabled-color: #fff;
|
|
109
|
+
--bs-btn-disabled-bg: #6c757d;
|
|
110
|
+
--bs-btn-disabled-border-color: #6c757d;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([variant='success']) {
|
|
114
|
+
--bs-btn-color: #fff;
|
|
115
|
+
--bs-btn-bg: #198754;
|
|
116
|
+
--bs-btn-border-color: #198754;
|
|
117
|
+
--bs-btn-hover-color: #fff;
|
|
118
|
+
--bs-btn-hover-bg: #157347;
|
|
119
|
+
--bs-btn-hover-border-color: #146c43;
|
|
120
|
+
--bs-btn-focus-shadow-rgb: 60, 153, 110;
|
|
121
|
+
--bs-btn-active-color: #fff;
|
|
122
|
+
--bs-btn-active-bg: #146c43;
|
|
123
|
+
--bs-btn-active-border-color: #13653f;
|
|
124
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
125
|
+
--bs-btn-disabled-color: #fff;
|
|
126
|
+
--bs-btn-disabled-bg: #198754;
|
|
127
|
+
--bs-btn-disabled-border-color: #198754;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([variant='danger']) {
|
|
131
|
+
--bs-btn-color: #fff;
|
|
132
|
+
--bs-btn-bg: #dc3545;
|
|
133
|
+
--bs-btn-border-color: #dc3545;
|
|
134
|
+
--bs-btn-hover-color: #fff;
|
|
135
|
+
--bs-btn-hover-bg: #bb2d3b;
|
|
136
|
+
--bs-btn-hover-border-color: #b02a37;
|
|
137
|
+
--bs-btn-focus-shadow-rgb: 225, 83, 97;
|
|
138
|
+
--bs-btn-active-color: #fff;
|
|
139
|
+
--bs-btn-active-bg: #b02a37;
|
|
140
|
+
--bs-btn-active-border-color: #a52834;
|
|
141
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
142
|
+
--bs-btn-disabled-color: #fff;
|
|
143
|
+
--bs-btn-disabled-bg: #dc3545;
|
|
144
|
+
--bs-btn-disabled-border-color: #dc3545;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([variant='warning']) {
|
|
148
|
+
--bs-btn-color: #000;
|
|
149
|
+
--bs-btn-bg: #ffc107;
|
|
150
|
+
--bs-btn-border-color: #ffc107;
|
|
151
|
+
--bs-btn-hover-color: #000;
|
|
152
|
+
--bs-btn-hover-bg: #ffca2c;
|
|
153
|
+
--bs-btn-hover-border-color: #ffc720;
|
|
154
|
+
--bs-btn-focus-shadow-rgb: 217, 164, 6;
|
|
155
|
+
--bs-btn-active-color: #000;
|
|
156
|
+
--bs-btn-active-bg: #ffcd39;
|
|
157
|
+
--bs-btn-active-border-color: #ffc720;
|
|
158
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
159
|
+
--bs-btn-disabled-color: #000;
|
|
160
|
+
--bs-btn-disabled-bg: #ffc107;
|
|
161
|
+
--bs-btn-disabled-border-color: #ffc107;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([variant='info']) {
|
|
165
|
+
--bs-btn-color: #000;
|
|
166
|
+
--bs-btn-bg: #0dcaf0;
|
|
167
|
+
--bs-btn-border-color: #0dcaf0;
|
|
168
|
+
--bs-btn-hover-color: #000;
|
|
169
|
+
--bs-btn-hover-bg: #31d2f2;
|
|
170
|
+
--bs-btn-hover-border-color: #25cff2;
|
|
171
|
+
--bs-btn-focus-shadow-rgb: 11, 172, 204;
|
|
172
|
+
--bs-btn-active-color: #000;
|
|
173
|
+
--bs-btn-active-bg: #3dd5f3;
|
|
174
|
+
--bs-btn-active-border-color: #25cff2;
|
|
175
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
176
|
+
--bs-btn-disabled-color: #000;
|
|
177
|
+
--bs-btn-disabled-bg: #0dcaf0;
|
|
178
|
+
--bs-btn-disabled-border-color: #0dcaf0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host([variant='light']) {
|
|
182
|
+
--bs-btn-color: #000;
|
|
183
|
+
--bs-btn-bg: #f8f9fa;
|
|
184
|
+
--bs-btn-border-color: #f8f9fa;
|
|
185
|
+
--bs-btn-hover-color: #000;
|
|
186
|
+
--bs-btn-hover-bg: #d3d4d5;
|
|
187
|
+
--bs-btn-hover-border-color: #c6c7c8;
|
|
188
|
+
--bs-btn-focus-shadow-rgb: 211, 212, 213;
|
|
189
|
+
--bs-btn-active-color: #000;
|
|
190
|
+
--bs-btn-active-bg: #c6c7c8;
|
|
191
|
+
--bs-btn-active-border-color: #babbbc;
|
|
192
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
193
|
+
--bs-btn-disabled-color: #000;
|
|
194
|
+
--bs-btn-disabled-bg: #f8f9fa;
|
|
195
|
+
--bs-btn-disabled-border-color: #f8f9fa;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
:host([variant='dark']) {
|
|
199
|
+
--bs-btn-color: #fff;
|
|
200
|
+
--bs-btn-bg: #212529;
|
|
201
|
+
--bs-btn-border-color: #212529;
|
|
202
|
+
--bs-btn-hover-color: #fff;
|
|
203
|
+
--bs-btn-hover-bg: #424649;
|
|
204
|
+
--bs-btn-hover-border-color: #373b3e;
|
|
205
|
+
--bs-btn-focus-shadow-rgb: 66, 70, 73;
|
|
206
|
+
--bs-btn-active-color: #fff;
|
|
207
|
+
--bs-btn-active-bg: #4d5154;
|
|
208
|
+
--bs-btn-active-border-color: #373b3e;
|
|
209
|
+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
|
210
|
+
--bs-btn-disabled-color: #fff;
|
|
211
|
+
--bs-btn-disabled-bg: #212529;
|
|
212
|
+
--bs-btn-disabled-border-color: #212529;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:host([variant='link']) {
|
|
216
|
+
--bs-btn-font-weight: 400;
|
|
217
|
+
--bs-btn-color: var(--bs-link-color);
|
|
218
|
+
--bs-btn-bg: transparent;
|
|
219
|
+
--bs-btn-border-color: transparent;
|
|
220
|
+
--bs-btn-hover-color: var(--bs-link-hover-color);
|
|
221
|
+
--bs-btn-hover-border-color: transparent;
|
|
222
|
+
--bs-btn-active-color: var(--bs-link-hover-color);
|
|
223
|
+
--bs-btn-active-border-color: transparent;
|
|
224
|
+
--bs-btn-disabled-color: #6c757d;
|
|
225
|
+
--bs-btn-disabled-border-color: transparent;
|
|
226
|
+
--bs-btn-box-shadow: 0 0 0 #000;
|
|
227
|
+
--bs-btn-focus-shadow-rgb: 49, 132, 253;
|
|
228
|
+
text-decoration: underline;
|
|
229
|
+
}
|
|
230
|
+
`,
|
|
231
|
+
];
|
|
232
|
+
|
|
233
|
+
constructor() {
|
|
234
|
+
super();
|
|
235
|
+
|
|
236
|
+
/** @type {BootstrapButtonVariant} */
|
|
237
|
+
this.variant = 'primary';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
customElements.define('bootstrap-button', BootstrapButton);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Button >> Extensions ||90
|
|
2
|
+
|
|
3
|
+
```js script
|
|
4
|
+
import { html } from '@mdjs/mdjs-preview';
|
|
5
|
+
import './extensions/bootstrap-button.mjs';
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Bootstrap button
|
|
9
|
+
|
|
10
|
+
```js preview-story
|
|
11
|
+
const capitalize = s => s[0].toUpperCase() + s.slice(1);
|
|
12
|
+
|
|
13
|
+
export const bootstrapButton = () => {
|
|
14
|
+
const variants = [
|
|
15
|
+
'primary',
|
|
16
|
+
'secondary',
|
|
17
|
+
'success',
|
|
18
|
+
'danger',
|
|
19
|
+
'warning',
|
|
20
|
+
'info',
|
|
21
|
+
'light',
|
|
22
|
+
'dark',
|
|
23
|
+
'link',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
return html`<div>
|
|
27
|
+
${variants.map(v => html`<bootstrap-button variant="${v}">${capitalize(v)}</bootstrap-button>`)}
|
|
28
|
+
</div>`;
|
|
29
|
+
};
|
|
30
|
+
```
|
|
@@ -11,21 +11,19 @@ import '@lion/ui/define/lion-checkbox-group.js';
|
|
|
11
11
|
import '@lion/ui/define/lion-checkbox.js';
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
<lion-checkbox
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</lion-checkbox-group>
|
|
21
|
-
`;
|
|
14
|
+
```html preview-story
|
|
15
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
16
|
+
<lion-checkbox label="Archimedes" .choiceValue=${'Archimedes'}></lion-checkbox>
|
|
17
|
+
<lion-checkbox label="Francis Bacon" .choiceValue=${'Francis Bacon'}></lion-checkbox>
|
|
18
|
+
<lion-checkbox label="Marie Curie" .choiceValue=${'Marie Curie'}></lion-checkbox>
|
|
19
|
+
</lion-checkbox-group>
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
> Make sure that the checkbox-group also has a name attribute, this is necessary for our [form](https://github.com/ing-bank/lion/blob/
|
|
22
|
+
> Make sure that the checkbox-group also has a name attribute, this is necessary for our [form](https://github.com/ing-bank/lion/blob/a19e02c443e21d4e6c62bb08bbe6db64f7446010/docs/components/form/overview.md)'s serialization result.
|
|
25
23
|
|
|
26
24
|
## Features
|
|
27
25
|
|
|
28
|
-
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/
|
|
26
|
+
Since it extends from our [fieldset](https://github.com/ing-bank/lion/blob/a19e02c443e21d4e6c62bb08bbe6db64f7446010/docs/components/fieldset/overview.md),
|
|
29
27
|
it has all the features a fieldset has.
|
|
30
28
|
|
|
31
29
|
## Installation
|
|
@@ -36,5 +34,6 @@ npm i --save @lion/ui
|
|
|
36
34
|
|
|
37
35
|
```js
|
|
38
36
|
import '@lion/ui/define/lion-checkbox-group.js';
|
|
37
|
+
import '@lion/ui/define/lion-checkbox-indeterminate.js';
|
|
39
38
|
import '@lion/ui/define/lion-checkbox.js';
|
|
40
39
|
```
|
|
@@ -45,86 +45,72 @@ Our recommendation would be to set the `name` attribute only on the `lion-checkb
|
|
|
45
45
|
|
|
46
46
|
You can pre-select options by targeting the `modelValue` object of the option and setting the `checked` property to `true`.
|
|
47
47
|
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
<lion-checkbox
|
|
51
|
-
|
|
52
|
-
<lion-checkbox label="
|
|
53
|
-
|
|
54
|
-
label="Marie Curie"
|
|
55
|
-
.modelValue=${{ value: 'Marie Curie', checked: true }}
|
|
56
|
-
></lion-checkbox>
|
|
57
|
-
</lion-checkbox-group>
|
|
58
|
-
`;
|
|
48
|
+
```html preview-story
|
|
49
|
+
<lion-checkbox-group name="scientists" label="Favorite scientists">
|
|
50
|
+
<lion-checkbox label="Archimedes" .choiceValue=${'Archimedes'}></lion-checkbox>
|
|
51
|
+
<lion-checkbox label="Francis Bacon" .choiceValue=${'Francis Bacon'} checked></lion-checkbox>
|
|
52
|
+
<lion-checkbox label="Marie Curie" .choiceValue=${'Marie Curie'}></lion-checkbox>
|
|
53
|
+
</lion-checkbox-group>
|
|
59
54
|
```
|
|
60
55
|
|
|
61
56
|
## Disabled
|
|
62
57
|
|
|
63
58
|
You can disable the entire group by setting the `disabled` attribute on the `<lion-checkbox-group>`.
|
|
64
59
|
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
<lion-checkbox
|
|
68
|
-
|
|
69
|
-
<lion-checkbox label="
|
|
70
|
-
|
|
71
|
-
label="Marie Curie"
|
|
72
|
-
.modelValue=${{ value: 'Marie Curie', checked: true }}
|
|
73
|
-
></lion-checkbox>
|
|
74
|
-
</lion-checkbox-group>
|
|
75
|
-
`;
|
|
60
|
+
```html preview-story
|
|
61
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists" disabled>
|
|
62
|
+
<lion-checkbox label="Archimedes" .choiceValue=${'Archimedes'}></lion-checkbox>
|
|
63
|
+
<lion-checkbox label="Francis Bacon" .choiceValue=${'Francis Bacon'}></lion-checkbox>
|
|
64
|
+
<lion-checkbox label="Marie Curie" .choiceValue=${'Marie Curie'}></lion-checkbox>
|
|
65
|
+
</lion-checkbox-group>
|
|
76
66
|
```
|
|
77
67
|
|
|
78
68
|
## Label
|
|
79
69
|
|
|
80
70
|
You can use `slot="label"` instead of the `label` attribute for defining more complex labels, such as containing screen reader only text or an anchor.
|
|
81
71
|
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
<lion-checkbox
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</lion-checkbox-group>
|
|
101
|
-
`;
|
|
72
|
+
```html preview-story
|
|
73
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
74
|
+
<lion-checkbox .choiceValue=${'Archimedes'}>
|
|
75
|
+
<label slot="label"
|
|
76
|
+
><a href="https://wikipedia.org/wiki/Archimedes" target="_blank">Archimedes</a></label
|
|
77
|
+
>
|
|
78
|
+
</lion-checkbox>
|
|
79
|
+
<lion-checkbox .choiceValue=${'Francis Bacon'}>
|
|
80
|
+
<label slot="label"
|
|
81
|
+
><a href="https://wikipedia.org/wiki/Francis_Bacon" target="_blank">Francis Bacon</a></label
|
|
82
|
+
>
|
|
83
|
+
</lion-checkbox>
|
|
84
|
+
<lion-checkbox .choiceValue=${'Marie Curie'}>
|
|
85
|
+
<label slot="label"
|
|
86
|
+
><a href="https://wikipedia.org/wiki/Marie_Curie" target="_blank">Marie Curie</a></label
|
|
87
|
+
>
|
|
88
|
+
</lion-checkbox>
|
|
89
|
+
</lion-checkbox-group>
|
|
102
90
|
```
|
|
103
91
|
|
|
104
92
|
## Help text
|
|
105
93
|
|
|
106
94
|
You can add help text on each checkbox with `help-text` attribute on the `<lion-checkbox>`.
|
|
107
95
|
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
<lion-checkbox
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</lion-checkbox-group>
|
|
127
|
-
`;
|
|
96
|
+
```html preview-story
|
|
97
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
98
|
+
<lion-checkbox
|
|
99
|
+
label="Archimedes"
|
|
100
|
+
.choiceValue=${'Archimedes'}
|
|
101
|
+
help-text="Archimedes of Syracuse was a Greek mathematician, physicist, engineer, inventor, and astronomer"
|
|
102
|
+
></lion-checkbox>
|
|
103
|
+
<lion-checkbox
|
|
104
|
+
label="Francis Bacon"
|
|
105
|
+
.choiceValue=${'Francis Bacon'}
|
|
106
|
+
help-text="Francis Bacon, 1st Viscount St Alban also known as Lord Verulam, was an English philosopher and statesman who served as Attorney General and as Lord Chancellor of England"
|
|
107
|
+
></lion-checkbox>
|
|
108
|
+
<lion-checkbox
|
|
109
|
+
label="Marie Curie"
|
|
110
|
+
.choiceValue=${'Marie Curie'}
|
|
111
|
+
help-text="Marie Skłodowska Curie born Maria Salomea Skłodowska, was a Polish and naturalized-French physicist and chemist who conducted pioneering research on radioactivity"
|
|
112
|
+
></lion-checkbox>
|
|
113
|
+
</lion-checkbox-group>
|
|
128
114
|
```
|
|
129
115
|
|
|
130
116
|
## Event
|
|
@@ -156,102 +142,84 @@ export const event = ({ shadowRoot }) => html`
|
|
|
156
142
|
|
|
157
143
|
A `checkbox-indeterminate`'s value is neither true nor false, but is instead indeterminate, meaning that its state cannot be determined or stated in pure binary terms, based on it's `checkbox` children.
|
|
158
144
|
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
<lion-checkbox-
|
|
162
|
-
<lion-checkbox
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
label="Galileo Galilei"
|
|
184
|
-
.choiceValue=${'Galileo Galilei'}
|
|
185
|
-
></lion-checkbox>
|
|
186
|
-
</lion-checkbox-indeterminate>
|
|
187
|
-
</lion-checkbox-group>
|
|
188
|
-
`;
|
|
145
|
+
```html preview-story
|
|
146
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
147
|
+
<lion-checkbox-indeterminate label="Old Greek scientists">
|
|
148
|
+
<lion-checkbox
|
|
149
|
+
label="Archimedes"
|
|
150
|
+
.choiceValue=${'Archimedes'}
|
|
151
|
+
></lion-checkbox>
|
|
152
|
+
<lion-checkbox label="Plato" .choiceValue=${'Plato'}></lion-checkbox>
|
|
153
|
+
<lion-checkbox
|
|
154
|
+
label="Pythagoras"
|
|
155
|
+
.choiceValue=${'Pythagoras'}
|
|
156
|
+
></lion-checkbox>
|
|
157
|
+
</lion-checkbox-indeterminate>
|
|
158
|
+
<lion-checkbox-indeterminate label="17th Century scientists">
|
|
159
|
+
<lion-checkbox
|
|
160
|
+
label="Isaac Newton"
|
|
161
|
+
.choiceValue=${'Isaac Newton'}
|
|
162
|
+
></lion-checkbox>
|
|
163
|
+
<lion-checkbox
|
|
164
|
+
label="Galileo Galilei"
|
|
165
|
+
.choiceValue=${'Galileo Galilei'}
|
|
166
|
+
></lion-checkbox>
|
|
167
|
+
</lion-checkbox-indeterminate>
|
|
168
|
+
</lion-checkbox-group>
|
|
189
169
|
```
|
|
190
170
|
|
|
191
171
|
The `checkbox-indeterminate` can have another `checkbox-indeterminate` as a child.
|
|
192
172
|
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
<lion-checkbox-
|
|
196
|
-
<lion-checkbox
|
|
173
|
+
```html preview-story
|
|
174
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
175
|
+
<lion-checkbox-indeterminate label="Scientists">
|
|
176
|
+
<lion-checkbox
|
|
177
|
+
label="Isaac Newton"
|
|
178
|
+
.choiceValue=${'Isaac Newton'}
|
|
179
|
+
></lion-checkbox>
|
|
180
|
+
<lion-checkbox
|
|
181
|
+
label="Galileo Galilei"
|
|
182
|
+
.choiceValue=${'Galileo Galilei'}
|
|
183
|
+
></lion-checkbox>
|
|
184
|
+
<lion-checkbox-indeterminate label="Old Greek scientists">
|
|
197
185
|
<lion-checkbox
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
.choiceValue=${'Isaac Newton'}
|
|
186
|
+
label="Archimedes"
|
|
187
|
+
.choiceValue=${'Archimedes'}
|
|
201
188
|
></lion-checkbox>
|
|
189
|
+
<lion-checkbox label="Plato" .choiceValue=${'Plato'}></lion-checkbox>
|
|
202
190
|
<lion-checkbox
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
.choiceValue=${'Galileo Galilei'}
|
|
191
|
+
label="Pythagoras"
|
|
192
|
+
.choiceValue=${'Pythagoras'}
|
|
206
193
|
></lion-checkbox>
|
|
207
|
-
<lion-checkbox-indeterminate slot="checkbox" label="Old Greek scientists">
|
|
208
|
-
<lion-checkbox
|
|
209
|
-
slot="checkbox"
|
|
210
|
-
label="Archimedes"
|
|
211
|
-
.choiceValue=${'Archimedes'}
|
|
212
|
-
></lion-checkbox>
|
|
213
|
-
<lion-checkbox slot="checkbox" label="Plato" .choiceValue=${'Plato'}></lion-checkbox>
|
|
214
|
-
<lion-checkbox
|
|
215
|
-
slot="checkbox"
|
|
216
|
-
label="Pythagoras"
|
|
217
|
-
.choiceValue=${'Pythagoras'}
|
|
218
|
-
></lion-checkbox>
|
|
219
|
-
</lion-checkbox-indeterminate>
|
|
220
194
|
</lion-checkbox-indeterminate>
|
|
221
|
-
</lion-checkbox-
|
|
222
|
-
|
|
195
|
+
</lion-checkbox-indeterminate>
|
|
196
|
+
</lion-checkbox-group>
|
|
223
197
|
```
|
|
224
198
|
|
|
225
199
|
You can also use `mixed-state` attribute so your indeterminate checkbox toggles through three states (indeterminate, checked, unchecked), where for indeterminate state the old children states are restored when you toggle back into this.
|
|
226
200
|
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
<lion-checkbox-
|
|
230
|
-
<lion-checkbox
|
|
201
|
+
```html preview-story
|
|
202
|
+
<lion-checkbox-group name="scientists[]" label="Favorite scientists">
|
|
203
|
+
<lion-checkbox-indeterminate mixed-state label="Scientists">
|
|
204
|
+
<lion-checkbox
|
|
205
|
+
label="Isaac Newton"
|
|
206
|
+
.choiceValue=${'Isaac Newton'}
|
|
207
|
+
></lion-checkbox>
|
|
208
|
+
<lion-checkbox
|
|
209
|
+
label="Galileo Galilei"
|
|
210
|
+
.choiceValue=${'Galileo Galilei'}
|
|
211
|
+
></lion-checkbox>
|
|
212
|
+
<lion-checkbox-indeterminate mixed-state label="Old Greek scientists">
|
|
231
213
|
<lion-checkbox
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
.choiceValue=${'Isaac Newton'}
|
|
214
|
+
label="Archimedes"
|
|
215
|
+
.choiceValue=${'Archimedes'}
|
|
235
216
|
></lion-checkbox>
|
|
217
|
+
<lion-checkbox label="Plato" .choiceValue=${'Plato'}></lion-checkbox>
|
|
236
218
|
<lion-checkbox
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
.choiceValue=${'Galileo Galilei'}
|
|
219
|
+
label="Pythagoras"
|
|
220
|
+
.choiceValue=${'Pythagoras'}
|
|
240
221
|
></lion-checkbox>
|
|
241
|
-
<lion-checkbox-indeterminate mixed-state slot="checkbox" label="Old Greek scientists">
|
|
242
|
-
<lion-checkbox
|
|
243
|
-
slot="checkbox"
|
|
244
|
-
label="Archimedes"
|
|
245
|
-
.choiceValue=${'Archimedes'}
|
|
246
|
-
></lion-checkbox>
|
|
247
|
-
<lion-checkbox slot="checkbox" label="Plato" .choiceValue=${'Plato'}></lion-checkbox>
|
|
248
|
-
<lion-checkbox
|
|
249
|
-
slot="checkbox"
|
|
250
|
-
label="Pythagoras"
|
|
251
|
-
.choiceValue=${'Pythagoras'}
|
|
252
|
-
></lion-checkbox>
|
|
253
|
-
</lion-checkbox-indeterminate>
|
|
254
222
|
</lion-checkbox-indeterminate>
|
|
255
|
-
</lion-checkbox-
|
|
256
|
-
|
|
223
|
+
</lion-checkbox-indeterminate>
|
|
224
|
+
</lion-checkbox-group>
|
|
257
225
|
```
|
|
@@ -22,7 +22,7 @@ export const main = () => html`
|
|
|
22
22
|
## Features
|
|
23
23
|
|
|
24
24
|
- Use `opened` attribute or `toggle()` method to render default open.
|
|
25
|
-
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/
|
|
25
|
+
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/a19e02c443e21d4e6c62bb08bbe6db64f7446010/docs/components/button/overview.md) or native `button` with custom styling.
|
|
26
26
|
- Observe the state with the help of `@opened-changed` event.
|
|
27
27
|
- `show()` and `hide()` are helper methods to hide or show the content from outside.
|
|
28
28
|
|