@sdata/web-vue 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sd.css +92 -1
- package/dist/sd.min.css +1 -1
- package/es/_hooks/use-allow-clear.d.ts +4 -0
- package/es/_hooks/use-allow-clear.js +20 -0
- package/es/_utils/color.js +1 -18
- package/es/auto-complete/auto-complete.js +4 -2
- package/es/cascader/cascader.js +1 -1
- package/es/cascader/cascader.vue.d.ts +1 -0
- package/es/cascader/cascader.vue_vue_type_script_lang.js +4 -1
- package/es/cascader/index.d.ts +3 -0
- package/es/color-picker/color-picker.d.ts +115 -40
- package/es/color-picker/color-picker.js +146 -102
- package/es/color-picker/index.d.ts +217 -69
- package/es/color-picker/interface.d.ts +41 -0
- package/es/color-picker/palette.js +1 -1
- package/es/color-picker/panel.d.ts +73 -34
- package/es/color-picker/panel.js +423 -89
- package/es/color-picker/style/index.css +92 -1
- package/es/color-picker/style/index.scss +107 -1
- package/es/color-picker/utils.d.ts +89 -0
- package/es/color-picker/utils.js +456 -0
- package/es/config-provider/config-provider.vue.d.ts +9 -0
- package/es/config-provider/config-provider.vue_vue_type_script_lang.js +6 -1
- package/es/config-provider/context.d.ts +1 -0
- package/es/config-provider/index.d.ts +15 -0
- package/es/date-picker/index.d.ts +1 -0
- package/es/date-picker/picker.js +1 -1
- package/es/date-picker/picker.vue.d.ts +1 -0
- package/es/date-picker/picker.vue_vue_type_script_lang.js +4 -1
- package/es/date-picker/range-picker.js +1 -1
- package/es/date-picker/range-picker.vue.d.ts +1 -0
- package/es/date-picker/range-picker.vue_vue_type_script_lang.js +4 -1
- package/es/index.css +92 -1
- package/es/input/input.js +4 -2
- package/es/input-number/input-number.js +4 -2
- package/es/input-tag/input-tag.js +4 -2
- package/es/mention/mention.js +4 -2
- package/es/rate/rate.js +4 -2
- package/es/select/select.js +4 -2
- package/es/textarea/index.d.ts +3 -3
- package/es/textarea/textarea.vue.d.ts +1 -1
- package/es/textarea/textarea.vue_vue_type_script_lang.js +6 -2
- package/es/time-picker/index.d.ts +3 -0
- package/es/time-picker/time-picker.js +1 -1
- package/es/time-picker/time-picker.vue.d.ts +1 -0
- package/es/time-picker/time-picker.vue_vue_type_script_lang.js +4 -1
- package/es/tree-select/index.d.ts +3 -0
- package/es/tree-select/tree-select.js +1 -1
- package/es/tree-select/tree-select.vue.d.ts +1 -0
- package/es/tree-select/tree-select.vue_vue_type_script_lang.js +4 -1
- package/json/vetur-attributes.json +46 -20
- package/json/vetur-tags.json +14 -6
- package/json/web-types.json +86 -22
- package/package.json +3 -1
- package/es/color-picker/input-alpha.js +0 -32
- package/es/color-picker/input-hex.js +0 -73
- package/es/color-picker/input-rgb.js +0 -55
|
@@ -65,7 +65,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
65
65
|
error: _ctx.error,
|
|
66
66
|
readonly: _ctx.readonly,
|
|
67
67
|
editable: !_ctx.readonly,
|
|
68
|
-
"allow-clear": _ctx.
|
|
68
|
+
"allow-clear": _ctx.mergedAllowClear && !_ctx.readonly,
|
|
69
69
|
placeholder: _ctx.computedPlaceholder,
|
|
70
70
|
onClear: _ctx.onInputClear
|
|
71
71
|
}), createSlots({
|
|
@@ -95,6 +95,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
95
95
|
inputValue: import("vue").Ref<string | (string | undefined)[] | undefined, string | (string | undefined)[] | undefined>;
|
|
96
96
|
computedFormat: import("vue").ComputedRef<string>;
|
|
97
97
|
computedUse12Hours: import("vue").ComputedRef<boolean>;
|
|
98
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
98
99
|
inputProps: import("vue").ComputedRef<{
|
|
99
100
|
focusedIndex: number;
|
|
100
101
|
onFocusedIndexChange: (index: number) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useFormItem } from "../_hooks/use-form-item.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import { isArray, isUndefined } from "../_utils/is.js";
|
|
4
|
+
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
4
5
|
import useState from "../_hooks/use-state.js";
|
|
5
6
|
import useMergeState from "../_hooks/use-merge-state.js";
|
|
6
7
|
import { useI18n } from "../locale/index.js";
|
|
@@ -90,8 +91,9 @@ var time_picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
90
91
|
"update:popupVisible": (_visible) => true
|
|
91
92
|
},
|
|
92
93
|
setup(props, { emit }) {
|
|
93
|
-
const { type, format, use12Hours, modelValue, defaultValue, popupVisible, defaultPopupVisible, disabled, placeholder, disableConfirm, disabledHours, disabledMinutes, disabledSeconds } = toRefs(props);
|
|
94
|
+
const { type, format, use12Hours, modelValue, defaultValue, popupVisible, defaultPopupVisible, disabled, placeholder, allowClear, disableConfirm, disabledHours, disabledMinutes, disabledSeconds } = toRefs(props);
|
|
94
95
|
const { mergedDisabled, eventHandlers } = useFormItem({ disabled });
|
|
96
|
+
const { mergedAllowClear } = useAllowClear(allowClear);
|
|
95
97
|
const isRange = computed(() => type.value === "time-range");
|
|
96
98
|
const prefixCls = getPrefixCls("timepicker");
|
|
97
99
|
const refInput = ref();
|
|
@@ -237,6 +239,7 @@ var time_picker_vue_vue_type_script_lang_default = defineComponent({
|
|
|
237
239
|
inputValue,
|
|
238
240
|
computedFormat,
|
|
239
241
|
computedUse12Hours,
|
|
242
|
+
mergedAllowClear,
|
|
240
243
|
inputProps: computed(() => {
|
|
241
244
|
if (isRange.value) return {
|
|
242
245
|
focusedIndex: focusedInputIndex.value,
|
|
@@ -147,6 +147,7 @@ declare const TreeSelect: {
|
|
|
147
147
|
isEmpty: import("vue").ComputedRef<boolean | undefined>;
|
|
148
148
|
computedFilterTreeNode: import("vue").ComputedRef<((node: import("..").TreeNodeData) => boolean) | undefined>;
|
|
149
149
|
isMultiple: import("vue").ComputedRef<boolean>;
|
|
150
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
150
151
|
selectViewValue: import("vue").ComputedRef<import("../_components/select-view/interface").SelectViewValue[]>;
|
|
151
152
|
computedDropdownStyle: import("vue").ComputedRef<import("vue").StyleValue[]>;
|
|
152
153
|
onSearchValueChange: (inputValue: string) => void;
|
|
@@ -2816,6 +2817,7 @@ declare const TreeSelect: {
|
|
|
2816
2817
|
isEmpty: import("vue").ComputedRef<boolean | undefined>;
|
|
2817
2818
|
computedFilterTreeNode: import("vue").ComputedRef<((node: import("..").TreeNodeData) => boolean) | undefined>;
|
|
2818
2819
|
isMultiple: import("vue").ComputedRef<boolean>;
|
|
2820
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
2819
2821
|
selectViewValue: import("vue").ComputedRef<import("../_components/select-view/interface").SelectViewValue[]>;
|
|
2820
2822
|
computedDropdownStyle: import("vue").ComputedRef<import("vue").StyleValue[]>;
|
|
2821
2823
|
onSearchValueChange: (inputValue: string) => void;
|
|
@@ -3009,6 +3011,7 @@ declare const TreeSelect: {
|
|
|
3009
3011
|
isEmpty: import("vue").ComputedRef<boolean | undefined>;
|
|
3010
3012
|
computedFilterTreeNode: import("vue").ComputedRef<((node: import("..").TreeNodeData) => boolean) | undefined>;
|
|
3011
3013
|
isMultiple: import("vue").ComputedRef<boolean>;
|
|
3014
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
3012
3015
|
selectViewValue: import("vue").ComputedRef<import("../_components/select-view/interface").SelectViewValue[]>;
|
|
3013
3016
|
computedDropdownStyle: import("vue").ComputedRef<import("vue").StyleValue[]>;
|
|
3014
3017
|
onSearchValueChange: (inputValue: string) => void;
|
|
@@ -80,7 +80,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
80
80
|
"model-value": _ctx.selectViewValue,
|
|
81
81
|
"input-value": _ctx.searchValue,
|
|
82
82
|
"allow-search": Boolean(_ctx.allowSearch),
|
|
83
|
-
"allow-clear": _ctx.
|
|
83
|
+
"allow-clear": _ctx.mergedAllowClear,
|
|
84
84
|
loading: _ctx.loading,
|
|
85
85
|
size: _ctx.size,
|
|
86
86
|
"max-tag-count": _ctx.maxTagCount,
|
|
@@ -145,6 +145,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
145
145
|
isEmpty: import("vue").ComputedRef<boolean | undefined>;
|
|
146
146
|
computedFilterTreeNode: import("vue").ComputedRef<((node: TreeNodeData) => boolean) | undefined>;
|
|
147
147
|
isMultiple: import("vue").ComputedRef<boolean>;
|
|
148
|
+
mergedAllowClear: import("vue").ComputedRef<boolean | undefined>;
|
|
148
149
|
selectViewValue: import("vue").ComputedRef<SelectViewValue[]>;
|
|
149
150
|
computedDropdownStyle: import("vue").ComputedRef<StyleValue[]>;
|
|
150
151
|
onSearchValueChange: (inputValue: string) => void;
|
|
@@ -3,6 +3,7 @@ import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
|
3
3
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
|
|
4
4
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
5
5
|
import { isFunction, isObject, isUndefined } from "../_utils/is.js";
|
|
6
|
+
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
6
7
|
import useMergeState from "../_hooks/use-merge-state.js";
|
|
7
8
|
import Empty from "../empty/index.js";
|
|
8
9
|
import Spin from "../spin/index.js";
|
|
@@ -123,10 +124,11 @@ var tree_select_vue_vue_type_script_lang_default = defineComponent({
|
|
|
123
124
|
},
|
|
124
125
|
setup(props, { emit, slots }) {
|
|
125
126
|
var _configCtx$slots, _configCtx$slots$empt;
|
|
126
|
-
const { defaultValue, modelValue, multiple, popupVisible, defaultPopupVisible, treeCheckable, treeCheckStrictly, data, fieldNames, disabled, labelInValue, filterTreeNode, disableFilter, dropdownStyle, treeProps, fallbackOption, selectable,
|
|
127
|
+
const { defaultValue, modelValue, multiple, popupVisible, defaultPopupVisible, treeCheckable, treeCheckStrictly, data, fieldNames, disabled, labelInValue, filterTreeNode, disableFilter, dropdownStyle, treeProps, fallbackOption, selectable, allowClear } = toRefs(props);
|
|
127
128
|
const { mergedDisabled, eventHandlers } = useFormItem({ disabled });
|
|
128
129
|
const prefixCls = getPrefixCls("tree-select");
|
|
129
130
|
const configCtx = inject(configProviderInjectionKey, void 0);
|
|
131
|
+
const { mergedAllowClear } = useAllowClear(allowClear);
|
|
130
132
|
const TreeSelectEmpty = configCtx === null || configCtx === void 0 || (_configCtx$slots$empt = (_configCtx$slots = configCtx.slots).empty) === null || _configCtx$slots$empt === void 0 || (_configCtx$slots$empt = _configCtx$slots$empt.call(_configCtx$slots, { component: "tree-select" })) === null || _configCtx$slots$empt === void 0 ? void 0 : _configCtx$slots$empt[0];
|
|
131
133
|
const isMultiple = computed(() => multiple.value || treeCheckable.value);
|
|
132
134
|
const isSelectable = (node, info) => {
|
|
@@ -229,6 +231,7 @@ var tree_select_vue_vue_type_script_lang_default = defineComponent({
|
|
|
229
231
|
isEmpty,
|
|
230
232
|
computedFilterTreeNode,
|
|
231
233
|
isMultiple,
|
|
234
|
+
mergedAllowClear,
|
|
232
235
|
selectViewValue,
|
|
233
236
|
computedDropdownStyle,
|
|
234
237
|
onSearchValueChange: handleInputValueChange,
|
|
@@ -698,53 +698,75 @@
|
|
|
698
698
|
"sd-color-picker/popup-visible-change": {
|
|
699
699
|
"description": "Triggered when the color panel is expanded and collapsed"
|
|
700
700
|
},
|
|
701
|
-
"sd-color-picker/
|
|
701
|
+
"sd-color-picker/value": {
|
|
702
702
|
"description": "Value",
|
|
703
703
|
"type": "string"
|
|
704
704
|
},
|
|
705
705
|
"sd-color-picker/default-value": {
|
|
706
|
-
"description": "Default value
|
|
706
|
+
"description": "Default value",
|
|
707
707
|
"type": "string"
|
|
708
708
|
},
|
|
709
709
|
"sd-color-picker/format": {
|
|
710
|
-
"description": "
|
|
711
|
-
"type": "string"
|
|
710
|
+
"description": "Value format"
|
|
712
711
|
},
|
|
713
712
|
"sd-color-picker/size": {
|
|
714
713
|
"description": "Size"
|
|
715
714
|
},
|
|
716
|
-
"sd-color-picker/
|
|
717
|
-
"description": "
|
|
715
|
+
"sd-color-picker/enable-alpha": {
|
|
716
|
+
"description": "Whether alpha channel is enabled",
|
|
718
717
|
"type": "boolean"
|
|
719
718
|
},
|
|
720
|
-
"sd-color-picker/show-
|
|
721
|
-
"description": "
|
|
719
|
+
"sd-color-picker/show-primary-color-preview": {
|
|
720
|
+
"description": "Whether to show primary color preview",
|
|
722
721
|
"type": "boolean"
|
|
723
722
|
},
|
|
724
|
-
"sd-color-picker/
|
|
725
|
-
"description": "
|
|
726
|
-
"type": "boolean"
|
|
723
|
+
"sd-color-picker/input-props": {
|
|
724
|
+
"description": "Input props"
|
|
727
725
|
},
|
|
728
|
-
"sd-color-picker/
|
|
729
|
-
"description": "
|
|
730
|
-
"type": "boolean"
|
|
726
|
+
"sd-color-picker/recent-colors": {
|
|
727
|
+
"description": "Recent colors"
|
|
731
728
|
},
|
|
732
|
-
"sd-color-picker/
|
|
733
|
-
"description": "
|
|
729
|
+
"sd-color-picker/default-recent-colors": {
|
|
730
|
+
"description": "Default recent colors"
|
|
731
|
+
},
|
|
732
|
+
"sd-color-picker/swatch-colors": {
|
|
733
|
+
"description": "Swatch colors"
|
|
734
|
+
},
|
|
735
|
+
"sd-color-picker/disabled": {
|
|
736
|
+
"description": "Disabled",
|
|
734
737
|
"type": "boolean"
|
|
735
738
|
},
|
|
736
739
|
"sd-color-picker/hide-trigger": {
|
|
737
|
-
"description": "
|
|
740
|
+
"description": "Render panel inline",
|
|
738
741
|
"type": "boolean"
|
|
739
742
|
},
|
|
740
743
|
"sd-color-picker/trigger-props": {
|
|
741
|
-
"description": "
|
|
744
|
+
"description": "Trigger props"
|
|
742
745
|
},
|
|
743
746
|
"sd-color-picker/history-colors": {
|
|
744
|
-
"description": "
|
|
747
|
+
"description": "Legacy history colors"
|
|
745
748
|
},
|
|
746
749
|
"sd-color-picker/preset-colors": {
|
|
747
|
-
"description": "
|
|
750
|
+
"description": "Legacy preset colors"
|
|
751
|
+
},
|
|
752
|
+
"sd-color-picker/show-text": {
|
|
753
|
+
"description": "Legacy show text",
|
|
754
|
+
"type": "boolean"
|
|
755
|
+
},
|
|
756
|
+
"sd-color-picker/show-history": {
|
|
757
|
+
"description": "Legacy show history",
|
|
758
|
+
"type": "boolean"
|
|
759
|
+
},
|
|
760
|
+
"sd-color-picker/show-preset": {
|
|
761
|
+
"description": "Legacy show preset",
|
|
762
|
+
"type": "boolean"
|
|
763
|
+
},
|
|
764
|
+
"sd-color-picker/disabled-alpha": {
|
|
765
|
+
"description": "Legacy disable alpha",
|
|
766
|
+
"type": "boolean"
|
|
767
|
+
},
|
|
768
|
+
"sd-color-picker/select-input-props": {
|
|
769
|
+
"description": "Select input props"
|
|
748
770
|
},
|
|
749
771
|
"sd-comment/author": {
|
|
750
772
|
"description": "Display as the comment author",
|
|
@@ -776,6 +798,10 @@
|
|
|
776
798
|
"sd-config-provider/size": {
|
|
777
799
|
"description": "Size"
|
|
778
800
|
},
|
|
801
|
+
"sd-config-provider/allow-clear": {
|
|
802
|
+
"description": "Whether to enable clear buttons by default",
|
|
803
|
+
"type": "boolean"
|
|
804
|
+
},
|
|
779
805
|
"sd-config-provider/global": {
|
|
780
806
|
"description": "Is global effect",
|
|
781
807
|
"type": "boolean"
|
package/json/vetur-tags.json
CHANGED
|
@@ -300,19 +300,26 @@
|
|
|
300
300
|
"attributes": [
|
|
301
301
|
"change",
|
|
302
302
|
"popup-visible-change",
|
|
303
|
-
"
|
|
303
|
+
"value",
|
|
304
304
|
"default-value",
|
|
305
305
|
"format",
|
|
306
306
|
"size",
|
|
307
|
-
"
|
|
308
|
-
"show-
|
|
309
|
-
"
|
|
307
|
+
"enable-alpha",
|
|
308
|
+
"show-primary-color-preview",
|
|
309
|
+
"input-props",
|
|
310
|
+
"recent-colors",
|
|
311
|
+
"default-recent-colors",
|
|
312
|
+
"swatch-colors",
|
|
310
313
|
"disabled",
|
|
311
|
-
"disabled-alpha",
|
|
312
314
|
"hide-trigger",
|
|
313
315
|
"trigger-props",
|
|
314
316
|
"history-colors",
|
|
315
|
-
"preset-colors"
|
|
317
|
+
"preset-colors",
|
|
318
|
+
"show-text",
|
|
319
|
+
"show-history",
|
|
320
|
+
"show-preset",
|
|
321
|
+
"disabled-alpha",
|
|
322
|
+
"select-input-props"
|
|
316
323
|
]
|
|
317
324
|
},
|
|
318
325
|
"sd-comment": {
|
|
@@ -329,6 +336,7 @@
|
|
|
329
336
|
"prefix-cls",
|
|
330
337
|
"locale",
|
|
331
338
|
"size",
|
|
339
|
+
"allow-clear",
|
|
332
340
|
"global",
|
|
333
341
|
"scroll-to-close",
|
|
334
342
|
"exchange-time",
|
package/json/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@sdata/web-vue",
|
|
5
|
-
"version": "1.7.
|
|
5
|
+
"version": "1.7.1",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -1825,7 +1825,7 @@
|
|
|
1825
1825
|
"name": "sd-color-picker",
|
|
1826
1826
|
"attributes": [
|
|
1827
1827
|
{
|
|
1828
|
-
"name": "
|
|
1828
|
+
"name": "value",
|
|
1829
1829
|
"description": "Value",
|
|
1830
1830
|
"value": {
|
|
1831
1831
|
"type": "string",
|
|
@@ -1834,7 +1834,7 @@
|
|
|
1834
1834
|
},
|
|
1835
1835
|
{
|
|
1836
1836
|
"name": "default-value",
|
|
1837
|
-
"description": "Default value
|
|
1837
|
+
"description": "Default value",
|
|
1838
1838
|
"value": {
|
|
1839
1839
|
"type": "string",
|
|
1840
1840
|
"kind": "expression"
|
|
@@ -1842,9 +1842,9 @@
|
|
|
1842
1842
|
},
|
|
1843
1843
|
{
|
|
1844
1844
|
"name": "format",
|
|
1845
|
-
"description": "
|
|
1845
|
+
"description": "Value format",
|
|
1846
1846
|
"value": {
|
|
1847
|
-
"type": "
|
|
1847
|
+
"type": "ColorFormat | LegacyFormat",
|
|
1848
1848
|
"kind": "expression"
|
|
1849
1849
|
}
|
|
1850
1850
|
},
|
|
@@ -1852,45 +1852,61 @@
|
|
|
1852
1852
|
"name": "size",
|
|
1853
1853
|
"description": "Size",
|
|
1854
1854
|
"value": {
|
|
1855
|
-
"type": "Size",
|
|
1855
|
+
"type": "Size | 'small' | 'medium' | 'large'",
|
|
1856
1856
|
"kind": "expression"
|
|
1857
1857
|
}
|
|
1858
1858
|
},
|
|
1859
1859
|
{
|
|
1860
|
-
"name": "
|
|
1861
|
-
"description": "
|
|
1860
|
+
"name": "enable-alpha",
|
|
1861
|
+
"description": "Whether alpha channel is enabled",
|
|
1862
1862
|
"value": {
|
|
1863
1863
|
"type": "boolean",
|
|
1864
1864
|
"kind": "expression"
|
|
1865
1865
|
}
|
|
1866
1866
|
},
|
|
1867
1867
|
{
|
|
1868
|
-
"name": "show-
|
|
1869
|
-
"description": "
|
|
1868
|
+
"name": "show-primary-color-preview",
|
|
1869
|
+
"description": "Whether to show primary color preview",
|
|
1870
1870
|
"value": {
|
|
1871
1871
|
"type": "boolean",
|
|
1872
1872
|
"kind": "expression"
|
|
1873
1873
|
}
|
|
1874
1874
|
},
|
|
1875
1875
|
{
|
|
1876
|
-
"name": "
|
|
1877
|
-
"description": "
|
|
1876
|
+
"name": "input-props",
|
|
1877
|
+
"description": "Input props",
|
|
1878
1878
|
"value": {
|
|
1879
|
-
"type": "
|
|
1879
|
+
"type": "Record<string, unknown>",
|
|
1880
1880
|
"kind": "expression"
|
|
1881
1881
|
}
|
|
1882
1882
|
},
|
|
1883
1883
|
{
|
|
1884
|
-
"name": "
|
|
1885
|
-
"description": "
|
|
1884
|
+
"name": "recent-colors",
|
|
1885
|
+
"description": "Recent colors",
|
|
1886
1886
|
"value": {
|
|
1887
|
-
"type": "
|
|
1887
|
+
"type": "RecentColorsValue",
|
|
1888
1888
|
"kind": "expression"
|
|
1889
1889
|
}
|
|
1890
1890
|
},
|
|
1891
1891
|
{
|
|
1892
|
-
"name": "
|
|
1893
|
-
"description": "
|
|
1892
|
+
"name": "default-recent-colors",
|
|
1893
|
+
"description": "Default recent colors",
|
|
1894
|
+
"value": {
|
|
1895
|
+
"type": "RecentColorsValue",
|
|
1896
|
+
"kind": "expression"
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
"name": "swatch-colors",
|
|
1901
|
+
"description": "Swatch colors",
|
|
1902
|
+
"value": {
|
|
1903
|
+
"type": "string[] | null",
|
|
1904
|
+
"kind": "expression"
|
|
1905
|
+
}
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
"name": "disabled",
|
|
1909
|
+
"description": "Disabled",
|
|
1894
1910
|
"value": {
|
|
1895
1911
|
"type": "boolean",
|
|
1896
1912
|
"kind": "expression"
|
|
@@ -1898,7 +1914,7 @@
|
|
|
1898
1914
|
},
|
|
1899
1915
|
{
|
|
1900
1916
|
"name": "hide-trigger",
|
|
1901
|
-
"description": "
|
|
1917
|
+
"description": "Render panel inline",
|
|
1902
1918
|
"value": {
|
|
1903
1919
|
"type": "boolean",
|
|
1904
1920
|
"kind": "expression"
|
|
@@ -1906,7 +1922,7 @@
|
|
|
1906
1922
|
},
|
|
1907
1923
|
{
|
|
1908
1924
|
"name": "trigger-props",
|
|
1909
|
-
"description": "
|
|
1925
|
+
"description": "Trigger props",
|
|
1910
1926
|
"value": {
|
|
1911
1927
|
"type": "Partial<TriggerProps>",
|
|
1912
1928
|
"kind": "expression"
|
|
@@ -1914,7 +1930,7 @@
|
|
|
1914
1930
|
},
|
|
1915
1931
|
{
|
|
1916
1932
|
"name": "history-colors",
|
|
1917
|
-
"description": "
|
|
1933
|
+
"description": "Legacy history colors",
|
|
1918
1934
|
"value": {
|
|
1919
1935
|
"type": "string[]",
|
|
1920
1936
|
"kind": "expression"
|
|
@@ -1922,11 +1938,51 @@
|
|
|
1922
1938
|
},
|
|
1923
1939
|
{
|
|
1924
1940
|
"name": "preset-colors",
|
|
1925
|
-
"description": "
|
|
1941
|
+
"description": "Legacy preset colors",
|
|
1926
1942
|
"value": {
|
|
1927
1943
|
"type": "string[]",
|
|
1928
1944
|
"kind": "expression"
|
|
1929
1945
|
}
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"name": "show-text",
|
|
1949
|
+
"description": "Legacy show text",
|
|
1950
|
+
"value": {
|
|
1951
|
+
"type": "boolean",
|
|
1952
|
+
"kind": "expression"
|
|
1953
|
+
}
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
"name": "show-history",
|
|
1957
|
+
"description": "Legacy show history",
|
|
1958
|
+
"value": {
|
|
1959
|
+
"type": "boolean",
|
|
1960
|
+
"kind": "expression"
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"name": "show-preset",
|
|
1965
|
+
"description": "Legacy show preset",
|
|
1966
|
+
"value": {
|
|
1967
|
+
"type": "boolean",
|
|
1968
|
+
"kind": "expression"
|
|
1969
|
+
}
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
"name": "disabled-alpha",
|
|
1973
|
+
"description": "Legacy disable alpha",
|
|
1974
|
+
"value": {
|
|
1975
|
+
"type": "boolean",
|
|
1976
|
+
"kind": "expression"
|
|
1977
|
+
}
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
"name": "select-input-props",
|
|
1981
|
+
"description": "Select input props",
|
|
1982
|
+
"value": {
|
|
1983
|
+
"type": "Record<string, unknown>",
|
|
1984
|
+
"kind": "expression"
|
|
1985
|
+
}
|
|
1930
1986
|
}
|
|
1931
1987
|
],
|
|
1932
1988
|
"events": [
|
|
@@ -2036,6 +2092,14 @@
|
|
|
2036
2092
|
"kind": "expression"
|
|
2037
2093
|
}
|
|
2038
2094
|
},
|
|
2095
|
+
{
|
|
2096
|
+
"name": "allow-clear",
|
|
2097
|
+
"description": "Whether to enable clear buttons by default",
|
|
2098
|
+
"value": {
|
|
2099
|
+
"type": "boolean",
|
|
2100
|
+
"kind": "expression"
|
|
2101
|
+
}
|
|
2102
|
+
},
|
|
2039
2103
|
{
|
|
2040
2104
|
"name": "global",
|
|
2041
2105
|
"description": "Is global effect",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdata/web-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "SD Design Vue: A Vue.js 3 UI Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sd",
|
|
@@ -69,9 +69,11 @@
|
|
|
69
69
|
"@semantic-release/git": "^10.0.1",
|
|
70
70
|
"@semantic-release/github": "^12.0.6",
|
|
71
71
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
72
|
+
"@types/clean-css": "^4.2.11",
|
|
72
73
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
73
74
|
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
74
75
|
"@vue/test-utils": "^2.4.6",
|
|
76
|
+
"@vueuse/core": "^14.2.1",
|
|
75
77
|
"clean-css": "^5.3.3",
|
|
76
78
|
"fast-glob": "^3.3.3",
|
|
77
79
|
"glob": "^13.0.6",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
|
-
import InputNumber from "../input-number/index.js";
|
|
3
|
-
import { createVNode, defineComponent } from "vue";
|
|
4
|
-
//#region components/color-picker/input-alpha.tsx
|
|
5
|
-
var input_alpha_default = /* @__PURE__ */ defineComponent({
|
|
6
|
-
name: "InputAlpha",
|
|
7
|
-
props: {
|
|
8
|
-
value: {
|
|
9
|
-
type: Number,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
disabled: Boolean,
|
|
13
|
-
onChange: Function
|
|
14
|
-
},
|
|
15
|
-
setup(props) {
|
|
16
|
-
const prefixCls = getPrefixCls("color-picker");
|
|
17
|
-
return () => createVNode(InputNumber, {
|
|
18
|
-
"class": `${prefixCls}-input-alpha`,
|
|
19
|
-
"size": "mini",
|
|
20
|
-
"min": 0,
|
|
21
|
-
"max": 100,
|
|
22
|
-
"disabled": props.disabled,
|
|
23
|
-
"modelValue": Math.round(props.value * 100),
|
|
24
|
-
"onChange": (a = 100) => {
|
|
25
|
-
var _props$onChange;
|
|
26
|
-
return (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, a / 100);
|
|
27
|
-
}
|
|
28
|
-
}, { suffix: () => "%" });
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
//#endregion
|
|
32
|
-
export { input_alpha_default as default };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
|
-
import input_group_default from "../input/input-group.js";
|
|
3
|
-
import useState from "../_hooks/use-state.js";
|
|
4
|
-
import Input from "../input/index.js";
|
|
5
|
-
import { hexToRgb, rgbToHsv } from "../_utils/color.js";
|
|
6
|
-
import input_alpha_default from "./input-alpha.js";
|
|
7
|
-
import { createVNode, defineComponent, toRefs, watch } from "vue";
|
|
8
|
-
//#region components/color-picker/input-hex.tsx
|
|
9
|
-
var input_hex_default = /* @__PURE__ */ defineComponent({
|
|
10
|
-
name: "InputHex",
|
|
11
|
-
props: {
|
|
12
|
-
color: {
|
|
13
|
-
type: Object,
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
alpha: {
|
|
17
|
-
type: Number,
|
|
18
|
-
required: true
|
|
19
|
-
},
|
|
20
|
-
disabled: Boolean,
|
|
21
|
-
disabledAlpha: Boolean,
|
|
22
|
-
onHsvChange: Function,
|
|
23
|
-
onAlphaChange: Function
|
|
24
|
-
},
|
|
25
|
-
setup(props) {
|
|
26
|
-
const prefixCls = getPrefixCls("color-picker");
|
|
27
|
-
const { color } = toRefs(props);
|
|
28
|
-
const [hex, setHex] = useState(color.value.hex);
|
|
29
|
-
const handlerChange = (value) => {
|
|
30
|
-
var _props$onHsvChange;
|
|
31
|
-
const _rgb = hexToRgb(value) || {
|
|
32
|
-
r: 255,
|
|
33
|
-
g: 0,
|
|
34
|
-
b: 0
|
|
35
|
-
};
|
|
36
|
-
const hsv = rgbToHsv(_rgb.r, _rgb.g, _rgb.b);
|
|
37
|
-
(_props$onHsvChange = props.onHsvChange) === null || _props$onHsvChange === void 0 || _props$onHsvChange.call(props, hsv);
|
|
38
|
-
};
|
|
39
|
-
const onInputChange = (value) => {
|
|
40
|
-
var _value$match$join, _value$match;
|
|
41
|
-
const matchValue = (_value$match$join = (_value$match = value.match(/[a-fA-F0-9]*/g)) === null || _value$match === void 0 ? void 0 : _value$match.join("")) !== null && _value$match$join !== void 0 ? _value$match$join : "";
|
|
42
|
-
if (matchValue !== color.value.hex) handlerChange(matchValue.toUpperCase());
|
|
43
|
-
};
|
|
44
|
-
const onPaste = (ev) => {
|
|
45
|
-
if (!ev.clipboardData) return;
|
|
46
|
-
let text = ev.clipboardData.getData("Text");
|
|
47
|
-
if (text.startsWith("#")) text = text.slice(1);
|
|
48
|
-
onInputChange(text);
|
|
49
|
-
ev.preventDefault();
|
|
50
|
-
};
|
|
51
|
-
watch(color, () => {
|
|
52
|
-
if (color.value.hex !== hex.value) setHex(color.value.hex);
|
|
53
|
-
});
|
|
54
|
-
return () => createVNode(input_group_default, { "class": `${prefixCls}-input-group` }, { default: () => [createVNode(Input, {
|
|
55
|
-
"class": `${prefixCls}-input-hex`,
|
|
56
|
-
"size": "mini",
|
|
57
|
-
"maxLength": 6,
|
|
58
|
-
"disabled": props.disabled,
|
|
59
|
-
"modelValue": hex.value,
|
|
60
|
-
"onInput": setHex,
|
|
61
|
-
"onChange": onInputChange,
|
|
62
|
-
"onBlur": () => handlerChange,
|
|
63
|
-
"onPressEnter": () => handlerChange,
|
|
64
|
-
"onPaste": onPaste
|
|
65
|
-
}, { prefix: () => "#" }), !props.disabledAlpha && createVNode(input_alpha_default, {
|
|
66
|
-
"disabled": props.disabled,
|
|
67
|
-
"value": props.alpha,
|
|
68
|
-
"onChange": props.onAlphaChange
|
|
69
|
-
}, null)] });
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
//#endregion
|
|
73
|
-
export { input_hex_default as default };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
|
|
2
|
-
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
-
import input_group_default from "../input/input-group.js";
|
|
4
|
-
import { rgbToHsv } from "../_utils/color.js";
|
|
5
|
-
import InputNumber from "../input-number/index.js";
|
|
6
|
-
import input_alpha_default from "./input-alpha.js";
|
|
7
|
-
import { createVNode, defineComponent, toRefs } from "vue";
|
|
8
|
-
//#region components/color-picker/input-rgb.tsx
|
|
9
|
-
var input_rgb_default = /* @__PURE__ */ defineComponent({
|
|
10
|
-
name: "InputRgb",
|
|
11
|
-
props: {
|
|
12
|
-
color: {
|
|
13
|
-
type: Object,
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
alpha: {
|
|
17
|
-
type: Number,
|
|
18
|
-
required: true
|
|
19
|
-
},
|
|
20
|
-
disabled: Boolean,
|
|
21
|
-
disabledAlpha: Boolean,
|
|
22
|
-
onHsvChange: Function,
|
|
23
|
-
onAlphaChange: Function
|
|
24
|
-
},
|
|
25
|
-
setup(props) {
|
|
26
|
-
const prefixCls = getPrefixCls("color-picker");
|
|
27
|
-
const { color } = toRefs(props);
|
|
28
|
-
const handleChange = (value) => {
|
|
29
|
-
var _props$onHsvChange;
|
|
30
|
-
const newRGB = _objectSpread2(_objectSpread2({}, color.value.rgb), value);
|
|
31
|
-
const hsv = rgbToHsv(newRGB.r, newRGB.g, newRGB.b);
|
|
32
|
-
(_props$onHsvChange = props.onHsvChange) === null || _props$onHsvChange === void 0 || _props$onHsvChange.call(props, hsv);
|
|
33
|
-
};
|
|
34
|
-
return () => createVNode(input_group_default, { "class": `${prefixCls}-input-group` }, { default: () => [[
|
|
35
|
-
"r",
|
|
36
|
-
"g",
|
|
37
|
-
"b"
|
|
38
|
-
].map((channel) => createVNode(InputNumber, {
|
|
39
|
-
"key": channel,
|
|
40
|
-
"size": "mini",
|
|
41
|
-
"min": 0,
|
|
42
|
-
"max": 255,
|
|
43
|
-
"disabled": props.disabled,
|
|
44
|
-
"modelValue": color.value.rgb[channel],
|
|
45
|
-
"hideButton": true,
|
|
46
|
-
"onChange": (val = 0) => handleChange({ [channel]: val })
|
|
47
|
-
}, null)), !props.disabledAlpha && createVNode(input_alpha_default, {
|
|
48
|
-
"disabled": props.disabled,
|
|
49
|
-
"value": props.alpha,
|
|
50
|
-
"onChange": props.onAlphaChange
|
|
51
|
-
}, null)] });
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
//#endregion
|
|
55
|
-
export { input_rgb_default as default };
|