@sellmate/design-system 1.0.14 → 1.0.16
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/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{sd-button_17.cjs.entry.js → sd-button_18.cjs.entry.js} +283 -15
- package/dist/cjs/sd-modal-card.cjs.entry.js +2 -8
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/sd-field/sd-field.js +4 -3
- package/dist/collection/components/sd-field/sd-field.js.map +1 -1
- package/dist/collection/components/sd-modal-card/sd-modal-card.js +5 -12
- package/dist/collection/components/sd-modal-card/sd-modal-card.js.map +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.css +4 -25
- package/dist/collection/components/sd-number-input/sd-number-input.js +186 -27
- package/dist/collection/components/sd-number-input/sd-number-input.js.map +1 -1
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
- package/dist/components/{p-Bgf0RnXW.js → p-B-8YfRUg.js} +5 -5
- package/dist/components/{p-Bgf0RnXW.js.map → p-B-8YfRUg.js.map} +1 -1
- package/dist/components/{p-SUihbngJ.js → p-C2pN-_wD.js} +6 -5
- package/dist/components/p-C2pN-_wD.js.map +1 -0
- package/dist/components/p-CCwNgVmC.js +16 -0
- package/dist/components/p-CCwNgVmC.js.map +1 -0
- package/dist/components/{p-CYr3YYfa.js → p-CFHNnfIq.js} +7 -7
- package/dist/components/{p-CYr3YYfa.js.map → p-CFHNnfIq.js.map} +1 -1
- package/dist/components/{p-CXyVUgP3.js → p-CkzAorp3.js} +8 -8
- package/dist/components/{p-CXyVUgP3.js.map → p-CkzAorp3.js.map} +1 -1
- package/dist/components/{p-CbEUJ3R6.js → p-D16-dM6f.js} +3 -3
- package/dist/components/{p-CbEUJ3R6.js.map → p-D16-dM6f.js.map} +1 -1
- package/dist/components/{p-wRu9w6Gl.js → p-DUh9r-hn.js} +4 -4
- package/dist/components/{p-wRu9w6Gl.js.map → p-DUh9r-hn.js.map} +1 -1
- package/dist/components/{p-B0HvHSm3.js → p-DjZ8vXCq.js} +9 -8
- package/dist/components/p-DjZ8vXCq.js.map +1 -0
- package/dist/components/{p-CYYaSMIB.js → p-Dv4dN3Y5.js} +3 -3
- package/dist/components/{p-CYYaSMIB.js.map → p-Dv4dN3Y5.js.map} +1 -1
- package/dist/components/{p-DQE5-tOR.js → p-xfqZA_70.js} +5 -16
- package/dist/components/p-xfqZA_70.js.map +1 -0
- package/dist/components/sd-date-picker.js +3 -3
- package/dist/components/sd-date-range-picker.js +3 -3
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-modal-card.js +2 -8
- package/dist/components/sd-modal-card.js.map +1 -1
- package/dist/components/sd-number-input.js +64 -23
- package/dist/components/sd-number-input.js.map +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +2 -2
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +2 -2
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-multiple-group.js +5 -5
- package/dist/components/sd-select-multiple.js +7 -7
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-table.js +8 -8
- package/dist/components/sd-textarea.js +2 -2
- package/dist/components/sd-toggle-button.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-0a4afc3a.entry.js +2 -0
- package/dist/design-system/p-0a4afc3a.entry.js.map +1 -0
- package/dist/design-system/p-35a79a70.entry.js +2 -0
- package/dist/design-system/p-559728ad.entry.js +2 -0
- package/dist/design-system/p-559728ad.entry.js.map +1 -0
- package/dist/design-system/{p-cb3dd19f.entry.js → p-c77a42a2.entry.js} +2 -2
- package/dist/design-system/{p-1d6dabd7.entry.js → p-d7258320.entry.js} +2 -2
- package/dist/design-system/{p-44af67a6.entry.js → p-e5272c50.entry.js} +2 -2
- package/dist/design-system/{p-1616a1f6.entry.js → p-e6d39e65.entry.js} +2 -2
- package/dist/design-system/{p-cb502581.entry.js → p-ee96032f.entry.js} +2 -2
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{sd-button_17.entry.js → sd-button_18.entry.js} +283 -16
- package/dist/esm/sd-modal-card.entry.js +2 -8
- package/dist/esm/sd-modal-card.entry.js.map +1 -1
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-multiple.entry.js +1 -1
- package/dist/esm/sd-select-option-group.entry.js +3 -3
- package/dist/esm/sd-toggle-button.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-modal-card/sd-modal-card.d.ts +1 -1
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +12 -3
- package/dist/types/components.d.ts +45 -9
- package/hydrate/index.js +64 -53
- package/hydrate/index.mjs +64 -53
- package/package.json +1 -1
- package/dist/cjs/sd-number-input.cjs.entry.js +0 -262
- package/dist/components/p-B0HvHSm3.js.map +0 -1
- package/dist/components/p-DQE5-tOR.js.map +0 -1
- package/dist/components/p-SUihbngJ.js.map +0 -1
- package/dist/design-system/p-29b74787.entry.js +0 -2
- package/dist/design-system/p-29b74787.entry.js.map +0 -1
- package/dist/design-system/p-390feb8e.entry.js +0 -2
- package/dist/design-system/p-54376630.entry.js +0 -2
- package/dist/design-system/p-54376630.entry.js.map +0 -1
- package/dist/design-system/p-eb0b0cfe.entry.js +0 -2
- package/dist/design-system/p-eb0b0cfe.entry.js.map +0 -1
- package/dist/esm/sd-number-input.entry.js +0 -260
- package/dist/esm/sd-number-input.entry.js.map +0 -1
- /package/dist/design-system/{p-390feb8e.entry.js.map → p-35a79a70.entry.js.map} +0 -0
- /package/dist/design-system/{p-cb3dd19f.entry.js.map → p-c77a42a2.entry.js.map} +0 -0
- /package/dist/design-system/{p-1d6dabd7.entry.js.map → p-d7258320.entry.js.map} +0 -0
- /package/dist/design-system/{p-44af67a6.entry.js.map → p-e5272c50.entry.js.map} +0 -0
- /package/dist/design-system/{p-1616a1f6.entry.js.map → p-e6d39e65.entry.js.map} +0 -0
- /package/dist/design-system/{p-cb502581.entry.js.map → p-ee96032f.entry.js.map} +0 -0
|
@@ -38,11 +38,11 @@ const SdPopover = class {
|
|
|
38
38
|
this.showPopover = false;
|
|
39
39
|
};
|
|
40
40
|
render() {
|
|
41
|
-
return (index.h(index.Fragment, { key: '
|
|
41
|
+
return (index.h(index.Fragment, { key: '883bea0d5ef88bb63b4a1a2d778aedf0bce6f000' }, this.label ? (index.h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })) : (index.h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (index.h("sd-floating-portal", { key: '748b76d151dce05cffdd97d9803a96f14554ad3b', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement }, index.h("div", { key: '36bd2a265c89589b13e67107d57e8045a87d6b40', class: {
|
|
42
42
|
'sd-floating-menu': true,
|
|
43
43
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
44
44
|
[this.menuClass]: !!this.menuClass,
|
|
45
|
-
} }, index.h("i", { key: '
|
|
45
|
+
} }, index.h("i", { key: 'cd9b298e666ce898c83576c869e60e1e5e0bb38f', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, index.h(tooltipArrow.TooltipArrow, { key: '79012e2c547a71e2084958925445ac26a8bbf7fe' })), index.h("div", { key: '0664419fe24318ced7cbca2da1b9e0741c48f333', class: "sd-floating-menu__content" }, this.menuTitle && index.h("div", { key: 'a3f9238db85a7ca245cb5f794e1a9249742c3b42', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (index.h("div", { key: '56696f99a5400276c099a8ca69f904b4a932802c', class: "sd-floating-menu__messages" }, this.messages.map(message => (index.h("div", null, message))))), this.buttons.length > 0 && (index.h("div", { key: 'cbdf8231857ccb20156d25758dbe2d1809e28656', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (index.h("sd-button", { ...button })))))), this.useClose && (index.h("button", { key: 'a2f249d05c6cd40d24005307d78aea95a841b0b8', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, index.h("sd-icon", { key: '13ba057c4acf7ae65cfe8d722fe8bdb69ce506ac', name: "close", size: "12", color: "gery_55" }))))))));
|
|
46
46
|
}
|
|
47
47
|
static get watchers() { return {
|
|
48
48
|
"show": ["watchShowHandler"]
|
|
@@ -41,10 +41,10 @@ const SdProgress = class {
|
|
|
41
41
|
return this.statusColor[this.progressStatus];
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (index.h("div", { key: '
|
|
44
|
+
return (index.h("div", { key: '43da9dac67e760bfe53b8db11c27eef7ef0d8b3b', style: {
|
|
45
45
|
'--progress-color': this.progressColor,
|
|
46
46
|
'--progress-percentage': `${this.progressPercentage}%`,
|
|
47
|
-
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && index.h("div", { key: '
|
|
47
|
+
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && index.h("div", { key: 'af4b1c44f655546fede8ad548bddc6afb7810d2b', class: "sd-progress__label" }, this.label)));
|
|
48
48
|
}
|
|
49
49
|
renderBarProgress() {
|
|
50
50
|
return (index.h("div", { class: `sd-progress__bar sd-progress__bar--${this.progressStatus}` }, index.h("div", { class: ['sd-progress__bar__percent', this.progressPercentage < 100 ? 'proceed' : ''].join(' ') }), index.h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--left" }, this.progressPercentage, "%"), index.h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--right" }, this.progressPercentage, "%")));
|
|
@@ -151,7 +151,7 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
151
151
|
this.handleOptionSelection(option);
|
|
152
152
|
};
|
|
153
153
|
render() {
|
|
154
|
-
return (index.h("sd-field", { key: '
|
|
154
|
+
return (index.h("sd-field", { key: 'a70e7fefb98428e616d2f124923dfa7ee7a7c2e2', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, useLabelRequired: this.useLabelRequired, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, index.h("div", { key: 'fda63e4e8dcc72aa0147b2981b49b7e28e377ee8', class: {
|
|
155
155
|
'sd-select-multiple': true,
|
|
156
156
|
'sd-select-multiple--open': this.isOpen,
|
|
157
157
|
'sd-select-multiple--disabled': this.disabled,
|
|
@@ -48,7 +48,7 @@ const SdSelectOptionGroup = class {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
render() {
|
|
51
|
-
return (index.h("div", { key: '
|
|
51
|
+
return (index.h("div", { key: '8e88aacd2c3122a563fcf78bcbe9731b6a29d8c5', class: {
|
|
52
52
|
'sd-select__option-group': true,
|
|
53
53
|
'sd-select__option-group--selected': !!this.isSelected,
|
|
54
54
|
'sd-select__option-group--disabled': !!this.option.disabled,
|
|
@@ -57,10 +57,10 @@ const SdSelectOptionGroup = class {
|
|
|
57
57
|
'sd-select__option-group--group': this.option.type === 'group',
|
|
58
58
|
'sd-select__option-group--subgroup': this.option.type === 'subgroup',
|
|
59
59
|
'sd-select__option-group--item': this.option.type === 'item',
|
|
60
|
-
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, index.h("div", { key: '
|
|
60
|
+
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, index.h("div", { key: 'be4bc7f2867ea5c86505bc9284ac3de46f7077f9', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (index.h("sd-checkbox", { key: '00063ab3a6f1d4f44671ac82dd05524968bec668', value: this.isSelected, disabled: this.option.disabled, onClick: e => {
|
|
61
61
|
e.preventDefault();
|
|
62
62
|
this.handleClick(this.option, this.isSelected, e);
|
|
63
|
-
} })), index.h("span", { key: '
|
|
63
|
+
} })), index.h("span", { key: '802c908d44bf1c0db5d64bf4c8d4bab4ebe2b87c', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (index.h("span", { key: 'efd26a2d6e4e2662410de3755b70a2a2585ad0c4', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
SdSelectOptionGroup.style = sdSelectOptionGroupCss();
|
|
@@ -41,7 +41,7 @@ const SdToggleButton = class {
|
|
|
41
41
|
this.change.emit(newValue);
|
|
42
42
|
};
|
|
43
43
|
render() {
|
|
44
|
-
return (index.h("label", { key: '
|
|
44
|
+
return (index.h("label", { key: '6f8d9e738490ef344ff26a4026b9de17af68041e', class: this.buttonClasses, "aria-label": this.label || 'toggle button' }, this.label, index.h("input", { key: '6d9d45c451301c4635e610fd70280be1fe65b316', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
SdToggleButton.style = sdToggleButtonCss();
|
|
@@ -37,7 +37,7 @@ const SdToggle = class {
|
|
|
37
37
|
this.change.emit(newValue);
|
|
38
38
|
};
|
|
39
39
|
render() {
|
|
40
|
-
return (index.h("label", { key: '
|
|
40
|
+
return (index.h("label", { key: 'c0fcd12c231fdb995b5edae756157c58b352fd0f', "aria-label": this.label || 'toggle', class: this.toggleClasses }, index.h("input", { key: 'e50042ae04830f4c276d8140725ab62cc2d0490d', type: "checkbox", checked: this.value, disabled: this.disabled, onInput: this.handleChange }), this.label && index.h("span", { key: '99f9506a2dcea8cfd85aabf6b71243c116a2bf11', class: "sd-toggle__label" }, this.label), index.h("div", { key: '424e1ae78d5684051bd7a2b3ba89f6760f773f1c', class: "sd-toggle__track" }, index.h("div", { key: '29aab89e58022ce22f026fb694bb9b1e4531d8cf', class: "sd-toggle__thumb" }))));
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
SdToggle.style = sdToggleCss();
|
|
@@ -5,6 +5,7 @@ const FORM_PARENT_TAGS = [
|
|
|
5
5
|
'sd-select-multiple-group',
|
|
6
6
|
'sd-input',
|
|
7
7
|
'sd-textarea',
|
|
8
|
+
'sd-number-input',
|
|
8
9
|
];
|
|
9
10
|
export class SdField {
|
|
10
11
|
el;
|
|
@@ -113,15 +114,15 @@ export class SdField {
|
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
render() {
|
|
116
|
-
return (h("div", { key: '
|
|
117
|
+
return (h("div", { key: '3c69abe493110b5665795706a9ae0e525f213aca', class: {
|
|
117
118
|
'sd-field': true,
|
|
118
119
|
'sd-field--has-label': !!this.label,
|
|
119
120
|
'sd-field--has-label-inside': !!this.label && this.insideLabel,
|
|
120
121
|
[this.fieldStatus]: !!this.fieldStatus,
|
|
121
|
-
} }, h("div", { key: '
|
|
122
|
+
} }, h("div", { key: 'decc6821b7172f5ecc2343472014c08674725904', class: "sd-field__wrapper" }, this.renderLabel(this.label), h("div", { key: 'ca5e93f049db10ecaaaab091fdf394ac4b55e292', class: {
|
|
122
123
|
'sd-field__control': true,
|
|
123
124
|
'sd-field__control--label-inside ': !!this.label && this.insideLabel,
|
|
124
|
-
} }, h("slot", { key: '
|
|
125
|
+
} }, h("slot", { key: '7ee38983d32985f4b4a035830bcdca0e14b2cf71' }))), this.errorMsg && h("div", { key: 'c2d6ef860ced48657b906806f2618594b094ea79', class: "sd-field__error-message" }, this.errorMsg)));
|
|
125
126
|
}
|
|
126
127
|
renderLabel(label) {
|
|
127
128
|
if (!label)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-field.js","sourceRoot":"","sources":["../../../src/components/sd-field/sd-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAK3E,MAAM,gBAAgB,GAAG;IACxB,WAAW;IACX,oBAAoB;IACpB,0BAA0B;IAC1B,UAAU;IACV,aAAa;
|
|
1
|
+
{"version":3,"file":"sd-field.js","sourceRoot":"","sources":["../../../src/components/sd-field/sd-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,E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CACb,CACM,CACR,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { h, Component, Element, Prop, State, Method } from '@stencil/core';\nimport { ValidatableField } from '../sd-form/sd-form';\nimport { Rule } from '../../types/form';\nimport { SdTooltipProps } from '../sd-tooltip/sd-tooltip';\n\nconst FORM_PARENT_TAGS = [\n 'sd-select',\n 'sd-select-multiple',\n 'sd-select-multiple-group',\n 'sd-input',\n 'sd-textarea',\n 'sd-number-input',\n];\n\ninterface FormHostElement extends HTMLElement {\n value: any;\n error?: boolean;\n errorMsg?: string;\n}\n\n@Component({ tag: 'sd-field', styleUrl: 'sd-field.scss' })\nexport class SdField implements ValidatableField {\n @Element() el!: HTMLElement;\n\n @Prop() name: string = '';\n @Prop() rules?: Rule[] = [];\n\n @Prop({ mutable: true }) error?: boolean = false;\n @Prop({ mutable: true }) disabled?: boolean = false;\n @Prop({ mutable: true }) hovered?: boolean = false;\n @Prop({ mutable: true }) focused?: boolean = false;\n @Prop() status?: 'default' | 'pass' | 'error';\n\n // props - label\n @Prop() label: string = '';\n @Prop() insideLabel: boolean = false;\n @Prop() useLabelRequired: boolean = false;\n @Prop() labelTooltip: string = '';\n @Prop() labelTooltipProps: SdTooltipProps | null = null;\n\n @State() errorMsg: string = '';\n\n private hostElement: FormHostElement | null = null;\n\n get value() {\n return this.hostElement?.value ?? null;\n }\n\n get fieldStatus() {\n let status = '';\n\n if (!!this.disabled) {\n status = 'disabled';\n return `sd-field--${status}`;\n }\n\n if (!!this.focused) {\n status = 'focus';\n return `sd-field--${status}`;\n }\n\n if (!!this.hovered) status = 'hover';\n if (!!this.status) status = this.status;\n if (!!this.error) status = 'error';\n return status ? `sd-field--${status}` : '';\n }\n\n componentDidLoad() {\n this.hostElement = this.findHostElement();\n this.registerToForm();\n }\n\n disconnectedCallback() {\n this.unregisterFromForm();\n }\n\n private findHostElement(): FormHostElement | null {\n for (const tag of FORM_PARENT_TAGS) {\n const parent = this.el.closest<FormHostElement>(tag);\n if (parent && 'value' in parent) {\n return parent;\n }\n }\n return null;\n }\n\n private registerToForm() {\n // if (!this.rules || this.rules.length === 0) {\n // console.warn('[sd-form-field] rules prop is required for sd-form integration');\n // return;\n // }\n\n const formEl = this.el.closest<HTMLSdFormElement>('sd-form');\n if (!formEl) return;\n\n formEl.componentOnReady().then(form => {\n form.sdRegisterField(this);\n });\n }\n\n private unregisterFromForm() {\n if (!this.name) return;\n\n const formEl = this.el.closest<HTMLSdFormElement>('sd-form');\n formEl?.componentOnReady().then(form => {\n form.sdUnregisterField(this.name);\n });\n }\n\n @Method()\n async sdValidate(): Promise<boolean> {\n if (!this.rules || this.rules.length === 0) return true;\n\n for (const rule of this.rules) {\n const result = rule(this.value ?? '');\n if (result !== true) {\n this.setError(true, result);\n return false;\n }\n }\n this.setError(false, '');\n return true;\n }\n\n @Method()\n async sdReset() {\n if (this.hostElement) {\n this.hostElement.value = null;\n }\n this.setError(false, '');\n }\n\n @Method()\n async sdResetValidation() {\n this.setError(false, '');\n }\n\n @Method()\n async sdFocus() {\n this.hostElement?.focus?.();\n this.hostElement?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }\n\n private setError(error: boolean, errorMsg: string) {\n this.errorMsg = errorMsg;\n\n if (this.hostElement) {\n this.hostElement.error = error;\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'sd-field': true,\n 'sd-field--has-label': !!this.label,\n 'sd-field--has-label-inside': !!this.label && this.insideLabel,\n [this.fieldStatus]: !!this.fieldStatus,\n }}\n >\n <div class=\"sd-field__wrapper\">\n {this.renderLabel(this.label)}\n <div\n class={{\n 'sd-field__control': true,\n 'sd-field__control--label-inside ': !!this.label && this.insideLabel,\n }}\n >\n <slot></slot>\n </div>\n </div>\n {this.errorMsg && <div class=\"sd-field__error-message\">{this.errorMsg}</div>}\n </div>\n );\n }\n\n private renderLabel(label?: string) {\n if (!label) return null;\n\n return (\n <label class={{ 'sd-field__label': true, 'sd-field__label-inside': this.insideLabel }}>\n {this.useLabelRequired && (\n <sd-icon\n name=\"star\"\n size=\"10\"\n color=\"brilliantblue_75\"\n class=\"sd-field__label__required-icon\"\n ></sd-icon>\n )}\n <div class=\"sd-field__label__text\">{label}</div>\n {this.labelTooltip && (\n <sd-tooltip class=\"sd-field__label__tooltip\" {...this.labelTooltipProps}>\n <div slot=\"content\">{this.labelTooltip}</div>\n </sd-tooltip>\n )}\n </label>\n );\n }\n}\n"]}
|
|
@@ -6,13 +6,7 @@ export class SdModalCard {
|
|
|
6
6
|
useCloseButton = true;
|
|
7
7
|
modalTitle = 'normal';
|
|
8
8
|
buttonFlexDirection = 'row';
|
|
9
|
-
buttonProps
|
|
10
|
-
{
|
|
11
|
-
label: '확인',
|
|
12
|
-
color: 'grey_80',
|
|
13
|
-
size: 'md',
|
|
14
|
-
},
|
|
15
|
-
];
|
|
9
|
+
buttonProps;
|
|
16
10
|
message = [];
|
|
17
11
|
modalClass = '';
|
|
18
12
|
close;
|
|
@@ -36,7 +30,7 @@ export class SdModalCard {
|
|
|
36
30
|
return modalClass;
|
|
37
31
|
}
|
|
38
32
|
render() {
|
|
39
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: '7374943ac733d43b7d6c027f074c2dfdfd859e51', class: this.getModalClass, style: { '--point-color': this.pointColor } }, this.useCloseButton && (h("sd-icon", { key: '75fd15b1241d8b4829372377a8212556828ef2f9', class: "sd-modal-card__close-button", name: "close", size: "20", color: "grey_65", onClick: () => this.close.emit() })), this.type !== 'normal' && (h("sd-icon", { key: '54619f342718bb9dd0589d5963ad390f1b792843', class: "sd-modal-card__icon", name: this.type === 'info' ? 'notificationOutline' : 'warningOutline', size: "32", color: this.type === 'info' ? 'brilliantblue_75' : 'red_75' })), h("h2", { key: '4197761d82baa632c67ff238388aa3162592d9ed', class: "sd-modal-card__title" }, this.modalTitle), h("slot", { key: '586ee3e295b2091d657d54f17945d4ac12541932' }, h("div", { key: 'dad5890bd4d0dfcfca45811ae58fe3e67d29e226', class: `sd-modal-card__message-container` }, this.message.map(msg => (h("p", { class: "sd-modal-card__message" }, msg))))), h("div", { key: '3af309aaa37574e5a3e74cbb3c9047216c1b74a8', class: `sd-modal-card__button-container flex-${this.buttonFlexDirection}` }, this.buttonProps?.map(button => (h("sd-button", { class: 'sd-modal-card__button', variant: button.variant ? button.variant : 'outline', label: button.label, color: button.color, size: button.size, onClick: () => !button.type || button.type === 'confirm' ? this.confirm.emit() : this.close.emit(), ...(button.class && { class: button.class }) }))))));
|
|
40
34
|
}
|
|
41
35
|
static get is() { return "sd-modal-card"; }
|
|
42
36
|
static get originalStyleUrls() {
|
|
@@ -156,7 +150,7 @@ export class SdModalCard {
|
|
|
156
150
|
"mutable": false,
|
|
157
151
|
"complexType": {
|
|
158
152
|
"original": "SdModalCardButtonProps[]",
|
|
159
|
-
"resolved": "SdModalCardButtonProps[]",
|
|
153
|
+
"resolved": "SdModalCardButtonProps[] | undefined",
|
|
160
154
|
"references": {
|
|
161
155
|
"SdModalCardButtonProps": {
|
|
162
156
|
"location": "local",
|
|
@@ -166,14 +160,13 @@ export class SdModalCard {
|
|
|
166
160
|
}
|
|
167
161
|
},
|
|
168
162
|
"required": false,
|
|
169
|
-
"optional":
|
|
163
|
+
"optional": true,
|
|
170
164
|
"docs": {
|
|
171
165
|
"tags": [],
|
|
172
166
|
"text": ""
|
|
173
167
|
},
|
|
174
168
|
"getter": false,
|
|
175
|
-
"setter": false
|
|
176
|
-
"defaultValue": "[\n {\n label: '\uD655\uC778',\n color: 'grey_80',\n size: 'md',\n },\n ]"
|
|
169
|
+
"setter": false
|
|
177
170
|
},
|
|
178
171
|
"message": {
|
|
179
172
|
"type": "unknown",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-modal-card.js","sourceRoot":"","sources":["../../../src/components/sd-modal-card/sd-modal-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,MAAM,OAAO,WAAW;IACf,IAAI,GAAkC,MAAM,CAAC;IAC7C,MAAM,GAAuC,QAAQ,CAAC;IACtD,cAAc,GAAY,IAAI,CAAC;IAC/B,UAAU,GAAW,QAAQ,CAAC;IAC9B,mBAAmB,GAAqB,KAAK,CAAC;IAC9C,WAAW,
|
|
1
|
+
{"version":3,"file":"sd-modal-card.js","sourceRoot":"","sources":["../../../src/components/sd-modal-card/sd-modal-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgBjD,MAAM,OAAO,WAAW;IACf,IAAI,GAAkC,MAAM,CAAC;IAC7C,MAAM,GAAuC,QAAQ,CAAC;IACtD,cAAc,GAAY,IAAI,CAAC;IAC/B,UAAU,GAAW,QAAQ,CAAC;IAC9B,mBAAmB,GAAqB,KAAK,CAAC;IAC9C,WAAW,CAA4B;IACvC,OAAO,GAAa,EAAE,CAAC;IAE/B,UAAU,GAAW,EAAE,CAAC;IAES,KAAK,CAA4B;IAC/B,OAAO,CAA4B;IAEtE,IAAY,UAAU;QACrB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE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AI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACxB,SAAG,KAAK,EAAC,wBAAwB,IAAE,GAAG,CAAK,CAC3C,CAAC,CACG,CACA;YACP,4DAAK,KAAK,EAAE,wCAAwC,IAAI,CAAC,mBAAmB,EAAE,IAC5E,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAChC,iBACC,KAAK,EAAE,uBAAuB,EAC9B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACpD,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,OAAO,EAAE,GAAG,EAAE,CACb,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAEhF,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,GACjC,CACb,CAAC,CACG,CACD,CACN,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Event, EventEmitter, Prop, h } from '@stencil/core';\nimport { resolveColor } from '../../utils/color';\nimport { ButtonSize, ButtonVariant } from '../sd-button/sd-button';\n\nexport interface SdModalCardButtonProps {\n label: string;\n color: string;\n size: ButtonSize;\n variant?: ButtonVariant;\n class?: string;\n type?: 'confirm' | 'cancel';\n}\n\n@Component({\n tag: 'sd-modal-card',\n styleUrl: 'sd-modal-card.scss',\n})\nexport class SdModalCard {\n @Prop() type: 'info' | 'warning' | 'normal' = 'info';\n @Prop() system: 'normal' | 'positive' | 'negative' = 'normal';\n @Prop() useCloseButton: boolean = true;\n @Prop() modalTitle: string = 'normal';\n @Prop() buttonFlexDirection: 'row' | 'column' = 'row';\n @Prop() buttonProps?: SdModalCardButtonProps[];\n @Prop() message: string[] = [];\n @Prop()\n modalClass: string = '';\n\n @Event({ eventName: 'sdClose' }) close!: EventEmitter<MouseEvent>;\n @Event({ eventName: 'sdConfirm' }) confirm!: EventEmitter<MouseEvent>;\n\n private get pointColor(): string {\n if (this.type !== 'normal') {\n return 'grey_95';\n }\n\n switch (this.system) {\n case 'positive':\n return resolveColor('brilliantblue_75');\n case 'negative':\n return resolveColor('red_75');\n default:\n return resolveColor('grey_95');\n }\n }\n\n private get getModalClass(): string {\n let modalClass = `sd-modal-card ${this.modalClass}`;\n modalClass += ' ' + `sd-modal-card-${this.system}`;\n return modalClass;\n }\n\n render() {\n return (\n <div class={this.getModalClass} style={{ '--point-color': this.pointColor }}>\n {this.useCloseButton && (\n <sd-icon\n class=\"sd-modal-card__close-button\"\n name=\"close\"\n size=\"20\"\n color=\"grey_65\"\n onClick={() => this.close.emit()}\n />\n )}\n {this.type !== 'normal' && (\n <sd-icon\n class=\"sd-modal-card__icon\"\n name={this.type === 'info' ? 'notificationOutline' : 'warningOutline'}\n size=\"32\"\n color={this.type === 'info' ? 'brilliantblue_75' : 'red_75'}\n />\n )}\n <h2 class=\"sd-modal-card__title\">{this.modalTitle}</h2>\n <slot>\n <div class={`sd-modal-card__message-container`}>\n {this.message.map(msg => (\n <p class=\"sd-modal-card__message\">{msg}</p>\n ))}\n </div>\n </slot>\n <div class={`sd-modal-card__button-container flex-${this.buttonFlexDirection}`}>\n {this.buttonProps?.map(button => (\n <sd-button\n class={'sd-modal-card__button'}\n variant={button.variant ? button.variant : 'outline'}\n label={button.label}\n color={button.color}\n size={button.size}\n onClick={() =>\n !button.type || button.type === 'confirm' ? this.confirm.emit() : this.close.emit()\n }\n {...(button.class && { class: button.class })}\n ></sd-button>\n ))}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -12,9 +12,6 @@ sd-icon .sd-icon--rotate-270 {
|
|
|
12
12
|
transform: rotate(270deg);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
sd-number-input .sd-number-input-container {
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
}
|
|
18
15
|
sd-number-input .sd-number-input {
|
|
19
16
|
box-sizing: border-box;
|
|
20
17
|
display: flex;
|
|
@@ -22,34 +19,12 @@ sd-number-input .sd-number-input {
|
|
|
22
19
|
align-items: center;
|
|
23
20
|
height: 28px;
|
|
24
21
|
padding: 4px 8px;
|
|
25
|
-
border: 1px solid #aaaaaa;
|
|
26
22
|
border-radius: 4px;
|
|
27
23
|
color: #333333;
|
|
28
24
|
font-size: 12px;
|
|
29
25
|
line-height: 20px;
|
|
30
|
-
background: white;
|
|
31
26
|
position: relative;
|
|
32
27
|
}
|
|
33
|
-
sd-number-input .sd-number-input--hovered {
|
|
34
|
-
border-color: #0075ff;
|
|
35
|
-
box-shadow: 0 0 4px 0 rgba(0, 113, 255, 0.4);
|
|
36
|
-
}
|
|
37
|
-
sd-number-input .sd-number-input.sd-number-input--error {
|
|
38
|
-
border-color: #fb4444;
|
|
39
|
-
}
|
|
40
|
-
sd-number-input .sd-number-input.sd-number-input--pass {
|
|
41
|
-
border-color: #2bce6c;
|
|
42
|
-
}
|
|
43
|
-
sd-number-input .sd-number-input.sd-number-input--disabled {
|
|
44
|
-
background-color: #eeeeee !important;
|
|
45
|
-
border-color: #cccccc !important;
|
|
46
|
-
cursor: not-allowed !important;
|
|
47
|
-
box-shadow: none !important;
|
|
48
|
-
}
|
|
49
|
-
sd-number-input .sd-number-input.sd-number-input--disabled .sd-number-input__input {
|
|
50
|
-
color: #888888 !important;
|
|
51
|
-
cursor: not-allowed !important;
|
|
52
|
-
}
|
|
53
28
|
sd-number-input .sd-number-input .sd-number-input__input {
|
|
54
29
|
display: block;
|
|
55
30
|
width: 100%;
|
|
@@ -66,6 +41,10 @@ sd-number-input .sd-number-input .sd-number-input__input {
|
|
|
66
41
|
padding-inline: 0;
|
|
67
42
|
text-align: right;
|
|
68
43
|
}
|
|
44
|
+
sd-number-input .sd-number-input .sd-number-input__input[disabled] {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
color: #888888;
|
|
47
|
+
}
|
|
69
48
|
sd-number-input .sd-number-input .sd-number-input__input::placeholder {
|
|
70
49
|
font-size: 12px;
|
|
71
50
|
height: 20px;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h, } from "@stencil/core";
|
|
2
|
+
import { nanoid } from "nanoid/non-secure";
|
|
2
3
|
export class SdNumberInput {
|
|
3
4
|
el;
|
|
4
5
|
min = Number.NEGATIVE_INFINITY;
|
|
@@ -8,20 +9,24 @@ export class SdNumberInput {
|
|
|
8
9
|
useDecimal = false;
|
|
9
10
|
value = null;
|
|
10
11
|
label;
|
|
12
|
+
insideLabel = false;
|
|
11
13
|
placeholder = '입력해 주세요.';
|
|
12
14
|
disabled = false;
|
|
13
15
|
width;
|
|
14
|
-
rules;
|
|
16
|
+
rules = [];
|
|
15
17
|
autoFocus = false;
|
|
16
18
|
status;
|
|
17
19
|
inputClass = '';
|
|
18
20
|
readonly = false;
|
|
19
21
|
inputStyle = {};
|
|
22
|
+
error = false;
|
|
23
|
+
focused = false;
|
|
24
|
+
hovered = false;
|
|
20
25
|
internalValue = null;
|
|
21
26
|
displayValue = '';
|
|
22
|
-
hovered = false;
|
|
23
|
-
error = false;
|
|
24
27
|
nativeEl = undefined;
|
|
28
|
+
formField;
|
|
29
|
+
name = nanoid();
|
|
25
30
|
update;
|
|
26
31
|
focus;
|
|
27
32
|
blur;
|
|
@@ -92,16 +97,18 @@ export class SdNumberInput {
|
|
|
92
97
|
this.value = newValue;
|
|
93
98
|
this.update?.emit(newValue);
|
|
94
99
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
}
|
|
101
|
+
async sdValidate() {
|
|
102
|
+
this.formField?.sdValidate();
|
|
103
|
+
}
|
|
104
|
+
async sdReset() {
|
|
105
|
+
this.formField?.sdReset();
|
|
106
|
+
}
|
|
107
|
+
async sdResetValidate() {
|
|
108
|
+
this.formField?.sdResetValidation();
|
|
109
|
+
}
|
|
110
|
+
async sdFocus() {
|
|
111
|
+
this.formField?.sdFocus();
|
|
105
112
|
}
|
|
106
113
|
componentWillLoad() {
|
|
107
114
|
if (this.value !== null && this.value !== undefined) {
|
|
@@ -164,11 +171,15 @@ export class SdNumberInput {
|
|
|
164
171
|
handleFocus = (event) => {
|
|
165
172
|
this.focus?.emit(event);
|
|
166
173
|
};
|
|
167
|
-
handleBlur = (event) => {
|
|
174
|
+
handleBlur = async (event) => {
|
|
168
175
|
this.updateDisplay();
|
|
169
176
|
if (this.nativeEl) {
|
|
170
177
|
this.nativeEl.value = this.displayValue;
|
|
171
178
|
}
|
|
179
|
+
if (this.rules && this.rules.length > 0) {
|
|
180
|
+
await this.formField?.sdValidate();
|
|
181
|
+
}
|
|
182
|
+
this.focused = false;
|
|
172
183
|
this.blur?.emit(event);
|
|
173
184
|
};
|
|
174
185
|
handleKeyDown = (event) => {
|
|
@@ -228,17 +239,17 @@ export class SdNumberInput {
|
|
|
228
239
|
const inputStyles = {
|
|
229
240
|
textAlign: this.useButton ? 'center' : 'right',
|
|
230
241
|
};
|
|
231
|
-
return (h("
|
|
242
|
+
return (h("sd-field", { key: 'ea231ae67c1e209d4c9adca87bd9760bcd28ec51', name: this.name, label: this.label, insideLabel: this.insideLabel, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, ref: el => (this.formField = el), style: inputWidth }, h("label", { key: '76bbc2fb1e36d25887ac0559ff7f34617a35883e', class: {
|
|
232
243
|
'sd-number-input': true,
|
|
233
244
|
[this.getInputStatus()]: true,
|
|
234
245
|
'sd-number-input--with-buttons': this.useButton,
|
|
235
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("input", { key: '
|
|
246
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("input", { key: '7978c4e8383017b9a8213e827f92c2d9ccc7b275', name: this.name, ref: el => (this.nativeEl = el), class: `sd-number-input__input ${this.inputClass}`, type: "text", inputMode: "numeric", value: this.displayValue, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onKeyDown: this.handleKeyDown, style: inputStyles, onFocus: this.handleFocus, onBlur: this.handleBlur }), this.useButton && (h("div", { key: 'aff328615ab939724ee0f77f4b7ac8b046eb16d1', class: "sd-number-input__buttons" }, h("button", { key: 'a27a592cc4e74b3272e3473988dbd877e9d0afd3', type: "button", class: {
|
|
236
247
|
'sd-number-input__button': true,
|
|
237
248
|
'sd-number-input__button--decrement': true,
|
|
238
|
-
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: '
|
|
249
|
+
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: '79853e0a9ab38cfaafbd8027dae1a0732702d5bc', name: "minus", size: 12, color: this.isDecrementDisabled() ? 'grey_45' : 'brilliantblue_70' })), h("button", { key: '0993c22719cdbdf3982dea138653ba1f2f6aa523', type: "button", class: {
|
|
239
250
|
'sd-number-input__button': true,
|
|
240
251
|
'sd-number-input__button--increment': true,
|
|
241
|
-
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '
|
|
252
|
+
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '6da02951a443a1a46fd44f6bd7c1a7ed41af0b01', name: "add", size: 12, color: this.isIncrementDisabled() ? 'grey_45' : 'brilliantblue_70' })))))));
|
|
242
253
|
}
|
|
243
254
|
static get is() { return "sd-number-input"; }
|
|
244
255
|
static get originalStyleUrls() {
|
|
@@ -392,6 +403,26 @@ export class SdNumberInput {
|
|
|
392
403
|
"reflect": false,
|
|
393
404
|
"attribute": "label"
|
|
394
405
|
},
|
|
406
|
+
"insideLabel": {
|
|
407
|
+
"type": "boolean",
|
|
408
|
+
"mutable": false,
|
|
409
|
+
"complexType": {
|
|
410
|
+
"original": "boolean",
|
|
411
|
+
"resolved": "boolean",
|
|
412
|
+
"references": {}
|
|
413
|
+
},
|
|
414
|
+
"required": false,
|
|
415
|
+
"optional": false,
|
|
416
|
+
"docs": {
|
|
417
|
+
"tags": [],
|
|
418
|
+
"text": ""
|
|
419
|
+
},
|
|
420
|
+
"getter": false,
|
|
421
|
+
"setter": false,
|
|
422
|
+
"reflect": false,
|
|
423
|
+
"attribute": "inside-label",
|
|
424
|
+
"defaultValue": "false"
|
|
425
|
+
},
|
|
395
426
|
"placeholder": {
|
|
396
427
|
"type": "string",
|
|
397
428
|
"mutable": false,
|
|
@@ -455,12 +486,13 @@ export class SdNumberInput {
|
|
|
455
486
|
"type": "unknown",
|
|
456
487
|
"mutable": false,
|
|
457
488
|
"complexType": {
|
|
458
|
-
"original": "
|
|
459
|
-
"resolved": "
|
|
489
|
+
"original": "Rule[]",
|
|
490
|
+
"resolved": "Rule[] | undefined",
|
|
460
491
|
"references": {
|
|
461
|
-
"
|
|
462
|
-
"location": "
|
|
463
|
-
"
|
|
492
|
+
"Rule": {
|
|
493
|
+
"location": "import",
|
|
494
|
+
"path": "../../types/form",
|
|
495
|
+
"id": "src/types/form.d.ts::Rule"
|
|
464
496
|
}
|
|
465
497
|
}
|
|
466
498
|
},
|
|
@@ -471,7 +503,8 @@ export class SdNumberInput {
|
|
|
471
503
|
"text": ""
|
|
472
504
|
},
|
|
473
505
|
"getter": false,
|
|
474
|
-
"setter": false
|
|
506
|
+
"setter": false,
|
|
507
|
+
"defaultValue": "[]"
|
|
475
508
|
},
|
|
476
509
|
"autoFocus": {
|
|
477
510
|
"type": "boolean",
|
|
@@ -569,15 +602,73 @@ export class SdNumberInput {
|
|
|
569
602
|
"getter": false,
|
|
570
603
|
"setter": false,
|
|
571
604
|
"defaultValue": "{}"
|
|
605
|
+
},
|
|
606
|
+
"error": {
|
|
607
|
+
"type": "boolean",
|
|
608
|
+
"mutable": true,
|
|
609
|
+
"complexType": {
|
|
610
|
+
"original": "boolean",
|
|
611
|
+
"resolved": "boolean",
|
|
612
|
+
"references": {}
|
|
613
|
+
},
|
|
614
|
+
"required": false,
|
|
615
|
+
"optional": false,
|
|
616
|
+
"docs": {
|
|
617
|
+
"tags": [],
|
|
618
|
+
"text": ""
|
|
619
|
+
},
|
|
620
|
+
"getter": false,
|
|
621
|
+
"setter": false,
|
|
622
|
+
"reflect": false,
|
|
623
|
+
"attribute": "error",
|
|
624
|
+
"defaultValue": "false"
|
|
625
|
+
},
|
|
626
|
+
"focused": {
|
|
627
|
+
"type": "boolean",
|
|
628
|
+
"mutable": true,
|
|
629
|
+
"complexType": {
|
|
630
|
+
"original": "boolean",
|
|
631
|
+
"resolved": "boolean",
|
|
632
|
+
"references": {}
|
|
633
|
+
},
|
|
634
|
+
"required": false,
|
|
635
|
+
"optional": false,
|
|
636
|
+
"docs": {
|
|
637
|
+
"tags": [],
|
|
638
|
+
"text": ""
|
|
639
|
+
},
|
|
640
|
+
"getter": false,
|
|
641
|
+
"setter": false,
|
|
642
|
+
"reflect": false,
|
|
643
|
+
"attribute": "focused",
|
|
644
|
+
"defaultValue": "false"
|
|
645
|
+
},
|
|
646
|
+
"hovered": {
|
|
647
|
+
"type": "boolean",
|
|
648
|
+
"mutable": true,
|
|
649
|
+
"complexType": {
|
|
650
|
+
"original": "boolean",
|
|
651
|
+
"resolved": "boolean",
|
|
652
|
+
"references": {}
|
|
653
|
+
},
|
|
654
|
+
"required": false,
|
|
655
|
+
"optional": false,
|
|
656
|
+
"docs": {
|
|
657
|
+
"tags": [],
|
|
658
|
+
"text": ""
|
|
659
|
+
},
|
|
660
|
+
"getter": false,
|
|
661
|
+
"setter": false,
|
|
662
|
+
"reflect": false,
|
|
663
|
+
"attribute": "hovered",
|
|
664
|
+
"defaultValue": "false"
|
|
572
665
|
}
|
|
573
666
|
};
|
|
574
667
|
}
|
|
575
668
|
static get states() {
|
|
576
669
|
return {
|
|
577
670
|
"internalValue": {},
|
|
578
|
-
"displayValue": {}
|
|
579
|
-
"hovered": {},
|
|
580
|
-
"error": {}
|
|
671
|
+
"displayValue": {}
|
|
581
672
|
};
|
|
582
673
|
}
|
|
583
674
|
static get events() {
|
|
@@ -642,6 +733,74 @@ export class SdNumberInput {
|
|
|
642
733
|
}
|
|
643
734
|
static get methods() {
|
|
644
735
|
return {
|
|
736
|
+
"sdValidate": {
|
|
737
|
+
"complexType": {
|
|
738
|
+
"signature": "() => Promise<void>",
|
|
739
|
+
"parameters": [],
|
|
740
|
+
"references": {
|
|
741
|
+
"Promise": {
|
|
742
|
+
"location": "global",
|
|
743
|
+
"id": "global::Promise"
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
"return": "Promise<void>"
|
|
747
|
+
},
|
|
748
|
+
"docs": {
|
|
749
|
+
"text": "",
|
|
750
|
+
"tags": []
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
"sdReset": {
|
|
754
|
+
"complexType": {
|
|
755
|
+
"signature": "() => Promise<void>",
|
|
756
|
+
"parameters": [],
|
|
757
|
+
"references": {
|
|
758
|
+
"Promise": {
|
|
759
|
+
"location": "global",
|
|
760
|
+
"id": "global::Promise"
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
"return": "Promise<void>"
|
|
764
|
+
},
|
|
765
|
+
"docs": {
|
|
766
|
+
"text": "",
|
|
767
|
+
"tags": []
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
"sdResetValidate": {
|
|
771
|
+
"complexType": {
|
|
772
|
+
"signature": "() => Promise<void>",
|
|
773
|
+
"parameters": [],
|
|
774
|
+
"references": {
|
|
775
|
+
"Promise": {
|
|
776
|
+
"location": "global",
|
|
777
|
+
"id": "global::Promise"
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
"return": "Promise<void>"
|
|
781
|
+
},
|
|
782
|
+
"docs": {
|
|
783
|
+
"text": "",
|
|
784
|
+
"tags": []
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
"sdFocus": {
|
|
788
|
+
"complexType": {
|
|
789
|
+
"signature": "() => Promise<void>",
|
|
790
|
+
"parameters": [],
|
|
791
|
+
"references": {
|
|
792
|
+
"Promise": {
|
|
793
|
+
"location": "global",
|
|
794
|
+
"id": "global::Promise"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
"return": "Promise<void>"
|
|
798
|
+
},
|
|
799
|
+
"docs": {
|
|
800
|
+
"text": "",
|
|
801
|
+
"tags": []
|
|
802
|
+
}
|
|
803
|
+
},
|
|
645
804
|
"sdGetNativeElement": {
|
|
646
805
|
"complexType": {
|
|
647
806
|
"signature": "() => Promise<HTMLInputElement | null>",
|