@uxda/appkit 4.1.20 → 4.1.22

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/appkit.css CHANGED
@@ -440,7 +440,7 @@ page {
440
440
  --text-color-dark-mode: #eee;
441
441
  }
442
442
  .number {
443
- font-family: 'DIN alternate', 'Roboto', sans-serif-condensed-light;
443
+ font-family: 'DIN alternate', 'Barlow Condensed', 'Roboto Condensed', sans-serif-condensed-light;
444
444
  }
445
445
  .account-card .card {
446
446
  background: #2f2f2f;
@@ -623,14 +623,14 @@ page {
623
623
  top: 11px;
624
624
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDIiIGhlaWdodD0iNDIiIHZpZXdCb3g9IjAgMCA0MiA0MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggb3BhY2l0eT0iMC4wMSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00MSA0MUgxVjFINDFWNDFaIiBmaWxsPSIjRDhEOEQ4IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4wMSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIzLjM1NjEgMjAuOTk5OUwzMy45NjM3IDMxLjYwNzJDMzQuNjE0NiAzMi4yNTgxIDM0LjYxNDYgMzMuMzEzNCAzMy45NjM3IDMzLjk2NDJDMzMuMzQyNSAzNC41ODU1IDMyLjM1MjcgMzQuNjEzOCAzMS42OTc5IDM0LjA0ODlMMjAuOTk5NCAyMy4zNTY2TDEwLjM5MzUgMzMuOTY0MkM5Ljc0MjY1IDM0LjYxNTEgOC42ODczOCAzNC42MTUxIDguMDM2NSAzMy45NjQyQzcuNDE1MTkgMzMuMzQyOSA3LjM4Njk3IDMyLjM1MzIgNy45NTE3OSAzMS42OTg0TDE4LjY0MjggMjAuOTk5OUw4LjAzNjUgMTAuMzk0QzcuMzg1NjMgOS43NDMxNCA3LjM4NTYzIDguNjg3ODcgOC4wMzY1IDguMDM2OTlDOC42NTc3OSA3LjQxNTY4IDkuNjQ3NTQgNy4zODc0NiAxMC4zMDIzIDcuOTUyMjdMMjAuOTk5NCAxOC42NDMzTDMxLjYwNjcgOC4wMzY5OUMzMi4yNTc2IDcuMzg2MTIgMzMuMzEyOSA3LjM4NjEyIDMzLjk2MzcgOC4wMzY5OUMzNC41ODUgOC42NTgyOCAzNC42MTMzIDkuNjQ4MDMgMzQuMDQ4NSAxMC4zMDI4TDIzLjM1NjEgMjAuOTk5OVoiIGZpbGw9IiMxNzFBMUQiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjAxIi8+Cjwvc3ZnPgo=");
625
625
  }
626
- .consumption-date-filter {
626
+ .appkit-date-filter {
627
627
  height: 100%;
628
628
  display: flex;
629
629
  flex-direction: column;
630
630
  width: 100%;
631
631
  position: relative;
632
632
  }
633
- .consumption-date-filter .date-filter-header {
633
+ .appkit-date-filter .date-filter-header {
634
634
  text-align: center;
635
635
  height: 44px;
636
636
  line-height: 44px;
@@ -638,42 +638,42 @@ page {
638
638
  font-size: 17px;
639
639
  background-color: #f5f5f5;
640
640
  }
641
- .consumption-date-filter .content {
641
+ .appkit-date-filter .content {
642
642
  flex: 1;
643
643
  margin: 15px;
644
644
  overflow-y: scroll;
645
645
  color: #353535;
646
646
  font-size: 13px;
647
647
  }
648
- .consumption-date-filter .content .title {
648
+ .appkit-date-filter .content .title {
649
649
  opacity: 0.6;
650
650
  line-height: 18px;
651
651
  }
652
- .consumption-date-filter .content .info {
652
+ .appkit-date-filter .content .info {
653
653
  display: grid;
654
654
  grid-template-columns: 1fr 1fr 1fr;
655
655
  grid-gap: 10px;
656
656
  margin: 10px 0;
657
657
  }
658
- .consumption-date-filter .content .info .item {
658
+ .appkit-date-filter .content .info .item {
659
659
  height: 30px;
660
660
  line-height: 30px;
661
661
  border: 1px solid #ccc;
662
662
  border-radius: 6px;
663
663
  text-align: center;
664
664
  }
665
- .consumption-date-filter .content .info .current {
665
+ .appkit-date-filter .content .info .current {
666
666
  border: 1px solid;
667
667
  border-image-source: linear-gradient(180deg, rgba(239, 208, 130, 0.8) 0%, rgba(255, 185, 120, 0.8) 100%);
668
668
  background: linear-gradient(180deg, rgba(239, 208, 130, 0.8) 0%, rgba(255, 185, 120, 0.8) 100%), linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
669
669
  }
670
- .consumption-date-filter .buttons {
671
- margin: 0 15px;
670
+ .appkit-date-filter .buttons {
671
+ margin: 32px 15px 0 15px;
672
672
  display: flex;
673
673
  justify-content: space-between;
674
674
  align-items: center;
675
675
  }
676
- .consumption-date-filter .buttons .btn {
676
+ .appkit-date-filter .buttons .btn {
677
677
  flex: 1;
678
678
  height: 40px;
679
679
  line-height: 40px;
@@ -684,22 +684,22 @@ page {
684
684
  font-size: 16px;
685
685
  border-radius: 6px;
686
686
  }
687
- .consumption-date-filter .buttons .confirm {
687
+ .appkit-date-filter .buttons .confirm {
688
688
  margin-left: 11px;
689
689
  color: #000;
690
690
  border: none;
691
691
  background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
692
692
  }
693
- .consumption-date-filter .time {
693
+ .appkit-date-filter .time {
694
694
  display: flex;
695
695
  justify-content: flex-start;
696
696
  align-items: center;
697
697
  margin: 10px 0 30px 0;
698
698
  }
699
- .consumption-date-filter .time .line {
699
+ .appkit-date-filter .time .line {
700
700
  margin: 0 8px;
701
701
  }
702
- .consumption-date-filter .time .item {
702
+ .appkit-date-filter .time .item {
703
703
  height: 30px;
704
704
  line-height: 30px;
705
705
  padding: 0 15px;
@@ -710,13 +710,16 @@ page {
710
710
  background: rgba(245, 245, 245, 0.8);
711
711
  border-radius: 6px;
712
712
  }
713
- .consumption-date-filter .time .current {
713
+ .appkit-date-filter .time .current {
714
714
  border: 1px solid #353535;
715
715
  }
716
- .consumption-date-filter .bottom {
716
+ .appkit-date-filter .bottom {
717
717
  height: 32px;
718
718
  background: #fff;
719
719
  }
720
+ .nut-overlay.date-filter-picker-overlay {
721
+ height: 100vh;
722
+ }
720
723
  .consumption-rules .title {
721
724
  line-height: 16px;
722
725
  font-weight: 500;
@@ -1462,7 +1465,7 @@ page {
1462
1465
  padding-left: 6px;
1463
1466
  }
1464
1467
  .notice-entry {
1465
- position: fixed;
1468
+ position: absolute;
1466
1469
  right: 0;
1467
1470
  top: 120px;
1468
1471
  min-width: 66px;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import '@nutui/nutui-taro/dist/packages/griditem/style/css';
7
7
  import Taro, { useDidShow, useRouter } from '@tarojs/taro';
8
8
  import '@nutui/nutui-taro/dist/packages/popup/style/css';
9
9
  import { isIdentityCard, isMobilePhone } from 'validator';
10
- import { NsForm, NsInput, NsButton, NsIcon, useNutshell } from '@uxda/nutshell/taro';
10
+ import { NsForm, NsInput, NsButton, NsIcon, usePopup, useNutshell } from '@uxda/nutshell/taro';
11
11
  import debounce from 'lodash/debounce';
12
12
  import '@nutui/nutui-taro/dist/packages/dialog/style/css';
13
13
  import '@nutui/nutui-taro/dist/packages/datepicker/style/css';
@@ -2217,7 +2217,7 @@ var script$u = /* @__PURE__ */ defineComponent({
2217
2217
 
2218
2218
  script$u.__file = "src/balance/components/ConsumptionFilter.vue";
2219
2219
 
2220
- const _hoisted_1$p = { class: "consumption-date-filter" };
2220
+ const _hoisted_1$p = { class: "appkit-date-filter" };
2221
2221
  const _hoisted_2$g = { class: "content" };
2222
2222
  const _hoisted_3$b = { class: "time" };
2223
2223
  var script$t = /* @__PURE__ */ defineComponent({
@@ -2229,7 +2229,7 @@ var script$t = /* @__PURE__ */ defineComponent({
2229
2229
  emits: ["complete", "reset"],
2230
2230
  setup(__props, { emit: __emit }) {
2231
2231
  const props = __props;
2232
- const emit = __emit;
2232
+ const emit = __emit, state = usePopup();
2233
2233
  watch(
2234
2234
  () => `${props.from}${props.to}`,
2235
2235
  () => {
@@ -2243,6 +2243,10 @@ var script$t = /* @__PURE__ */ defineComponent({
2243
2243
  const minDate = ref();
2244
2244
  const maxDate = ref(/* @__PURE__ */ new Date());
2245
2245
  const datePickerOpen = ref(false);
2246
+ state.beforeClose = () => {
2247
+ datePickerOpen.value = false;
2248
+ return true;
2249
+ };
2246
2250
  function reset() {
2247
2251
  emit("reset");
2248
2252
  }
@@ -2261,6 +2265,11 @@ var script$t = /* @__PURE__ */ defineComponent({
2261
2265
  result.to = time;
2262
2266
  }
2263
2267
  datePickerOpen.value = false;
2268
+ state.couldClose = true;
2269
+ }
2270
+ function onDatePickerCancel() {
2271
+ datePickerOpen.value = false;
2272
+ state.couldClose = true;
2264
2273
  }
2265
2274
  function switchDateInput(shift) {
2266
2275
  if (shift === "from") {
@@ -2273,12 +2282,13 @@ var script$t = /* @__PURE__ */ defineComponent({
2273
2282
  focusedDate.value = new Date(result[shift]);
2274
2283
  focused.value = shift;
2275
2284
  datePickerOpen.value = true;
2285
+ state.couldClose = false;
2276
2286
  }
2277
2287
  return (_ctx, _cache) => {
2278
2288
  const _component_nut_date_picker = DatePicker;
2279
2289
  const _component_nut_popup = Popup;
2280
2290
  return openBlock(), createElementBlock("div", _hoisted_1$p, [
2281
- _cache[7] || (_cache[7] = createElementVNode(
2291
+ _cache[6] || (_cache[6] = createElementVNode(
2282
2292
  "div",
2283
2293
  { class: "date-filter-header" },
2284
2294
  "\u65E5\u671F\u9009\u62E9",
@@ -2286,7 +2296,7 @@ var script$t = /* @__PURE__ */ defineComponent({
2286
2296
  /* HOISTED */
2287
2297
  )),
2288
2298
  createElementVNode("div", _hoisted_2$g, [
2289
- _cache[6] || (_cache[6] = createElementVNode(
2299
+ _cache[5] || (_cache[5] = createElementVNode(
2290
2300
  "div",
2291
2301
  { class: "title" },
2292
2302
  "\u81EA\u5B9A\u4E49",
@@ -2304,7 +2314,7 @@ var script$t = /* @__PURE__ */ defineComponent({
2304
2314
  3
2305
2315
  /* TEXT, CLASS */
2306
2316
  ),
2307
- _cache[5] || (_cache[5] = createElementVNode(
2317
+ _cache[4] || (_cache[4] = createElementVNode(
2308
2318
  "div",
2309
2319
  { class: "line" },
2310
2320
  "-",
@@ -2333,7 +2343,7 @@ var script$t = /* @__PURE__ */ defineComponent({
2333
2343
  onClick: onOkClick
2334
2344
  }, "\u786E\u5B9A")
2335
2345
  ]),
2336
- _cache[8] || (_cache[8] = createElementVNode(
2346
+ _cache[7] || (_cache[7] = createElementVNode(
2337
2347
  "div",
2338
2348
  { class: "bottom" },
2339
2349
  null,
@@ -2342,8 +2352,10 @@ var script$t = /* @__PURE__ */ defineComponent({
2342
2352
  )),
2343
2353
  createVNode(_component_nut_popup, {
2344
2354
  visible: datePickerOpen.value,
2345
- "onUpdate:visible": _cache[4] || (_cache[4] = ($event) => datePickerOpen.value = $event),
2346
- position: "bottom"
2355
+ "onUpdate:visible": _cache[3] || (_cache[3] = ($event) => datePickerOpen.value = $event),
2356
+ class: "appkit-date-filter-picker-popup",
2357
+ position: "bottom",
2358
+ "overlay-class": "appkit-date-filter-picker-overlay"
2347
2359
  }, {
2348
2360
  default: withCtx(() => [
2349
2361
  createVNode(_component_nut_date_picker, {
@@ -2353,7 +2365,7 @@ var script$t = /* @__PURE__ */ defineComponent({
2353
2365
  "max-date": maxDate.value,
2354
2366
  "is-show-chinese": false,
2355
2367
  "three-dimensional": false,
2356
- onCancel: _cache[3] || (_cache[3] = ($event) => datePickerOpen.value = false),
2368
+ onCancel: onDatePickerCancel,
2357
2369
  onConfirm: onDatePickerComplete
2358
2370
  }, null, 8, ["modelValue", "min-date", "max-date"])
2359
2371
  ]),
@@ -3198,14 +3210,18 @@ var script$n = /* @__PURE__ */ defineComponent({
3198
3210
  const $n = useNutshell();
3199
3211
  const model = useModel(__props, "modelValue");
3200
3212
  const openDateRangePicker = () => {
3213
+ const child = ref();
3201
3214
  $n.sheet({
3202
3215
  component: script$t,
3216
+ ref: child,
3203
3217
  props: {
3204
3218
  from: model.value.from,
3205
3219
  to: model.value.to
3206
3220
  },
3221
+ modal: true,
3222
+ // 不允许点击 overlay 关闭弹窗
3223
+ mask: true,
3207
3224
  onComplete(result) {
3208
- console.log("===openDateFilter complete", result);
3209
3225
  model.value = {
3210
3226
  from: result.from,
3211
3227
  to: result.to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.1.20",
3
+ "version": "4.1.22",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "author": "",
22
22
  "dependencies": {
23
- "@babel/runtime": "^7.7.7",
23
+ "@babel/runtime": "^7.25.6",
24
24
  "@nutui/auto-import-resolver": "^1.0.0",
25
25
  "@nutui/icons-vue-taro": "^0.0.9",
26
26
  "@nutui/nutui-taro": "^4.3.11",
@@ -34,7 +34,6 @@
34
34
  "@tarojs/shared": "^4.0.0",
35
35
  "@tarojs/taro": "^4.0.0",
36
36
  "@types/wechat-miniprogram": "^3.4.7",
37
- "@uxda/nutshell": "^1.0.0",
38
37
  "dayjs": "^1.11.10",
39
38
  "validator": "^13.12.0",
40
39
  "vue": "^3.5.0"
@@ -71,5 +70,8 @@
71
70
  "unplugin-auto-import": "^0.18.2",
72
71
  "unplugin-vue-components": "^0.27.3",
73
72
  "webpack": "^5.78.0"
73
+ },
74
+ "peerDependencies": {
75
+ "@uxda/nutshell": "^1.0.0"
74
76
  }
75
77
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="consumption-date-filter">
2
+ <div class="appkit-date-filter">
3
3
  <div class="date-filter-header">日期选择</div>
4
4
  <div class="content">
5
5
  <div class="title">自定义</div>
@@ -22,22 +22,25 @@
22
22
  <div class="btn confirm" @click="onOkClick">确定</div>
23
23
  </div>
24
24
  <div class="bottom"></div>
25
- <nut-popup v-model:visible="datePickerOpen" position="bottom">
25
+ <nut-popup v-model:visible="datePickerOpen"
26
+ class="appkit-date-filter-picker-popup"
27
+ position="bottom"
28
+ overlay-class="appkit-date-filter-picker-overlay">
26
29
  <nut-date-picker
27
30
  v-model="focusedDate"
28
31
  :min-date="minDate"
29
32
  :max-date="maxDate"
30
33
  :is-show-chinese="false"
31
34
  :three-dimensional="false"
32
- @cancel="datePickerOpen = false"
33
- @confirm="onDatePickerComplete"
34
- ></nut-date-picker>
35
+ @cancel="onDatePickerCancel"
36
+ @confirm="onDatePickerComplete" />
35
37
  </nut-popup>
36
38
  </div>
37
39
  </template>
38
40
 
39
41
  <script lang="ts" setup>
40
42
  import { reactive, ref, watch } from 'vue'
43
+ import { usePopup } from '@uxda/nutshell/taro'
41
44
 
42
45
  type DateFilterProps = {
43
46
  from: string
@@ -46,7 +49,8 @@ type DateFilterProps = {
46
49
 
47
50
  const props = defineProps<DateFilterProps>()
48
51
 
49
- const emit = defineEmits(['complete', 'reset'])
52
+ const emit = defineEmits(['complete', 'reset']),
53
+ state = usePopup()
50
54
 
51
55
  watch(
52
56
  () => `${props.from}${props.to}`,
@@ -71,6 +75,11 @@ const minDate = ref<any>()
71
75
  const maxDate = ref<Date>(new Date())
72
76
  const datePickerOpen = ref<boolean>(false)
73
77
 
78
+ state.beforeClose = () => {
79
+ datePickerOpen.value = false
80
+ return true
81
+ }
82
+
74
83
  /**
75
84
  * 日期重置
76
85
  */
@@ -99,6 +108,12 @@ function onDatePickerComplete({ selectedValue, selectedOptions }) {
99
108
  result.to = time
100
109
  }
101
110
  datePickerOpen.value = false
111
+ state.couldClose = true
112
+ }
113
+
114
+ function onDatePickerCancel () {
115
+ datePickerOpen.value = false
116
+ state.couldClose = true
102
117
  }
103
118
 
104
119
  /**
@@ -106,7 +121,7 @@ function onDatePickerComplete({ selectedValue, selectedOptions }) {
106
121
  * 当选择开始时间大于结束时间,结束时间改为开始时间
107
122
  * 时间选择器都要小于当前时间,结束时间的时间选择器要以开始时间为最小值,
108
123
  */
109
- function switchDateInput(shift: string) {
124
+ function switchDateInput (shift: string) {
110
125
  // 要设置一下结束时间的起始值 开始时间往前倒5年
111
126
  if (shift === 'from') {
112
127
  let time = result.from.split('-').map(Number)
@@ -118,10 +133,12 @@ function switchDateInput(shift: string) {
118
133
  focusedDate.value = new Date(result[shift])
119
134
  focused.value = shift
120
135
  datePickerOpen.value = true
136
+ // 不允许浮窗关闭
137
+ state.couldClose = false
121
138
  }
122
139
  </script>
123
140
  <style lang="scss">
124
- .consumption-date-filter {
141
+ .appkit-date-filter {
125
142
  height: 100%;
126
143
  display: flex;
127
144
  flex-direction: column;
@@ -174,7 +191,7 @@ function switchDateInput(shift: string) {
174
191
  }
175
192
  }
176
193
  .buttons {
177
- margin: 0 15px;
194
+ margin: 32px 15px 0 15px;
178
195
  display: flex;
179
196
  justify-content: space-between;
180
197
  align-items: center;
@@ -224,4 +241,9 @@ function switchDateInput(shift: string) {
224
241
  background: #fff;
225
242
  }
226
243
  }
244
+ .nut-overlay {
245
+ &.date-filter-picker-overlay {
246
+ height: 100vh;
247
+ }
248
+ }
227
249
  </style>
@@ -10,7 +10,7 @@
10
10
  </template>
11
11
 
12
12
  <script lang="ts" setup>
13
- import { computed, PropType, reactive } from 'vue'
13
+ import { computed, PropType, ref } from 'vue'
14
14
  import { useNutshell } from '@uxda/nutshell/taro'
15
15
  import DateFilter from './DateFilter.vue'
16
16
  import dayjs from 'dayjs'
@@ -32,14 +32,17 @@ const model = defineModel({
32
32
  })
33
33
 
34
34
  const openDateRangePicker = () => {
35
+ const child = ref()
35
36
  $n.sheet({
36
37
  component: DateFilter,
38
+ ref: child,
37
39
  props: {
38
40
  from: model.value.from,
39
41
  to: model.value.to,
40
42
  },
43
+ modal: true, // 不允许点击 overlay 关闭弹窗
44
+ mask: true,
41
45
  onComplete (result: any) {
42
- console.log('===openDateFilter complete', result)
43
46
  model.value = {
44
47
  from: result.from,
45
48
  to: result.to
@@ -66,7 +66,7 @@ async function getNotice() {
66
66
 
67
67
  <style lang="scss">
68
68
  .notice-entry {
69
- position: fixed;
69
+ position: absolute;
70
70
  right: 0;
71
71
  top: 120px;
72
72
  min-width: 66px;
@@ -1,3 +1,3 @@
1
1
  .number {
2
- font-family: 'DIN alternate', 'Roboto', sans-serif-condensed-light;
2
+ font-family: 'DIN alternate', 'Barlow Condensed', 'Roboto Condensed', sans-serif-condensed-light;
3
3
  }