@politiet/sheriff-web-components 2.6.0 → 2.6.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/custom-elements.json +1270 -978
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mixins/index.d.ts +3 -0
- package/dist/mixins/index.d.ts.map +1 -1
- package/dist/mixins/index.js +3 -0
- package/dist/mixins/index.js.map +1 -1
- package/dist/mixins/sds-dialog-target-mixin.d.ts +11 -0
- package/dist/mixins/sds-dialog-target-mixin.d.ts.map +1 -0
- package/dist/mixins/sds-dialog-target-mixin.js +95 -0
- package/dist/mixins/sds-dialog-target-mixin.js.map +1 -0
- package/dist/mixins/sds-form-control-mixin.d.ts +14 -0
- package/dist/mixins/sds-form-control-mixin.d.ts.map +1 -0
- package/dist/mixins/sds-form-control-mixin.js +40 -0
- package/dist/mixins/sds-form-control-mixin.js.map +1 -0
- package/dist/sds-button/sds-button.component.d.ts +3 -1
- package/dist/sds-button/sds-button.component.d.ts.map +1 -1
- package/dist/sds-button/sds-button.component.js +13 -3
- package/dist/sds-button/sds-button.component.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.d.ts +8 -16
- package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.js +38 -51
- package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.styles.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.styles.js +1 -0
- package/dist/sds-checkbox/sds-checkbox.styles.js.map +1 -1
- package/dist/sds-chip/sds-chip.d.ts +7 -15
- package/dist/sds-chip/sds-chip.d.ts.map +1 -1
- package/dist/sds-chip/sds-chip.js +16 -29
- package/dist/sds-chip/sds-chip.js.map +1 -1
- package/dist/sds-chip/sds-chip.styles.js +1 -1
- package/dist/sds-chip/sds-chip.styles.js.map +1 -1
- package/dist/sds-dialog/sds-dialog.component.d.ts +56 -0
- package/dist/sds-dialog/sds-dialog.component.d.ts.map +1 -0
- package/dist/sds-dialog/sds-dialog.component.js +181 -0
- package/dist/sds-dialog/sds-dialog.component.js.map +1 -0
- package/dist/sds-dialog/sds-dialog.d.ts +2 -52
- package/dist/sds-dialog/sds-dialog.d.ts.map +1 -1
- package/dist/sds-dialog/sds-dialog.js +2 -163
- package/dist/sds-dialog/sds-dialog.js.map +1 -1
- package/dist/sds-dialog/sds-dialog.spec.d.ts +2 -0
- package/dist/sds-dialog/sds-dialog.spec.d.ts.map +1 -0
- package/dist/sds-dialog/sds-dialog.spec.js +50 -0
- package/dist/sds-dialog/sds-dialog.spec.js.map +1 -0
- package/dist/sds-dialog/sds-dialog.styles.d.ts.map +1 -1
- package/dist/sds-dialog/sds-dialog.styles.js +1 -3
- package/dist/sds-dialog/sds-dialog.styles.js.map +1 -1
- package/dist/sds-radio/sds-radio.d.ts +14 -17
- package/dist/sds-radio/sds-radio.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.js +45 -61
- package/dist/sds-radio/sds-radio.js.map +1 -1
- package/dist/sds-select/sds-select.component.d.ts +54 -0
- package/dist/sds-select/sds-select.component.d.ts.map +1 -0
- package/dist/sds-select/sds-select.component.js +290 -0
- package/dist/sds-select/sds-select.component.js.map +1 -0
- package/dist/sds-select/sds-select.d.ts +2 -61
- package/dist/sds-select/sds-select.d.ts.map +1 -1
- package/dist/sds-select/sds-select.js +2 -298
- package/dist/sds-select/sds-select.js.map +1 -1
- package/dist/sds-select/sds-select.styles.js +1 -1
- package/dist/sds-select/sds-select.styles.js.map +1 -1
- package/dist/sds-stepper/sds-stepper.d.ts +0 -1
- package/dist/sds-stepper/sds-stepper.d.ts.map +1 -1
- package/dist/sds-stepper/sds-stepper.js +2 -3
- package/dist/sds-stepper/sds-stepper.js.map +1 -1
- package/dist/sds-stepper/sds-stepper.styles.d.ts.map +1 -1
- package/dist/sds-stepper/sds-stepper.styles.js +2 -1
- package/dist/sds-stepper/sds-stepper.styles.js.map +1 -1
- package/dist/sds-stepper-step/sds-stepper-step.styles.d.ts.map +1 -1
- package/dist/sds-stepper-step/sds-stepper-step.styles.js +7 -5
- package/dist/sds-stepper-step/sds-stepper-step.styles.js.map +1 -1
- package/dist/sds-switch/sds-switch.d.ts +5 -14
- package/dist/sds-switch/sds-switch.d.ts.map +1 -1
- package/dist/sds-switch/sds-switch.js +13 -26
- package/dist/sds-switch/sds-switch.js.map +1 -1
- package/dist/sds-switch/sds-switch.styles.js +1 -1
- package/dist/sds-switch/sds-switch.styles.js.map +1 -1
- package/dist/sds-textarea/sds-textarea.d.ts +12 -21
- package/dist/sds-textarea/sds-textarea.d.ts.map +1 -1
- package/dist/sds-textarea/sds-textarea.js +3 -20
- package/dist/sds-textarea/sds-textarea.js.map +1 -1
- package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -1
- package/dist/sds-textarea/sds-textarea.styles.js +8 -5
- package/dist/sds-textarea/sds-textarea.styles.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.d.ts +11 -20
- package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.js +4 -21
- package/dist/sds-textfield/sds-textfield.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.styles.js +5 -1
- package/dist/sds-textfield/sds-textfield.styles.js.map +1 -1
- package/dist/sheriff-web-components.js +186 -177
- package/package.json +1 -1
- package/web-types.json +1000 -853
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { SDSChipProps } from './sds-chip/sds-chip';
|
|
|
13
13
|
export { SDSDetails } from './sds-details/sds-details';
|
|
14
14
|
export type { SDSDetailsProps as SDSDetailProps } from './sds-details/sds-details';
|
|
15
15
|
export { SDSDialog } from './sds-dialog/sds-dialog';
|
|
16
|
-
export type { SDSDialogProps } from './sds-dialog/sds-dialog';
|
|
16
|
+
export type { SDSDialogProps } from './sds-dialog/sds-dialog.component';
|
|
17
17
|
export { SDSHeading } from './sds-heading/sds-heading';
|
|
18
18
|
export type { SDSHeadingProps } from './sds-heading/sds-heading.component';
|
|
19
19
|
export { SDSIcon } from './sds-icon/sds-icon';
|
|
@@ -33,7 +33,7 @@ export type { SDSRadioProps } from './sds-radio/sds-radio';
|
|
|
33
33
|
export { SDSRadioGroup } from './sds-radio-group/sds-radio-group';
|
|
34
34
|
export type { SDSRadioGroupProps } from './sds-radio-group/sds-radio-group';
|
|
35
35
|
export { SDSSelect } from './sds-select/sds-select';
|
|
36
|
-
export type { SDSSelectProps } from './sds-select/sds-select';
|
|
36
|
+
export type { SDSSelectProps } from './sds-select/sds-select.component';
|
|
37
37
|
export { SDSStepper } from './sds-stepper/sds-stepper';
|
|
38
38
|
export type { SDSStepperProps } from './sds-stepper/sds-stepper';
|
|
39
39
|
export { SDSStepperStep } from './sds-stepper-step/sds-stepper-step';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAErF,OAAO,EAAE,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O,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { SDSAlert } from './sds-alert/sds-alert';\nexport type { SDSAlertProps } from './sds-alert/sds-alert.component';\n\nexport { SDSButton } from './sds-button/sds-button';\nexport type { SDSButtonProps } from './sds-button/sds-button.component';\n\nexport { SDSCard } from './sds-card/sds-card';\nexport type { SDSCardProps } from './sds-card/sds-card';\n\nexport { SDSCheckbox } from './sds-checkbox/sds-checkbox';\nexport type { SDSCheckboxProps } from './sds-checkbox/sds-checkbox';\n\nexport { SDSCheckboxGroup } from './sds-checkbox-group/sds-checkbox-group';\nexport type { SDSCheckboxGroupProps } from './sds-checkbox-group/sds-checkbox-group';\n\nexport { SDSChip } from './sds-chip/sds-chip';\nexport type { SDSChipProps } from './sds-chip/sds-chip';\n\nexport { SDSDetails } from './sds-details/sds-details';\nexport type { SDSDetailsProps as SDSDetailProps } from './sds-details/sds-details';\n\nexport { SDSDialog } from './sds-dialog/sds-dialog';\nexport type { SDSDialogProps } from './sds-dialog/sds-dialog';\n\nexport { SDSHeading } from './sds-heading/sds-heading';\nexport type { SDSHeadingProps } from './sds-heading/sds-heading.component';\n\nexport { SDSIcon } from './sds-icon/sds-icon';\nexport type { SDSIconProps } from './sds-icon/sds-icon.component';\n\nexport { SDSLoader } from './sds-loader/sds-loader';\nexport type { SDSLoaderProps } from './sds-loader/sds-loader';\n\nexport { SDSNotification } from './sds-notification/sds-notification';\nexport type { SDSNotificationProps } from './sds-notification/sds-notification';\n\nexport { SDSProcess } from './sds-process/sds-process';\nexport type { SDSProcessProps } from './sds-process/sds-process';\n\nexport { SDSProcessStep } from './sds-process-step/sds-process-step';\nexport type { SDSProcessStepProps } from './sds-process-step/sds-process-step';\nexport { SDSPopover } from './sds-popover/sds-popover';\nexport type { SDSPopoverProps } from './sds-popover/sds-popover';\n\nexport { SDSRadio } from './sds-radio/sds-radio';\nexport type { SDSRadioProps } from './sds-radio/sds-radio';\n\nexport { SDSRadioGroup } from './sds-radio-group/sds-radio-group';\nexport type { SDSRadioGroupProps } from './sds-radio-group/sds-radio-group';\n\nexport { SDSSelect } from './sds-select/sds-select';\nexport type { SDSSelectProps } from './sds-select/sds-select';\n\nexport { SDSStepper } from './sds-stepper/sds-stepper';\nexport type { SDSStepperProps } from './sds-stepper/sds-stepper';\n\nexport { SDSStepperStep } from './sds-stepper-step/sds-stepper-step';\nexport type { SDSStepperStepProps } from './sds-stepper-step/sds-stepper-step';\n\nexport { SDSSwitch } from './sds-switch/sds-switch';\nexport type { SDSSwitchProps } from './sds-switch/sds-switch';\n\nexport { SDSTag } from './sds-tag/sds-tag';\nexport type { SDSTagProps } from './sds-tag/sds-tag';\n\nexport { SDSText } from './sds-text/sds-text';\nexport type { SDSTextProps } from './sds-text/sds-text.component';\n\nexport { SDSTextField } from './sds-textfield/sds-textfield';\nexport type { SDSTextFieldProps } from './sds-textfield/sds-textfield';\n\nexport { SDSTextArea } from './sds-textarea/sds-textarea';\nexport type { SDSTextAreaProps }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AC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { SDSAlert } from './sds-alert/sds-alert';\nexport type { SDSAlertProps } from './sds-alert/sds-alert.component';\n\nexport { SDSButton } from './sds-button/sds-button';\nexport type { SDSButtonProps } from './sds-button/sds-button.component';\n\nexport { SDSCard } from './sds-card/sds-card';\nexport type { SDSCardProps } from './sds-card/sds-card';\n\nexport { SDSCheckbox } from './sds-checkbox/sds-checkbox';\nexport type { SDSCheckboxProps } from './sds-checkbox/sds-checkbox';\n\nexport { SDSCheckboxGroup } from './sds-checkbox-group/sds-checkbox-group';\nexport type { SDSCheckboxGroupProps } from './sds-checkbox-group/sds-checkbox-group';\n\nexport { SDSChip } from './sds-chip/sds-chip';\nexport type { SDSChipProps } from './sds-chip/sds-chip';\n\nexport { SDSDetails } from './sds-details/sds-details';\nexport type { SDSDetailsProps as SDSDetailProps } from './sds-details/sds-details';\n\nexport { SDSDialog } from './sds-dialog/sds-dialog';\nexport type { SDSDialogProps } from './sds-dialog/sds-dialog.component';\n\nexport { SDSHeading } from './sds-heading/sds-heading';\nexport type { SDSHeadingProps } from './sds-heading/sds-heading.component';\n\nexport { SDSIcon } from './sds-icon/sds-icon';\nexport type { SDSIconProps } from './sds-icon/sds-icon.component';\n\nexport { SDSLoader } from './sds-loader/sds-loader';\nexport type { SDSLoaderProps } from './sds-loader/sds-loader';\n\nexport { SDSNotification } from './sds-notification/sds-notification';\nexport type { SDSNotificationProps } from './sds-notification/sds-notification';\n\nexport { SDSProcess } from './sds-process/sds-process';\nexport type { SDSProcessProps } from './sds-process/sds-process';\n\nexport { SDSProcessStep } from './sds-process-step/sds-process-step';\nexport type { SDSProcessStepProps } from './sds-process-step/sds-process-step';\nexport { SDSPopover } from './sds-popover/sds-popover';\nexport type { SDSPopoverProps } from './sds-popover/sds-popover';\n\nexport { SDSRadio } from './sds-radio/sds-radio';\nexport type { SDSRadioProps } from './sds-radio/sds-radio';\n\nexport { SDSRadioGroup } from './sds-radio-group/sds-radio-group';\nexport type { SDSRadioGroupProps } from './sds-radio-group/sds-radio-group';\n\nexport { SDSSelect } from './sds-select/sds-select';\nexport type { SDSSelectProps } from './sds-select/sds-select.component';\n\nexport { SDSStepper } from './sds-stepper/sds-stepper';\nexport type { SDSStepperProps } from './sds-stepper/sds-stepper';\n\nexport { SDSStepperStep } from './sds-stepper-step/sds-stepper-step';\nexport type { SDSStepperStepProps } from './sds-stepper-step/sds-stepper-step';\n\nexport { SDSSwitch } from './sds-switch/sds-switch';\nexport type { SDSSwitchProps } from './sds-switch/sds-switch';\n\nexport { SDSTag } from './sds-tag/sds-tag';\nexport type { SDSTagProps } from './sds-tag/sds-tag';\n\nexport { SDSText } from './sds-text/sds-text';\nexport type { SDSTextProps } from './sds-text/sds-text.component';\n\nexport { SDSTextField } from './sds-textfield/sds-textfield';\nexport type { SDSTextFieldProps } from './sds-textfield/sds-textfield';\n\nexport { SDSTextArea } from './sds-textarea/sds-textarea';\nexport type { SDSTextAreaProps } from './sds-textarea/sds-textarea';\n"]}
|
package/dist/mixins/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { SDSDelegateInteractionMixin } from './sds-delegate-interaction-mixin';
|
|
2
2
|
export { SDSEventDispatcherMixin } from './sds-event-dispatcher-mixin';
|
|
3
|
+
export { SDSFormControlMixin } from './sds-form-control-mixin';
|
|
4
|
+
export { SDSDialogTargetMixin } from './sds-dialog-target-mixin';
|
|
5
|
+
export { SDSPopoverTargetMixin } from './sds-popover-target-mixin';
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mixins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mixins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/mixins/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { SDSDelegateInteractionMixin } from './sds-delegate-interaction-mixin';
|
|
2
2
|
export { SDSEventDispatcherMixin } from './sds-event-dispatcher-mixin';
|
|
3
|
+
export { SDSFormControlMixin } from './sds-form-control-mixin';
|
|
4
|
+
export { SDSDialogTargetMixin } from './sds-dialog-target-mixin';
|
|
5
|
+
export { SDSPopoverTargetMixin } from './sds-popover-target-mixin';
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/dist/mixins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mixins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export { SDSDelegateInteractionMixin } from './sds-delegate-interaction-mixin';\nexport { SDSEventDispatcherMixin } from './sds-event-dispatcher-mixin';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mixins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export { SDSDelegateInteractionMixin } from './sds-delegate-interaction-mixin';\nexport { SDSEventDispatcherMixin } from './sds-event-dispatcher-mixin';\nexport { SDSFormControlMixin } from './sds-form-control-mixin';\nexport { SDSDialogTargetMixin } from './sds-dialog-target-mixin';\nexport { SDSPopoverTargetMixin } from './sds-popover-target-mixin';\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Constructable } from './types';
|
|
3
|
+
type DialogCommand = 'close' | 'request-close' | 'show-modal';
|
|
4
|
+
export interface SDSDialogTargetMixinInterface {
|
|
5
|
+
command?: DialogCommand;
|
|
6
|
+
commandFor?: string;
|
|
7
|
+
runDialogCommand(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function SDSDialogTargetMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSDialogTargetMixinInterface> & T;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=sds-dialog-target-mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-dialog-target-mixin.d.ts","sourceRoot":"","sources":["../../src/mixins/sds-dialog-target-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,KAAK,aAAa,GAAG,OAAO,GAAG,eAAe,GAAG,YAAY,CAAC;AAE9D,MAAM,WAAW,6BAA6B;IAC7C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,IAAI,IAAI,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,aAAa,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAuGzI"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { property } from 'lit/decorators.js';
|
|
8
|
+
export function SDSDialogTargetMixin(superClass) {
|
|
9
|
+
class SDSDialogTarget extends superClass {
|
|
10
|
+
updated(changed) {
|
|
11
|
+
super.updated(changed);
|
|
12
|
+
if (changed.has('command') || changed.has('commandFor')) {
|
|
13
|
+
this._updateCommandTarget();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
disconnectedCallback() {
|
|
17
|
+
super.disconnectedCallback();
|
|
18
|
+
this._cleanupDialogObserver();
|
|
19
|
+
}
|
|
20
|
+
_cleanupDialogObserver() {
|
|
21
|
+
if (this._dialogOpenObserver) {
|
|
22
|
+
this._dialogOpenObserver.disconnect();
|
|
23
|
+
this._dialogOpenObserver = undefined;
|
|
24
|
+
}
|
|
25
|
+
this._dialogElement = undefined;
|
|
26
|
+
}
|
|
27
|
+
_observeDialog(button, dialog) {
|
|
28
|
+
this._dialogElement = dialog;
|
|
29
|
+
// Observe the 'open' attribute to detect when the dialog opens
|
|
30
|
+
this._dialogOpenObserver = new MutationObserver((mutations) => {
|
|
31
|
+
for (const mutation of mutations) {
|
|
32
|
+
if (mutation.attributeName === 'open') {
|
|
33
|
+
const isOpen = dialog.hasAttribute('open');
|
|
34
|
+
button.setAttribute('aria-expanded', String(isOpen));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
this._dialogOpenObserver.observe(dialog, { attributes: true, attributeFilter: ['open'] });
|
|
39
|
+
}
|
|
40
|
+
_clearAriaFields(button) {
|
|
41
|
+
button.removeAttribute('aria-haspopup');
|
|
42
|
+
button.removeAttribute('aria-expanded');
|
|
43
|
+
button.removeAttribute('aria-controls');
|
|
44
|
+
}
|
|
45
|
+
_updateCommandTarget() {
|
|
46
|
+
this._cleanupDialogObserver();
|
|
47
|
+
const internalButton = this.shadowRoot?.querySelector('#control');
|
|
48
|
+
if (!internalButton) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!this.commandFor || !this.command) {
|
|
52
|
+
this._clearAriaFields(internalButton);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (this.command !== 'show-modal') {
|
|
56
|
+
this._clearAriaFields(internalButton);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const root = this.getRootNode();
|
|
60
|
+
const targetDialog = (root.getElementById?.(this.commandFor) ?? document.getElementById(this.commandFor));
|
|
61
|
+
if (!targetDialog) {
|
|
62
|
+
this._clearAriaFields(internalButton);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
internalButton.setAttribute('aria-haspopup', 'dialog');
|
|
66
|
+
internalButton.setAttribute('aria-expanded', String(targetDialog.open));
|
|
67
|
+
internalButton.setAttribute('aria-controls', this.commandFor);
|
|
68
|
+
this._observeDialog(internalButton, targetDialog);
|
|
69
|
+
}
|
|
70
|
+
runDialogCommand() {
|
|
71
|
+
if (!this._dialogElement) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
switch (this.command) {
|
|
75
|
+
case 'show-modal':
|
|
76
|
+
this._dialogElement.showModal();
|
|
77
|
+
break;
|
|
78
|
+
case 'close':
|
|
79
|
+
this._dialogElement.close();
|
|
80
|
+
break;
|
|
81
|
+
case 'request-close':
|
|
82
|
+
this._dialogElement.requestClose();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: String, attribute: 'command' })
|
|
89
|
+
], SDSDialogTarget.prototype, "command", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: String, attribute: 'commandfor' })
|
|
92
|
+
], SDSDialogTarget.prototype, "commandFor", void 0);
|
|
93
|
+
return SDSDialogTarget;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=sds-dialog-target-mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-dialog-target-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-dialog-target-mixin.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAa7C,MAAM,UAAU,oBAAoB,CAAsC,UAAa;IACtF,MAAM,eAAgB,SAAQ,UAAU;QAO9B,OAAO,CAAC,OAAuB;YACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAEvB,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzD,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC7B,CAAC;QACF,CAAC;QAEQ,oBAAoB;YAC5B,KAAK,CAAC,oBAAoB,EAAE,CAAC;YAC7B,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC/B,CAAC;QAEO,sBAAsB;YAC7B,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAC9B,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC;gBACtC,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACtC,CAA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QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;uDAAqB;IAmG1E,OAAO,eAAe,CAAC;AACxB,CAAC","sourcesContent":["import { LitElement, PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Constructable } from './types';\n\nimport type { SDSDialog } from '../sds-dialog/sds-dialog';\n\ntype DialogCommand = 'close' | 'request-close' | 'show-modal';\n\nexport interface SDSDialogTargetMixinInterface {\n\tcommand?: DialogCommand;\n\tcommandFor?: string;\n\trunDialogCommand(): void;\n}\n\nexport function SDSDialogTargetMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSDialogTargetMixinInterface> & T {\n\tclass SDSDialogTarget extends superClass {\n\t\t@property({ type: String, attribute: 'command' }) command?: DialogCommand;\n\t\t@property({ type: String, attribute: 'commandfor' }) commandFor?: string;\n\n\t\tprivate _dialogElement?: SDSDialog;\n\t\tprivate _dialogOpenObserver?: MutationObserver;\n\n\t\toverride updated(changed: PropertyValues) {\n\t\t\tsuper.updated(changed);\n\n\t\t\tif (changed.has('command') || changed.has('commandFor')) {\n\t\t\t\tthis._updateCommandTarget();\n\t\t\t}\n\t\t}\n\n\t\toverride disconnectedCallback() {\n\t\t\tsuper.disconnectedCallback();\n\t\t\tthis._cleanupDialogObserver();\n\t\t}\n\n\t\tprivate _cleanupDialogObserver() {\n\t\t\tif (this._dialogOpenObserver) {\n\t\t\t\tthis._dialogOpenObserver.disconnect();\n\t\t\t\tthis._dialogOpenObserver = undefined;\n\t\t\t}\n\t\t\tthis._dialogElement = undefined;\n\t\t}\n\n\t\tprivate _observeDialog(button: HTMLButtonElement, dialog: SDSDialog) {\n\t\t\tthis._dialogElement = dialog;\n\n\t\t\t// Observe the 'open' attribute to detect when the dialog opens\n\t\t\tthis._dialogOpenObserver = new MutationObserver((mutations) => {\n\t\t\t\tfor (const mutation of mutations) {\n\t\t\t\t\tif (mutation.attributeName === 'open') {\n\t\t\t\t\t\tconst isOpen = dialog.hasAttribute('open');\n\t\t\t\t\t\tbutton.setAttribute('aria-expanded', String(isOpen));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._dialogOpenObserver.observe(dialog, { attributes: true, attributeFilter: ['open'] });\n\t\t}\n\n\t\tprivate _clearAriaFields(button: HTMLButtonElement) {\n\t\t\tbutton.removeAttribute('aria-haspopup');\n\t\t\tbutton.removeAttribute('aria-expanded');\n\t\t\tbutton.removeAttribute('aria-controls');\n\t\t}\n\n\t\tprivate _updateCommandTarget() {\n\t\t\tthis._cleanupDialogObserver();\n\n\t\t\tconst internalButton = this.shadowRoot?.querySelector<HTMLButtonElement>('#control');\n\t\t\tif (!internalButton) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this.commandFor || !this.command) {\n\t\t\t\tthis._clearAriaFields(internalButton);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.command !== 'show-modal') {\n\t\t\t\tthis._clearAriaFields(internalButton);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\tconst targetDialog = (root.getElementById?.(this.commandFor) ?? document.getElementById(this.commandFor)) as SDSDialog | null;\n\n\t\t\tif (!targetDialog) {\n\t\t\t\tthis._clearAriaFields(internalButton);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tinternalButton.setAttribute('aria-haspopup', 'dialog');\n\t\t\tinternalButton.setAttribute('aria-expanded', String(targetDialog.open));\n\t\t\tinternalButton.setAttribute('aria-controls', this.commandFor);\n\n\t\t\tthis._observeDialog(internalButton, targetDialog);\n\t\t}\n\n\t\trunDialogCommand(): void {\n\t\t\tif (!this._dialogElement) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch (this.command) {\n\t\t\t\tcase 'show-modal':\n\t\t\t\t\tthis._dialogElement.showModal();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'close':\n\t\t\t\t\tthis._dialogElement.close();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'request-close':\n\t\t\t\t\tthis._dialogElement.requestClose();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn SDSDialogTarget;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Constructable } from './types';
|
|
3
|
+
export interface SDSFormControlProps {
|
|
4
|
+
name?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SDSFormControlMixinInterface extends SDSFormControlProps {
|
|
9
|
+
readonly internals: ElementInternals;
|
|
10
|
+
readonly form: HTMLFormElement | null;
|
|
11
|
+
formDisabledCallback(disabled: boolean): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function SDSFormControlMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSFormControlMixinInterface> & T;
|
|
14
|
+
//# sourceMappingURL=sds-form-control-mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-form-control-mixin.d.ts","sourceRoot":"","sources":["../../src/mixins/sds-form-control-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACrE,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CACjD;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,aAAa,CAAC,4BAA4B,CAAC,GAAG,CAAC,CA+BvI"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
export function SDSFormControlMixin(superClass) {
|
|
10
|
+
class SDSFormControl extends superClass {
|
|
11
|
+
constructor(...args) {
|
|
12
|
+
super(...args);
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
this.readOnly = false;
|
|
15
|
+
this.internals = this.attachInternals();
|
|
16
|
+
}
|
|
17
|
+
get form() {
|
|
18
|
+
return this.internals.form;
|
|
19
|
+
}
|
|
20
|
+
formDisabledCallback(disabled) {
|
|
21
|
+
this.disabled = disabled;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
SDSFormControl.formAssociated = true;
|
|
25
|
+
SDSFormControl.shadowRootOptions = {
|
|
26
|
+
...LitElement.shadowRootOptions,
|
|
27
|
+
delegatesFocus: true,
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
property({ type: String, reflect: true })
|
|
31
|
+
], SDSFormControl.prototype, "name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
property({ type: Boolean })
|
|
34
|
+
], SDSFormControl.prototype, "disabled", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
property({ type: Boolean, attribute: 'readonly', reflect: true })
|
|
37
|
+
], SDSFormControl.prototype, "readOnly", void 0);
|
|
38
|
+
return SDSFormControl;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=sds-form-control-mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-form-control-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-form-control-mixin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAe7C,MAAM,UAAU,mBAAmB,CAAsC,UAAa;IACrF,MAAM,cAAe,SAAQ,UAAU;QAetC,YAAY,GAAG,IAAW;YACzB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAJa,aAAQ,GAAY,KAAK,CAAC;YACY,aAAQ,GAAY,KAAK,CAAC;YAI5F,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,CAAC;QAED,IAAI,IAAI;YACP,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC5B,CAAC;QAED,oBAAoB,CAAC,QAAiB;YACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;;IAzBM,6BAAc,GAAG,IAAI,AAAP,CAAQ;IACtB,gCAAiB,GAAmB;QAC1C,GAAG,UAAU,CAAC,iBAAiB;QAC/B,cAAc,EAAE,IAAI;KACpB,AAHuB,CAGtB;IAMyC;QAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;IAC5B;QAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAA2B;IACY;QAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAA2B;IAgB9F,OAAO,cAAc,CAAC;AACvB,CAAC","sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Constructable } from './types';\n\nexport interface SDSFormControlProps {\n name?: string;\n disabled?: boolean;\n readOnly?: boolean;\n}\n\nexport interface SDSFormControlMixinInterface extends SDSFormControlProps {\n readonly internals: ElementInternals;\n readonly form: HTMLFormElement | null;\n formDisabledCallback(disabled: boolean): void;\n}\n\nexport function SDSFormControlMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSFormControlMixinInterface> & T {\n\tclass SDSFormControl extends superClass {\n\t\tstatic formAssociated = true;\n\t\tstatic shadowRootOptions: ShadowRootInit = {\n\t\t\t...LitElement.shadowRootOptions,\n\t\t\tdelegatesFocus: true,\n\t\t};\n\n\t\treadonly internals: ElementInternals;\n\n\t\t// Props\n\t\t// TODO: Add size: Extract<SDS_SIZES, 'lg' | 'md' | 'sm'> once legacy size aliases are removed from sds-chip and sds-switch\n\t\t@property({ type: String, reflect: true }) name?: string;\n\t\t@property({ type: Boolean }) disabled: boolean = false;\n\t\t@property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly: boolean = false;\n\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args);\n\t\t\tthis.internals = this.attachInternals();\n\t\t}\n\n\t\tget form(): HTMLFormElement | null {\n\t\t\treturn this.internals.form;\n\t\t}\n\n\t\tformDisabledCallback(disabled: boolean): void {\n\t\t\tthis.disabled = disabled;\n\t\t}\n\t}\n\n\treturn SDSFormControl;\n}\n"]}
|
|
@@ -5,6 +5,8 @@ type ButtonVariant = SDS_VARIANTS | 'critical';
|
|
|
5
5
|
type ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;
|
|
6
6
|
type TargetTypes = '_self' | '_blank' | '_parent' | '_top';
|
|
7
7
|
export interface SDSButtonProps {
|
|
8
|
+
command?: 'close' | 'request-close' | 'show-modal';
|
|
9
|
+
commandFor?: string;
|
|
8
10
|
disabled?: boolean;
|
|
9
11
|
form?: string;
|
|
10
12
|
href?: string;
|
|
@@ -19,7 +21,7 @@ export interface SDSButtonProps {
|
|
|
19
21
|
value?: string;
|
|
20
22
|
variant?: ButtonVariant;
|
|
21
23
|
}
|
|
22
|
-
declare const SDSButtonComponent_base: import("../mixins/types").Constructable<import("../mixins/sds-popover-target-mixin").SDSPopoverTargetMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-delegate-interaction-mixin").DelegateInteractionMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & typeof LitElement;
|
|
24
|
+
declare const SDSButtonComponent_base: import("../mixins/types").Constructable<import("../mixins/sds-dialog-target-mixin").SDSDialogTargetMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-popover-target-mixin").SDSPopoverTargetMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-delegate-interaction-mixin").DelegateInteractionMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & typeof LitElement;
|
|
23
25
|
export declare class SDSButtonComponent extends SDSButtonComponent_base {
|
|
24
26
|
static styles: import("lit").CSSResult[];
|
|
25
27
|
static formAssociated: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.component.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-button.component.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAIhE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAInD,KAAK,UAAU,GAAG,QAAQ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AAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAQ;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,UAAU,CAAY;IAC5B,KAAK,EAAE,MAAM,CAAM;IACnB,OAAO,EAAE,aAAa,CAAa;IAE3D,OAAO,EAAG,iBAAiB,CAAC;;IAOtC,OAAO,CAAC,OAAO,EAAE,cAAc;IASxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CA8D3B;IAEO,MAAM;CA+Bf"}
|
|
@@ -8,10 +8,9 @@ import { LitElement, html, nothing } from 'lit';
|
|
|
8
8
|
import { property, query } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { SDSPopoverTargetMixin } from '../mixins/sds-popover-target-mixin';
|
|
12
11
|
import { styles } from './sds-button.styles';
|
|
13
|
-
import { SDSEventDispatcherMixin, SDSDelegateInteractionMixin } from '../mixins';
|
|
14
|
-
export class SDSButtonComponent extends SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement))) {
|
|
12
|
+
import { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSDialogTargetMixin, SDSPopoverTargetMixin } from '../mixins';
|
|
13
|
+
export class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)))) {
|
|
15
14
|
constructor() {
|
|
16
15
|
super();
|
|
17
16
|
this.disabled = false;
|
|
@@ -31,6 +30,17 @@ export class SDSButtonComponent extends SDSPopoverTargetMixin(SDSDelegateInterac
|
|
|
31
30
|
}
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
33
|
+
// For dialog commands, emulate the native commandfor/command behavior on the host.
|
|
34
|
+
// Stop propagation and re-dispatch a composed click for listeners on the host.
|
|
35
|
+
if (this.commandFor && this.command) {
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
event.stopImmediatePropagation();
|
|
38
|
+
if (!this.disabled) {
|
|
39
|
+
this.runDialogCommand();
|
|
40
|
+
this.dispatchSheriffEvent('click');
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
34
44
|
event.preventDefault();
|
|
35
45
|
event.stopImmediatePropagation();
|
|
36
46
|
if (!this.disabled) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.component.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAuBjF,MAAM,OAAO,kBAAmB,SAAQ,qBAAqB,CAAC,2BAA2B,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAC;IAyB9H;QACC,KAAK,EAAE,CAAC;QAfmC,aAAQ,GAAY,KAAK,CAAC;QAC1B,SAAI,GAAY,KAAK,CAAC;QACtB,YAAO,GAAY,KAAK,CAAC;QAI1B,SAAI,GAAe,IAAI,CAAC;QAExB,SAAI,GAAe,QAAQ,CAAC;QAC5B,UAAK,GAAW,EAAE,CAAC;QACnB,YAAO,GAAkB,SAAS,CAAC;QAkB7D,iBAAY,GAAG,CAAC,KAAiB,EAAE,EAAE;YACrD,oEAAoE;YACpE,+EAA+E;YAC/E,IAAI,IAAI,CAAC,aAAa,EA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,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAsB;AACrB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAA6B;AAC5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAoB;AACnB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAoC;AAE3D;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAA6B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDSPopoverTargetMixin } from '../mixins/sds-popover-target-mixin';\nimport { SDS_SIZES, SDS_VARIANTS } from '../types';\nimport { styles } from './sds-button.styles';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin } from '../mixins';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = SDS_VARIANTS | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\ntype TargetTypes = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface SDSButtonProps {\n\tdisabled?: boolean;\n\tform?: string;\n\thref?: string;\n\ticon?: boolean;\n\tloading?: boolean;\n\tname?: string;\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: string;\n\tsize?: ButtonSize;\n\ttarget?: TargetTypes;\n\ttype?: ButtonType;\n\tvalue?: string;\n\tvariant?: ButtonVariant;\n}\n\nexport class SDSButtonComponent extends SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement))) {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\tstatic override shadowRootOptions: ShadowRootInit = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: Boolean, reflect: true }) icon: boolean = false;\n\t@property({ type: Boolean, reflect: true }) loading: boolean = false;\n\t@property({ type: String, reflect: true }) form?: string;\n\t@property({ type: String, reflect: true }) href?: string;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) size: ButtonSize = 'lg';\n\t@property({ type: String, reflect: true }) target?: TargetTypes;\n\t@property({ type: String, reflect: true }) type: ButtonType = 'button';\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) variant: ButtonVariant = 'primary';\n\n\t@query('#control') control!: HTMLButtonElement;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\tsuper.updated(changed);\n\n\t\t// Cast critical variant to danger palette to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.setAttribute('data-palette', 'danger');\n\t\t}\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\t// For popover triggers, let the browser handle the toggle natively.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.popoverTarget) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst shouldSubmit = this.dispatchSheriffEvent('submit');\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.requestSubmit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.requestSubmit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst shouldReset = this.dispatchSheriffEvent('reset');\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t}\n\t};\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--as-link': !!this.href,\n\t\t};\n\n\t\tif (this.href) {\n\t\t\treturn html` <a id=\"link\" class=\"${classMap(buttonClasses)}\" href=\"${this.href}\" target=\"${ifDefined(this.target)}\">\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</a>`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t>\n\t\t\t\t${this.loading ? html`<sds-loader slot=\"before\" ?contrast=\"${this.variant !== 'primary'}\"></sds-loader>` : nothing} ${this.loading ? nothing : html`<slot name=\"before\"></slot>`}\n\t\t\t\t<slot></slot>\n\t\t\t\t${this.loading ? nothing : html`<slot name=\"after\"></slot>`}\n\t\t\t</button>\n\t\t`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sds-button.component.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAyB9H,MAAM,OAAO,kBAAmB,SAAQ,oBAAoB,CAAC,qBAAqB,CAAC,2BAA2B,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAyBpJ;QACC,KAAK,EAAE,CAAC;QAfmC,aAAQ,GAAY,KAAK,CAAC;QAC1B,SAAI,GAAY,KAAK,CAAC;QACtB,YAAO,GAAY,KAAK,CAAC;QAI1B,SAAI,GAAe,IAAI,CAAC;QAExB,SAAI,GAAe,QAAQ,CAAC;QAC5B,UAAK,GAAW,EAAE,CAAC;QACnB,YAAO,GAAkB,SAAS,CAAC;QAkB7D,iBAAY,GAAG,CAAC,KAAiB,EAAE,EAAE;YACrD,oEAAoE;YACpE,+EAA+E;YAC/E,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBACxB,KAAK,CAA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AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAyB;AACxB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAsB;AACrB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAA6B;AAC5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAoB;AACnB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAoC;AAE3D;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAA6B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDS_SIZES, SDS_VARIANTS } from '../types';\nimport { styles } from './sds-button.styles';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSDialogTargetMixin, SDSPopoverTargetMixin } from '../mixins';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = SDS_VARIANTS | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\ntype TargetTypes = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface SDSButtonProps {\n\tcommand?: 'close' | 'request-close' | 'show-modal';\n\tcommandFor?: string;\n\tdisabled?: boolean;\n\tform?: string;\n\thref?: string;\n\ticon?: boolean;\n\tloading?: boolean;\n\tname?: string;\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: string;\n\tsize?: ButtonSize;\n\ttarget?: TargetTypes;\n\ttype?: ButtonType;\n\tvalue?: string;\n\tvariant?: ButtonVariant;\n}\n\nexport class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)))) {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\tstatic override shadowRootOptions: ShadowRootInit = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: Boolean, reflect: true }) icon: boolean = false;\n\t@property({ type: Boolean, reflect: true }) loading: boolean = false;\n\t@property({ type: String, reflect: true }) form?: string;\n\t@property({ type: String, reflect: true }) href?: string;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) size: ButtonSize = 'lg';\n\t@property({ type: String, reflect: true }) target?: TargetTypes;\n\t@property({ type: String, reflect: true }) type: ButtonType = 'button';\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) variant: ButtonVariant = 'primary';\n\n\t@query('#control') control!: HTMLButtonElement;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\tsuper.updated(changed);\n\n\t\t// Cast critical variant to danger palette to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.setAttribute('data-palette', 'danger');\n\t\t}\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\t// For popover triggers, let the browser handle the toggle natively.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.popoverTarget) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// For dialog commands, emulate the native commandfor/command behavior on the host.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.commandFor && this.command) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.runDialogCommand();\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst shouldSubmit = this.dispatchSheriffEvent('submit');\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.requestSubmit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.requestSubmit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst shouldReset = this.dispatchSheriffEvent('reset');\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t}\n\t};\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--as-link': !!this.href,\n\t\t};\n\n\t\tif (this.href) {\n\t\t\treturn html` <a id=\"link\" class=\"${classMap(buttonClasses)}\" href=\"${this.href}\" target=\"${ifDefined(this.target)}\">\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</a>`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t>\n\t\t\t\t${this.loading ? html`<sds-loader slot=\"before\" ?contrast=\"${this.variant !== 'primary'}\"></sds-loader>` : nothing} ${this.loading ? nothing : html`<slot name=\"before\"></slot>`}\n\t\t\t\t<slot></slot>\n\t\t\t\t${this.loading ? nothing : html`<slot name=\"after\"></slot>`}\n\t\t\t</button>\n\t\t`;\n\t}\n}\n"]}
|
|
@@ -1,42 +1,35 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { SDS_SIZES } from '../types';
|
|
3
|
+
import type { SDSFormControlProps } from '../mixins/sds-form-control-mixin';
|
|
3
4
|
type CheckboxSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;
|
|
4
|
-
export interface SDSCheckboxProps {
|
|
5
|
-
name?: string;
|
|
5
|
+
export interface SDSCheckboxProps extends SDSFormControlProps {
|
|
6
6
|
label?: string;
|
|
7
7
|
value?: string;
|
|
8
8
|
checked?: boolean;
|
|
9
|
-
disabled?: boolean;
|
|
10
9
|
error?: boolean;
|
|
11
10
|
required?: boolean;
|
|
12
|
-
readonly?: boolean;
|
|
13
11
|
size?: CheckboxSize;
|
|
14
12
|
'help-text'?: string;
|
|
15
13
|
parentRequestDisabled?: boolean;
|
|
16
14
|
}
|
|
17
|
-
declare const SDSCheckbox_base: import("../mixins/types").Constructable<import("../mixins/sds-delegate-interaction-mixin").DelegateInteractionMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & typeof LitElement;
|
|
15
|
+
declare const SDSCheckbox_base: import("../mixins/types").Constructable<import("../mixins/sds-delegate-interaction-mixin").DelegateInteractionMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-form-control-mixin").SDSFormControlMixinInterface> & typeof LitElement;
|
|
18
16
|
export declare class SDSCheckbox extends SDSCheckbox_base {
|
|
19
17
|
static styles: import("lit").CSSResult[];
|
|
20
|
-
static formAssociated: boolean;
|
|
21
|
-
readonly internals: ElementInternals;
|
|
22
|
-
static shadowRootOptions: ShadowRootInit;
|
|
23
|
-
name?: string;
|
|
24
18
|
label?: string;
|
|
25
19
|
value?: string;
|
|
26
20
|
checked: boolean;
|
|
21
|
+
error: boolean;
|
|
22
|
+
required: boolean;
|
|
23
|
+
size: CheckboxSize;
|
|
24
|
+
helpText?: string;
|
|
27
25
|
/**
|
|
28
26
|
* disabled:
|
|
29
27
|
* - If set directly (prop/attr), this checkbox becomes "self-controlled"
|
|
30
28
|
* and ignores parentRequestDisabled.
|
|
31
29
|
* - If not self-controlled, this follows parentRequestDisabled (group/form).
|
|
32
|
-
|
|
30
|
+
*/
|
|
33
31
|
get disabled(): SDSCheckboxProps['disabled'];
|
|
34
32
|
set disabled(value: SDSCheckboxProps['disabled']);
|
|
35
|
-
error: boolean;
|
|
36
|
-
required: boolean;
|
|
37
|
-
size: CheckboxSize;
|
|
38
|
-
helpText?: string;
|
|
39
|
-
readOnly: boolean;
|
|
40
33
|
/**
|
|
41
34
|
* parentRequestDisabled:
|
|
42
35
|
* - Set by SDSCheckboxGroup to request disabled/enabled.
|
|
@@ -50,7 +43,6 @@ export declare class SDSCheckbox extends SDSCheckbox_base {
|
|
|
50
43
|
private _settingDisabledFromParent;
|
|
51
44
|
private _parentRequestDisabled;
|
|
52
45
|
private _initialChecked;
|
|
53
|
-
constructor();
|
|
54
46
|
connectedCallback(): void;
|
|
55
47
|
firstUpdated(_changedProperties: PropertyValues): void;
|
|
56
48
|
formResetCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-checkbox.d.ts","sourceRoot":"","sources":["../../src/sds-checkbox/sds-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAMhE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-checkbox.d.ts","sourceRoot":"","sources":["../../src/sds-checkbox/sds-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAMhE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,KAAK,YAAY,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC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;CAiCf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;KAC5B;CACD"}
|
|
@@ -10,14 +10,47 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
|
10
10
|
import { classMap } from 'lit/directives/class-map.js';
|
|
11
11
|
import { guardedCustomElement } from '../utils/guarded-custom-element';
|
|
12
12
|
import { styles } from './sds-checkbox.styles';
|
|
13
|
-
import { SDSDelegateInteractionMixin, SDSEventDispatcherMixin } from '../mixins';
|
|
14
|
-
let SDSCheckbox = class SDSCheckbox extends SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)) {
|
|
13
|
+
import { SDSDelegateInteractionMixin, SDSEventDispatcherMixin, SDSFormControlMixin } from '../mixins';
|
|
14
|
+
let SDSCheckbox = class SDSCheckbox extends SDSDelegateInteractionMixin(SDSEventDispatcherMixin(SDSFormControlMixin(LitElement))) {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.checked = false;
|
|
18
|
+
this.error = false;
|
|
19
|
+
this.required = false;
|
|
20
|
+
this.size = 'md';
|
|
21
|
+
this._disabled = false;
|
|
22
|
+
this._disabledIsAuthorControlled = false;
|
|
23
|
+
this._settingDisabledFromParent = false;
|
|
24
|
+
this._parentRequestDisabled = false;
|
|
25
|
+
this._initialChecked = false;
|
|
26
|
+
this._handleChange = (event) => {
|
|
27
|
+
event.stopImmediatePropagation();
|
|
28
|
+
if (this.disabled || this.readOnly) {
|
|
29
|
+
event.target.checked = this.checked;
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const elem = event.target;
|
|
34
|
+
this.checked = elem.checked;
|
|
35
|
+
this.internals.setFormValue(elem.checked ? elem.value : null);
|
|
36
|
+
this._validate();
|
|
37
|
+
this.dispatchSheriffEvent('change');
|
|
38
|
+
};
|
|
39
|
+
this._handleFocus = (event) => {
|
|
40
|
+
event.stopImmediatePropagation();
|
|
41
|
+
this.dispatchSheriffEvent('focus');
|
|
42
|
+
};
|
|
43
|
+
this._handleBlur = (event) => {
|
|
44
|
+
event.stopImmediatePropagation();
|
|
45
|
+
this.dispatchSheriffEvent('blur');
|
|
46
|
+
};
|
|
47
|
+
}
|
|
15
48
|
/**
|
|
16
49
|
* disabled:
|
|
17
50
|
* - If set directly (prop/attr), this checkbox becomes "self-controlled"
|
|
18
51
|
* and ignores parentRequestDisabled.
|
|
19
52
|
* - If not self-controlled, this follows parentRequestDisabled (group/form).
|
|
20
|
-
|
|
53
|
+
*/
|
|
21
54
|
get disabled() {
|
|
22
55
|
return this._disabled;
|
|
23
56
|
}
|
|
@@ -53,41 +86,6 @@ let SDSCheckbox = class SDSCheckbox extends SDSDelegateInteractionMixin(SDSEvent
|
|
|
53
86
|
this.disabled = newVal;
|
|
54
87
|
this._settingDisabledFromParent = false;
|
|
55
88
|
}
|
|
56
|
-
constructor() {
|
|
57
|
-
super();
|
|
58
|
-
this.checked = false;
|
|
59
|
-
this.error = false;
|
|
60
|
-
this.required = false;
|
|
61
|
-
this.size = 'md';
|
|
62
|
-
this.readOnly = false;
|
|
63
|
-
this._disabled = false;
|
|
64
|
-
this._disabledIsAuthorControlled = false;
|
|
65
|
-
this._settingDisabledFromParent = false;
|
|
66
|
-
this._parentRequestDisabled = false;
|
|
67
|
-
this._initialChecked = false;
|
|
68
|
-
this._handleChange = (event) => {
|
|
69
|
-
event.stopImmediatePropagation();
|
|
70
|
-
if (this.disabled || this.readOnly) {
|
|
71
|
-
event.target.checked = this.checked;
|
|
72
|
-
event.preventDefault();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const elem = event.target;
|
|
76
|
-
this.checked = elem.checked;
|
|
77
|
-
this.internals.setFormValue(elem.checked ? elem.value : null);
|
|
78
|
-
this._validate();
|
|
79
|
-
this.dispatchSheriffEvent('change');
|
|
80
|
-
};
|
|
81
|
-
this._handleFocus = (event) => {
|
|
82
|
-
event.stopImmediatePropagation();
|
|
83
|
-
this.dispatchSheriffEvent('focus');
|
|
84
|
-
};
|
|
85
|
-
this._handleBlur = (event) => {
|
|
86
|
-
event.stopImmediatePropagation();
|
|
87
|
-
this.dispatchSheriffEvent('blur');
|
|
88
|
-
};
|
|
89
|
-
this.internals = this.attachInternals();
|
|
90
|
-
}
|
|
91
89
|
connectedCallback() {
|
|
92
90
|
super.connectedCallback();
|
|
93
91
|
this._initialChecked = this.checked;
|
|
@@ -171,14 +169,6 @@ let SDSCheckbox = class SDSCheckbox extends SDSDelegateInteractionMixin(SDSEvent
|
|
|
171
169
|
};
|
|
172
170
|
// Styling
|
|
173
171
|
SDSCheckbox.styles = [styles];
|
|
174
|
-
SDSCheckbox.formAssociated = true;
|
|
175
|
-
SDSCheckbox.shadowRootOptions = {
|
|
176
|
-
...LitElement.shadowRootOptions,
|
|
177
|
-
delegatesFocus: true,
|
|
178
|
-
};
|
|
179
|
-
__decorate([
|
|
180
|
-
property({ type: String, reflect: true })
|
|
181
|
-
], SDSCheckbox.prototype, "name", void 0);
|
|
182
172
|
__decorate([
|
|
183
173
|
property({ type: String, reflect: true })
|
|
184
174
|
], SDSCheckbox.prototype, "label", void 0);
|
|
@@ -188,9 +178,6 @@ __decorate([
|
|
|
188
178
|
__decorate([
|
|
189
179
|
property({ type: Boolean, reflect: true })
|
|
190
180
|
], SDSCheckbox.prototype, "checked", void 0);
|
|
191
|
-
__decorate([
|
|
192
|
-
property({ type: Boolean, reflect: true })
|
|
193
|
-
], SDSCheckbox.prototype, "disabled", null);
|
|
194
181
|
__decorate([
|
|
195
182
|
property({ type: Boolean, reflect: true })
|
|
196
183
|
], SDSCheckbox.prototype, "error", void 0);
|
|
@@ -204,8 +191,8 @@ __decorate([
|
|
|
204
191
|
property({ type: String, attribute: 'help-text' })
|
|
205
192
|
], SDSCheckbox.prototype, "helpText", void 0);
|
|
206
193
|
__decorate([
|
|
207
|
-
property({ type: Boolean
|
|
208
|
-
], SDSCheckbox.prototype, "
|
|
194
|
+
property({ type: Boolean })
|
|
195
|
+
], SDSCheckbox.prototype, "disabled", null);
|
|
209
196
|
__decorate([
|
|
210
197
|
property({ type: Boolean, attribute: false })
|
|
211
198
|
], SDSCheckbox.prototype, "parentRequestDisabled", null);
|