persagy-vant 0.0.42 → 0.0.44

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 (67) hide show
  1. package/es/action-sheet/ActionSheet.d.ts +4 -0
  2. package/es/action-sheet/ActionSheet.mjs +4 -1
  3. package/es/action-sheet/index.css +1 -1
  4. package/es/action-sheet/index.d.ts +3 -0
  5. package/es/action-sheet/index.less +4 -0
  6. package/es/index.d.ts +1 -1
  7. package/es/index.mjs +1 -1
  8. package/es/locale/lang/en-US.d.ts +6 -0
  9. package/es/locale/lang/en-US.mjs +6 -0
  10. package/es/locale/lang/zh-CN.d.ts +6 -0
  11. package/es/locale/lang/zh-CN.mjs +6 -0
  12. package/es/object-select/ObjectSelect.d.ts +7 -2
  13. package/es/object-select/ObjectSelect.mjs +26 -13
  14. package/es/object-select/index.d.ts +5 -1
  15. package/es/tree-select/TreeSelect.d.ts +7 -1
  16. package/es/tree-select/TreeSelect.mjs +107 -54
  17. package/es/tree-select/index.css +1 -1
  18. package/es/tree-select/index.d.ts +6 -2
  19. package/es/tree-select/index.less +6 -0
  20. package/es/tree-select/style/index.mjs +1 -0
  21. package/es/tree-select/style/less.mjs +1 -0
  22. package/es/uploader/Uploader.d.ts +6 -1
  23. package/es/uploader/Uploader.mjs +80 -19
  24. package/es/uploader/index.css +1 -1
  25. package/es/uploader/index.d.ts +6 -2
  26. package/es/uploader/index.less +4 -0
  27. package/es/uploader/style/index.mjs +3 -0
  28. package/es/uploader/style/less.mjs +3 -0
  29. package/es/uploader/types.d.ts +2 -1
  30. package/lib/action-sheet/ActionSheet.d.ts +4 -0
  31. package/lib/action-sheet/ActionSheet.js +4 -1
  32. package/lib/action-sheet/index.css +1 -1
  33. package/lib/action-sheet/index.d.ts +3 -0
  34. package/lib/action-sheet/index.less +4 -0
  35. package/lib/index.css +1 -1
  36. package/lib/index.d.ts +1 -1
  37. package/lib/index.js +1 -1
  38. package/lib/locale/lang/en-US.d.ts +6 -0
  39. package/lib/locale/lang/en-US.js +6 -0
  40. package/lib/locale/lang/zh-CN.d.ts +6 -0
  41. package/lib/locale/lang/zh-CN.js +6 -0
  42. package/lib/object-select/ObjectSelect.d.ts +7 -2
  43. package/lib/object-select/ObjectSelect.js +25 -12
  44. package/lib/object-select/index.d.ts +5 -1
  45. package/lib/tree-select/TreeSelect.d.ts +7 -1
  46. package/lib/tree-select/TreeSelect.js +107 -52
  47. package/lib/tree-select/index.css +1 -1
  48. package/lib/tree-select/index.d.ts +6 -2
  49. package/lib/tree-select/index.less +6 -0
  50. package/lib/tree-select/style/index.js +1 -0
  51. package/lib/tree-select/style/less.js +1 -0
  52. package/lib/uploader/Uploader.d.ts +6 -1
  53. package/lib/uploader/Uploader.js +79 -18
  54. package/lib/uploader/index.css +1 -1
  55. package/lib/uploader/index.d.ts +6 -2
  56. package/lib/uploader/index.less +4 -0
  57. package/lib/uploader/style/index.js +3 -0
  58. package/lib/uploader/style/less.js +3 -0
  59. package/lib/uploader/types.d.ts +2 -1
  60. package/lib/vant.cjs.js +232 -98
  61. package/lib/vant.es.js +233 -99
  62. package/lib/vant.js +232 -98
  63. package/lib/vant.min.js +1 -1
  64. package/lib/web-types.json +1 -1
  65. package/package.json +1 -1
  66. package/skills/use-persagy-vant/references/business-component-catalog.md +1 -1
  67. package/skills/use-persagy-vant/references/component-catalog.md +2 -2
package/lib/vant.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, provide, watchEffect, mergeProps, onDeactivated, onBeforeUnmount, Transition, withDirectives, vShow, onActivated, Teleport, Fragment, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, onUpdated, withKeys, TransitionGroup, h } from "vue";
1
+ import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, provide, watchEffect, mergeProps, onDeactivated, onBeforeUnmount, Transition, withDirectives, vShow, onActivated, Teleport, Fragment, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, onUpdated, withKeys, shallowReactive, TransitionGroup, h } from "vue";
2
2
  import { useWindowSize, useRect, useChildren, useParent, onMountedOrActivated, getScrollParent, useEventListener, useClickAway, useCustomFieldValue, CUSTOM_FIELD_INJECTION_KEY, useToggle, raf, useScrollParent, usePageVisibility, doubleRaf, cancelRaf, useCountDown, inBrowser as inBrowser$1 } from "@vant/use";
3
3
  import { offsetModifier, createPopper } from "@vant/popperjs";
4
4
  import Plyr from "plyr";
@@ -299,6 +299,12 @@ var stdin_default$29 = {
299
299
  },
300
300
  vanTabs: {
301
301
  moreTitle: "更多标签"
302
+ },
303
+ vanUploader: {
304
+ sourcePickerTitle: "选择上传方式",
305
+ takePhoto: "拍照",
306
+ recordVideo: "拍视频",
307
+ chooseFromAlbum: "从相册选择"
302
308
  }
303
309
  };
304
310
  const lang = ref("zh-CN");
@@ -1784,6 +1790,7 @@ const actionSheetProps = extend({}, popupSharedProps, {
1784
1790
  closeable: truthProp,
1785
1791
  cancelText: String,
1786
1792
  description: String,
1793
+ contentAdaptive: Boolean,
1787
1794
  closeOnPopstate: truthProp,
1788
1795
  closeOnClickAction: Boolean,
1789
1796
  safeAreaInsetBottom: truthProp
@@ -1892,7 +1899,9 @@ var stdin_default$1W = defineComponent({
1892
1899
  }
1893
1900
  };
1894
1901
  return () => createVNode(Popup, mergeProps({
1895
- "class": bem$1I(),
1902
+ "class": bem$1I({
1903
+ "content-adaptive": props2.contentAdaptive
1904
+ }),
1896
1905
  "position": "bottom",
1897
1906
  "onUpdate:show": updateShow
1898
1907
  }, pick(props2, popupInheritKeys$2)), {
@@ -7599,21 +7608,21 @@ var stdin_default$1o = defineComponent({
7599
7608
  }, [renderChildren()]);
7600
7609
  }
7601
7610
  });
7602
- var __defProp$1 = Object.defineProperty;
7611
+ var __defProp = Object.defineProperty;
7603
7612
  var __defProps = Object.defineProperties;
7604
7613
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7605
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
7606
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
7607
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
7608
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7609
- var __spreadValues$1 = (a, b) => {
7614
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7615
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7616
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7617
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7618
+ var __spreadValues = (a, b) => {
7610
7619
  for (var prop in b || (b = {}))
7611
- if (__hasOwnProp$1.call(b, prop))
7612
- __defNormalProp$1(a, prop, b[prop]);
7613
- if (__getOwnPropSymbols$1)
7614
- for (var prop of __getOwnPropSymbols$1(b)) {
7615
- if (__propIsEnum$1.call(b, prop))
7616
- __defNormalProp$1(a, prop, b[prop]);
7620
+ if (__hasOwnProp.call(b, prop))
7621
+ __defNormalProp(a, prop, b[prop]);
7622
+ if (__getOwnPropSymbols)
7623
+ for (var prop of __getOwnPropSymbols(b)) {
7624
+ if (__propIsEnum.call(b, prop))
7625
+ __defNormalProp(a, prop, b[prop]);
7617
7626
  }
7618
7627
  return a;
7619
7628
  };
@@ -7869,7 +7878,7 @@ var stdin_default$1n = defineComponent({
7869
7878
  name: tab.title,
7870
7879
  disabled: tab.disabled
7871
7880
  }));
7872
- return actions.map((action, index) => __spreadProps(__spreadValues$1({}, action), {
7881
+ return actions.map((action, index) => __spreadProps(__spreadValues({}, action), {
7873
7882
  color: index === state.currentIndex ? "var(--van-primary-color)" : action.color,
7874
7883
  className: [action.className, bem$1d("more-option", {
7875
7884
  active: index === state.currentIndex
@@ -13023,21 +13032,25 @@ var stdin_default$K = defineComponent({
13023
13032
  }
13024
13033
  });
13025
13034
  const InfoCard = withInstall(stdin_default$K);
13026
- var __defProp = Object.defineProperty;
13027
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
13028
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13029
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
13030
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13031
- var __spreadValues = (a, b) => {
13032
- for (var prop in b || (b = {}))
13033
- if (__hasOwnProp.call(b, prop))
13034
- __defNormalProp(a, prop, b[prop]);
13035
- if (__getOwnPropSymbols)
13036
- for (var prop of __getOwnPropSymbols(b)) {
13037
- if (__propIsEnum.call(b, prop))
13038
- __defNormalProp(a, prop, b[prop]);
13039
- }
13040
- return a;
13035
+ var __async$2 = (__this, __arguments, generator) => {
13036
+ return new Promise((resolve, reject) => {
13037
+ var fulfilled = (value) => {
13038
+ try {
13039
+ step(generator.next(value));
13040
+ } catch (e) {
13041
+ reject(e);
13042
+ }
13043
+ };
13044
+ var rejected = (value) => {
13045
+ try {
13046
+ step(generator.throw(value));
13047
+ } catch (e) {
13048
+ reject(e);
13049
+ }
13050
+ };
13051
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
13052
+ step((generator = generator.apply(__this, __arguments)).next());
13053
+ });
13041
13054
  };
13042
13055
  const [name$B, bem$B] = createNamespace("tree-select");
13043
13056
  const treeSelectProps = {
@@ -13049,20 +13062,31 @@ const treeSelectProps = {
13049
13062
  selectableParent: Boolean,
13050
13063
  showParentSelect: Boolean,
13051
13064
  showSelectLevels: Array,
13052
- showDivider: truthProp
13065
+ showDivider: truthProp,
13066
+ loadChildren: Function
13053
13067
  };
13054
13068
  var stdin_default$J = defineComponent({
13055
13069
  name: name$B,
13056
13070
  props: treeSelectProps,
13057
- emits: ["update:modelValue", "update:expandedKeys", "select", "expand"],
13071
+ emits: ["update:modelValue", "update:expandedKeys", "select", "expand", "load", "load-error"],
13058
13072
  setup(props2, {
13059
13073
  emit,
13060
13074
  slots
13061
13075
  }) {
13062
13076
  const selectedKeys = computed(() => props2.modelValue);
13063
13077
  const expandedKeys = computed(() => props2.expandedKeys);
13078
+ const resolvedChildren = shallowReactive(/* @__PURE__ */ new Map());
13079
+ const loadingKeys = shallowReactive(/* @__PURE__ */ new Set());
13080
+ const loadedKeys = shallowReactive(/* @__PURE__ */ new Set());
13064
13081
  const isExpanded = (id) => expandedKeys.value.includes(id);
13065
13082
  const isSelected = (id) => selectedKeys.value.includes(id);
13083
+ const isLoading = (id) => loadingKeys.has(id);
13084
+ const getChildren = (item) => {
13085
+ var _a;
13086
+ return ((_a = item.children) == null ? void 0 : _a.length) ? item.children : resolvedChildren.get(item.id) || item.children || [];
13087
+ };
13088
+ const isLoadable = (item) => !!props2.loadChildren && Array.isArray(item.children) && !item.children.length && !loadedKeys.has(item.id);
13089
+ const isBranch = (item) => !!getChildren(item).length || isLoadable(item) || isLoading(item.id);
13066
13090
  const isSelectionVisible = (hasChildren, level) => {
13067
13091
  var _a;
13068
13092
  const configuredVisibility = (_a = props2.showSelectLevels) == null ? void 0 : _a[level];
@@ -13074,10 +13098,7 @@ var stdin_default$J = defineComponent({
13074
13098
  paddingLeft: `calc(var(--van-padding-md) + ${level * 16}px)`,
13075
13099
  "--van-tree-select-divider-left": `calc(var(--van-padding-md) + ${level * 16}px)`
13076
13100
  });
13077
- const getDescendantIds = (item) => {
13078
- var _a;
13079
- return ((_a = item.children) == null ? void 0 : _a.flatMap((child) => [child.id, ...getDescendantIds(child)])) || [];
13080
- };
13101
+ const getDescendantIds = (item) => getChildren(item).flatMap((child) => [child.id, ...getDescendantIds(child)]);
13081
13102
  const getSelectionState = (item) => {
13082
13103
  const descendantIds = getDescendantIds(item);
13083
13104
  if (!props2.cascade || !descendantIds.length) {
@@ -13092,11 +13113,11 @@ var stdin_default$J = defineComponent({
13092
13113
  };
13093
13114
  const syncParentSelection = (items, values) => {
13094
13115
  items.forEach((item) => {
13095
- var _a;
13096
- if (!((_a = item.children) == null ? void 0 : _a.length))
13116
+ const children = getChildren(item);
13117
+ if (!children.length)
13097
13118
  return;
13098
- syncParentSelection(item.children, values);
13099
- const childIds = item.children.map((child) => child.id);
13119
+ syncParentSelection(children, values);
13120
+ const childIds = children.map((child) => child.id);
13100
13121
  const index = values.indexOf(item.id);
13101
13122
  const allChildrenSelected = childIds.every((id) => values.includes(id));
13102
13123
  if (allChildrenSelected && index === -1)
@@ -13105,13 +13126,45 @@ var stdin_default$J = defineComponent({
13105
13126
  values.splice(index, 1);
13106
13127
  });
13107
13128
  };
13108
- const toggleExpanded = (id) => {
13129
+ const updateExpanded = (id, expanded) => {
13109
13130
  const next = expandedKeys.value.slice();
13110
13131
  const index = next.indexOf(id);
13111
- index === -1 ? next.push(id) : next.splice(index, 1);
13132
+ if (expanded && index === -1)
13133
+ next.push(id);
13134
+ if (!expanded && index !== -1)
13135
+ next.splice(index, 1);
13112
13136
  emit("update:expandedKeys", next);
13113
- emit("expand", id, index === -1);
13137
+ emit("expand", id, expanded);
13114
13138
  };
13139
+ const toggleExpanded = (item) => __async$2(this, null, function* () {
13140
+ const {
13141
+ id
13142
+ } = item;
13143
+ if (isLoading(id))
13144
+ return;
13145
+ if (isExpanded(id)) {
13146
+ updateExpanded(id, false);
13147
+ return;
13148
+ }
13149
+ if (isLoadable(item)) {
13150
+ loadingKeys.add(id);
13151
+ try {
13152
+ const result = yield props2.loadChildren(item);
13153
+ const children = Array.isArray(result) ? result : [];
13154
+ resolvedChildren.set(id, children);
13155
+ loadedKeys.add(id);
13156
+ emit("load", item, children);
13157
+ if (children.length)
13158
+ updateExpanded(id, true);
13159
+ } catch (error) {
13160
+ emit("load-error", item, error);
13161
+ } finally {
13162
+ loadingKeys.delete(id);
13163
+ }
13164
+ return;
13165
+ }
13166
+ updateExpanded(id, true);
13167
+ });
13115
13168
  const updateSelected = (item, selected) => {
13116
13169
  if (item.disabled || item.selectable === false)
13117
13170
  return;
@@ -13130,12 +13183,13 @@ var stdin_default$J = defineComponent({
13130
13183
  emit("select", item, selected);
13131
13184
  };
13132
13185
  const renderNodes = (items, level = 0) => items.map((item) => {
13133
- var _a;
13134
- const hasChildren = !!((_a = item.children) == null ? void 0 : _a.length);
13186
+ const children = getChildren(item);
13187
+ const hasChildren = isBranch(item);
13135
13188
  const expanded = isExpanded(item.id);
13189
+ const loading = isLoading(item.id);
13136
13190
  const renderTitle = () => {
13137
- var _a2;
13138
- return ((_a2 = slots.title) == null ? void 0 : _a2.call(slots, {
13191
+ var _a;
13192
+ return ((_a = slots.title) == null ? void 0 : _a.call(slots, {
13139
13193
  item,
13140
13194
  level,
13141
13195
  hasChildren
@@ -13155,36 +13209,29 @@ var stdin_default$J = defineComponent({
13155
13209
  }
13156
13210
  const selectable = item.selectable !== false && isSelectionVisible(hasChildren, level);
13157
13211
  const selectionState = getSelectionState(item);
13158
- return createVNode("div", {
13159
- "key": item.id,
13160
- "class": bem$B("node")
13161
- }, [createVNode(Cell, {
13162
- "class": bem$B("cell", {
13163
- branch: hasChildren
13164
- }),
13165
- "title": item.text,
13166
- "border": props2.showDivider,
13167
- "style": getNodeStyle(level),
13168
- "rightSelect": selectable && selectionState !== "indeterminate" ? selectionState === "checked" : void 0,
13169
- "selectType": props2.multiple ? "checkbox" : "radio",
13170
- "onUpdate:rightSelect": (value) => updateSelected(item, value)
13171
- }, __spreadValues({
13212
+ const cellSlots = {
13172
13213
  title: () => [hasChildren ? createVNode("button", {
13173
13214
  "type": "button",
13174
13215
  "class": bem$B("expand-control"),
13175
13216
  "disabled": item.disabled,
13217
+ "aria-busy": loading,
13218
+ "aria-disabled": loading,
13176
13219
  "onClick": (event) => {
13177
13220
  event.stopPropagation();
13178
- toggleExpanded(item.id);
13221
+ toggleExpanded(item);
13179
13222
  }
13180
- }, [createVNode(Icon, {
13223
+ }, [loading ? createVNode(Loading, {
13224
+ "class": bem$B("loading"),
13225
+ "size": "var(--van-tree-select-arrow-size)"
13226
+ }, null) : createVNode(Icon, {
13181
13227
  "name": "trangle-down",
13182
13228
  "class": bem$B("arrow", {
13183
13229
  expanded
13184
13230
  })
13185
13231
  }, null), createVNode("span", null, [renderTitle()])]) : createVNode("span", null, [renderTitle()])]
13186
- }, selectable && selectionState === "indeterminate" ? {
13187
- "right-select": () => createVNode("button", {
13232
+ };
13233
+ if (selectable && selectionState === "indeterminate") {
13234
+ cellSlots["right-select"] = () => createVNode("button", {
13188
13235
  "type": "button",
13189
13236
  "class": bem$B("indeterminate"),
13190
13237
  "aria-label": `部分选中${item.text}`,
@@ -13192,13 +13239,27 @@ var stdin_default$J = defineComponent({
13192
13239
  event.stopPropagation();
13193
13240
  updateSelected(item, true);
13194
13241
  }
13195
- }, null)
13196
- } : {})), createVNode(Transition, {
13242
+ }, null);
13243
+ }
13244
+ return createVNode("div", {
13245
+ "key": item.id,
13246
+ "class": bem$B("node")
13247
+ }, [createVNode(Cell, {
13248
+ "class": bem$B("cell", {
13249
+ branch: hasChildren
13250
+ }),
13251
+ "title": item.text,
13252
+ "border": props2.showDivider,
13253
+ "style": getNodeStyle(level),
13254
+ "rightSelect": selectable && selectionState !== "indeterminate" ? selectionState === "checked" : void 0,
13255
+ "selectType": props2.multiple ? "checkbox" : "radio",
13256
+ "onUpdate:rightSelect": (value) => updateSelected(item, value)
13257
+ }, cellSlots), createVNode(Transition, {
13197
13258
  "name": "van-tree-select-expand"
13198
13259
  }, {
13199
13260
  default: () => [hasChildren && expanded && createVNode("div", {
13200
13261
  "class": bem$B("children")
13201
- }, [renderNodes(item.children, level + 1)])]
13262
+ }, [renderNodes(children, level + 1)])]
13202
13263
  })]);
13203
13264
  });
13204
13265
  return () => createVNode("div", {
@@ -15838,13 +15899,7 @@ const spaceItems = [{
15838
15899
  id: "high-voltage",
15839
15900
  text: "高压计量柜",
15840
15901
  selectable: false,
15841
- children: [{
15842
- id: "metering-cabinet-1",
15843
- text: "B3_高压计量柜_1#"
15844
- }, {
15845
- id: "metering-cabinet-2",
15846
- text: "B3_高压计量柜_2#"
15847
- }]
15902
+ children: []
15848
15903
  }]
15849
15904
  }, {
15850
15905
  id: "chiller-room",
@@ -16164,13 +16219,14 @@ const objectSelectProps = {
16164
16219
  specialties: {
16165
16220
  type: Array,
16166
16221
  default: () => specialties
16167
- }
16222
+ },
16223
+ loadChildren: Function
16168
16224
  };
16169
16225
  const flattenItems$1 = (items) => items.flatMap((item) => [item, ...item.children ? flattenItems$1(item.children) : []]);
16170
16226
  var stdin_default$t = defineComponent({
16171
16227
  name: name$o,
16172
16228
  props: objectSelectProps,
16173
- emits: ["update:show", "update:modelValue", "change", "confirm"],
16229
+ emits: ["update:show", "update:modelValue", "change", "confirm", "load", "load-error"],
16174
16230
  setup(props2, {
16175
16231
  emit
16176
16232
  }) {
@@ -16183,6 +16239,14 @@ var stdin_default$t = defineComponent({
16183
16239
  const expandedSelected = ref(false);
16184
16240
  const searching = ref(false);
16185
16241
  const keyword = ref("");
16242
+ const loadedChildren = shallowReactive(/* @__PURE__ */ new Map());
16243
+ const getChildren = (item) => loadedChildren.get(item.id) || item.children || [];
16244
+ const hydrateItems = (items) => items.map((item) => {
16245
+ const children = getChildren(item);
16246
+ return children.length ? extend({}, item, {
16247
+ children: hydrateItems(children)
16248
+ }) : item;
16249
+ });
16186
16250
  const currentSpecialtyItems = (specialty) => specialtyType.value === 0 ? specialty.deviceItems : specialty.systemItems;
16187
16251
  const expandOnlySpecialty = () => {
16188
16252
  if (props2.specialties.length === 1) {
@@ -16207,7 +16271,7 @@ var stdin_default$t = defineComponent({
16207
16271
  immediate: true
16208
16272
  });
16209
16273
  const selected = computed(() => props2.modelValue);
16210
- const allItems = computed(() => flattenItems$1([...props2.spaceItems, ...props2.specialties.flatMap((specialty) => [...specialty.deviceItems, ...specialty.systemItems])]));
16274
+ const allItems = computed(() => flattenItems$1(hydrateItems([...props2.spaceItems, ...props2.specialties.flatMap((specialty) => [...specialty.deviceItems, ...specialty.systemItems])])));
16211
16275
  const selectedItems = computed(() => allItems.value.filter((item) => selected.value.includes(item.id)));
16212
16276
  const searchResults = computed(() => {
16213
16277
  const query = keyword.value.trim().toLowerCase();
@@ -16252,19 +16316,29 @@ var stdin_default$t = defineComponent({
16252
16316
  update([]);
16253
16317
  expandedSelected.value = false;
16254
16318
  };
16319
+ const onLoad = (item, children) => {
16320
+ loadedChildren.set(item.id, children);
16321
+ emit("load", item, children);
16322
+ };
16323
+ const onLoadError = (item, error) => {
16324
+ emit("load-error", item, error);
16325
+ };
16255
16326
  const renderTree = (items) => createVNode("div", {
16256
16327
  "class": bem$o("tree-card")
16257
16328
  }, [createVNode(TreeSelect, {
16258
16329
  "modelValue": selected.value,
16259
16330
  "expandedKeys": expandedKeys.value,
16260
- "items": items,
16331
+ "items": hydrateItems(items),
16261
16332
  "multiple": true,
16262
16333
  "showParentSelect": true,
16263
16334
  "cascade": false,
16335
+ "loadChildren": props2.loadChildren,
16264
16336
  "onUpdate:modelValue": update,
16265
16337
  "onUpdate:expandedKeys": (value) => {
16266
16338
  expandedKeys.value = value;
16267
- }
16339
+ },
16340
+ "onLoad": onLoad,
16341
+ "onLoad-error": onLoadError
16268
16342
  }, null)]);
16269
16343
  const renderSpecialty = (specialty) => {
16270
16344
  var _a;
@@ -19215,6 +19289,7 @@ const uploaderProps = {
19215
19289
  accept: makeStringProp("image/*"),
19216
19290
  capture: String,
19217
19291
  multiple: Boolean,
19292
+ sourcePicker: Boolean,
19218
19293
  label: String,
19219
19294
  required: Boolean,
19220
19295
  disabled: Boolean,
@@ -19244,21 +19319,26 @@ const uploaderProps = {
19244
19319
  var stdin_default$7 = defineComponent({
19245
19320
  name: name$3,
19246
19321
  props: uploaderProps,
19247
- emits: ["delete", "oversize", "click-upload", "close-preview", "click-preview", "update:modelValue"],
19322
+ emits: ["delete", "oversize", "click-upload", "close-preview", "click-preview", "select-source", "update:modelValue"],
19248
19323
  setup(props2, {
19249
19324
  emit,
19250
19325
  slots
19251
19326
  }) {
19252
19327
  const inputRef = ref();
19328
+ const cameraInputRef = ref();
19329
+ const videoInputRef = ref();
19330
+ const sourcePickerVisible = ref(false);
19253
19331
  const urls = [];
19254
19332
  const getDetail = (index = props2.modelValue.length) => ({
19255
19333
  name: props2.name,
19256
19334
  index
19257
19335
  });
19258
19336
  const resetInput = () => {
19259
- if (inputRef.value) {
19260
- inputRef.value.value = "";
19261
- }
19337
+ [inputRef, cameraInputRef, videoInputRef].forEach((input) => {
19338
+ if (input.value) {
19339
+ input.value.value = "";
19340
+ }
19341
+ });
19262
19342
  };
19263
19343
  const onAfterRead = (items) => {
19264
19344
  resetInput();
@@ -19394,21 +19474,69 @@ var stdin_default$7 = defineComponent({
19394
19474
  "class": bem$3("required")
19395
19475
  }, [createTextVNode("*")]), props2.label]);
19396
19476
  };
19397
- const onClickUpload = (event) => emit("click-upload", event);
19477
+ const acceptTypes = () => props2.accept.split(",").map((type) => type.trim().toLowerCase()).filter(Boolean);
19478
+ const acceptsMediaType = (type) => acceptTypes().some((accept) => accept === `${type}/*` || accept.startsWith(`${type}/`));
19479
+ const triggerInput = (source) => {
19480
+ const target = source === "camera" ? cameraInputRef.value : source === "video" ? videoInputRef.value : inputRef.value;
19481
+ if (target && !props2.disabled && !props2.readonly) {
19482
+ emit("select-source", source);
19483
+ target.click();
19484
+ }
19485
+ };
19486
+ const onClickUpload = (event) => {
19487
+ emit("click-upload", event);
19488
+ if (props2.sourcePicker && !props2.disabled && !props2.readonly) {
19489
+ sourcePickerVisible.value = true;
19490
+ }
19491
+ };
19492
+ const renderInput = (input, accept, capture, multiple = false, hidden = false) => createVNode("input", {
19493
+ "ref": input,
19494
+ "type": "file",
19495
+ "class": bem$3("input", {
19496
+ hidden
19497
+ }),
19498
+ "accept": accept,
19499
+ "capture": capture,
19500
+ "multiple": multiple,
19501
+ "disabled": props2.disabled,
19502
+ "onChange": onChange
19503
+ }, null);
19504
+ const renderSourcePicker = () => {
19505
+ if (!props2.sourcePicker)
19506
+ return;
19507
+ const actions = [];
19508
+ if (acceptsMediaType("image")) {
19509
+ actions.push({
19510
+ name: t("takePhoto"),
19511
+ callback: () => triggerInput("camera")
19512
+ });
19513
+ }
19514
+ if (acceptsMediaType("video")) {
19515
+ actions.push({
19516
+ name: t("recordVideo"),
19517
+ callback: () => triggerInput("video")
19518
+ });
19519
+ }
19520
+ actions.push({
19521
+ name: t("chooseFromAlbum"),
19522
+ callback: () => triggerInput("album")
19523
+ });
19524
+ return createVNode(ActionSheet, {
19525
+ "show": sourcePickerVisible.value,
19526
+ "title": t("sourcePickerTitle"),
19527
+ "actions": actions,
19528
+ "contentAdaptive": true,
19529
+ "closeOnClickAction": true,
19530
+ "onUpdate:show": (show) => {
19531
+ sourcePickerVisible.value = show;
19532
+ }
19533
+ }, null);
19534
+ };
19398
19535
  const renderUpload = () => {
19399
19536
  if (props2.modelValue.length >= props2.maxCount || !props2.showUpload) {
19400
19537
  return;
19401
19538
  }
19402
- const Input = props2.readonly ? null : createVNode("input", {
19403
- "ref": inputRef,
19404
- "type": "file",
19405
- "class": bem$3("input"),
19406
- "accept": props2.accept,
19407
- "capture": props2.capture,
19408
- "multiple": props2.multiple,
19409
- "disabled": props2.disabled,
19410
- "onChange": onChange
19411
- }, null);
19539
+ const Input = props2.readonly ? null : props2.sourcePicker ? [renderInput(inputRef, props2.accept, void 0, props2.multiple, true), acceptsMediaType("image") && renderInput(cameraInputRef, "image/*", props2.capture || "environment", false, true), acceptsMediaType("video") && renderInput(videoInputRef, "video/*", props2.capture || "environment", false, true)] : renderInput(inputRef, props2.accept, props2.capture, props2.multiple);
19412
19540
  if (slots.default) {
19413
19541
  return createVNode("div", {
19414
19542
  "class": bem$3("input-wrapper"),
@@ -19428,8 +19556,14 @@ var stdin_default$7 = defineComponent({
19428
19556
  "class": bem$3("upload-text")
19429
19557
  }, [props2.uploadText]), Input]);
19430
19558
  };
19431
- const chooseFile = () => {
19432
- if (inputRef.value && !props2.disabled) {
19559
+ const chooseFile = (source) => {
19560
+ if (props2.disabled || props2.readonly)
19561
+ return;
19562
+ if (source) {
19563
+ triggerInput(source);
19564
+ } else if (props2.sourcePicker) {
19565
+ sourcePickerVisible.value = true;
19566
+ } else if (inputRef.value) {
19433
19567
  inputRef.value.click();
19434
19568
  }
19435
19569
  };
@@ -19449,7 +19583,7 @@ var stdin_default$7 = defineComponent({
19449
19583
  "class": bem$3("wrapper", {
19450
19584
  disabled: props2.disabled
19451
19585
  })
19452
- }, [props2.uploadFirst ? createVNode(Fragment, null, [renderUpload(), renderPreviewList()]) : createVNode(Fragment, null, [renderPreviewList(), renderUpload()])])]);
19586
+ }, [props2.uploadFirst ? createVNode(Fragment, null, [renderUpload(), renderPreviewList()]) : createVNode(Fragment, null, [renderPreviewList(), renderUpload()])]), renderSourcePicker()]);
19453
19587
  }
19454
19588
  });
19455
19589
  const Uploader = withInstall(stdin_default$7);
@@ -21329,7 +21463,7 @@ const Lazyload = {
21329
21463
  });
21330
21464
  }
21331
21465
  };
21332
- const version = "0.0.42";
21466
+ const version = "0.0.44";
21333
21467
  function install(app) {
21334
21468
  const components = [
21335
21469
  ActionBar,