@pisell/materials 6.4.8 → 6.4.9
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +24 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +25 -24
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
- package/es/components/auto-resize-text/index.d.ts +6 -0
- package/es/components/auto-resize-text/index.js +40 -0
- package/es/components/batch-editor/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +11 -12
- package/es/components/date-picker/index.d.ts +0 -1
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +18 -0
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/keyboard/index.d.ts +22 -0
- package/es/components/keyboard/index.js +159 -0
- package/es/components/keyboard/index.less +44 -0
- package/es/components/page/index.d.ts +0 -1
- package/es/components/pisell-config-provider/context.d.ts +22 -0
- package/es/components/pisell-config-provider/index.d.ts +13 -0
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellAdjustPrice/type.d.ts +22 -0
- package/es/components/pisellQRScanner/index.d.ts +0 -13
- package/es/components/pisellQRScanner/index.js +0 -8
- package/es/components/pisellToast/squareToast/index.d.ts +15 -0
- package/es/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/es/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -1
- package/es/components/pisellWalletPassCard/index.js +2 -1
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/components/Action/index.d.ts +3 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/productCard/locales.d.ts +84 -0
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useTableSetting.js +1 -1
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Number/types.d.ts +26 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +78 -0
- package/es/components/virtualInput/index.d.ts +24 -0
- package/es/components/virtualInput/index.js +60 -0
- package/es/components/virtualInput/index.less +42 -0
- package/es/components/walletCard/Guide/index.d.ts +3 -0
- package/es/components/walletCard/index.d.ts +67 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +286 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +281 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +281 -0
- package/es/locales/zh-TW.js +1 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
- package/lib/components/auto-resize-text/index.d.ts +6 -0
- package/lib/components/auto-resize-text/index.js +71 -0
- package/lib/components/batch-editor/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +11 -12
- package/lib/components/date-picker/index.d.ts +0 -1
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +18 -0
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/keyboard/index.d.ts +22 -0
- package/lib/components/keyboard/index.js +223 -0
- package/lib/components/keyboard/index.less +44 -0
- package/lib/components/page/index.d.ts +0 -1
- package/lib/components/pisell-config-provider/context.d.ts +22 -0
- package/lib/components/pisell-config-provider/index.d.ts +13 -0
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellAdjustPrice/type.d.ts +22 -0
- package/lib/components/pisellQRScanner/index.d.ts +0 -13
- package/lib/components/pisellToast/squareToast/index.d.ts +15 -0
- package/lib/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/lib/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -1
- package/lib/components/pisellWalletPassCard/index.js +2 -1
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/components/Action/index.d.ts +3 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/productCard/locales.d.ts +84 -0
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useTableSetting.js +1 -1
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Number/types.d.ts +26 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +78 -0
- package/lib/components/virtualInput/index.d.ts +24 -0
- package/lib/components/virtualInput/index.js +102 -0
- package/lib/components/virtualInput/index.less +42 -0
- package/lib/components/walletCard/Guide/index.d.ts +3 -0
- package/lib/components/walletCard/index.d.ts +67 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +286 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +281 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +281 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/platform.d.ts +1 -1
- package/package.json +3 -3
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"table-filter-search": string;
|
|
3
|
+
"table-filter-clear": string;
|
|
4
|
+
"table-filter-filter": string;
|
|
5
|
+
"table-filter-min": string;
|
|
6
|
+
"table-filter-max": string;
|
|
7
|
+
"table-pagination-previous": string;
|
|
8
|
+
"table-pagination-next": string;
|
|
9
|
+
"table-pagination-total": (current: string, total: string) => string;
|
|
10
|
+
"select-dropdown-render-select-all": string;
|
|
11
|
+
"select-dropdown-render-search": string;
|
|
12
|
+
"sort-button-text": string;
|
|
13
|
+
"sort-oldest-to-newest": string;
|
|
14
|
+
"sort-newest-to-oldest": string;
|
|
15
|
+
"sort-a-z": string;
|
|
16
|
+
"sort-z-a": string;
|
|
17
|
+
"sort-from-morning-to-night": string;
|
|
18
|
+
"sort-from-evening-to-morning": string;
|
|
19
|
+
"sort-0-9": string;
|
|
20
|
+
"sort-9-0": string;
|
|
21
|
+
"table-action-filter-button": string;
|
|
22
|
+
"table-action-filter-quick-filter": string;
|
|
23
|
+
"table-action-filter-quick-filter-tip": (count: number) => string;
|
|
24
|
+
"table-action-filter-other-filter": string;
|
|
25
|
+
"table-action-filter-other-filter-tip": () => string;
|
|
26
|
+
"table-action-group-by-title": string;
|
|
27
|
+
"table-action-group-by-title-tip": string;
|
|
28
|
+
"table-action-column-title": string;
|
|
29
|
+
"table-column-group-records": string;
|
|
30
|
+
"table-column-group-lock-tip": string;
|
|
31
|
+
"table-column-drag-sort-disabled-tip": string;
|
|
32
|
+
"table-action-filter-no-filter": string;
|
|
33
|
+
"table-action-range-picker-presets-today": string;
|
|
34
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
35
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
38
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
39
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
40
|
+
"virtual-keyboard-time-now": string;
|
|
41
|
+
"virtual-keyboard-time-ok": string;
|
|
42
|
+
'batch-editor-batch-edit': string;
|
|
43
|
+
'batch-editor-actions': string;
|
|
44
|
+
'batch-editor-remove': string;
|
|
45
|
+
'batch-editor-price': string;
|
|
46
|
+
'batch-editor-cancel': string;
|
|
47
|
+
'batch-editor-search': string;
|
|
48
|
+
'batch-editor-confirm': string;
|
|
49
|
+
'batch-editor-batch-remove': string;
|
|
50
|
+
'batch-editor-what-price': string;
|
|
51
|
+
'batch-editor-quick-edit': string;
|
|
52
|
+
'batch-editor-quick-edit-title': (product: string, num: string) => string;
|
|
53
|
+
'batch-editor-quick-edit-title-2': (product: string) => string;
|
|
54
|
+
'table-action-export-import-export-success': string;
|
|
55
|
+
'table-action-export-import-button': string;
|
|
56
|
+
'table-action-export-import-export-range': string;
|
|
57
|
+
'table-action-export-import-current-page': string;
|
|
58
|
+
'table-action-export-import-all-records': string;
|
|
59
|
+
'table-action-export-import-selected-records': string;
|
|
60
|
+
'table-action-export-import-selected': string;
|
|
61
|
+
'table-action-export-import-item': (length: number) => string;
|
|
62
|
+
'table-action-export-import-product': string;
|
|
63
|
+
'table-action-export-import-table-text-input-title': string;
|
|
64
|
+
'table-action-export-import-table-text-input-describe': string;
|
|
65
|
+
'table-action-export-import-table-error-file': string;
|
|
66
|
+
'table-action-export-import-import-success': string;
|
|
67
|
+
'table-action-export-import-import-phone': string;
|
|
68
|
+
'table-action-export-import-table-success-download': string;
|
|
69
|
+
'table-action-export-import-table-textimport-product': string;
|
|
70
|
+
'table-action-export-import-table-text-product-template': string;
|
|
71
|
+
'table-action-export-import-table-text-click-download': string;
|
|
72
|
+
'table-action-export-import-table-text-edit-file': string;
|
|
73
|
+
'table-action-export-import-button-import': string;
|
|
74
|
+
'table-action-export-import-cancel': string;
|
|
75
|
+
'table-action-export-import-file-completed': string;
|
|
76
|
+
'table-action-export-import-file-processing': string;
|
|
77
|
+
'table-action-export-import-file-pending': string;
|
|
78
|
+
'table-action-export-import-file-refresh': string;
|
|
79
|
+
'table-action-export-import-export-title': string;
|
|
80
|
+
'table-action-export-import-file-hint': string;
|
|
81
|
+
'table-action-export-import-file-name': string;
|
|
82
|
+
'table-action-export-import-file-content': string;
|
|
83
|
+
'table-action-export-import-file-content-all': string;
|
|
84
|
+
'table-action-export-import-file-content-part': string;
|
|
85
|
+
'table-action-export-import-file-status': string;
|
|
86
|
+
'table-action-export-import-file-account': string;
|
|
87
|
+
'table-action-export-import-file-created': string;
|
|
88
|
+
'table-action-export-import-file-record': (length: number) => string;
|
|
89
|
+
'table-action-export-import-import-title': string;
|
|
90
|
+
'table-action-export-import-log-hint': string;
|
|
91
|
+
'table-action-export-import-log-name': string;
|
|
92
|
+
'table-action-export-import-log-result': string;
|
|
93
|
+
'table-action-export-import-log-ok': (num: number) => string;
|
|
94
|
+
'table-action-export-import-log-err': (num: number) => string;
|
|
95
|
+
'table-action-export-import-log-check': string;
|
|
96
|
+
'table-action-export-import-log-detail-title': string;
|
|
97
|
+
'table-action-export-import-log-err-log': string;
|
|
98
|
+
'table-action-export-import-log-copy': string;
|
|
99
|
+
'table-action-export-import-table-success-copy': string;
|
|
100
|
+
'drag-sort-tree-unavailable-today-tip': string;
|
|
101
|
+
'date-picker-today': string;
|
|
102
|
+
'date-picker-yesterday': string;
|
|
103
|
+
'date-picker-tomorrow': string;
|
|
104
|
+
'date-picker-next_monday': string;
|
|
105
|
+
'date-picker-last_friday': string;
|
|
106
|
+
'date-picker-first_day_of_this_month': string;
|
|
107
|
+
'date-picker-last_day_of_this_month': string;
|
|
108
|
+
'date-picker-first_day_of_next_month': string;
|
|
109
|
+
'date-picker-last_day_of_last_month': string;
|
|
110
|
+
'date-picker-invalid-date': string;
|
|
111
|
+
"date-picker-apply": string;
|
|
112
|
+
'date-picker-shortcut-custom': string;
|
|
113
|
+
'pisell-input-copy-success': string;
|
|
114
|
+
'pisell-input-copy': string;
|
|
115
|
+
'pisell-empty-description-no-data': string;
|
|
116
|
+
'pisell-information-entry-input-search': string;
|
|
117
|
+
'pisell-information-entry-input-confirm': string;
|
|
118
|
+
'pisell-information-entry-scan-exit': string;
|
|
119
|
+
'pisell-wallet-pass-card-detail': string;
|
|
120
|
+
'pisell-wallet-pass-card-edit': string;
|
|
121
|
+
'pisell-wallet-pass-card-name': string;
|
|
122
|
+
'pisell-wallet-pass-card-store-name': string;
|
|
123
|
+
'pisell-wallet-pass-card-balance': string;
|
|
124
|
+
'pisell-wallet-pass-card-redeem': string;
|
|
125
|
+
'pisell-wallet-pass-card-code': string;
|
|
126
|
+
'pisell-wallet-pass-card-valid-to': string;
|
|
127
|
+
'pisell-wallet-pass-card-confirm': string;
|
|
128
|
+
'pisell-wallet-pass-card-cancel': string;
|
|
129
|
+
'pisell-wallet-pass-card-required': string;
|
|
130
|
+
'pisell-wallet-pass-card-expireDate': string;
|
|
131
|
+
'pisell-adjust-price-price-override': string;
|
|
132
|
+
'pisell-adjust-price-discount': string;
|
|
133
|
+
'pisell-adjust-price-discount-amount': string;
|
|
134
|
+
'pisell-adjust-price-discount-percentage': string;
|
|
135
|
+
'pisell-adjust-price-total-after-discount': string;
|
|
136
|
+
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
137
|
+
'pisell-discount-card-title': string;
|
|
138
|
+
'pisell-discount-card-unit': string;
|
|
139
|
+
'pisell-discount-card-fixed-amount-prefix': string;
|
|
140
|
+
'pisell-data-source-table-add': string;
|
|
141
|
+
'pisell-data-source-table-edit': string;
|
|
142
|
+
'pisell-data-source-table-detail': string;
|
|
143
|
+
'pisell-data-source-table-delete': string;
|
|
144
|
+
'pisell-record-view-available': string;
|
|
145
|
+
'pisell-record-view-unavailable': string;
|
|
146
|
+
'pisell-data-source-form-required-message': string;
|
|
147
|
+
'pisell-data-source-form-email-message': string;
|
|
148
|
+
'pisell-data-source-form-domain-message': string;
|
|
149
|
+
'pisell-data-source-form-url-message': string;
|
|
150
|
+
'pisell-data-source-form-phone-message': string;
|
|
151
|
+
'pisell-data-source-form-min-length-message': (minLength: number) => string;
|
|
152
|
+
'pisell-data-source-form-max-length-message': (maxLength: number) => string;
|
|
153
|
+
'pisell-data-source-form-min-value-message': (minValue: number) => string;
|
|
154
|
+
'pisell-data-source-form-max-value-message': (maxValue: number) => string;
|
|
155
|
+
'pisell-data-source-form-mobile-message': string;
|
|
156
|
+
'pisell-number-format-thousand': string;
|
|
157
|
+
'pisell-number-format-million': string;
|
|
158
|
+
'pisell-number-format-billion': string;
|
|
159
|
+
'walletCard-done': string;
|
|
160
|
+
'walletCard-qrcode': string;
|
|
161
|
+
'walletCard-barcode': string;
|
|
162
|
+
'pisell-upload-button': string;
|
|
163
|
+
'pisell-upload-setting-size-error': (maxSize: number) => string;
|
|
164
|
+
'pisell-upload-setting-type-error': (type: string) => string;
|
|
165
|
+
'pisell-upload-count-error': (count: number) => string;
|
|
166
|
+
'pisell-upload-error': (name: string) => string;
|
|
167
|
+
'pisell-upload-multilingual-title': string;
|
|
168
|
+
'pisell-upload-multilingual-item-title-original': string;
|
|
169
|
+
'pisell-upload-multilingual-item-title-en': string;
|
|
170
|
+
'pisell-upload-multilingual-item-title-zh-CN': string;
|
|
171
|
+
'pisell-upload-multilingual-item-title-zh-HK': string;
|
|
172
|
+
'pisell-color-picker-default': string;
|
|
173
|
+
'pisell-action-get-data': string;
|
|
174
|
+
'pisell-action-delete-success': string;
|
|
175
|
+
'pisell-action-delete-failed': string;
|
|
176
|
+
'walletCard-piont': string;
|
|
177
|
+
'walletCard-rechargeable': string;
|
|
178
|
+
'walletCard-voucher': string;
|
|
179
|
+
'walletCard-discount': string;
|
|
180
|
+
'pisellQrcode-done': string;
|
|
181
|
+
'pisellQrcode-qrcode': string;
|
|
182
|
+
'pisell-delete-confirm-title': string;
|
|
183
|
+
'pisell-delete-confirm-content': string;
|
|
184
|
+
'pisell-delete-confirm-ok': string;
|
|
185
|
+
'pisell-delete-confirm-cancel': string;
|
|
186
|
+
'pisell-design-mode-action-disabled': string;
|
|
187
|
+
'pisell-translation-original': string;
|
|
188
|
+
'pisell-version-modal-title': string;
|
|
189
|
+
'pisell-version-modal-current-version': string;
|
|
190
|
+
'pisell-version-modal-version': string;
|
|
191
|
+
'pisell-version-modal-update-notes': string;
|
|
192
|
+
'pisell-version-modal-patch': string;
|
|
193
|
+
'pisell-version-modal-minor': string;
|
|
194
|
+
'pisell-version-modal-major': string;
|
|
195
|
+
'pisell-version-modal-custom': string;
|
|
196
|
+
'pisell-version-modal-cancel': string;
|
|
197
|
+
'pisell-version-modal-confirm': string;
|
|
198
|
+
'pisell-version-modal-describe-update-notes': string;
|
|
199
|
+
'pisell-version-modal-version-error': string;
|
|
200
|
+
'pisell-version-modal-version-required': string;
|
|
201
|
+
'pisell-version-modal-based-on-version': string;
|
|
202
|
+
'subdomain-error-too-short': string;
|
|
203
|
+
'subdomain-error-too-long': string;
|
|
204
|
+
'subdomain-error-pattern': string;
|
|
205
|
+
'subdomain-error-numbers-only': string;
|
|
206
|
+
'subdomain-error-hyphen-ends': string;
|
|
207
|
+
'subdomain-error-consecutive-hyphens': string;
|
|
208
|
+
'pisell-icon-select-placeholder': string;
|
|
209
|
+
'pisell-icon-select-outlined': string;
|
|
210
|
+
'pisell-icon-select-filled': string;
|
|
211
|
+
'pisell-icon-select-two-tone': string;
|
|
212
|
+
'pisell-icon-select-iconfont': string;
|
|
213
|
+
'pisell-icon-select-search': string;
|
|
214
|
+
'pisell-icon-select-select': string;
|
|
215
|
+
'pisell-lowcode-app-version-control-live': string;
|
|
216
|
+
'pisell-lowcode-app-version-control-draft': string;
|
|
217
|
+
'pisell-lowcode-app-version-control-deprecated': string;
|
|
218
|
+
'pisell-lowcode-app-version-control-new-version': string;
|
|
219
|
+
'pisell-lowcode-app-version-control-promote-to-live': string;
|
|
220
|
+
'pisell-lowcode-app-version-control-promote-version': (version: string) => string;
|
|
221
|
+
'pisell-lowcode-app-version-control-promote-version-describe': string;
|
|
222
|
+
'pisell-lowcode-app-version-control-promote-version-ok': string;
|
|
223
|
+
'pisell-lowcode-app-version-control-promote-version-cancel': string;
|
|
224
|
+
'pisell-lowcode-app-version-control-version-exists': string;
|
|
225
|
+
'pisell-lowcode-drop-sort-add': string;
|
|
226
|
+
'pisell-lowcode-navigation-menu-add-sub-menu': string;
|
|
227
|
+
'pisell-lowcode-navigation-menu-add-page': string;
|
|
228
|
+
'pisell-lowcode-navigation-menu-add-page-tip': string;
|
|
229
|
+
'pisell-lowcode-navigation-menu-tag-base': string;
|
|
230
|
+
'pisell-lowcode-navigation-menu-tag-proCode': string;
|
|
231
|
+
'pisell-lowcode-navigation-menu-tag-pisell1': string;
|
|
232
|
+
'pisell-lowcode-navigation-menu-tag-group': string;
|
|
233
|
+
'pisell-lowcode-navigation-menu-tag-sub-menu': string;
|
|
234
|
+
'pisell-lowcode-navigation-menu-tag-custom': string;
|
|
235
|
+
'pisell-data-source-form-app-identifier-pattern': string;
|
|
236
|
+
'pisell-data-source-form-app-identifier-start-with-letter': string;
|
|
237
|
+
'pisell-data-source-form-app-identifier-special-ends': string;
|
|
238
|
+
'pisell-data-source-form-app-identifier-consecutive-special': string;
|
|
239
|
+
"qrscanner-loading": string;
|
|
240
|
+
"qrscanner-success": string;
|
|
241
|
+
"qrscanner-success-qrcode": string;
|
|
242
|
+
"qrscanner-success-barcode": string;
|
|
243
|
+
"qrscanner-error-upload-image": string;
|
|
244
|
+
"qrscanner-error-load-failed": string;
|
|
245
|
+
"qrscanner-error-no-code": string;
|
|
246
|
+
"qrscanner-error-camera-init": string;
|
|
247
|
+
"qrscanner-error-process-image": string;
|
|
248
|
+
'pisell-login-and-register-title': string;
|
|
249
|
+
'pisell-login-and-register-subtitle': string;
|
|
250
|
+
'pisell-login-and-register-email-label': string;
|
|
251
|
+
'pisell-login-and-register-email-placeholder': string;
|
|
252
|
+
'pisell-login-and-register-password-label': string;
|
|
253
|
+
'pisell-login-and-register-password-placeholder': string;
|
|
254
|
+
'pisell-login-and-register-email-error': string;
|
|
255
|
+
'pisell-login-and-register-email-error-valid': string;
|
|
256
|
+
'pisell-login-and-register-password-error': string;
|
|
257
|
+
'pisell-login-and-register-login': string;
|
|
258
|
+
'pisell-login-and-register-google': string;
|
|
259
|
+
'pisell-login-and-register-facebook': string;
|
|
260
|
+
'pisell-login-and-register-apple': string;
|
|
261
|
+
'pisell-login-and-register-sign-up': string;
|
|
262
|
+
'pisell-login-and-register-login-tab': string;
|
|
263
|
+
'pisell-login-and-register-register-tab': string;
|
|
264
|
+
'pisell-login-and-register-register-email-placeholder': string;
|
|
265
|
+
'pisell-login-and-register-register-password-placeholder': string;
|
|
266
|
+
'pisell-login-and-register-register-button-text': string;
|
|
267
|
+
'pisell-login-and-register-remember-me': string;
|
|
268
|
+
'pisell-login-and-register-forgot-password': string;
|
|
269
|
+
'pisell2.text.goodpass.product-vouchers': string;
|
|
270
|
+
'pisell2.text.goodpass.last-settlement': string;
|
|
271
|
+
'pisell2.text.goodpass.view-more': string;
|
|
272
|
+
'pisell2.text.goodpass.save': string;
|
|
273
|
+
'pisell-wallet-pass-card-status-used': string;
|
|
274
|
+
'pisell-wallet-pass-card-status-expired': string;
|
|
275
|
+
'pisell-wallet-pass-card-status-disabled': string;
|
|
276
|
+
'pisell-wallet-pass-card-status-conflict': string;
|
|
277
|
+
'pisell-wallet-pass-card-status-lastPayment': string;
|
|
278
|
+
'pisell-wallet-pass-card-reset': string;
|
|
279
|
+
'pisell-wallet-pass-card-done': string;
|
|
280
|
+
};
|
|
281
|
+
export default _default;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -337,6 +337,7 @@ export default {
|
|
|
337
337
|
'pisell-wallet-pass-card-status-expired': '已過期',
|
|
338
338
|
'pisell-wallet-pass-card-status-disabled': '已禁用',
|
|
339
339
|
'pisell-wallet-pass-card-status-conflict': '衝突',
|
|
340
|
+
'pisell-wallet-pass-card-status-lastPayment': '上次結算',
|
|
340
341
|
'pisell-wallet-pass-card-reset': '清空',
|
|
341
342
|
'pisell-wallet-pass-card-done': '保存'
|
|
342
343
|
};
|
package/es/utils/index.d.ts
CHANGED
package/es/utils/platform.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isMobile: () =>
|
|
1
|
+
export declare const isMobile: () => boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare type Options = {
|
|
2
|
+
mode?: 'oneline' | 'multiline' | 'box' | 'boxoneline' | undefined;
|
|
3
|
+
minFontSizePx?: number | undefined;
|
|
4
|
+
maxFontSizePx?: number | undefined;
|
|
5
|
+
fontSizePrecisionPx?: number | undefined;
|
|
6
|
+
scrollToEnd?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare function updateTextSize({ innerEl, containerEl, mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, scrollToEnd, }: Options & {
|
|
9
|
+
innerEl: HTMLElement;
|
|
10
|
+
containerEl: HTMLElement;
|
|
11
|
+
}): void;
|
|
12
|
+
declare type DisconnectableFunction = {
|
|
13
|
+
(): void;
|
|
14
|
+
disconnect: () => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function autoTextSize({ innerEl, containerEl, mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, scrollToEnd, }: Options & {
|
|
17
|
+
innerEl: HTMLElement;
|
|
18
|
+
containerEl: HTMLElement;
|
|
19
|
+
}): DisconnectableFunction;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/auto-resize-text/auto-text-size-standalone.ts
|
|
20
|
+
var auto_text_size_standalone_exports = {};
|
|
21
|
+
__export(auto_text_size_standalone_exports, {
|
|
22
|
+
autoTextSize: () => autoTextSize,
|
|
23
|
+
updateTextSize: () => updateTextSize
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(auto_text_size_standalone_exports);
|
|
26
|
+
function throttleAnimationFrame(func) {
|
|
27
|
+
let wait = false;
|
|
28
|
+
return () => {
|
|
29
|
+
if (!wait) {
|
|
30
|
+
wait = true;
|
|
31
|
+
requestAnimationFrame(() => {
|
|
32
|
+
func();
|
|
33
|
+
wait = false;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var antiOverflowAlgo = ({
|
|
39
|
+
fontSizePx,
|
|
40
|
+
minFontSizePx,
|
|
41
|
+
fontSizePrecisionPx,
|
|
42
|
+
updateFontSizePx,
|
|
43
|
+
breakPredicate: breakPred
|
|
44
|
+
}) => {
|
|
45
|
+
const maxIterCount = Math.ceil(1 / fontSizePrecisionPx);
|
|
46
|
+
let iterCount = 0;
|
|
47
|
+
while (fontSizePx > minFontSizePx && iterCount < maxIterCount) {
|
|
48
|
+
if (breakPred()) break;
|
|
49
|
+
fontSizePx = updateFontSizePx(fontSizePx - fontSizePrecisionPx);
|
|
50
|
+
iterCount++;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var getContentWidth = (element) => {
|
|
54
|
+
const computedStyle = getComputedStyle(element);
|
|
55
|
+
return element.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight);
|
|
56
|
+
};
|
|
57
|
+
var getContentHeight = (element) => {
|
|
58
|
+
const computedStyle = getComputedStyle(element);
|
|
59
|
+
return element.clientHeight - parseFloat(computedStyle.paddingTop) - parseFloat(computedStyle.paddingBottom);
|
|
60
|
+
};
|
|
61
|
+
var multilineAlgo = (opts) => {
|
|
62
|
+
opts.innerEl.style.whiteSpace = "nowrap";
|
|
63
|
+
onelineAlgo(opts);
|
|
64
|
+
if (opts.innerEl.scrollWidth > getContentWidth(opts.containerEl)) {
|
|
65
|
+
opts.innerEl.style.whiteSpace = "normal";
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var onelineAlgo = ({
|
|
69
|
+
innerEl,
|
|
70
|
+
containerEl,
|
|
71
|
+
fontSizePx,
|
|
72
|
+
minFontSizePx,
|
|
73
|
+
maxFontSizePx,
|
|
74
|
+
fontSizePrecisionPx,
|
|
75
|
+
updateFontSizePx
|
|
76
|
+
}) => {
|
|
77
|
+
const maxIterCount = 10;
|
|
78
|
+
let iterCount = 0;
|
|
79
|
+
let prevOverflowFactor = 1;
|
|
80
|
+
while (iterCount < maxIterCount) {
|
|
81
|
+
const w0 = innerEl.scrollWidth;
|
|
82
|
+
const w1 = getContentWidth(containerEl);
|
|
83
|
+
const canGrow = fontSizePx < maxFontSizePx && w0 < w1;
|
|
84
|
+
const canShrink = fontSizePx > minFontSizePx && w0 > w1;
|
|
85
|
+
const overflowFactor = w0 / w1;
|
|
86
|
+
if (prevOverflowFactor === overflowFactor) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (!(canGrow || canShrink)) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
const updatePx = fontSizePx / overflowFactor - fontSizePx;
|
|
93
|
+
const prevFontSizePx = fontSizePx;
|
|
94
|
+
fontSizePx = updateFontSizePx(fontSizePx + updatePx);
|
|
95
|
+
if (Math.abs(fontSizePx - prevFontSizePx) <= fontSizePrecisionPx) {
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
prevOverflowFactor = overflowFactor;
|
|
99
|
+
iterCount++;
|
|
100
|
+
}
|
|
101
|
+
antiOverflowAlgo({
|
|
102
|
+
fontSizePx,
|
|
103
|
+
minFontSizePx,
|
|
104
|
+
updateFontSizePx,
|
|
105
|
+
fontSizePrecisionPx,
|
|
106
|
+
breakPredicate: () => innerEl.scrollWidth <= getContentWidth(containerEl)
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
var boxAlgo = ({
|
|
110
|
+
innerEl,
|
|
111
|
+
containerEl,
|
|
112
|
+
fontSizePx,
|
|
113
|
+
minFontSizePx,
|
|
114
|
+
maxFontSizePx,
|
|
115
|
+
fontSizePrecisionPx,
|
|
116
|
+
updateFontSizePx
|
|
117
|
+
}) => {
|
|
118
|
+
const maxIterCount = 100;
|
|
119
|
+
fontSizePx = updateFontSizePx((maxFontSizePx - minFontSizePx) * 0.5);
|
|
120
|
+
let updatePx = (maxFontSizePx - minFontSizePx) * 0.25;
|
|
121
|
+
let iterCount = 0;
|
|
122
|
+
while (updatePx > fontSizePrecisionPx && iterCount < maxIterCount) {
|
|
123
|
+
const w0 = innerEl.scrollWidth;
|
|
124
|
+
const w1 = getContentWidth(containerEl);
|
|
125
|
+
const h0 = innerEl.scrollHeight;
|
|
126
|
+
const h1 = getContentHeight(containerEl);
|
|
127
|
+
if (w0 === w1 && h0 === h1) break;
|
|
128
|
+
if (fontSizePx < maxFontSizePx && w0 <= w1 && h0 <= h1) {
|
|
129
|
+
fontSizePx = updateFontSizePx(fontSizePx + updatePx);
|
|
130
|
+
} else if (fontSizePx > minFontSizePx && (w0 > w1 || h0 > h1)) {
|
|
131
|
+
fontSizePx = updateFontSizePx(fontSizePx - updatePx);
|
|
132
|
+
}
|
|
133
|
+
updatePx *= 0.5;
|
|
134
|
+
iterCount++;
|
|
135
|
+
}
|
|
136
|
+
antiOverflowAlgo({
|
|
137
|
+
fontSizePx,
|
|
138
|
+
minFontSizePx,
|
|
139
|
+
updateFontSizePx,
|
|
140
|
+
fontSizePrecisionPx,
|
|
141
|
+
breakPredicate: () => innerEl.scrollWidth <= getContentWidth(containerEl) && innerEl.scrollHeight <= getContentHeight(containerEl)
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
function updateTextSize({
|
|
145
|
+
innerEl,
|
|
146
|
+
containerEl,
|
|
147
|
+
mode = "multiline",
|
|
148
|
+
minFontSizePx = 8,
|
|
149
|
+
maxFontSizePx = 160,
|
|
150
|
+
fontSizePrecisionPx = 0.1,
|
|
151
|
+
scrollToEnd = false
|
|
152
|
+
}) {
|
|
153
|
+
const t0 = performance.now();
|
|
154
|
+
if (!isFinite(minFontSizePx)) {
|
|
155
|
+
throw new Error(`Invalid minFontSizePx (${minFontSizePx})`);
|
|
156
|
+
}
|
|
157
|
+
if (!isFinite(minFontSizePx)) {
|
|
158
|
+
throw new Error(`Invalid maxFontSizePx (${maxFontSizePx})`);
|
|
159
|
+
}
|
|
160
|
+
if (!isFinite(fontSizePrecisionPx) || fontSizePrecisionPx === 0) {
|
|
161
|
+
throw new Error(`Invalid fontSizePrecisionPx (${fontSizePrecisionPx})`);
|
|
162
|
+
}
|
|
163
|
+
if (containerEl.children.length > 1) {
|
|
164
|
+
console.warn(
|
|
165
|
+
`AutoTextSize has ${containerEl.children.length - 1} siblings. This may interfere with the algorithm.`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
const containerStyles = {
|
|
169
|
+
display: "flex",
|
|
170
|
+
alignItems: "start"
|
|
171
|
+
};
|
|
172
|
+
const innerStyles = {
|
|
173
|
+
display: "block"
|
|
174
|
+
};
|
|
175
|
+
if (mode === "oneline") {
|
|
176
|
+
innerStyles.whiteSpace = "nowrap";
|
|
177
|
+
} else if (mode === "multiline") {
|
|
178
|
+
innerStyles.wordBreak = "break-word";
|
|
179
|
+
} else if (mode === "box") {
|
|
180
|
+
innerStyles.whiteSpace = "pre-wrap";
|
|
181
|
+
innerStyles.wordBreak = "break-word";
|
|
182
|
+
} else if (mode === "boxoneline") {
|
|
183
|
+
innerStyles.whiteSpace = "nowrap";
|
|
184
|
+
}
|
|
185
|
+
Object.assign(containerEl.style, containerStyles);
|
|
186
|
+
Object.assign(innerEl.style, innerStyles);
|
|
187
|
+
const fontSizeStr = window.getComputedStyle(innerEl, null).getPropertyValue("font-size");
|
|
188
|
+
let fontSizePx = parseFloat(fontSizeStr);
|
|
189
|
+
let iterations = 0;
|
|
190
|
+
const updateFontSizePx = (px) => {
|
|
191
|
+
px = Math.min(Math.max(px, minFontSizePx), maxFontSizePx);
|
|
192
|
+
fontSizePx = px;
|
|
193
|
+
innerEl.style.fontSize = `${fontSizePx}px`;
|
|
194
|
+
iterations++;
|
|
195
|
+
return fontSizePx;
|
|
196
|
+
};
|
|
197
|
+
if (fontSizePx > maxFontSizePx || fontSizePx < minFontSizePx) {
|
|
198
|
+
updateFontSizePx(fontSizePx);
|
|
199
|
+
}
|
|
200
|
+
const algoOpts = {
|
|
201
|
+
innerEl,
|
|
202
|
+
containerEl,
|
|
203
|
+
fontSizePx,
|
|
204
|
+
minFontSizePx,
|
|
205
|
+
maxFontSizePx,
|
|
206
|
+
fontSizePrecisionPx,
|
|
207
|
+
updateFontSizePx
|
|
208
|
+
};
|
|
209
|
+
if (mode === "oneline") {
|
|
210
|
+
onelineAlgo(algoOpts);
|
|
211
|
+
} else if (mode === "multiline") {
|
|
212
|
+
multilineAlgo(algoOpts);
|
|
213
|
+
} else if (mode === "box") {
|
|
214
|
+
boxAlgo(algoOpts);
|
|
215
|
+
} else if (mode === "boxoneline") {
|
|
216
|
+
boxAlgo(algoOpts);
|
|
217
|
+
}
|
|
218
|
+
if (scrollToEnd) {
|
|
219
|
+
requestAnimationFrame(() => {
|
|
220
|
+
if (mode === "oneline" || mode === "boxoneline") {
|
|
221
|
+
const maxScrollLeft = Math.max(0, innerEl.scrollWidth - innerEl.clientWidth);
|
|
222
|
+
innerEl.scrollLeft = maxScrollLeft;
|
|
223
|
+
} else {
|
|
224
|
+
const maxScrollTop = Math.max(0, innerEl.scrollHeight - innerEl.clientHeight);
|
|
225
|
+
innerEl.scrollTop = maxScrollTop;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function autoTextSize({
|
|
231
|
+
innerEl,
|
|
232
|
+
containerEl,
|
|
233
|
+
mode,
|
|
234
|
+
minFontSizePx,
|
|
235
|
+
maxFontSizePx,
|
|
236
|
+
fontSizePrecisionPx,
|
|
237
|
+
scrollToEnd
|
|
238
|
+
}) {
|
|
239
|
+
let containerDimensions = void 0;
|
|
240
|
+
const throttledUpdateTextSize = throttleAnimationFrame(() => {
|
|
241
|
+
updateTextSize({
|
|
242
|
+
innerEl,
|
|
243
|
+
containerEl,
|
|
244
|
+
mode,
|
|
245
|
+
maxFontSizePx,
|
|
246
|
+
minFontSizePx,
|
|
247
|
+
fontSizePrecisionPx,
|
|
248
|
+
scrollToEnd
|
|
249
|
+
});
|
|
250
|
+
containerDimensions = [
|
|
251
|
+
getContentWidth(containerEl),
|
|
252
|
+
getContentHeight(containerEl)
|
|
253
|
+
];
|
|
254
|
+
});
|
|
255
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
256
|
+
const prevContainerDimensions = containerDimensions;
|
|
257
|
+
containerDimensions = [
|
|
258
|
+
getContentWidth(containerEl),
|
|
259
|
+
getContentHeight(containerEl)
|
|
260
|
+
];
|
|
261
|
+
if ((prevContainerDimensions == null ? void 0 : prevContainerDimensions[0]) !== containerDimensions[0] || (prevContainerDimensions == null ? void 0 : prevContainerDimensions[1]) !== containerDimensions[1]) {
|
|
262
|
+
throttledUpdateTextSize();
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
resizeObserver.observe(containerEl);
|
|
266
|
+
throttledUpdateTextSize.disconnect = () => resizeObserver.disconnect();
|
|
267
|
+
return throttledUpdateTextSize;
|
|
268
|
+
}
|
|
269
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
270
|
+
0 && (module.exports = {
|
|
271
|
+
autoTextSize,
|
|
272
|
+
updateTextSize
|
|
273
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { DetailedHTMLProps, HTMLAttributes, ReactElement, ReactHTML } from 'react';
|
|
2
|
+
import { Options } from './auto-text-size-standalone';
|
|
3
|
+
export default function AutoResizeText({ mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, scrollToEnd, as: Comp, children, ...rest }: Options & {
|
|
4
|
+
as?: keyof ReactHTML | React.ComponentType<any>;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>): ReactElement;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/auto-resize-text/index.tsx
|
|
30
|
+
var auto_resize_text_exports = {};
|
|
31
|
+
__export(auto_resize_text_exports, {
|
|
32
|
+
default: () => AutoResizeText
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(auto_resize_text_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_auto_text_size_standalone = require("./auto-text-size-standalone");
|
|
37
|
+
function AutoResizeText({
|
|
38
|
+
mode,
|
|
39
|
+
minFontSizePx,
|
|
40
|
+
maxFontSizePx,
|
|
41
|
+
fontSizePrecisionPx,
|
|
42
|
+
scrollToEnd,
|
|
43
|
+
as: Comp = "div",
|
|
44
|
+
children,
|
|
45
|
+
...rest
|
|
46
|
+
}) {
|
|
47
|
+
const updateTextSizeRef = (0, import_react.useRef)();
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = updateTextSizeRef.current) == null ? void 0 : _a.call(updateTextSizeRef);
|
|
51
|
+
}, [children]);
|
|
52
|
+
const refCallback = (0, import_react.useCallback)(
|
|
53
|
+
(innerEl) => {
|
|
54
|
+
var _a;
|
|
55
|
+
(_a = updateTextSizeRef.current) == null ? void 0 : _a.disconnect();
|
|
56
|
+
const containerEl = innerEl == null ? void 0 : innerEl.parentElement;
|
|
57
|
+
if (!innerEl || !containerEl) return;
|
|
58
|
+
updateTextSizeRef.current = (0, import_auto_text_size_standalone.autoTextSize)({
|
|
59
|
+
innerEl,
|
|
60
|
+
containerEl,
|
|
61
|
+
mode,
|
|
62
|
+
minFontSizePx,
|
|
63
|
+
maxFontSizePx,
|
|
64
|
+
fontSizePrecisionPx,
|
|
65
|
+
scrollToEnd
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
[mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, scrollToEnd]
|
|
69
|
+
);
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(Comp, { ref: refCallback, ...rest }, children);
|
|
71
|
+
}
|