@v-c/select 1.2.3 → 1.2.5

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.
@@ -69,6 +69,7 @@ export interface BaseSelectProps extends BaseSelectPrivateProps {
69
69
  tagRender?: (props: CustomTagProps) => any;
70
70
  direction?: 'ltr' | 'rtl';
71
71
  autoFocus?: boolean;
72
+ autoComplete?: string;
72
73
  placeholder?: VueNode;
73
74
  maxCount?: number;
74
75
  title?: string;
@@ -430,6 +430,11 @@ var BaseSelect = /* @__PURE__ */ defineComponent((props, { expose, attrs }) => {
430
430
  required: false,
431
431
  default: void 0
432
432
  },
433
+ autoComplete: {
434
+ type: String,
435
+ required: false,
436
+ default: void 0
437
+ },
433
438
  placeholder: {
434
439
  type: [
435
440
  Object,
@@ -23,9 +23,21 @@ var OptionList = /* @__PURE__ */ defineComponent({
23
23
  const baseProps = useBaseProps();
24
24
  const context = useSelectContext();
25
25
  const itemPrefixCls = computed(() => `${baseProps.value?.prefixCls}-item`);
26
+ const cacheRef = shallowRef({
27
+ value: context.value?.flattenOptions || [],
28
+ condition: [!!baseProps.value?.open, !!baseProps.value?.lockOptions]
29
+ });
26
30
  const memoFlattenOptions = computed(() => {
27
- if (!baseProps.value?.open) return context.value?.flattenOptions || [];
28
- return context.value?.flattenOptions || [];
31
+ const nextCondition = [!!baseProps.value?.open, !!baseProps.value?.lockOptions];
32
+ const nextValue = context.value?.flattenOptions || [];
33
+ if (nextCondition[0] && !nextCondition[1]) {
34
+ cacheRef.value = {
35
+ value: nextValue,
36
+ condition: nextCondition
37
+ };
38
+ return nextValue;
39
+ }
40
+ return cacheRef.value.value;
29
41
  });
30
42
  const listRef = shallowRef(null);
31
43
  const overMaxCount = computed(() => {
package/dist/Select.js CHANGED
@@ -248,6 +248,11 @@ var Select = /* @__PURE__ */ defineComponent({
248
248
  required: false,
249
249
  default: void 0
250
250
  },
251
+ autoComplete: {
252
+ type: String,
253
+ required: false,
254
+ default: void 0
255
+ },
251
256
  placeholder: {
252
257
  type: [
253
258
  Object,
@@ -64,7 +64,7 @@ var Input = /* @__PURE__ */ defineComponent((props, { expose, attrs }) => {
64
64
  }, { immediate: true });
65
65
  return () => {
66
66
  const { style, autoComplete, className, value, readOnly } = props;
67
- const { prefixCls, autoFocus, placeholder } = selectInputContext.value ?? {};
67
+ const { prefixCls, autoFocus, autoComplete: contextAutoComplete, placeholder } = selectInputContext.value ?? {};
68
68
  const { input: InputComponent = "input" } = selectInputContext.value?.components ?? {};
69
69
  const { styles, id, classNames, open, activeDescendantId, role, disabled } = baseProps.value ?? {};
70
70
  const inputCls = clsx(`${prefixCls}-input`, classNames?.input, className);
@@ -80,7 +80,7 @@ var Input = /* @__PURE__ */ defineComponent((props, { expose, attrs }) => {
80
80
  "--select-input-width": widthCssVar.value
81
81
  },
82
82
  autoFocus,
83
- "autocomplete": autoComplete || "new-password",
83
+ "autocomplete": autoComplete ?? contextAutoComplete ?? "new-password",
84
84
  "class": inputCls,
85
85
  disabled,
86
86
  "value": value || "",
@@ -29,6 +29,7 @@ export interface SelectInputProps {
29
29
  onSelectorRemove?: (value: DisplayValueType) => void;
30
30
  maxLength?: number;
31
31
  autoFocus?: boolean;
32
+ autoComplete?: string;
32
33
  /** Check if `tokenSeparators` contains `\n` or `\r\n` */
33
34
  tokenWithEnter?: boolean;
34
35
  className?: string;
@@ -22,6 +22,7 @@ var DEFAULT_OMIT_PROPS = [
22
22
  "onPopupScroll",
23
23
  "tabIndex",
24
24
  "activeValue",
25
+ "autoComplete",
25
26
  "onSelectorRemove",
26
27
  "focused"
27
28
  ];
@@ -316,6 +317,11 @@ var SelectInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
316
317
  required: false,
317
318
  default: void 0
318
319
  },
320
+ autoComplete: {
321
+ type: String,
322
+ required: false,
323
+ default: void 0
324
+ },
319
325
  tokenWithEnter: {
320
326
  type: Boolean,
321
327
  required: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/select",
3
3
  "type": "module",
4
- "version": "1.2.3",
4
+ "version": "1.2.5",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@v-c/overflow": "^1.1.1",
38
- "@v-c/trigger": "^1.1.0",
38
+ "@v-c/trigger": "^1.1.1",
39
39
  "@v-c/virtual-list": "^1.1.1",
40
40
  "@v-c/util": "^1.1.0"
41
41
  },