@nutui/nutui 4.3.1 → 4.3.3

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 (130) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/nutui.es.js +2 -4
  3. package/dist/nutui.js +6035 -6408
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/actionsheet/ActionSheet.js +1 -1
  6. package/dist/packages/address/Address.js +1 -1
  7. package/dist/packages/addresslist/AddressList.js +2 -2
  8. package/dist/packages/animate/Animate.js +51 -44
  9. package/dist/packages/backtop/Backtop.js +79 -89
  10. package/dist/packages/calendar/Calendar.js +814 -3
  11. package/dist/packages/calendar/index.scss +0 -1
  12. package/dist/packages/calendarcard/CalendarCard.js +1 -1
  13. package/dist/packages/card/Card.js +4 -4
  14. package/dist/packages/cascader/Cascader.js +1 -1
  15. package/dist/packages/checkbox/Checkbox.js +1 -1
  16. package/dist/packages/circleprogress/CircleProgress.js +90 -97
  17. package/dist/packages/col/Col.js +41 -30
  18. package/dist/packages/comment/Comment.js +2 -2
  19. package/dist/packages/{common-LvGbU-A3.js → common-FZL3qC99.js} +5 -2
  20. package/dist/packages/dialog/Dialog.js +1 -1
  21. package/dist/packages/ecard/Ecard.js +2 -2
  22. package/dist/packages/form/Form.js +3 -1
  23. package/dist/packages/formitem/FormItem.js +1 -1
  24. package/dist/packages/imagepreview/ImagePreview.js +1 -1
  25. package/dist/packages/{index-wY4t0zYt.js → index-BqB5dTeo.js} +29 -17
  26. package/dist/packages/{index.vue_vue_type_script_lang-w2sgcysj.js → index.vue_vue_type_script_lang-n0HbjvfF.js} +1 -1
  27. package/dist/packages/input/Input.js +8 -8
  28. package/dist/packages/inputnumber/InputNumber.js +84 -103
  29. package/dist/packages/invoice/Invoice.js +87 -138
  30. package/dist/packages/layout/Layout.js +3 -0
  31. package/dist/packages/menuitem/MenuItem.js +1 -1
  32. package/dist/packages/navbar/Navbar.js +103 -115
  33. package/dist/packages/notify/Notify.js +1 -1
  34. package/dist/packages/numberkeyboard/NumberKeyboard.js +1 -1
  35. package/dist/packages/popover/Popover.js +1 -1
  36. package/dist/packages/popup/Popup.js +1 -1
  37. package/dist/packages/price/Price.js +69 -77
  38. package/dist/packages/progress/Progress.js +96 -115
  39. package/dist/packages/radio/Radio.js +1 -1
  40. package/dist/packages/range/Range.js +1 -1
  41. package/dist/packages/rate/Rate.js +99 -141
  42. package/dist/packages/row/Row.js +43 -39
  43. package/dist/packages/searchbar/Searchbar.js +1 -1
  44. package/dist/packages/shortpassword/ShortPassword.js +1 -1
  45. package/dist/packages/sku/Sku.js +5 -5
  46. package/dist/packages/swipe/Swipe.js +96 -110
  47. package/dist/packages/swipegroup/SwipeGroup.js +41 -23
  48. package/dist/packages/switch/Switch.js +12 -4
  49. package/dist/packages/switch/index.css +1 -1
  50. package/dist/packages/switch/index.scss +1 -1
  51. package/dist/packages/tag/Tag.js +57 -66
  52. package/dist/packages/textarea/Textarea.js +1 -1
  53. package/dist/packages/timeselect/TimeSelect.js +1 -1
  54. package/dist/packages/uploader/Uploader.js +5 -5
  55. package/dist/smartips/web-types.json +12 -3
  56. package/dist/style.css +1 -1
  57. package/dist/styles/base-jdb.css +1 -1
  58. package/dist/styles/base-jddkh.css +1 -1
  59. package/dist/styles/base-jdt.css +1 -1
  60. package/dist/styles/themes/default.scss +0 -1
  61. package/dist/styles/themes/jdb.scss +0 -1
  62. package/dist/styles/themes/jddkh.scss +0 -1
  63. package/dist/styles/themes/jdt.scss +0 -1
  64. package/dist/styles/variables-jdb.scss +0 -1
  65. package/dist/styles/variables-jddkh.scss +0 -1
  66. package/dist/styles/variables-jdt.scss +0 -1
  67. package/dist/styles/variables.scss +0 -1
  68. package/dist/types/__VUE/animate/animate.vue.d.ts +75 -0
  69. package/dist/types/__VUE/animate/index.d.ts +6 -0
  70. package/dist/types/__VUE/backtop/backtop.vue.d.ts +87 -0
  71. package/dist/types/__VUE/backtop/index.d.ts +5 -0
  72. package/dist/types/__VUE/calendaritem/index.vue.d.ts +2 -12
  73. package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +88 -0
  74. package/dist/types/__VUE/circleprogress/index.d.ts +6 -0
  75. package/dist/types/__VUE/col/col.vue.d.ts +53 -0
  76. package/dist/types/__VUE/col/index.d.ts +5 -0
  77. package/dist/types/__VUE/form/common.d.ts +2 -0
  78. package/dist/types/__VUE/form/types.d.ts +0 -1
  79. package/dist/types/__VUE/input/index.vue.d.ts +1 -1
  80. package/dist/types/__VUE/inputnumber/index.d.ts +5 -0
  81. package/dist/types/__VUE/inputnumber/input-number.vue.d.ts +112 -0
  82. package/dist/types/__VUE/invoice/index.d.ts +6 -0
  83. package/dist/types/__VUE/invoice/invoice.vue.d.ts +59 -0
  84. package/dist/types/__VUE/invoice/types.d.ts +12 -0
  85. package/dist/types/__VUE/layout/index.d.ts +4 -0
  86. package/dist/types/__VUE/layout/layout.vue.d.ts +10 -0
  87. package/dist/types/__VUE/navbar/index.d.ts +5 -0
  88. package/dist/types/__VUE/navbar/navbar.vue.d.ts +125 -0
  89. package/dist/types/__VUE/price/index.d.ts +6 -0
  90. package/dist/types/__VUE/price/price.vue.d.ts +83 -0
  91. package/dist/types/__VUE/progress/index.d.ts +6 -0
  92. package/dist/types/__VUE/progress/progress.vue.d.ts +91 -0
  93. package/dist/types/__VUE/rate/index.d.ts +5 -0
  94. package/dist/types/__VUE/rate/rate.vue.d.ts +208 -0
  95. package/dist/types/__VUE/row/index.d.ts +5 -0
  96. package/dist/types/__VUE/row/row.vue.d.ts +71 -0
  97. package/dist/types/__VUE/swipe/index.d.ts +6 -0
  98. package/dist/types/__VUE/swipe/swipe.vue.d.ts +79 -0
  99. package/dist/types/__VUE/swipe/types.d.ts +1 -0
  100. package/dist/types/__VUE/swipegroup/index.d.ts +5 -0
  101. package/dist/types/__VUE/swipegroup/swipe-group.vue.d.ts +47 -0
  102. package/dist/types/__VUE/switch/index.vue.d.ts +9 -0
  103. package/dist/types/__VUE/tag/index.d.ts +6 -0
  104. package/dist/types/__VUE/tag/tag.vue.d.ts +90 -0
  105. package/dist/types/__VUE/tag/types.d.ts +1 -1
  106. package/dist/types/index.d.ts +32 -18
  107. package/package.json +1 -1
  108. package/dist/packages/calendaritem/CalendarItem.js +0 -819
  109. package/dist/packages/calendaritem/index.css +0 -0
  110. package/dist/packages/calendaritem/index.mjs +0 -2
  111. package/dist/packages/calendaritem/index.scss +0 -0
  112. package/dist/packages/calendaritem/style/css.mjs +0 -2
  113. package/dist/packages/calendaritem/style/index.mjs +0 -2
  114. package/dist/packages/types-Ynmct7na.js +0 -4
  115. package/dist/types/__VUE/animate/index.vue.d.ts +0 -71
  116. package/dist/types/__VUE/backtop/index.vue.d.ts +0 -98
  117. package/dist/types/__VUE/circleprogress/index.vue.d.ts +0 -95
  118. package/dist/types/__VUE/col/index.vue.d.ts +0 -42
  119. package/dist/types/__VUE/inputnumber/index.vue.d.ts +0 -117
  120. package/dist/types/__VUE/invoice/index.vue.d.ts +0 -53
  121. package/dist/types/__VUE/layout/index.vue.d.ts +0 -12
  122. package/dist/types/__VUE/navbar/index.vue.d.ts +0 -129
  123. package/dist/types/__VUE/price/index.vue.d.ts +0 -97
  124. package/dist/types/__VUE/progress/index.vue.d.ts +0 -120
  125. package/dist/types/__VUE/rate/index.vue.d.ts +0 -240
  126. package/dist/types/__VUE/row/index.vue.d.ts +0 -62
  127. package/dist/types/__VUE/swipe/index.vue.d.ts +0 -70
  128. package/dist/types/__VUE/swipegroup/index.vue.d.ts +0 -26
  129. package/dist/types/__VUE/tag/index.vue.d.ts +0 -94
  130. /package/dist/types/__VUE/animate/{type.d.ts → types.d.ts} +0 -0
@@ -1,42 +1,49 @@
1
- import { toRefs, ref, computed, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, renderSlot, createVNode, createCommentVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "../component-TCzwHGVq.js";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, ref, computed, onMounted, nextTick, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, renderSlot, createVNode, unref, createCommentVNode, toDisplayString } from "vue";
3
21
  import { Left } from "@nutui/icons-vue";
4
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
5
- const { componentName, create } = createComponent("navbar");
6
- const _sfc_main = create({
7
- components: { Left },
22
+ import { w as withInstall } from "../with-install-p59gYYU_.js";
23
+ const _hoisted_1 = {
24
+ key: 1,
25
+ class: "nut-navbar__text"
26
+ };
27
+ const _hoisted_2 = { class: "nut-navbar__title" };
28
+ const _hoisted_3 = {
29
+ key: 0,
30
+ class: "nut-navbar__text"
31
+ };
32
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
33
+ name: "NutNavbar"
34
+ }), {
35
+ __name: "navbar",
8
36
  props: {
9
37
  leftShow: { type: Boolean, default: false },
10
- //左侧 是否显示返回icon
11
- title: { type: String, default: "" },
12
- //中间 文字标题
38
+ title: { default: "" },
13
39
  titleIcon: { type: Boolean, default: false },
14
- //中间
15
- leftText: { type: String, default: "" },
16
- //左侧文字
17
- desc: { type: String, default: "" },
18
- //右侧 按钮文字
19
- fixed: {
20
- type: Boolean,
21
- default: false
22
- },
23
- safeAreaInsetTop: {
24
- type: Boolean,
25
- default: false
26
- },
27
- border: {
28
- type: Boolean,
29
- default: false
30
- },
31
- placeholder: {
32
- // 生成一个等高的占位元素
33
- type: Boolean,
34
- default: true
35
- },
36
- zIndex: {
37
- type: [Number, String],
38
- default: 10
39
- }
40
+ leftText: { default: "" },
41
+ desc: { default: "" },
42
+ fixed: { type: Boolean, default: false },
43
+ safeAreaInsetTop: { type: Boolean, default: false },
44
+ border: { type: Boolean, default: false },
45
+ placeholder: { type: Boolean, default: true },
46
+ zIndex: { default: 10 }
40
47
  },
41
48
  emits: [
42
49
  "clickBack",
@@ -49,21 +56,22 @@ const _sfc_main = create({
49
56
  "onClickIcon",
50
57
  "onClickRight"
51
58
  ],
52
- setup(props, { emit }) {
53
- const { border, fixed, safeAreaInsetTop, placeholder } = toRefs(props);
59
+ setup(__props, { emit: __emit }) {
60
+ const props = __props;
61
+ const emit = __emit;
54
62
  const navHeight = ref("auto");
55
63
  const navbarRef = ref();
56
64
  const classes = computed(() => {
57
- const prefixCls = componentName;
65
+ const prefixCls = "nut-navbar";
58
66
  return {
59
67
  [prefixCls]: true,
60
- [`${prefixCls}--border`]: border.value,
61
- [`${prefixCls}--fixed`]: fixed.value,
62
- [`${prefixCls}--safe-area-inset-top`]: safeAreaInsetTop.value
68
+ [`${prefixCls}--border`]: props.border,
69
+ [`${prefixCls}--fixed`]: props.fixed,
70
+ [`${prefixCls}--safe-area-inset-top`]: props.safeAreaInsetTop
63
71
  };
64
72
  });
65
73
  const rootStyle = computed(() => {
66
- if (fixed.value && placeholder.value) {
74
+ if (props.fixed && props.placeholder) {
67
75
  return {
68
76
  height: navHeight.value
69
77
  };
@@ -77,7 +85,7 @@ const _sfc_main = create({
77
85
  }
78
86
  };
79
87
  onMounted(() => {
80
- if (fixed.value && placeholder.value) {
88
+ if (props.fixed && props.placeholder) {
81
89
  nextTick(() => {
82
90
  getNavHeight();
83
91
  });
@@ -99,79 +107,59 @@ const _sfc_main = create({
99
107
  emit("clickRight");
100
108
  emit("onClickRight");
101
109
  };
102
- return {
103
- navbarRef,
104
- rootStyle,
105
- classes,
106
- navHeight,
107
- handleLeft,
108
- handleCenter,
109
- handleCenterIcon,
110
- handleRight
111
- };
112
- }
113
- });
114
- const _hoisted_1 = {
115
- key: 1,
116
- class: "nut-navbar__text"
117
- };
118
- const _hoisted_2 = { class: "nut-navbar__title" };
119
- const _hoisted_3 = {
120
- key: 0,
121
- class: "nut-navbar__text"
122
- };
123
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
124
- const _component_Left = resolveComponent("Left");
125
- return openBlock(), createElementBlock("view", {
126
- class: "nut-navbar--placeholder",
127
- style: normalizeStyle(_ctx.rootStyle)
128
- }, [
129
- createElementVNode("view", {
130
- ref: "navbarRef",
131
- class: normalizeClass(_ctx.classes),
132
- style: normalizeStyle({ zIndex: _ctx.zIndex })
133
- }, [
134
- createElementVNode("view", {
135
- class: "nut-navbar__left",
136
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleLeft && _ctx.handleLeft(...args))
110
+ return (_ctx, _cache) => {
111
+ return openBlock(), createElementBlock("view", {
112
+ class: "nut-navbar--placeholder",
113
+ style: normalizeStyle(rootStyle.value)
137
114
  }, [
138
- _ctx.leftShow ? renderSlot(_ctx.$slots, "left-show", { key: 0 }, () => [
139
- createVNode(_component_Left, {
140
- height: "12px",
141
- color: "#979797"
142
- })
143
- ]) : createCommentVNode("", true),
144
- _ctx.leftText ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.leftText), 1)) : createCommentVNode("", true),
145
- renderSlot(_ctx.$slots, "left")
146
- ]),
147
- createElementVNode("view", _hoisted_2, [
148
- _ctx.title ? (openBlock(), createElementBlock("view", {
149
- key: 0,
150
- class: "title",
151
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
152
- }, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
153
- _ctx.titleIcon ? (openBlock(), createElementBlock("view", {
154
- key: 1,
155
- class: "icon",
156
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleCenterIcon && _ctx.handleCenterIcon(...args))
115
+ createElementVNode("view", {
116
+ ref_key: "navbarRef",
117
+ ref: navbarRef,
118
+ class: normalizeClass(classes.value),
119
+ style: normalizeStyle({ zIndex: _ctx.zIndex })
157
120
  }, [
158
- renderSlot(_ctx.$slots, "title-icon", {
159
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleCenterIcon && _ctx.handleCenterIcon(...args))
160
- })
161
- ])) : createCommentVNode("", true),
162
- renderSlot(_ctx.$slots, "content")
163
- ]),
164
- createElementVNode("view", {
165
- class: "nut-navbar__right",
166
- onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleRight && _ctx.handleRight(...args))
167
- }, [
168
- _ctx.desc ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.desc), 1)) : createCommentVNode("", true),
169
- renderSlot(_ctx.$slots, "right")
170
- ])
171
- ], 6)
172
- ], 4);
173
- }
174
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
121
+ createElementVNode("view", {
122
+ class: "nut-navbar__left",
123
+ onClick: handleLeft
124
+ }, [
125
+ _ctx.leftShow ? renderSlot(_ctx.$slots, "left-show", { key: 0 }, () => [
126
+ createVNode(unref(Left), {
127
+ height: "12px",
128
+ color: "#979797"
129
+ })
130
+ ]) : createCommentVNode("", true),
131
+ _ctx.leftText ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.leftText), 1)) : createCommentVNode("", true),
132
+ renderSlot(_ctx.$slots, "left")
133
+ ]),
134
+ createElementVNode("view", _hoisted_2, [
135
+ _ctx.title ? (openBlock(), createElementBlock("view", {
136
+ key: 0,
137
+ class: "title",
138
+ onClick: handleCenter
139
+ }, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
140
+ _ctx.titleIcon ? (openBlock(), createElementBlock("view", {
141
+ key: 1,
142
+ class: "icon",
143
+ onClick: handleCenterIcon
144
+ }, [
145
+ renderSlot(_ctx.$slots, "title-icon", { onClick: handleCenterIcon })
146
+ ])) : createCommentVNode("", true),
147
+ renderSlot(_ctx.$slots, "content")
148
+ ]),
149
+ createElementVNode("view", {
150
+ class: "nut-navbar__right",
151
+ onClick: handleRight
152
+ }, [
153
+ _ctx.desc ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.desc), 1)) : createCommentVNode("", true),
154
+ renderSlot(_ctx.$slots, "right")
155
+ ])
156
+ ], 6)
157
+ ], 4);
158
+ };
159
+ }
160
+ }));
161
+ withInstall(_sfc_main);
175
162
  export {
176
- index as default
163
+ _sfc_main as Navbar,
164
+ _sfc_main as default
177
165
  };
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, createVNode, render, onMounted, h } from "vue";
21
21
  import { c as createComponent } from "../component-TCzwHGVq.js";
22
- import { N as NutPopup } from "../index-wY4t0zYt.js";
22
+ import { N as NutPopup } from "../index-BqB5dTeo.js";
23
23
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
24
24
  const { create } = createComponent("notify");
25
25
  const _sfc_main = create({
@@ -1,6 +1,6 @@
1
1
  import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } from "vue";
2
2
  import { c as createComponent } from "../component-TCzwHGVq.js";
3
- import { N as NutPopup } from "../index-wY4t0zYt.js";
3
+ import { N as NutPopup } from "../index-BqB5dTeo.js";
4
4
  import { u as useLocale } from "../index-s3RgMhc7.js";
5
5
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
6
6
  const { create } = createComponent("number-keyboard");
@@ -2,7 +2,7 @@ import { ref, computed, onMounted, watch, nextTick, resolveComponent, openBlock,
2
2
  import { c as createComponent } from "../component-TCzwHGVq.js";
3
3
  import { r as renderIcon } from "../renderIcon--EgZu5_5.js";
4
4
  import { u as useRect } from "../index-cp6Ms_Qe.js";
5
- import { N as NutPopup } from "../index-wY4t0zYt.js";
5
+ import { N as NutPopup } from "../index-BqB5dTeo.js";
6
6
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
7
7
  const { create } = createComponent("popover");
8
8
  const _sfc_main = create({
@@ -1,4 +1,4 @@
1
- import { N } from "../index-wY4t0zYt.js";
1
+ import { N } from "../index-BqB5dTeo.js";
2
2
  import "vue";
3
3
  import "../_plugin-vue_export-helper-yVxbj29m.js";
4
4
  export {
@@ -1,47 +1,47 @@
1
- import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "../component-TCzwHGVq.js";
3
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
4
- const { componentName, create } = createComponent("price");
5
- const _sfc_main = create({
6
- props: {
7
- price: {
8
- type: [Number, String],
9
- default: 0
10
- },
11
- needSymbol: {
12
- type: Boolean,
13
- default: true
14
- },
15
- symbol: {
16
- type: String,
17
- default: "¥"
18
- },
19
- decimalDigits: {
20
- type: Number,
21
- default: 2
22
- },
23
- thousands: {
24
- type: Boolean,
25
- default: false
26
- },
27
- position: {
28
- type: String,
29
- default: "before"
30
- },
31
- size: {
32
- type: String,
33
- default: "normal"
34
- },
35
- strikeThrough: {
36
- type: Boolean,
37
- default: false
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
38
16
  }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
21
+ import { w as withInstall } from "../with-install-p59gYYU_.js";
22
+ const _hoisted_1 = ["innerHTML"];
23
+ const _hoisted_2 = ["innerHTML"];
24
+ const prefix = "nut-price";
25
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
26
+ name: "NutPrice"
27
+ }), {
28
+ __name: "price",
29
+ props: {
30
+ price: { default: 0 },
31
+ needSymbol: { type: Boolean, default: true },
32
+ symbol: { default: "¥" },
33
+ decimalDigits: { default: 2 },
34
+ thousands: { type: Boolean, default: false },
35
+ position: { default: "before" },
36
+ size: { default: "normal" },
37
+ strikeThrough: { type: Boolean, default: false }
39
38
  },
40
- setup(props) {
39
+ setup(__props) {
40
+ const props = __props;
41
41
  const classes = computed(() => {
42
42
  return {
43
- [componentName]: true,
44
- [`${componentName}--strike`]: props.strikeThrough
43
+ [prefix]: true,
44
+ [`${prefix}--strike`]: props.strikeThrough
45
45
  };
46
46
  });
47
47
  const showSymbol = computed(() => {
@@ -81,44 +81,36 @@ const _sfc_main = create({
81
81
  const resultFixed = Number(result).toFixed(props.decimalDigits);
82
82
  return String(resultFixed).substring(2, resultFixed.length);
83
83
  };
84
- return {
85
- classes,
86
- showSymbol,
87
- checkPoint,
88
- formatThousands,
89
- formatDecimal
84
+ return (_ctx, _cache) => {
85
+ return openBlock(), createElementBlock("view", {
86
+ class: normalizeClass(classes.value)
87
+ }, [
88
+ _ctx.needSymbol && _ctx.position === "before" ? (openBlock(), createElementBlock("view", {
89
+ key: 0,
90
+ class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
91
+ innerHTML: showSymbol.value
92
+ }, null, 10, _hoisted_1)) : createCommentVNode("", true),
93
+ createElementVNode("view", {
94
+ class: normalizeClass(`nut-price--${_ctx.size}`)
95
+ }, toDisplayString(formatThousands(_ctx.price)), 3),
96
+ _ctx.decimalDigits != 0 ? (openBlock(), createElementBlock("view", {
97
+ key: 1,
98
+ class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
99
+ }, ".", 2)) : createCommentVNode("", true),
100
+ createElementVNode("view", {
101
+ class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
102
+ }, toDisplayString(formatDecimal(_ctx.price)), 3),
103
+ _ctx.needSymbol && _ctx.position === "after" ? (openBlock(), createElementBlock("view", {
104
+ key: 2,
105
+ class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
106
+ innerHTML: showSymbol.value
107
+ }, null, 10, _hoisted_2)) : createCommentVNode("", true)
108
+ ], 2);
90
109
  };
91
110
  }
92
- });
93
- const _hoisted_1 = ["innerHTML"];
94
- const _hoisted_2 = ["innerHTML"];
95
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
96
- return openBlock(), createElementBlock("view", {
97
- class: normalizeClass(_ctx.classes)
98
- }, [
99
- _ctx.needSymbol && _ctx.position === "before" ? (openBlock(), createElementBlock("view", {
100
- key: 0,
101
- class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
102
- innerHTML: _ctx.showSymbol
103
- }, null, 10, _hoisted_1)) : createCommentVNode("", true),
104
- createElementVNode("view", {
105
- class: normalizeClass(`nut-price--${_ctx.size}`)
106
- }, toDisplayString(_ctx.formatThousands(_ctx.price)), 3),
107
- _ctx.decimalDigits != 0 ? (openBlock(), createElementBlock("view", {
108
- key: 1,
109
- class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
110
- }, ".", 2)) : createCommentVNode("", true),
111
- createElementVNode("view", {
112
- class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
113
- }, toDisplayString(_ctx.formatDecimal(_ctx.price)), 3),
114
- _ctx.needSymbol && _ctx.position === "after" ? (openBlock(), createElementBlock("view", {
115
- key: 2,
116
- class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
117
- innerHTML: _ctx.showSymbol
118
- }, null, 10, _hoisted_2)) : createCommentVNode("", true)
119
- ], 2);
120
- }
121
- const NutPrice = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
111
+ }));
112
+ withInstall(_sfc_main);
122
113
  export {
123
- NutPrice as default
114
+ _sfc_main as Price,
115
+ _sfc_main as default
124
116
  };