@v-c/picker 0.0.7 → 1.0.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.
Files changed (144) hide show
  1. package/package.json +11 -11
  2. package/dist/PickerInput/Popup/Footer.cjs +0 -115
  3. package/dist/PickerInput/Popup/PopupPanel.cjs +0 -413
  4. package/dist/PickerInput/Popup/PresetPanel.cjs +0 -54
  5. package/dist/PickerInput/Popup/index.cjs +0 -526
  6. package/dist/PickerInput/RangePicker.cjs +0 -1911
  7. package/dist/PickerInput/Selector/Icon.cjs +0 -89
  8. package/dist/PickerInput/Selector/Input.cjs +0 -376
  9. package/dist/PickerInput/Selector/MaskFormat.cjs +0 -72
  10. package/dist/PickerInput/Selector/RangeSelector.cjs +0 -1393
  11. package/dist/PickerInput/Selector/SingleSelector/MultipleDates.cjs +0 -110
  12. package/dist/PickerInput/Selector/SingleSelector/index.cjs +0 -1361
  13. package/dist/PickerInput/Selector/hooks/useClearIcon.cjs +0 -17
  14. package/dist/PickerInput/Selector/hooks/useInputHooks.cjs +0 -125
  15. package/dist/PickerInput/Selector/hooks/useRootProps.cjs +0 -14
  16. package/dist/PickerInput/Selector/util.cjs +0 -32
  17. package/dist/PickerInput/SinglePicker.cjs +0 -1881
  18. package/dist/PickerInput/context.cjs +0 -12
  19. package/dist/PickerInput/hooks/useCellRender.cjs +0 -25
  20. package/dist/PickerInput/hooks/useDelayState.cjs +0 -37
  21. package/dist/PickerInput/hooks/useDisabledBoundary.cjs +0 -15
  22. package/dist/PickerInput/hooks/useFieldFormat.cjs +0 -17
  23. package/dist/PickerInput/hooks/useFieldsInvalidate.cjs +0 -24
  24. package/dist/PickerInput/hooks/useFilledProps.cjs +0 -103
  25. package/dist/PickerInput/hooks/useInputReadOnly.cjs +0 -13
  26. package/dist/PickerInput/hooks/useInvalidate.cjs +0 -34
  27. package/dist/PickerInput/hooks/useLockEffect.cjs +0 -16
  28. package/dist/PickerInput/hooks/useOpen.cjs +0 -15
  29. package/dist/PickerInput/hooks/usePresets.cjs +0 -21
  30. package/dist/PickerInput/hooks/useRangeActive.cjs +0 -57
  31. package/dist/PickerInput/hooks/useRangeDisabledDate.cjs +0 -21
  32. package/dist/PickerInput/hooks/useRangePickerValue.cjs +0 -100
  33. package/dist/PickerInput/hooks/useRangeValue.cjs +0 -135
  34. package/dist/PickerInput/hooks/useShowNow.cjs +0 -15
  35. package/dist/PickerPanel/DatePanel/index.cjs +0 -294
  36. package/dist/PickerPanel/DateTimePanel/index.cjs +0 -180
  37. package/dist/PickerPanel/DecadePanel/index.cjs +0 -230
  38. package/dist/PickerPanel/MonthPanel/index.cjs +0 -219
  39. package/dist/PickerPanel/PanelBody.cjs +0 -157
  40. package/dist/PickerPanel/PanelHeader.cjs +0 -132
  41. package/dist/PickerPanel/QuarterPanel/index.cjs +0 -211
  42. package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.cjs +0 -145
  43. package/dist/PickerPanel/TimePanel/TimePanelBody/index.cjs +0 -286
  44. package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.cjs +0 -65
  45. package/dist/PickerPanel/TimePanel/index.cjs +0 -173
  46. package/dist/PickerPanel/WeekPanel/index.cjs +0 -179
  47. package/dist/PickerPanel/YearPanel/index.cjs +0 -239
  48. package/dist/PickerPanel/context.cjs +0 -61
  49. package/dist/PickerPanel/index.cjs +0 -473
  50. package/dist/PickerTrigger/index.cjs +0 -139
  51. package/dist/PickerTrigger/util.cjs +0 -13
  52. package/dist/_virtual/rolldown_runtime.cjs +0 -21
  53. package/dist/generate/dateFns.cjs +0 -80
  54. package/dist/generate/dayjs.cjs +0 -117
  55. package/dist/generate/index.cjs +0 -1
  56. package/dist/generate/luxon.cjs +0 -75
  57. package/dist/generate/moment.cjs +0 -107
  58. package/dist/hooks/useLocale.cjs +0 -45
  59. package/dist/hooks/useSemantic.cjs +0 -18
  60. package/dist/hooks/useSyncState.cjs +0 -29
  61. package/dist/hooks/useTimeConfig.cjs +0 -161
  62. package/dist/hooks/useTimeInfo.cjs +0 -114
  63. package/dist/hooks/useToggleDates.cjs +0 -16
  64. package/dist/index.cjs +0 -12
  65. package/dist/interface.cjs +0 -1
  66. package/dist/locale/am_ET.cjs +0 -34
  67. package/dist/locale/ar_EG.cjs +0 -32
  68. package/dist/locale/az_AZ.cjs +0 -33
  69. package/dist/locale/bg_BG.cjs +0 -32
  70. package/dist/locale/bn_BD.cjs +0 -33
  71. package/dist/locale/by_BY.cjs +0 -33
  72. package/dist/locale/ca_ES.cjs +0 -32
  73. package/dist/locale/common.cjs +0 -8
  74. package/dist/locale/cs_CZ.cjs +0 -32
  75. package/dist/locale/da_DK.cjs +0 -32
  76. package/dist/locale/de_DE.cjs +0 -32
  77. package/dist/locale/el_GR.cjs +0 -32
  78. package/dist/locale/en_GB.cjs +0 -32
  79. package/dist/locale/en_US.cjs +0 -33
  80. package/dist/locale/es_ES.cjs +0 -32
  81. package/dist/locale/es_MX.cjs +0 -33
  82. package/dist/locale/et_EE.cjs +0 -32
  83. package/dist/locale/eu_ES.cjs +0 -34
  84. package/dist/locale/fa_IR.cjs +0 -32
  85. package/dist/locale/fi_FI.cjs +0 -32
  86. package/dist/locale/fr_BE.cjs +0 -32
  87. package/dist/locale/fr_CA.cjs +0 -33
  88. package/dist/locale/fr_FR.cjs +0 -33
  89. package/dist/locale/ga_IE.cjs +0 -33
  90. package/dist/locale/gl_ES.cjs +0 -32
  91. package/dist/locale/he_IL.cjs +0 -33
  92. package/dist/locale/hi_IN.cjs +0 -33
  93. package/dist/locale/hr_HR.cjs +0 -33
  94. package/dist/locale/hu_HU.cjs +0 -33
  95. package/dist/locale/id_ID.cjs +0 -33
  96. package/dist/locale/is_IS.cjs +0 -32
  97. package/dist/locale/it_IT.cjs +0 -55
  98. package/dist/locale/ja_JP.cjs +0 -35
  99. package/dist/locale/ka_GE.cjs +0 -33
  100. package/dist/locale/kk_KZ.cjs +0 -32
  101. package/dist/locale/km_KH.cjs +0 -34
  102. package/dist/locale/kmr_IQ.cjs +0 -32
  103. package/dist/locale/kn_IN.cjs +0 -33
  104. package/dist/locale/ko_KR.cjs +0 -34
  105. package/dist/locale/lt_LT.cjs +0 -34
  106. package/dist/locale/lv_LV.cjs +0 -32
  107. package/dist/locale/mk_MK.cjs +0 -32
  108. package/dist/locale/ml_IN.cjs +0 -33
  109. package/dist/locale/mn_MN.cjs +0 -34
  110. package/dist/locale/mr_IN.cjs +0 -59
  111. package/dist/locale/ms_MY.cjs +0 -34
  112. package/dist/locale/my_MM.cjs +0 -33
  113. package/dist/locale/nb_NO.cjs +0 -34
  114. package/dist/locale/ne_NP.cjs +0 -33
  115. package/dist/locale/nl_BE.cjs +0 -32
  116. package/dist/locale/nl_NL.cjs +0 -32
  117. package/dist/locale/pl_PL.cjs +0 -32
  118. package/dist/locale/pt_BR.cjs +0 -56
  119. package/dist/locale/pt_PT.cjs +0 -55
  120. package/dist/locale/ro_RO.cjs +0 -33
  121. package/dist/locale/ru_RU.cjs +0 -32
  122. package/dist/locale/si_LK.cjs +0 -34
  123. package/dist/locale/sk_SK.cjs +0 -32
  124. package/dist/locale/sl_SI.cjs +0 -32
  125. package/dist/locale/sr_Cyrl_RS.cjs +0 -32
  126. package/dist/locale/sr_RS.cjs +0 -32
  127. package/dist/locale/sv_SE.cjs +0 -32
  128. package/dist/locale/ta_IN.cjs +0 -33
  129. package/dist/locale/te_IN.cjs +0 -33
  130. package/dist/locale/th_TH.cjs +0 -32
  131. package/dist/locale/tk_TK.cjs +0 -32
  132. package/dist/locale/tr_TR.cjs +0 -55
  133. package/dist/locale/ug_CN.cjs +0 -35
  134. package/dist/locale/uk_UA.cjs +0 -32
  135. package/dist/locale/ur_PK.cjs +0 -33
  136. package/dist/locale/uz_UZ.cjs +0 -33
  137. package/dist/locale/vi_VN.cjs +0 -33
  138. package/dist/locale/zh_CN.cjs +0 -36
  139. package/dist/locale/zh_TW.cjs +0 -36
  140. package/dist/utils/dateUtil.cjs +0 -105
  141. package/dist/utils/getClearIcon.cjs +0 -7
  142. package/dist/utils/miscUtil.cjs +0 -46
  143. package/dist/utils/uiUtil.cjs +0 -6
  144. package/dist/utils/warnUtil.cjs +0 -8
@@ -1,17 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_rolldown_runtime = require("../../../_virtual/rolldown_runtime.cjs");
6
- let vue = require("vue");
7
- let _v_c_util = require("@v-c/util");
8
- function fillClearIcon(prefixCls, allowClear, clearIcon) {
9
- if (process.env.NODE_ENV !== "production" && clearIcon) (0, _v_c_util.warning)(false, "`clearIcon` will be removed in future. Please use `allowClear` instead.");
10
- if (allowClear === false) return null;
11
- return (allowClear && typeof allowClear === "object" ? allowClear : {}).clearIcon || clearIcon || (0, vue.createVNode)("span", { "class": `${prefixCls}-clear-btn` }, null);
12
- }
13
- function useClearIcon(prefixCls, allowClear, clearIcon) {
14
- return (0, vue.computed)(() => fillClearIcon(prefixCls.value, allowClear?.value, clearIcon?.value));
15
- }
16
- exports.default = useClearIcon;
17
- exports.fillClearIcon = fillClearIcon;
@@ -1,125 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_rolldown_runtime = require("../../../_virtual/rolldown_runtime.cjs");
6
- let vue = require("vue");
7
- let _v_c_util = require("@v-c/util");
8
- function formatValue(value, { generateConfig, locale, format }) {
9
- if (!value) return "";
10
- if (typeof format === "function") return format(value);
11
- return generateConfig.locale.format(locale.locale, value, format) || String(value);
12
- }
13
- function pickAttrs(props, { aria, data }) {
14
- const result = {};
15
- Object.keys(props).forEach((key) => {
16
- if (aria && (key.startsWith("aria-") || key === "role")) result[key] = props[key];
17
- if (data && key.startsWith("data-")) result[key] = props[key];
18
- });
19
- return result;
20
- }
21
- function useInputProps(props, postProps) {
22
- const parseDate = (str, formatStr) => {
23
- const { generateConfig, locale } = props.value;
24
- const parsed = generateConfig.locale.parse(locale.locale, str, [formatStr]);
25
- return parsed && generateConfig.isValidate(parsed) ? parsed : null;
26
- };
27
- const firstFormat = (0, vue.computed)(() => props.value.format[0]);
28
- const getText = (date) => {
29
- const { locale, generateConfig } = props.value;
30
- return formatValue(date, {
31
- locale,
32
- format: firstFormat.value,
33
- generateConfig
34
- });
35
- };
36
- const valueTexts = (0, vue.computed)(() => (props.value.value || []).map(getText));
37
- const size = (0, vue.computed)(() => {
38
- const { picker, generateConfig } = props.value;
39
- const defaultSize = picker === "time" ? 8 : 10;
40
- const length = typeof firstFormat.value === "function" ? firstFormat.value(generateConfig.getNow()).length : firstFormat.value.length;
41
- return Math.max(defaultSize, length) + 2;
42
- });
43
- const validateFormat = (text) => {
44
- const { format } = props.value;
45
- for (let i = 0; i < format.length; i += 1) {
46
- const singleFormat = format[i];
47
- if (typeof singleFormat === "string") {
48
- const parsed = parseDate(text, singleFormat);
49
- if (parsed) return parsed;
50
- }
51
- }
52
- return false;
53
- };
54
- const getInputProps = (index) => {
55
- function getProp(propValue) {
56
- return index !== void 0 ? propValue[index] : propValue;
57
- }
58
- const pickedAttrs = pickAttrs(props.value, {
59
- aria: true,
60
- data: true
61
- });
62
- const { maskFormat, preserveInvalidOnBlur, inputReadOnly, required, "aria-required": ariaRequired, name, autoComplete, id, invalid, placeholder, activeHelp, activeIndex, allHelp, disabled, onFocus, onBlur, onSubmit, onInputChange, onInvalid, onChange, onOpenChange, onKeyDown, open } = props.value;
63
- const inputProps = {
64
- ...pickedAttrs,
65
- "format": maskFormat,
66
- "validateFormat": (text) => !!validateFormat(text),
67
- preserveInvalidOnBlur,
68
- "readOnly": inputReadOnly,
69
- required,
70
- "aria-required": ariaRequired,
71
- name,
72
- autoComplete,
73
- "size": size.value,
74
- "id": getProp(id),
75
- "value": getProp(valueTexts.value) || "",
76
- "invalid": getProp(invalid),
77
- "placeholder": getProp(placeholder),
78
- "active": activeIndex === index,
79
- "helped": allHelp || activeHelp && activeIndex === index,
80
- "disabled": getProp(disabled),
81
- "onFocus": (event) => {
82
- onFocus(event, index);
83
- },
84
- "onBlur": (event) => {
85
- onBlur(event, index);
86
- },
87
- onSubmit,
88
- "onChange": (text) => {
89
- onInputChange();
90
- const parsed = validateFormat(text);
91
- if (parsed) {
92
- onInvalid(false, index);
93
- onChange(parsed, index);
94
- return;
95
- }
96
- onInvalid(!!text, index);
97
- },
98
- "onHelp": () => {
99
- onOpenChange(true, { index });
100
- },
101
- "onKeyDown": (event) => {
102
- let prevented = false;
103
- onKeyDown?.(event, () => {
104
- if (process.env.NODE_ENV !== "production") (0, _v_c_util.warning)(false, "`preventDefault` callback is deprecated. Please call `event.preventDefault` directly.");
105
- prevented = true;
106
- });
107
- if (!event.defaultPrevented && !prevented) switch (event.key) {
108
- case "Escape":
109
- onOpenChange(false, { index });
110
- break;
111
- case "Enter":
112
- if (!open) onOpenChange(true);
113
- break;
114
- }
115
- },
116
- ...postProps?.({ valueTexts: valueTexts.value })
117
- };
118
- Object.keys(inputProps).forEach((key) => {
119
- if (inputProps[key] === void 0) delete inputProps[key];
120
- });
121
- return inputProps;
122
- };
123
- return [getInputProps, getText];
124
- }
125
- exports.default = useInputProps;
@@ -1,14 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_rolldown_runtime = require("../../../_virtual/rolldown_runtime.cjs");
6
- const require_miscUtil = require("../../../utils/miscUtil.cjs");
7
- let vue = require("vue");
8
- var propNames = ["onMouseEnter", "onMouseLeave"];
9
- function useRootProps(props) {
10
- return (0, vue.computed)(() => {
11
- return require_miscUtil.pickProps(props, propNames);
12
- });
13
- }
14
- exports.default = useRootProps;
@@ -1,32 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- function getMaskRange(key) {
3
- return {
4
- YYYY: [
5
- 0,
6
- 9999,
7
- (/* @__PURE__ */ new Date()).getFullYear()
8
- ],
9
- MM: [1, 12],
10
- DD: [1, 31],
11
- HH: [0, 23],
12
- mm: [0, 59],
13
- ss: [0, 59],
14
- SSS: [0, 999]
15
- }[key];
16
- }
17
- function raf(callback, delayFrames = 1) {
18
- let id;
19
- let remainingFrames = delayFrames;
20
- function internalCallback() {
21
- remainingFrames -= 1;
22
- if (remainingFrames <= 0) callback();
23
- else id = requestAnimationFrame(internalCallback);
24
- }
25
- id = requestAnimationFrame(internalCallback);
26
- return id;
27
- }
28
- raf.cancel = (id) => {
29
- cancelAnimationFrame(id);
30
- };
31
- exports.getMaskRange = getMaskRange;
32
- exports.raf = raf;